changes;
-
- /*
- * Skip token that encodes the skip information while executing the current
- * request
- */
- @JsonProperty(value = "$skipToken")
- private Object skipToken;
-
- /**
- * Get the changes property: The pageable value returned by the operation, i.e. a list of changes to the resource.
- *
- * - The list is ordered from the most recent changes to the least recent changes. - This list will be empty if
- * there were no changes during the requested interval. - The `Before` snapshot timestamp value of the oldest change
- * can be outside of the specified time interval.
- *
- * @return the changes value.
- */
- public List changes() {
- return this.changes;
- }
-
- /**
- * Set the changes property: The pageable value returned by the operation, i.e. a list of changes to the resource.
- *
- * - The list is ordered from the most recent changes to the least recent changes. - This list will be empty if
- * there were no changes during the requested interval. - The `Before` snapshot timestamp value of the oldest change
- * can be outside of the specified time interval.
- *
- * @param changes the changes value to set.
- * @return the ResourceChangeListInner object itself.
- */
- public ResourceChangeListInner withChanges(List changes) {
- this.changes = changes;
- return this;
- }
-
- /**
- * Get the skipToken property: Skip token that encodes the skip information while executing the current request.
- *
- * @return the skipToken value.
- */
- public Object skipToken() {
- return this.skipToken;
- }
-
- /**
- * Set the skipToken property: Skip token that encodes the skip information while executing the current request.
- *
- * @param skipToken the skipToken value to set.
- * @return the ResourceChangeListInner object itself.
- */
- public ResourceChangeListInner withSkipToken(Object skipToken) {
- this.skipToken = skipToken;
- return this;
- }
-
- /**
- * Validates the instance.
- *
- * @throws IllegalArgumentException thrown if the instance is not valid.
- */
- public void validate() {
- if (changes() != null) {
- changes().forEach(e -> e.validate());
- }
- }
-}
diff --git a/sdk/resourcegraph/azure-resourcemanager-resourcegraph/src/main/java/com/azure/resourcemanager/resourcegraph/implementation/OperationsClientImpl.java b/sdk/resourcegraph/azure-resourcemanager-resourcegraph/src/main/java/com/azure/resourcemanager/resourcegraph/implementation/OperationsClientImpl.java
index 12c12f2070fe..92e4e6c050be 100644
--- a/sdk/resourcegraph/azure-resourcemanager-resourcegraph/src/main/java/com/azure/resourcemanager/resourcegraph/implementation/OperationsClientImpl.java
+++ b/sdk/resourcegraph/azure-resourcemanager-resourcegraph/src/main/java/com/azure/resourcemanager/resourcegraph/implementation/OperationsClientImpl.java
@@ -24,7 +24,6 @@
import com.azure.core.management.exception.ManagementException;
import com.azure.core.util.Context;
import com.azure.core.util.FluxUtil;
-import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.resourcegraph.fluent.OperationsClient;
import com.azure.resourcemanager.resourcegraph.fluent.models.OperationInner;
import com.azure.resourcemanager.resourcegraph.models.OperationListResult;
@@ -32,8 +31,6 @@
/** An instance of this class provides access to all the operations defined in OperationsClient. */
public final class OperationsClientImpl implements OperationsClient {
- private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class);
-
/** The proxy service used to perform REST calls. */
private final OperationsService service;
@@ -74,7 +71,8 @@ Mono> list(
*
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return result of the request to list Resource Graph operations.
+ * @return result of the request to list Resource Graph operations along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listSinglePageAsync() {
@@ -84,10 +82,10 @@ private Mono> listSinglePageAsync() {
new IllegalArgumentException(
"Parameter this.client.getEndpoint() is required and cannot be null."));
}
- final String apiVersion = "2021-03-01";
final String accept = "application/json";
return FluxUtil
- .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context))
+ .withContext(
+ context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context))
.>map(
res ->
new PagedResponseBase<>(
@@ -102,7 +100,8 @@ private Mono> listSinglePageAsync() {
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return result of the request to list Resource Graph operations.
+ * @return result of the request to list Resource Graph operations along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listSinglePageAsync(Context context) {
@@ -112,11 +111,10 @@ private Mono> listSinglePageAsync(Context context)
new IllegalArgumentException(
"Parameter this.client.getEndpoint() is required and cannot be null."));
}
- final String apiVersion = "2021-03-01";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
- .list(this.client.getEndpoint(), apiVersion, accept, context)
+ .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)
.map(
res ->
new PagedResponseBase<>(
@@ -128,7 +126,7 @@ private Mono> listSinglePageAsync(Context context)
*
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return result of the request to list Resource Graph operations.
+ * @return result of the request to list Resource Graph operations as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listAsync() {
@@ -142,7 +140,7 @@ private PagedFlux listAsync() {
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return result of the request to list Resource Graph operations.
+ * @return result of the request to list Resource Graph operations as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listAsync(Context context) {
@@ -154,7 +152,7 @@ private PagedFlux listAsync(Context context) {
*
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return result of the request to list Resource Graph operations.
+ * @return result of the request to list Resource Graph operations as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable list() {
@@ -168,7 +166,7 @@ public PagedIterable list() {
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return result of the request to list Resource Graph operations.
+ * @return result of the request to list Resource Graph operations as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable list(Context context) {
diff --git a/sdk/resourcegraph/azure-resourcemanager-resourcegraph/src/main/java/com/azure/resourcemanager/resourcegraph/implementation/OperationsImpl.java b/sdk/resourcegraph/azure-resourcemanager-resourcegraph/src/main/java/com/azure/resourcemanager/resourcegraph/implementation/OperationsImpl.java
index a242d89136e9..31f3c85a921e 100644
--- a/sdk/resourcegraph/azure-resourcemanager-resourcegraph/src/main/java/com/azure/resourcemanager/resourcegraph/implementation/OperationsImpl.java
+++ b/sdk/resourcegraph/azure-resourcemanager-resourcegraph/src/main/java/com/azure/resourcemanager/resourcegraph/implementation/OperationsImpl.java
@@ -11,10 +11,9 @@
import com.azure.resourcemanager.resourcegraph.fluent.models.OperationInner;
import com.azure.resourcemanager.resourcegraph.models.Operation;
import com.azure.resourcemanager.resourcegraph.models.Operations;
-import com.fasterxml.jackson.annotation.JsonIgnore;
public final class OperationsImpl implements Operations {
- @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class);
+ private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class);
private final OperationsClient innerClient;
diff --git a/sdk/resourcegraph/azure-resourcemanager-resourcegraph/src/main/java/com/azure/resourcemanager/resourcegraph/implementation/ResourceChangeDataImpl.java b/sdk/resourcegraph/azure-resourcemanager-resourcegraph/src/main/java/com/azure/resourcemanager/resourcegraph/implementation/ResourceChangeDataImpl.java
deleted file mode 100644
index 56cd4365f0f3..000000000000
--- a/sdk/resourcegraph/azure-resourcemanager-resourcegraph/src/main/java/com/azure/resourcemanager/resourcegraph/implementation/ResourceChangeDataImpl.java
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
-
-package com.azure.resourcemanager.resourcegraph.implementation;
-
-import com.azure.resourcemanager.resourcegraph.fluent.models.ResourceChangeDataInner;
-import com.azure.resourcemanager.resourcegraph.models.ChangeType;
-import com.azure.resourcemanager.resourcegraph.models.ResourceChangeData;
-import com.azure.resourcemanager.resourcegraph.models.ResourceChangeDataAfterSnapshot;
-import com.azure.resourcemanager.resourcegraph.models.ResourceChangeDataBeforeSnapshot;
-import com.azure.resourcemanager.resourcegraph.models.ResourcePropertyChange;
-import java.util.Collections;
-import java.util.List;
-
-public final class ResourceChangeDataImpl implements ResourceChangeData {
- private ResourceChangeDataInner innerObject;
-
- private final com.azure.resourcemanager.resourcegraph.ResourceGraphManager serviceManager;
-
- ResourceChangeDataImpl(
- ResourceChangeDataInner innerObject,
- com.azure.resourcemanager.resourcegraph.ResourceGraphManager serviceManager) {
- this.innerObject = innerObject;
- this.serviceManager = serviceManager;
- }
-
- public String resourceId() {
- return this.innerModel().resourceId();
- }
-
- public String changeId() {
- return this.innerModel().changeId();
- }
-
- public ResourceChangeDataBeforeSnapshot beforeSnapshot() {
- return this.innerModel().beforeSnapshot();
- }
-
- public ResourceChangeDataAfterSnapshot afterSnapshot() {
- return this.innerModel().afterSnapshot();
- }
-
- public ChangeType changeType() {
- return this.innerModel().changeType();
- }
-
- public List propertyChanges() {
- List inner = this.innerModel().propertyChanges();
- if (inner != null) {
- return Collections.unmodifiableList(inner);
- } else {
- return Collections.emptyList();
- }
- }
-
- public ResourceChangeDataInner innerModel() {
- return this.innerObject;
- }
-
- private com.azure.resourcemanager.resourcegraph.ResourceGraphManager manager() {
- return this.serviceManager;
- }
-}
diff --git a/sdk/resourcegraph/azure-resourcemanager-resourcegraph/src/main/java/com/azure/resourcemanager/resourcegraph/implementation/ResourceChangeListImpl.java b/sdk/resourcegraph/azure-resourcemanager-resourcegraph/src/main/java/com/azure/resourcemanager/resourcegraph/implementation/ResourceChangeListImpl.java
deleted file mode 100644
index e0e7c8dca71a..000000000000
--- a/sdk/resourcegraph/azure-resourcemanager-resourcegraph/src/main/java/com/azure/resourcemanager/resourcegraph/implementation/ResourceChangeListImpl.java
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
-
-package com.azure.resourcemanager.resourcegraph.implementation;
-
-import com.azure.resourcemanager.resourcegraph.fluent.models.ResourceChangeDataInner;
-import com.azure.resourcemanager.resourcegraph.fluent.models.ResourceChangeListInner;
-import com.azure.resourcemanager.resourcegraph.models.ResourceChangeData;
-import com.azure.resourcemanager.resourcegraph.models.ResourceChangeList;
-import java.util.Collections;
-import java.util.List;
-import java.util.stream.Collectors;
-
-public final class ResourceChangeListImpl implements ResourceChangeList {
- private ResourceChangeListInner innerObject;
-
- private final com.azure.resourcemanager.resourcegraph.ResourceGraphManager serviceManager;
-
- ResourceChangeListImpl(
- ResourceChangeListInner innerObject,
- com.azure.resourcemanager.resourcegraph.ResourceGraphManager serviceManager) {
- this.innerObject = innerObject;
- this.serviceManager = serviceManager;
- }
-
- public List changes() {
- List inner = this.innerModel().changes();
- if (inner != null) {
- return Collections
- .unmodifiableList(
- inner
- .stream()
- .map(inner1 -> new ResourceChangeDataImpl(inner1, this.manager()))
- .collect(Collectors.toList()));
- } else {
- return Collections.emptyList();
- }
- }
-
- public Object skipToken() {
- return this.innerModel().skipToken();
- }
-
- public ResourceChangeListInner innerModel() {
- return this.innerObject;
- }
-
- private com.azure.resourcemanager.resourcegraph.ResourceGraphManager manager() {
- return this.serviceManager;
- }
-}
diff --git a/sdk/resourcegraph/azure-resourcemanager-resourcegraph/src/main/java/com/azure/resourcemanager/resourcegraph/implementation/ResourceGraphClientImpl.java b/sdk/resourcegraph/azure-resourcemanager-resourcegraph/src/main/java/com/azure/resourcemanager/resourcegraph/implementation/ResourceGraphClientImpl.java
index 607a0acd0bbb..5029148e9c90 100644
--- a/sdk/resourcegraph/azure-resourcemanager-resourcegraph/src/main/java/com/azure/resourcemanager/resourcegraph/implementation/ResourceGraphClientImpl.java
+++ b/sdk/resourcegraph/azure-resourcemanager-resourcegraph/src/main/java/com/azure/resourcemanager/resourcegraph/implementation/ResourceGraphClientImpl.java
@@ -37,8 +37,6 @@
/** Initializes a new instance of the ResourceGraphClientImpl type. */
@ServiceClient(builder = ResourceGraphClientBuilder.class)
public final class ResourceGraphClientImpl implements ResourceGraphClient {
- private final ClientLogger logger = new ClientLogger(ResourceGraphClientImpl.class);
-
/** server parameter. */
private final String endpoint;
@@ -51,6 +49,18 @@ public String getEndpoint() {
return this.endpoint;
}
+ /** Api Version. */
+ private final String apiVersion;
+
+ /**
+ * Gets Api Version.
+ *
+ * @return the apiVersion value.
+ */
+ public String getApiVersion() {
+ return this.apiVersion;
+ }
+
/** The HTTP pipeline to send requests through. */
private final HttpPipeline httpPipeline;
@@ -130,6 +140,7 @@ public OperationsClient getOperations() {
this.serializerAdapter = serializerAdapter;
this.defaultPollInterval = defaultPollInterval;
this.endpoint = endpoint;
+ this.apiVersion = "2021-06-01-preview";
this.resourceProviders = new ResourceProvidersClientImpl(this);
this.operations = new OperationsClientImpl(this);
}
@@ -217,7 +228,7 @@ public Mono getLroFinalResultOrError(AsyncPollResponse,
managementError = null;
}
} catch (IOException | RuntimeException ioe) {
- logger.logThrowableAsWarning(ioe);
+ LOGGER.logThrowableAsWarning(ioe);
}
}
} else {
@@ -276,4 +287,6 @@ public Mono getBodyAsString(Charset charset) {
return Mono.just(new String(responseBody, charset));
}
}
+
+ private static final ClientLogger LOGGER = new ClientLogger(ResourceGraphClientImpl.class);
}
diff --git a/sdk/resourcegraph/azure-resourcemanager-resourcegraph/src/main/java/com/azure/resourcemanager/resourcegraph/implementation/ResourceProvidersClientImpl.java b/sdk/resourcegraph/azure-resourcemanager-resourcegraph/src/main/java/com/azure/resourcemanager/resourcegraph/implementation/ResourceProvidersClientImpl.java
index 5c82e03a81fa..39576f2de847 100644
--- a/sdk/resourcegraph/azure-resourcemanager-resourcegraph/src/main/java/com/azure/resourcemanager/resourcegraph/implementation/ResourceProvidersClientImpl.java
+++ b/sdk/resourcegraph/azure-resourcemanager-resourcegraph/src/main/java/com/azure/resourcemanager/resourcegraph/implementation/ResourceProvidersClientImpl.java
@@ -21,22 +21,14 @@
import com.azure.core.management.exception.ManagementException;
import com.azure.core.util.Context;
import com.azure.core.util.FluxUtil;
-import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.resourcegraph.fluent.ResourceProvidersClient;
import com.azure.resourcemanager.resourcegraph.fluent.models.QueryResponseInner;
-import com.azure.resourcemanager.resourcegraph.fluent.models.ResourceChangeDataInner;
-import com.azure.resourcemanager.resourcegraph.fluent.models.ResourceChangeListInner;
import com.azure.resourcemanager.resourcegraph.models.QueryRequest;
-import com.azure.resourcemanager.resourcegraph.models.ResourceChangeDetailsRequestParameters;
-import com.azure.resourcemanager.resourcegraph.models.ResourceChangesRequestParameters;
import com.azure.resourcemanager.resourcegraph.models.ResourcesHistoryRequest;
-import java.util.List;
import reactor.core.publisher.Mono;
/** An instance of this class provides access to all the operations defined in ResourceProvidersClient. */
public final class ResourceProvidersClientImpl implements ResourceProvidersClient {
- private final ClientLogger logger = new ClientLogger(ResourceProvidersClientImpl.class);
-
/** The proxy service used to perform REST calls. */
private final ResourceProvidersService service;
@@ -61,28 +53,6 @@ public final class ResourceProvidersClientImpl implements ResourceProvidersClien
@Host("{$host}")
@ServiceInterface(name = "ResourceGraphClientR")
private interface ResourceProvidersService {
- @Headers({"Content-Type: application/json"})
- @Post("/providers/Microsoft.ResourceGraph/resourceChanges")
- @ExpectedResponses({200})
- @UnexpectedResponseExceptionType(ManagementException.class)
- Mono> resourceChanges(
- @HostParam("$host") String endpoint,
- @QueryParam("api-version") String apiVersion,
- @BodyParam("application/json") ResourceChangesRequestParameters parameters,
- @HeaderParam("Accept") String accept,
- Context context);
-
- @Headers({"Content-Type: application/json"})
- @Post("/providers/Microsoft.ResourceGraph/resourceChangeDetails")
- @ExpectedResponses({200})
- @UnexpectedResponseExceptionType(ManagementException.class)
- Mono>> resourceChangeDetails(
- @HostParam("$host") String endpoint,
- @QueryParam("api-version") String apiVersion,
- @BodyParam("application/json") ResourceChangeDetailsRequestParameters parameters,
- @HeaderParam("Accept") String accept,
- Context context);
-
@Headers({"Content-Type: application/json"})
@Post("/providers/Microsoft.ResourceGraph/resources")
@ExpectedResponses({200})
@@ -106,234 +76,6 @@ Mono> resourcesHistory(
Context context);
}
- /**
- * List changes to a resource for a given time interval.
- *
- * @param parameters the parameters for this request for changes.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return a list of changes associated with a resource over a specific time interval.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> resourceChangesWithResponseAsync(
- ResourceChangesRequestParameters parameters) {
- if (this.client.getEndpoint() == null) {
- return Mono
- .error(
- new IllegalArgumentException(
- "Parameter this.client.getEndpoint() is required and cannot be null."));
- }
- if (parameters == null) {
- return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
- } else {
- parameters.validate();
- }
- final String apiVersion = "2020-09-01-preview";
- final String accept = "application/json";
- return FluxUtil
- .withContext(
- context -> service.resourceChanges(this.client.getEndpoint(), apiVersion, parameters, accept, context))
- .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
- }
-
- /**
- * List changes to a resource for a given time interval.
- *
- * @param parameters the parameters for this request for changes.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return a list of changes associated with a resource over a specific time interval.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> resourceChangesWithResponseAsync(
- ResourceChangesRequestParameters parameters, Context context) {
- if (this.client.getEndpoint() == null) {
- return Mono
- .error(
- new IllegalArgumentException(
- "Parameter this.client.getEndpoint() is required and cannot be null."));
- }
- if (parameters == null) {
- return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
- } else {
- parameters.validate();
- }
- final String apiVersion = "2020-09-01-preview";
- final String accept = "application/json";
- context = this.client.mergeContext(context);
- return service.resourceChanges(this.client.getEndpoint(), apiVersion, parameters, accept, context);
- }
-
- /**
- * List changes to a resource for a given time interval.
- *
- * @param parameters the parameters for this request for changes.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return a list of changes associated with a resource over a specific time interval.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- private Mono resourceChangesAsync(ResourceChangesRequestParameters parameters) {
- return resourceChangesWithResponseAsync(parameters)
- .flatMap(
- (Response res) -> {
- if (res.getValue() != null) {
- return Mono.just(res.getValue());
- } else {
- return Mono.empty();
- }
- });
- }
-
- /**
- * List changes to a resource for a given time interval.
- *
- * @param parameters the parameters for this request for changes.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return a list of changes associated with a resource over a specific time interval.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- public ResourceChangeListInner resourceChanges(ResourceChangesRequestParameters parameters) {
- return resourceChangesAsync(parameters).block();
- }
-
- /**
- * List changes to a resource for a given time interval.
- *
- * @param parameters the parameters for this request for changes.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return a list of changes associated with a resource over a specific time interval.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- public Response resourceChangesWithResponse(
- ResourceChangesRequestParameters parameters, Context context) {
- return resourceChangesWithResponseAsync(parameters, context).block();
- }
-
- /**
- * Get resource change details.
- *
- * @param parameters The parameters for this request for resource change details.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return resource change details.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- private Mono>> resourceChangeDetailsWithResponseAsync(
- ResourceChangeDetailsRequestParameters parameters) {
- if (this.client.getEndpoint() == null) {
- return Mono
- .error(
- new IllegalArgumentException(
- "Parameter this.client.getEndpoint() is required and cannot be null."));
- }
- if (parameters == null) {
- return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
- } else {
- parameters.validate();
- }
- final String apiVersion = "2020-09-01-preview";
- final String accept = "application/json";
- return FluxUtil
- .withContext(
- context ->
- service.resourceChangeDetails(this.client.getEndpoint(), apiVersion, parameters, accept, context))
- .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
- }
-
- /**
- * Get resource change details.
- *
- * @param parameters The parameters for this request for resource change details.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return resource change details.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- private Mono>> resourceChangeDetailsWithResponseAsync(
- ResourceChangeDetailsRequestParameters parameters, Context context) {
- if (this.client.getEndpoint() == null) {
- return Mono
- .error(
- new IllegalArgumentException(
- "Parameter this.client.getEndpoint() is required and cannot be null."));
- }
- if (parameters == null) {
- return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
- } else {
- parameters.validate();
- }
- final String apiVersion = "2020-09-01-preview";
- final String accept = "application/json";
- context = this.client.mergeContext(context);
- return service.resourceChangeDetails(this.client.getEndpoint(), apiVersion, parameters, accept, context);
- }
-
- /**
- * Get resource change details.
- *
- * @param parameters The parameters for this request for resource change details.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return resource change details.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> resourceChangeDetailsAsync(
- ResourceChangeDetailsRequestParameters parameters) {
- return resourceChangeDetailsWithResponseAsync(parameters)
- .flatMap(
- (Response> res) -> {
- if (res.getValue() != null) {
- return Mono.just(res.getValue());
- } else {
- return Mono.empty();
- }
- });
- }
-
- /**
- * Get resource change details.
- *
- * @param parameters The parameters for this request for resource change details.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return resource change details.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- public List resourceChangeDetails(ResourceChangeDetailsRequestParameters parameters) {
- return resourceChangeDetailsAsync(parameters).block();
- }
-
- /**
- * Get resource change details.
- *
- * @param parameters The parameters for this request for resource change details.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return resource change details.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- public Response> resourceChangeDetailsWithResponse(
- ResourceChangeDetailsRequestParameters parameters, Context context) {
- return resourceChangeDetailsWithResponseAsync(parameters, context).block();
- }
-
/**
* Queries the resources managed by Azure Resource Manager for scopes specified in the request.
*
@@ -341,7 +83,7 @@ public Response> resourceChangeDetailsWithResponse
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return query result.
+ * @return query result along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> resourcesWithResponseAsync(QueryRequest query) {
@@ -356,10 +98,11 @@ private Mono> resourcesWithResponseAsync(QueryReque
} else {
query.validate();
}
- final String apiVersion = "2021-03-01";
final String accept = "application/json";
return FluxUtil
- .withContext(context -> service.resources(this.client.getEndpoint(), apiVersion, query, accept, context))
+ .withContext(
+ context ->
+ service.resources(this.client.getEndpoint(), this.client.getApiVersion(), query, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
@@ -371,7 +114,7 @@ private Mono> resourcesWithResponseAsync(QueryReque
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return query result.
+ * @return query result along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> resourcesWithResponseAsync(QueryRequest query, Context context) {
@@ -386,10 +129,9 @@ private Mono> resourcesWithResponseAsync(QueryReque
} else {
query.validate();
}
- final String apiVersion = "2021-03-01";
final String accept = "application/json";
context = this.client.mergeContext(context);
- return service.resources(this.client.getEndpoint(), apiVersion, query, accept, context);
+ return service.resources(this.client.getEndpoint(), this.client.getApiVersion(), query, accept, context);
}
/**
@@ -399,7 +141,7 @@ private Mono> resourcesWithResponseAsync(QueryReque
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return query result.
+ * @return query result on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono resourcesAsync(QueryRequest query) {
@@ -436,7 +178,7 @@ public QueryResponseInner resources(QueryRequest query) {
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return query result.
+ * @return query result along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response resourcesWithResponse(QueryRequest query, Context context) {
@@ -446,11 +188,11 @@ public Response resourcesWithResponse(QueryRequest query, Co
/**
* List all snapshots of a resource for a given time interval.
*
- * @param request The request parameter.
+ * @param request Request specifying the query and its options.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return any object.
+ * @return any object along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> resourcesHistoryWithResponseAsync(ResourcesHistoryRequest request) {
@@ -465,23 +207,25 @@ private Mono> resourcesHistoryWithResponseAsync(ResourcesHistor
} else {
request.validate();
}
- final String apiVersion = "2020-04-01-preview";
final String accept = "application/json";
return FluxUtil
.withContext(
- context -> service.resourcesHistory(this.client.getEndpoint(), apiVersion, request, accept, context))
+ context ->
+ service
+ .resourcesHistory(
+ this.client.getEndpoint(), this.client.getApiVersion(), request, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* List all snapshots of a resource for a given time interval.
*
- * @param request The request parameter.
+ * @param request Request specifying the query and its options.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return any object.
+ * @return any object along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> resourcesHistoryWithResponseAsync(ResourcesHistoryRequest request, Context context) {
@@ -496,20 +240,20 @@ private Mono> resourcesHistoryWithResponseAsync(ResourcesHistor
} else {
request.validate();
}
- final String apiVersion = "2020-04-01-preview";
final String accept = "application/json";
context = this.client.mergeContext(context);
- return service.resourcesHistory(this.client.getEndpoint(), apiVersion, request, accept, context);
+ return service
+ .resourcesHistory(this.client.getEndpoint(), this.client.getApiVersion(), request, accept, context);
}
/**
* List all snapshots of a resource for a given time interval.
*
- * @param request The request parameter.
+ * @param request Request specifying the query and its options.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return any object.
+ * @return any object on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono