com.azure.resourcemanager.applicationinsights.implementation.ExportConfigurationsImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-applicationinsights Show documentation
Show all versions of azure-resourcemanager-applicationinsights Show documentation
This package contains Microsoft Azure SDK for ApplicationInsights Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Composite Swagger for Application Insights Management Client. Package tag package-2022-04-01.
The newest version!
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.applicationinsights.implementation;
import com.azure.core.http.rest.Response;
import com.azure.core.http.rest.SimpleResponse;
import com.azure.core.util.Context;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.applicationinsights.fluent.ExportConfigurationsClient;
import com.azure.resourcemanager.applicationinsights.fluent.models.ApplicationInsightsComponentExportConfigurationInner;
import com.azure.resourcemanager.applicationinsights.models.ApplicationInsightsComponentExportConfiguration;
import com.azure.resourcemanager.applicationinsights.models.ApplicationInsightsComponentExportRequest;
import com.azure.resourcemanager.applicationinsights.models.ExportConfigurations;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
public final class ExportConfigurationsImpl implements ExportConfigurations {
private static final ClientLogger LOGGER = new ClientLogger(ExportConfigurationsImpl.class);
private final ExportConfigurationsClient innerClient;
private final com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager serviceManager;
public ExportConfigurationsImpl(
ExportConfigurationsClient innerClient,
com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager serviceManager) {
this.innerClient = innerClient;
this.serviceManager = serviceManager;
}
public List list(String resourceGroupName, String resourceName) {
List inner =
this.serviceClient().list(resourceGroupName, resourceName);
if (inner != null) {
return Collections
.unmodifiableList(
inner
.stream()
.map(inner1 -> new ApplicationInsightsComponentExportConfigurationImpl(inner1, this.manager()))
.collect(Collectors.toList()));
} else {
return Collections.emptyList();
}
}
public Response> listWithResponse(
String resourceGroupName, String resourceName, Context context) {
Response> inner =
this.serviceClient().listWithResponse(resourceGroupName, resourceName, context);
if (inner != null) {
return new SimpleResponse<>(
inner.getRequest(),
inner.getStatusCode(),
inner.getHeaders(),
inner
.getValue()
.stream()
.map(inner1 -> new ApplicationInsightsComponentExportConfigurationImpl(inner1, this.manager()))
.collect(Collectors.toList()));
} else {
return null;
}
}
public List create(
String resourceGroupName, String resourceName, ApplicationInsightsComponentExportRequest exportProperties) {
List inner =
this.serviceClient().create(resourceGroupName, resourceName, exportProperties);
if (inner != null) {
return Collections
.unmodifiableList(
inner
.stream()
.map(inner1 -> new ApplicationInsightsComponentExportConfigurationImpl(inner1, this.manager()))
.collect(Collectors.toList()));
} else {
return Collections.emptyList();
}
}
public Response> createWithResponse(
String resourceGroupName,
String resourceName,
ApplicationInsightsComponentExportRequest exportProperties,
Context context) {
Response> inner =
this.serviceClient().createWithResponse(resourceGroupName, resourceName, exportProperties, context);
if (inner != null) {
return new SimpleResponse<>(
inner.getRequest(),
inner.getStatusCode(),
inner.getHeaders(),
inner
.getValue()
.stream()
.map(inner1 -> new ApplicationInsightsComponentExportConfigurationImpl(inner1, this.manager()))
.collect(Collectors.toList()));
} else {
return null;
}
}
public ApplicationInsightsComponentExportConfiguration delete(
String resourceGroupName, String resourceName, String exportId) {
ApplicationInsightsComponentExportConfigurationInner inner =
this.serviceClient().delete(resourceGroupName, resourceName, exportId);
if (inner != null) {
return new ApplicationInsightsComponentExportConfigurationImpl(inner, this.manager());
} else {
return null;
}
}
public Response deleteWithResponse(
String resourceGroupName, String resourceName, String exportId, Context context) {
Response inner =
this.serviceClient().deleteWithResponse(resourceGroupName, resourceName, exportId, context);
if (inner != null) {
return new SimpleResponse<>(
inner.getRequest(),
inner.getStatusCode(),
inner.getHeaders(),
new ApplicationInsightsComponentExportConfigurationImpl(inner.getValue(), this.manager()));
} else {
return null;
}
}
public ApplicationInsightsComponentExportConfiguration get(
String resourceGroupName, String resourceName, String exportId) {
ApplicationInsightsComponentExportConfigurationInner inner =
this.serviceClient().get(resourceGroupName, resourceName, exportId);
if (inner != null) {
return new ApplicationInsightsComponentExportConfigurationImpl(inner, this.manager());
} else {
return null;
}
}
public Response getWithResponse(
String resourceGroupName, String resourceName, String exportId, Context context) {
Response inner =
this.serviceClient().getWithResponse(resourceGroupName, resourceName, exportId, context);
if (inner != null) {
return new SimpleResponse<>(
inner.getRequest(),
inner.getStatusCode(),
inner.getHeaders(),
new ApplicationInsightsComponentExportConfigurationImpl(inner.getValue(), this.manager()));
} else {
return null;
}
}
public ApplicationInsightsComponentExportConfiguration update(
String resourceGroupName,
String resourceName,
String exportId,
ApplicationInsightsComponentExportRequest exportProperties) {
ApplicationInsightsComponentExportConfigurationInner inner =
this.serviceClient().update(resourceGroupName, resourceName, exportId, exportProperties);
if (inner != null) {
return new ApplicationInsightsComponentExportConfigurationImpl(inner, this.manager());
} else {
return null;
}
}
public Response updateWithResponse(
String resourceGroupName,
String resourceName,
String exportId,
ApplicationInsightsComponentExportRequest exportProperties,
Context context) {
Response inner =
this
.serviceClient()
.updateWithResponse(resourceGroupName, resourceName, exportId, exportProperties, context);
if (inner != null) {
return new SimpleResponse<>(
inner.getRequest(),
inner.getStatusCode(),
inner.getHeaders(),
new ApplicationInsightsComponentExportConfigurationImpl(inner.getValue(), this.manager()));
} else {
return null;
}
}
private ExportConfigurationsClient serviceClient() {
return this.innerClient;
}
private com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager() {
return this.serviceManager;
}
}