diff --git a/sdk/changeanalysis/azure-resourcemanager-changeanalysis/CHANGELOG.md b/sdk/changeanalysis/azure-resourcemanager-changeanalysis/CHANGELOG.md index a3eb18725037..e74c76a90bd9 100644 --- a/sdk/changeanalysis/azure-resourcemanager-changeanalysis/CHANGELOG.md +++ b/sdk/changeanalysis/azure-resourcemanager-changeanalysis/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2022-02-09) +- Azure Resource Manager AzureChangeAnalysis client library for Java. This package contains Microsoft Azure SDK for AzureChangeAnalysis Management SDK. Package tag package-2021-04-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## 1.0.0 (2021-04-21) diff --git a/sdk/changeanalysis/azure-resourcemanager-changeanalysis/README.md b/sdk/changeanalysis/azure-resourcemanager-changeanalysis/README.md index 206f6be0cede..271d13800e8d 100644 --- a/sdk/changeanalysis/azure-resourcemanager-changeanalysis/README.md +++ b/sdk/changeanalysis/azure-resourcemanager-changeanalysis/README.md @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-changeanalysis - 1.0.0 + 1.1.0-beta.1 ``` [//]: # ({x-version-update-end}) @@ -74,6 +74,9 @@ See [API design][design] for general introduction on design and key concepts on ## Examples +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/changeanalysis/azure-resourcemanager-changeanalysis/SAMPLE.md) + + ## Troubleshooting ## Next steps diff --git a/sdk/changeanalysis/azure-resourcemanager-changeanalysis/SAMPLE.md b/sdk/changeanalysis/azure-resourcemanager-changeanalysis/SAMPLE.md new file mode 100644 index 000000000000..97bd23718461 --- /dev/null +++ b/sdk/changeanalysis/azure-resourcemanager-changeanalysis/SAMPLE.md @@ -0,0 +1,125 @@ +# Code snippets and samples + + +## Changes + +- [List](#changes_list) +- [ListByResourceGroup](#changes_listbyresourcegroup) + +## Operations + +- [List](#operations_list) + +## ResourceChanges + +- [List](#resourcechanges_list) +### Changes_List + +```java +import com.azure.core.util.Context; +import java.time.OffsetDateTime; + +/** Samples for Changes List. */ +public final class ChangesListSamples { + /* + * x-ms-original-file: specification/changeanalysis/resource-manager/Microsoft.ChangeAnalysis/stable/2021-04-01/examples/ChangesListChangesBySubscription.json + */ + /** + * Sample code: Changes_ListChangesBySubscription. + * + * @param manager Entry point to AzureChangeAnalysisManager. + */ + public static void changesListChangesBySubscription( + com.azure.resourcemanager.changeanalysis.AzureChangeAnalysisManager manager) { + manager + .changes() + .list( + OffsetDateTime.parse("2021-04-25T12:09:03.141Z"), + OffsetDateTime.parse("2021-04-26T12:09:03.141Z"), + null, + Context.NONE); + } +} +``` + +### Changes_ListByResourceGroup + +```java +import com.azure.core.util.Context; +import java.time.OffsetDateTime; + +/** Samples for Changes ListByResourceGroup. */ +public final class ChangesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/changeanalysis/resource-manager/Microsoft.ChangeAnalysis/stable/2021-04-01/examples/ChangesListChangesByResourceGroup.json + */ + /** + * Sample code: Changes_ListChangesByResourceGroup. + * + * @param manager Entry point to AzureChangeAnalysisManager. + */ + public static void changesListChangesByResourceGroup( + com.azure.resourcemanager.changeanalysis.AzureChangeAnalysisManager manager) { + manager + .changes() + .listByResourceGroup( + "MyResourceGroup", + OffsetDateTime.parse("2021-04-25T12:09:03.141Z"), + OffsetDateTime.parse("2021-04-26T12:09:03.141Z"), + null, + Context.NONE); + } +} +``` + +### Operations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/changeanalysis/resource-manager/Microsoft.ChangeAnalysis/stable/2021-04-01/examples/OperationsList.json + */ + /** + * Sample code: Operations_List. + * + * @param manager Entry point to AzureChangeAnalysisManager. + */ + public static void operationsList(com.azure.resourcemanager.changeanalysis.AzureChangeAnalysisManager manager) { + manager.operations().list(null, Context.NONE); + } +} +``` + +### ResourceChanges_List + +```java +import com.azure.core.util.Context; +import java.time.OffsetDateTime; + +/** Samples for ResourceChanges List. */ +public final class ResourceChangesListSamples { + /* + * x-ms-original-file: specification/changeanalysis/resource-manager/Microsoft.ChangeAnalysis/stable/2021-04-01/examples/ResourceChangesList.json + */ + /** + * Sample code: ResourceChanges_List. + * + * @param manager Entry point to AzureChangeAnalysisManager. + */ + public static void resourceChangesList( + com.azure.resourcemanager.changeanalysis.AzureChangeAnalysisManager manager) { + manager + .resourceChanges() + .list( + "subscriptions/4d962866-1e3f-47f2-bd18-450c08f914c1/resourceGroups/MyResourceGroup/providers/Microsoft.Web/sites/mysite", + OffsetDateTime.parse("2021-04-25T12:09:03.141Z"), + OffsetDateTime.parse("2021-04-26T12:09:03.141Z"), + null, + Context.NONE); + } +} +``` + diff --git a/sdk/changeanalysis/azure-resourcemanager-changeanalysis/pom.xml b/sdk/changeanalysis/azure-resourcemanager-changeanalysis/pom.xml index 4f167ecf727f..bb64db1c98d1 100644 --- a/sdk/changeanalysis/azure-resourcemanager-changeanalysis/pom.xml +++ b/sdk/changeanalysis/azure-resourcemanager-changeanalysis/pom.xml @@ -1,55 +1,55 @@ - 4.0.0 - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + - com.azure.resourcemanager - azure-resourcemanager-changeanalysis - 1.1.0-beta.1 - jar + com.azure.resourcemanager + azure-resourcemanager-changeanalysis + 1.1.0-beta.1 + jar - Microsoft Azure SDK for AzureChangeAnalysis Management - This package contains Microsoft Azure SDK for AzureChangeAnalysis Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2021-04-01. - https://github.com/Azure/azure-sdk-for-java + Microsoft Azure SDK for AzureChangeAnalysis Management + This package contains Microsoft Azure SDK for AzureChangeAnalysis Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2021-04-01. + https://github.com/Azure/azure-sdk-for-java - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + - - https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - microsoft - Microsoft - - - - UTF-8 - true - - - - com.azure - azure-core - 1.25.0 - - - com.azure - azure-core-management - 1.5.2 - - + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true + + + + com.azure + azure-core + 1.25.0 + + + com.azure + azure-core-management + 1.5.2 + + diff --git a/sdk/changeanalysis/azure-resourcemanager-changeanalysis/src/main/java/com/azure/resourcemanager/changeanalysis/AzureChangeAnalysisManager.java b/sdk/changeanalysis/azure-resourcemanager-changeanalysis/src/main/java/com/azure/resourcemanager/changeanalysis/AzureChangeAnalysisManager.java index b4a1431fb1fe..1c3f55aeba55 100644 --- a/sdk/changeanalysis/azure-resourcemanager-changeanalysis/src/main/java/com/azure/resourcemanager/changeanalysis/AzureChangeAnalysisManager.java +++ b/sdk/changeanalysis/azure-resourcemanager-changeanalysis/src/main/java/com/azure/resourcemanager/changeanalysis/AzureChangeAnalysisManager.java @@ -8,8 +8,8 @@ import com.azure.core.http.HttpClient; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; @@ -17,6 +17,7 @@ import com.azure.core.http.policy.RequestIdPolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; @@ -33,6 +34,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; +import java.util.stream.Collectors; /** Entry point to AzureChangeAnalysisManager. */ public final class AzureChangeAnalysisManager { @@ -85,6 +87,7 @@ public static final class Configurable { private HttpClient httpClient; private HttpLogOptions httpLogOptions; private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); private RetryPolicy retryPolicy; private Duration defaultPollInterval; @@ -124,6 +127,17 @@ public Configurable withPolicy(HttpPipelinePolicy policy) { return this; } + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + /** * Sets the retry policy to the HTTP pipeline. * @@ -166,7 +180,7 @@ public AzureChangeAnalysisManager authenticate(TokenCredential credential, Azure .append("-") .append("com.azure.resourcemanager.changeanalysis") .append("/") - .append("1.0.0"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -180,20 +194,33 @@ public AzureChangeAnalysisManager authenticate(TokenCredential credential, Azure userAgentBuilder.append(" (auto-generated)"); } + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } if (retryPolicy == null) { retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); } List policies = new ArrayList<>(); policies.add(new UserAgentPolicy(userAgentBuilder.toString())); policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); policies - .add( - new BearerTokenAuthenticationPolicy( - credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); - policies.addAll(this.policies); + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); HttpPipeline httpPipeline = diff --git a/sdk/changeanalysis/azure-resourcemanager-changeanalysis/src/main/java/com/azure/resourcemanager/changeanalysis/implementation/ChangesClientImpl.java b/sdk/changeanalysis/azure-resourcemanager-changeanalysis/src/main/java/com/azure/resourcemanager/changeanalysis/implementation/ChangesClientImpl.java index 7f8c0ce74d38..ddbc022e7af6 100644 --- a/sdk/changeanalysis/azure-resourcemanager-changeanalysis/src/main/java/com/azure/resourcemanager/changeanalysis/implementation/ChangesClientImpl.java +++ b/sdk/changeanalysis/azure-resourcemanager-changeanalysis/src/main/java/com/azure/resourcemanager/changeanalysis/implementation/ChangesClientImpl.java @@ -123,7 +123,7 @@ Mono> listChangesBySubscriptionNext( * @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 the list of detected changes. + * @return the list of detected changes along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( @@ -190,7 +190,7 @@ private Mono> listByResourceGroupSinglePageAsync( * @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 the list of detected changes. + * @return the list of detected changes along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( @@ -356,7 +356,7 @@ public PagedIterable listByResourceGroup( * @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 the list of detected changes. + * @return the list of detected changes along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( @@ -417,7 +417,7 @@ 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 the list of detected changes. + * @return the list of detected changes along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( @@ -566,7 +566,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 the list of detected changes. + * @return the list of detected changes along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listChangesByResourceGroupNextSinglePageAsync(String nextLink) { @@ -603,7 +603,7 @@ private Mono> listChangesByResourceGroupNextSinglePag * @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 the list of detected changes. + * @return the list of detected changes along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listChangesByResourceGroupNextSinglePageAsync( @@ -639,7 +639,7 @@ private Mono> listChangesByResourceGroupNextSinglePag * @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 the list of detected changes. + * @return the list of detected changes along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listChangesBySubscriptionNextSinglePageAsync(String nextLink) { @@ -676,7 +676,7 @@ private Mono> listChangesBySubscriptionNextSinglePage * @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 the list of detected changes. + * @return the list of detected changes along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listChangesBySubscriptionNextSinglePageAsync( diff --git a/sdk/changeanalysis/azure-resourcemanager-changeanalysis/src/main/java/com/azure/resourcemanager/changeanalysis/implementation/OperationsClientImpl.java b/sdk/changeanalysis/azure-resourcemanager-changeanalysis/src/main/java/com/azure/resourcemanager/changeanalysis/implementation/OperationsClientImpl.java index 0b7037028fd4..32f5654dd3f2 100644 --- a/sdk/changeanalysis/azure-resourcemanager-changeanalysis/src/main/java/com/azure/resourcemanager/changeanalysis/implementation/OperationsClientImpl.java +++ b/sdk/changeanalysis/azure-resourcemanager-changeanalysis/src/main/java/com/azure/resourcemanager/changeanalysis/implementation/OperationsClientImpl.java @@ -91,7 +91,8 @@ Mono> listNext( * @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 the resource provider operation list. + * @return the resource provider operation list along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String skipToken) { @@ -129,7 +130,8 @@ private Mono> listSingle * @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 the resource provider operation list. + * @return the resource provider operation list along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( @@ -244,7 +246,8 @@ public PagedIterable list(String skipT * @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 the resource provider operation list. + * @return the resource provider operation list along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -280,7 +283,8 @@ private Mono> listNextSi * @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 the resource provider operation list. + * @return the resource provider operation list along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync( diff --git a/sdk/changeanalysis/azure-resourcemanager-changeanalysis/src/main/java/com/azure/resourcemanager/changeanalysis/implementation/ResourceChangesClientImpl.java b/sdk/changeanalysis/azure-resourcemanager-changeanalysis/src/main/java/com/azure/resourcemanager/changeanalysis/implementation/ResourceChangesClientImpl.java index 60dd6ef17c08..b31d648ca4fe 100644 --- a/sdk/changeanalysis/azure-resourcemanager-changeanalysis/src/main/java/com/azure/resourcemanager/changeanalysis/implementation/ResourceChangesClientImpl.java +++ b/sdk/changeanalysis/azure-resourcemanager-changeanalysis/src/main/java/com/azure/resourcemanager/changeanalysis/implementation/ResourceChangesClientImpl.java @@ -99,7 +99,7 @@ Mono> listNext( * @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 the list of detected changes. + * @return the list of detected changes along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( @@ -159,7 +159,7 @@ 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 the list of detected changes. + * @return the list of detected changes along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( @@ -316,7 +316,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 the list of detected changes. + * @return the list of detected changes along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -352,7 +352,7 @@ private Mono> listNextSinglePageAsync(String nextLink * @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 the list of detected changes. + * @return the list of detected changes along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/changeanalysis/azure-resourcemanager-changeanalysis/src/samples/java/com/azure/resourcemanager/changeanalysis/generated/ChangesListByResourceGroupSamples.java b/sdk/changeanalysis/azure-resourcemanager-changeanalysis/src/samples/java/com/azure/resourcemanager/changeanalysis/generated/ChangesListByResourceGroupSamples.java new file mode 100644 index 000000000000..b98bba68663f --- /dev/null +++ b/sdk/changeanalysis/azure-resourcemanager-changeanalysis/src/samples/java/com/azure/resourcemanager/changeanalysis/generated/ChangesListByResourceGroupSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.changeanalysis.generated; + +import com.azure.core.util.Context; +import java.time.OffsetDateTime; + +/** Samples for Changes ListByResourceGroup. */ +public final class ChangesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/changeanalysis/resource-manager/Microsoft.ChangeAnalysis/stable/2021-04-01/examples/ChangesListChangesByResourceGroup.json + */ + /** + * Sample code: Changes_ListChangesByResourceGroup. + * + * @param manager Entry point to AzureChangeAnalysisManager. + */ + public static void changesListChangesByResourceGroup( + com.azure.resourcemanager.changeanalysis.AzureChangeAnalysisManager manager) { + manager + .changes() + .listByResourceGroup( + "MyResourceGroup", + OffsetDateTime.parse("2021-04-25T12:09:03.141Z"), + OffsetDateTime.parse("2021-04-26T12:09:03.141Z"), + null, + Context.NONE); + } +} diff --git a/sdk/changeanalysis/azure-resourcemanager-changeanalysis/src/samples/java/com/azure/resourcemanager/changeanalysis/generated/ChangesListSamples.java b/sdk/changeanalysis/azure-resourcemanager-changeanalysis/src/samples/java/com/azure/resourcemanager/changeanalysis/generated/ChangesListSamples.java new file mode 100644 index 000000000000..48de94a24e5e --- /dev/null +++ b/sdk/changeanalysis/azure-resourcemanager-changeanalysis/src/samples/java/com/azure/resourcemanager/changeanalysis/generated/ChangesListSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.changeanalysis.generated; + +import com.azure.core.util.Context; +import java.time.OffsetDateTime; + +/** Samples for Changes List. */ +public final class ChangesListSamples { + /* + * x-ms-original-file: specification/changeanalysis/resource-manager/Microsoft.ChangeAnalysis/stable/2021-04-01/examples/ChangesListChangesBySubscription.json + */ + /** + * Sample code: Changes_ListChangesBySubscription. + * + * @param manager Entry point to AzureChangeAnalysisManager. + */ + public static void changesListChangesBySubscription( + com.azure.resourcemanager.changeanalysis.AzureChangeAnalysisManager manager) { + manager + .changes() + .list( + OffsetDateTime.parse("2021-04-25T12:09:03.141Z"), + OffsetDateTime.parse("2021-04-26T12:09:03.141Z"), + null, + Context.NONE); + } +} diff --git a/sdk/changeanalysis/azure-resourcemanager-changeanalysis/src/samples/java/com/azure/resourcemanager/changeanalysis/generated/OperationsListSamples.java b/sdk/changeanalysis/azure-resourcemanager-changeanalysis/src/samples/java/com/azure/resourcemanager/changeanalysis/generated/OperationsListSamples.java new file mode 100644 index 000000000000..1542e1da4ddf --- /dev/null +++ b/sdk/changeanalysis/azure-resourcemanager-changeanalysis/src/samples/java/com/azure/resourcemanager/changeanalysis/generated/OperationsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.changeanalysis.generated; + +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/changeanalysis/resource-manager/Microsoft.ChangeAnalysis/stable/2021-04-01/examples/OperationsList.json + */ + /** + * Sample code: Operations_List. + * + * @param manager Entry point to AzureChangeAnalysisManager. + */ + public static void operationsList(com.azure.resourcemanager.changeanalysis.AzureChangeAnalysisManager manager) { + manager.operations().list(null, Context.NONE); + } +} diff --git a/sdk/changeanalysis/azure-resourcemanager-changeanalysis/src/samples/java/com/azure/resourcemanager/changeanalysis/generated/ResourceChangesListSamples.java b/sdk/changeanalysis/azure-resourcemanager-changeanalysis/src/samples/java/com/azure/resourcemanager/changeanalysis/generated/ResourceChangesListSamples.java new file mode 100644 index 000000000000..b47b2082db68 --- /dev/null +++ b/sdk/changeanalysis/azure-resourcemanager-changeanalysis/src/samples/java/com/azure/resourcemanager/changeanalysis/generated/ResourceChangesListSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.changeanalysis.generated; + +import com.azure.core.util.Context; +import java.time.OffsetDateTime; + +/** Samples for ResourceChanges List. */ +public final class ResourceChangesListSamples { + /* + * x-ms-original-file: specification/changeanalysis/resource-manager/Microsoft.ChangeAnalysis/stable/2021-04-01/examples/ResourceChangesList.json + */ + /** + * Sample code: ResourceChanges_List. + * + * @param manager Entry point to AzureChangeAnalysisManager. + */ + public static void resourceChangesList( + com.azure.resourcemanager.changeanalysis.AzureChangeAnalysisManager manager) { + manager + .resourceChanges() + .list( + "subscriptions/4d962866-1e3f-47f2-bd18-450c08f914c1/resourceGroups/MyResourceGroup/providers/Microsoft.Web/sites/mysite", + OffsetDateTime.parse("2021-04-25T12:09:03.141Z"), + OffsetDateTime.parse("2021-04-26T12:09:03.141Z"), + null, + Context.NONE); + } +}