From ae017ddad282c0257b6b85eb3c9cedf602c3e096 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 31 May 2022 07:48:36 +0000 Subject: [PATCH] CodeGen from PR 19275 in Azure/azure-rest-api-specs Merge b8ea71895a022e73e0b4fcdb7a6219aa3575b18b into ef2dedc629c54795597b7e11affad0cd6e804a8b --- .../CHANGELOG.md | 4 +- .../README.md | 2 +- .../CustomLocationsManager.java | 67 ++++++- .../fluent/CustomLocationsClient.java | 40 ++-- .../fluent/models/CustomLocationInner.java | 4 - .../models/CustomLocationOperationInner.java | 4 - .../CustomLocationOperationValueDisplay.java | 4 - .../models/CustomLocationProperties.java | 4 - .../models/EnabledResourceTypeInner.java | 4 - .../models/EnabledResourceTypeProperties.java | 4 - .../implementation/CustomLocationImpl.java | 4 + .../CustomLocationsClientImpl.java | 179 +++++++++--------- .../implementation/CustomLocationsImpl.java | 19 +- ...ustomLocationsManagementClientBuilder.java | 34 ++-- .../CustomLocationsManagementClientImpl.java | 13 +- .../models/CustomLocation.java | 7 + .../models/CustomLocationListResult.java | 4 - .../models/CustomLocationOperationsList.java | 7 +- ...ustomLocationPropertiesAuthentication.java | 4 - .../models/CustomLocations.java | 26 +-- ...sourceTypePropertiesTypesMetadataItem.java | 5 - .../EnabledResourceTypesListResult.java | 4 - .../extendedlocation/models/HostType.java | 6 +- .../extendedlocation/models/Identity.java | 4 - .../models/PatchableCustomLocations.java | 4 - .../models/ResourceIdentityType.java | 6 +- 26 files changed, 249 insertions(+), 214 deletions(-) diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/CHANGELOG.md b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/CHANGELOG.md index dbc32924d120..6dc37fba3f39 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/CHANGELOG.md +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.1 (2022-05-31) + +- Azure Resource Manager CustomLocations client library for Java. This package contains Microsoft Azure SDK for CustomLocations Management SDK. The customLocations Rest API spec. Package tag package-2021-08-15. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/README.md b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/README.md index f0c3b82aeabd..cff2ebf60fdc 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/README.md +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/README.md @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-extendedlocation - 1.0.0-beta.1 + 1.0.0-beta.2 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/CustomLocationsManager.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/CustomLocationsManager.java index dd1f9e16aa11..5ee7889bec7a 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/CustomLocationsManager.java +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/CustomLocationsManager.java @@ -8,12 +8,15 @@ 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.AddHeadersFromContextPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; import com.azure.core.http.policy.HttpPolicyProviders; import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; @@ -29,6 +32,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; +import java.util.stream.Collectors; /** Entry point to CustomLocationsManager. The customLocations Rest API spec. */ public final class CustomLocationsManager { @@ -61,6 +65,19 @@ public static CustomLocationsManager authenticate(TokenCredential credential, Az return configure().authenticate(credential, profile); } + /** + * Creates an instance of CustomLocations service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the CustomLocations service API instance. + */ + public static CustomLocationsManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new CustomLocationsManager(httpPipeline, profile, null); + } + /** * Gets a Configurable instance that can be used to create CustomLocationsManager with optional configuration. * @@ -72,13 +89,14 @@ public static Configurable configure() { /** The Configurable allowing configurations to be set. */ public static final class Configurable { - private final ClientLogger logger = new ClientLogger(Configurable.class); + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); private HttpClient httpClient; private HttpLogOptions httpLogOptions; private final List policies = new ArrayList<>(); private final List scopes = new ArrayList<>(); private RetryPolicy retryPolicy; + private RetryOptions retryOptions; private Duration defaultPollInterval; private Configurable() { @@ -139,6 +157,19 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { return this; } + /** + * Sets the retry options for the HTTP pipeline retry policy. + * + *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + /** * Sets the default poll interval, used when service does not provide "Retry-After" header. * @@ -146,9 +177,11 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { * @return the configurable object itself. */ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + this.defaultPollInterval = + Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); if (this.defaultPollInterval.isNegative()) { - throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); } return this; } @@ -188,16 +221,34 @@ public CustomLocationsManager authenticate(TokenCredential credential, AzureProf scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); } if (retryPolicy == null) { - retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } } List policies = new ArrayList<>(); policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); 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.addAll(this.policies); + 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 = @@ -209,7 +260,11 @@ public CustomLocationsManager authenticate(TokenCredential credential, AzureProf } } - /** @return Resource collection API of CustomLocations. */ + /** + * Gets the resource collection API of CustomLocations. It manages CustomLocation. + * + * @return Resource collection API of CustomLocations. + */ public CustomLocations customLocations() { if (this.customLocations == null) { this.customLocations = new CustomLocationsImpl(clientObject.getCustomLocations(), this); diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/CustomLocationsClient.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/CustomLocationsClient.java index 25036a4298f6..56fe7cb08522 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/CustomLocationsClient.java +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/CustomLocationsClient.java @@ -23,7 +23,7 @@ public interface CustomLocationsClient { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lists of Custom Locations operations. + * @return lists of Custom Locations operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listOperations(); @@ -35,7 +35,7 @@ public interface CustomLocationsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lists of Custom Locations operations. + * @return lists of Custom Locations operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listOperations(Context context); @@ -46,7 +46,8 @@ public interface CustomLocationsClient { * * @throws com.azure.core.management.exception.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 Custom Locations in the specified subscription. + * @return a list of Custom Locations in the specified subscription as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -59,7 +60,8 @@ public interface CustomLocationsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Custom Locations in the specified subscription. + * @return a list of Custom Locations in the specified subscription as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); @@ -72,7 +74,8 @@ public interface CustomLocationsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Custom Locations in the specified subscription and resource group. + * @return a list of Custom Locations in the specified subscription and resource group as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); @@ -86,7 +89,8 @@ public interface CustomLocationsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Custom Locations in the specified subscription and resource group. + * @return a list of Custom Locations in the specified subscription and resource group as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName, Context context); @@ -113,7 +117,7 @@ public interface CustomLocationsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 details of the customLocation with a specified resource group and name. + * @return the details of the customLocation with a specified resource group and name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getByResourceGroupWithResponse( @@ -128,9 +132,9 @@ Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom Locations definition. + * @return the {@link SyncPoller} for polling of custom Locations definition. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, CustomLocationInner> beginCreateOrUpdate( String resourceGroupName, String resourceName, CustomLocationInner parameters); @@ -144,9 +148,9 @@ SyncPoller, CustomLocationInner> beginCreateOrUp * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom Locations definition. + * @return the {@link SyncPoller} for polling of custom Locations definition. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, CustomLocationInner> beginCreateOrUpdate( String resourceGroupName, String resourceName, CustomLocationInner parameters, Context context); @@ -188,9 +192,9 @@ CustomLocationInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName); /** @@ -202,9 +206,9 @@ CustomLocationInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, Context context); /** @@ -256,7 +260,7 @@ CustomLocationInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom Locations definition. + * @return custom Locations definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response updateWithResponse( @@ -270,7 +274,7 @@ Response updateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 the Enabled Resource Types. + * @return the list of the Enabled Resource Types as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listEnabledResourceTypes(String resourceGroupName, String resourceName); @@ -284,7 +288,7 @@ Response updateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 the Enabled Resource Types. + * @return the list of the Enabled Resource Types as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listEnabledResourceTypes( diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/models/CustomLocationInner.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/models/CustomLocationInner.java index 959433f3fdb9..47150ea86aef 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/models/CustomLocationInner.java +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/models/CustomLocationInner.java @@ -7,11 +7,9 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; import com.azure.core.management.SystemData; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.extendedlocation.models.CustomLocationPropertiesAuthentication; import com.azure.resourcemanager.extendedlocation.models.HostType; import com.azure.resourcemanager.extendedlocation.models.Identity; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; import java.util.Map; @@ -19,8 +17,6 @@ /** Custom Locations definition. */ @Fluent public final class CustomLocationInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomLocationInner.class); - /* * Identity for the resource. */ diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/models/CustomLocationOperationInner.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/models/CustomLocationOperationInner.java index 3b7b67928554..50d93d07c049 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/models/CustomLocationOperationInner.java +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/models/CustomLocationOperationInner.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.extendedlocation.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Custom Locations operation. */ @Fluent public final class CustomLocationOperationInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomLocationOperationInner.class); - /* * Describes the properties of a Custom Locations Operation Value Display. */ diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/models/CustomLocationOperationValueDisplay.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/models/CustomLocationOperationValueDisplay.java index 02beea16b665..d7b392602ab8 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/models/CustomLocationOperationValueDisplay.java +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/models/CustomLocationOperationValueDisplay.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.extendedlocation.fluent.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Describes the properties of a Custom Locations Operation Value Display. */ @Immutable public final class CustomLocationOperationValueDisplay { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomLocationOperationValueDisplay.class); - /* * The description of the operation. */ diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/models/CustomLocationProperties.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/models/CustomLocationProperties.java index 1a7f81f52c91..fa16e20bd221 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/models/CustomLocationProperties.java +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/models/CustomLocationProperties.java @@ -5,18 +5,14 @@ package com.azure.resourcemanager.extendedlocation.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.extendedlocation.models.CustomLocationPropertiesAuthentication; import com.azure.resourcemanager.extendedlocation.models.HostType; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Properties for a custom location. */ @Fluent public final class CustomLocationProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomLocationProperties.class); - /* * This is optional input that contains the authentication that should be * used to generate the namespace. diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/models/EnabledResourceTypeInner.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/models/EnabledResourceTypeInner.java index 14bc61cffa53..feead694005d 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/models/EnabledResourceTypeInner.java +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/models/EnabledResourceTypeInner.java @@ -7,17 +7,13 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.extendedlocation.models.EnabledResourceTypePropertiesTypesMetadataItem; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** EnabledResourceType definition. */ @Fluent public final class EnabledResourceTypeInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EnabledResourceTypeInner.class); - /* * The set of properties for EnabledResourceType specific to a Custom * Location diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/models/EnabledResourceTypeProperties.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/models/EnabledResourceTypeProperties.java index e48cdf788d64..3a1120ea802b 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/models/EnabledResourceTypeProperties.java +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/models/EnabledResourceTypeProperties.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.extendedlocation.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.extendedlocation.models.EnabledResourceTypePropertiesTypesMetadataItem; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Properties for EnabledResourceType of a custom location. */ @Fluent public final class EnabledResourceTypeProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EnabledResourceTypeProperties.class); - /* * Cluster Extension ID */ diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/CustomLocationImpl.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/CustomLocationImpl.java index 1450cdfa7b31..6aa11ba706cc 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/CustomLocationImpl.java +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/CustomLocationImpl.java @@ -96,6 +96,10 @@ public String regionName() { return this.location(); } + public String resourceGroupName() { + return resourceGroupName; + } + public CustomLocationInner innerModel() { return this.innerObject; } diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/CustomLocationsClientImpl.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/CustomLocationsClientImpl.java index da27ca9a7b67..07df9f5bab4f 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/CustomLocationsClientImpl.java +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/CustomLocationsClientImpl.java @@ -30,7 +30,6 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.extendedlocation.fluent.CustomLocationsClient; @@ -47,8 +46,6 @@ /** An instance of this class provides access to all the operations defined in CustomLocationsClient. */ public final class CustomLocationsClientImpl implements CustomLocationsClient { - private final ClientLogger logger = new ClientLogger(CustomLocationsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final CustomLocationsService service; @@ -231,7 +228,8 @@ Mono> listEnabledResourceTypesNext( * * @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 lists of Custom Locations operations. + * @return lists of Custom Locations operations along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listOperationsSinglePageAsync() { @@ -265,7 +263,8 @@ private Mono> listOperationsSinglePa * @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 lists of Custom Locations operations. + * @return lists of Custom Locations operations along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listOperationsSinglePageAsync(Context context) { @@ -295,7 +294,7 @@ private Mono> listOperationsSinglePa * * @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 lists of Custom Locations operations. + * @return lists of Custom Locations operations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listOperationsAsync() { @@ -310,7 +309,7 @@ private PagedFlux listOperationsAsync() { * @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 lists of Custom Locations operations. + * @return lists of Custom Locations operations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listOperationsAsync(Context context) { @@ -324,7 +323,7 @@ private PagedFlux listOperationsAsync(Context cont * * @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 lists of Custom Locations operations. + * @return lists of Custom Locations operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listOperations() { @@ -338,7 +337,7 @@ public PagedIterable listOperations() { * @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 lists of Custom Locations operations. + * @return lists of Custom Locations operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listOperations(Context context) { @@ -351,7 +350,8 @@ public PagedIterable listOperations(Context contex * * @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 Custom Locations in the specified subscription. + * @return a list of Custom Locations in the specified subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -398,7 +398,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 a list of Custom Locations in the specified subscription. + * @return a list of Custom Locations in the specified subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -440,7 +441,7 @@ private Mono> listSinglePageAsync(Context con * * @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 Custom Locations in the specified subscription. + * @return a list of Custom Locations in the specified subscription as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -456,7 +457,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 a list of Custom Locations in the specified subscription. + * @return a list of Custom Locations in the specified subscription as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -470,7 +471,8 @@ 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 a list of Custom Locations in the specified subscription. + * @return a list of Custom Locations in the specified subscription as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -485,7 +487,8 @@ 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 a list of Custom Locations in the specified subscription. + * @return a list of Custom Locations in the specified subscription as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -500,7 +503,8 @@ public PagedIterable list(Context context) { * @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 Custom Locations in the specified subscription and resource group. + * @return a list of Custom Locations in the specified subscription and resource group along with {@link + * PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { @@ -553,7 +557,8 @@ private Mono> listByResourceGroupSinglePageAs * @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 Custom Locations in the specified subscription and resource group. + * @return a list of Custom Locations in the specified subscription and resource group along with {@link + * PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( @@ -603,7 +608,8 @@ private Mono> listByResourceGroupSinglePageAs * @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 Custom Locations in the specified subscription and resource group. + * @return a list of Custom Locations in the specified subscription and resource group as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { @@ -621,7 +627,8 @@ private PagedFlux listByResourceGroupAsync(String resourceG * @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 Custom Locations in the specified subscription and resource group. + * @return a list of Custom Locations in the specified subscription and resource group as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { @@ -638,7 +645,8 @@ private PagedFlux listByResourceGroupAsync(String resourceG * @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 Custom Locations in the specified subscription and resource group. + * @return a list of Custom Locations in the specified subscription and resource group as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { @@ -654,7 +662,8 @@ public PagedIterable listByResourceGroup(String resourceGro * @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 Custom Locations in the specified subscription and resource group. + * @return a list of Custom Locations in the specified subscription and resource group as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { @@ -669,7 +678,8 @@ public PagedIterable listByResourceGroup(String resourceGro * @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 details of the customLocation with a specified resource group and name. + * @return the details of the customLocation with a specified resource group and name along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -718,7 +728,8 @@ private Mono> getByResourceGroupWithResponseAsync( * @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 details of the customLocation with a specified resource group and name. + * @return the details of the customLocation with a specified resource group and name along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -763,19 +774,13 @@ private Mono> getByResourceGroupWithResponseAsync( * @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 details of the customLocation with a specified resource group and name. + * @return the details of the customLocation with a specified resource group and name on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync(String resourceGroupName, String resourceName) { return getByResourceGroupWithResponseAsync(resourceGroupName, resourceName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -802,7 +807,7 @@ public CustomLocationInner getByResourceGroup(String resourceGroupName, String r * @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 details of the customLocation with a specified resource group and name. + * @return the details of the customLocation with a specified resource group and name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse( @@ -819,7 +824,7 @@ public Response getByResourceGroupWithResponse( * @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 custom Locations definition. + * @return custom Locations definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -875,7 +880,7 @@ private Mono>> createOrUpdateWithResponseAsync( * @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 custom Locations definition. + * @return custom Locations definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -927,9 +932,9 @@ private Mono>> createOrUpdateWithResponseAsync( * @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 custom Locations definition. + * @return the {@link PollerFlux} for polling of custom Locations definition. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, CustomLocationInner> beginCreateOrUpdateAsync( String resourceGroupName, String resourceName, CustomLocationInner parameters) { Mono>> mono = @@ -941,7 +946,7 @@ private PollerFlux, CustomLocationInner> beginCr this.client.getHttpPipeline(), CustomLocationInner.class, CustomLocationInner.class, - Context.NONE); + this.client.getContext()); } /** @@ -954,9 +959,9 @@ private PollerFlux, CustomLocationInner> beginCr * @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 custom Locations definition. + * @return the {@link PollerFlux} for polling of custom Locations definition. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, CustomLocationInner> beginCreateOrUpdateAsync( String resourceGroupName, String resourceName, CustomLocationInner parameters, Context context) { context = this.client.mergeContext(context); @@ -977,9 +982,9 @@ private PollerFlux, CustomLocationInner> beginCr * @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 custom Locations definition. + * @return the {@link SyncPoller} for polling of custom Locations definition. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, CustomLocationInner> beginCreateOrUpdate( String resourceGroupName, String resourceName, CustomLocationInner parameters) { return beginCreateOrUpdateAsync(resourceGroupName, resourceName, parameters).getSyncPoller(); @@ -995,9 +1000,9 @@ public SyncPoller, CustomLocationInner> beginCre * @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 custom Locations definition. + * @return the {@link SyncPoller} for polling of custom Locations definition. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, CustomLocationInner> beginCreateOrUpdate( String resourceGroupName, String resourceName, CustomLocationInner parameters, Context context) { return beginCreateOrUpdateAsync(resourceGroupName, resourceName, parameters, context).getSyncPoller(); @@ -1012,7 +1017,7 @@ public SyncPoller, CustomLocationInner> beginCre * @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 custom Locations definition. + * @return custom Locations definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -1032,7 +1037,7 @@ private Mono createOrUpdateAsync( * @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 custom Locations definition. + * @return custom Locations definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -1085,7 +1090,7 @@ public CustomLocationInner createOrUpdate( * @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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String resourceName) { @@ -1133,7 +1138,7 @@ private Mono>> deleteWithResponseAsync(String resource * @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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( @@ -1178,14 +1183,15 @@ private Mono>> deleteWithResponseAsync( * @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 completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String resourceName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -1197,9 +1203,9 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @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 completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String resourceName, Context context) { context = this.client.mergeContext(context); @@ -1217,9 +1223,9 @@ private PollerFlux, Void> beginDeleteAsync( * @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 completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName) { return beginDeleteAsync(resourceGroupName, resourceName).getSyncPoller(); } @@ -1233,9 +1239,9 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @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 completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String resourceName, Context context) { return beginDeleteAsync(resourceGroupName, resourceName, context).getSyncPoller(); @@ -1249,7 +1255,7 @@ public SyncPoller, Void> beginDelete( * @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 completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String resourceName) { @@ -1265,7 +1271,7 @@ private Mono deleteAsync(String resourceGroupName, String resourceName) { * @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 completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String resourceName, Context context) { @@ -1312,7 +1318,7 @@ public void delete(String resourceGroupName, String resourceName, Context contex * @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 custom Locations definition. + * @return custom Locations definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -1368,7 +1374,7 @@ private Mono> updateWithResponseAsync( * @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 custom Locations definition. + * @return custom Locations definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -1420,20 +1426,13 @@ private Mono> updateWithResponseAsync( * @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 custom Locations definition. + * @return custom Locations definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( String resourceGroupName, String resourceName, PatchableCustomLocations parameters) { return updateWithResponseAsync(resourceGroupName, resourceName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1463,7 +1462,7 @@ public CustomLocationInner update( * @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 custom Locations definition. + * @return custom Locations definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse( @@ -1479,7 +1478,8 @@ public Response updateWithResponse( * @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 the Enabled Resource Types. + * @return the list of the Enabled Resource Types along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listEnabledResourceTypesSinglePageAsync( @@ -1537,7 +1537,8 @@ private Mono> listEnabledResourceTypesSi * @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 the Enabled Resource Types. + * @return the list of the Enabled Resource Types along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listEnabledResourceTypesSinglePageAsync( @@ -1591,7 +1592,7 @@ private Mono> listEnabledResourceTypesSi * @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 the Enabled Resource Types. + * @return the list of the Enabled Resource Types as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listEnabledResourceTypesAsync( @@ -1610,7 +1611,7 @@ private PagedFlux listEnabledResourceTypesAsync( * @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 the Enabled Resource Types. + * @return the list of the Enabled Resource Types as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listEnabledResourceTypesAsync( @@ -1628,7 +1629,7 @@ private PagedFlux listEnabledResourceTypesAsync( * @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 the Enabled Resource Types. + * @return the list of the Enabled Resource Types as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listEnabledResourceTypes( @@ -1645,7 +1646,7 @@ public PagedIterable listEnabledResourceTypes( * @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 the Enabled Resource Types. + * @return the list of the Enabled Resource Types as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listEnabledResourceTypes( @@ -1660,7 +1661,8 @@ public PagedIterable listEnabledResourceTypes( * @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 lists of Custom Locations operations. + * @return lists of Custom Locations operations along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listOperationsNextSinglePageAsync(String nextLink) { @@ -1696,7 +1698,8 @@ private Mono> listOperationsNextSing * @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 lists of Custom Locations operations. + * @return lists of Custom Locations operations along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listOperationsNextSinglePageAsync( @@ -1732,7 +1735,8 @@ private Mono> listOperationsNextSing * @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 Custom Locations operation response. + * @return the List Custom Locations operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { @@ -1769,7 +1773,8 @@ private Mono> listBySubscriptionNextSinglePag * @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 Custom Locations operation response. + * @return the List Custom Locations operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync( @@ -1805,7 +1810,8 @@ private Mono> listBySubscriptionNextSinglePag * @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 Custom Locations operation response. + * @return the List Custom Locations operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { @@ -1842,7 +1848,8 @@ private Mono> listByResourceGroupNextSinglePa * @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 Custom Locations operation response. + * @return the List Custom Locations operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync( @@ -1878,7 +1885,8 @@ private Mono> listByResourceGroupNextSinglePa * @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 list of EnabledResourceTypes definition. + * @return list of EnabledResourceTypes definition along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listEnabledResourceTypesNextSinglePageAsync(String nextLink) { @@ -1915,7 +1923,8 @@ private Mono> listEnabledResourceTypesNe * @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 list of EnabledResourceTypes definition. + * @return list of EnabledResourceTypes definition along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listEnabledResourceTypesNextSinglePageAsync( diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/CustomLocationsImpl.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/CustomLocationsImpl.java index 6e6001b52b9d..619998d56d6a 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/CustomLocationsImpl.java +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/CustomLocationsImpl.java @@ -17,10 +17,9 @@ import com.azure.resourcemanager.extendedlocation.models.CustomLocationOperation; import com.azure.resourcemanager.extendedlocation.models.CustomLocations; import com.azure.resourcemanager.extendedlocation.models.EnabledResourceType; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class CustomLocationsImpl implements CustomLocations { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomLocationsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(CustomLocationsImpl.class); private final CustomLocationsClient innerClient; @@ -111,7 +110,7 @@ public PagedIterable listEnabledResourceTypes( public CustomLocation getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -119,7 +118,7 @@ public CustomLocation getById(String id) { } String resourceName = Utils.getValueFromIdByName(id, "customLocations"); if (resourceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -131,7 +130,7 @@ public CustomLocation getById(String id) { public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -139,7 +138,7 @@ public Response getByIdWithResponse(String id, Context context) } String resourceName = Utils.getValueFromIdByName(id, "customLocations"); if (resourceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -151,7 +150,7 @@ public Response getByIdWithResponse(String id, Context context) public void deleteById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -159,7 +158,7 @@ public void deleteById(String id) { } String resourceName = Utils.getValueFromIdByName(id, "customLocations"); if (resourceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -171,7 +170,7 @@ public void deleteById(String id) { public void deleteByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -179,7 +178,7 @@ public void deleteByIdWithResponse(String id, Context context) { } String resourceName = Utils.getValueFromIdByName(id, "customLocations"); if (resourceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/CustomLocationsManagementClientBuilder.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/CustomLocationsManagementClientBuilder.java index 02bb4057f0a6..bfe77faa4075 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/CustomLocationsManagementClientBuilder.java +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/CustomLocationsManagementClientBuilder.java @@ -7,7 +7,6 @@ import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.CookiePolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.AzureEnvironment; @@ -67,34 +66,34 @@ public CustomLocationsManagementClientBuilder environment(AzureEnvironment envir } /* - * The default poll interval for long-running operation + * The HTTP pipeline to send requests through */ - private Duration defaultPollInterval; + private HttpPipeline pipeline; /** - * Sets The default poll interval for long-running operation. + * Sets The HTTP pipeline to send requests through. * - * @param defaultPollInterval the defaultPollInterval value. + * @param pipeline the pipeline value. * @return the CustomLocationsManagementClientBuilder. */ - public CustomLocationsManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = defaultPollInterval; + public CustomLocationsManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; return this; } /* - * The HTTP pipeline to send requests through + * The default poll interval for long-running operation */ - private HttpPipeline pipeline; + private Duration defaultPollInterval; /** - * Sets The HTTP pipeline to send requests through. + * Sets The default poll interval for long-running operation. * - * @param pipeline the pipeline value. + * @param defaultPollInterval the defaultPollInterval value. * @return the CustomLocationsManagementClientBuilder. */ - public CustomLocationsManagementClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; + public CustomLocationsManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; return this; } @@ -126,15 +125,12 @@ public CustomLocationsManagementClientImpl buildClient() { if (environment == null) { this.environment = AzureEnvironment.AZURE; } + if (pipeline == null) { + this.pipeline = new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + } if (defaultPollInterval == null) { this.defaultPollInterval = Duration.ofSeconds(30); } - if (pipeline == null) { - this.pipeline = - new HttpPipelineBuilder() - .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) - .build(); - } if (serializerAdapter == null) { this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); } diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/CustomLocationsManagementClientImpl.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/CustomLocationsManagementClientImpl.java index a1c9efc763b8..c208a04bbe27 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/CustomLocationsManagementClientImpl.java +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/implementation/CustomLocationsManagementClientImpl.java @@ -15,6 +15,7 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.management.polling.PollerFactory; import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; import com.azure.core.util.polling.LongRunningOperationStatus; @@ -29,15 +30,12 @@ import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.time.Duration; -import java.util.Map; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; /** Initializes a new instance of the CustomLocationsManagementClientImpl type. */ @ServiceClient(builder = CustomLocationsManagementClientBuilder.class) public final class CustomLocationsManagementClientImpl implements CustomLocationsManagementClient { - private final ClientLogger logger = new ClientLogger(CustomLocationsManagementClientImpl.class); - /** The ID of the target subscription. */ private final String subscriptionId; @@ -164,10 +162,7 @@ public Context getContext() { * @return the merged context. */ public Context mergeContext(Context context) { - for (Map.Entry entry : this.getContext().getValues().entrySet()) { - context = context.addData(entry.getKey(), entry.getValue()); - } - return context; + return CoreUtils.mergeContexts(this.getContext(), context); } /** @@ -231,7 +226,7 @@ public Mono getLroFinalResultOrError(AsyncPollResponse, managementError = null; } } catch (IOException | RuntimeException ioe) { - logger.logThrowableAsWarning(ioe); + LOGGER.logThrowableAsWarning(ioe); } } } else { @@ -290,4 +285,6 @@ public Mono getBodyAsString(Charset charset) { return Mono.just(new String(responseBody, charset)); } } + + private static final ClientLogger LOGGER = new ClientLogger(CustomLocationsManagementClientImpl.class); } diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/CustomLocation.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/CustomLocation.java index cf6854db3e06..dba09bf89e49 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/CustomLocation.java +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/CustomLocation.java @@ -128,6 +128,13 @@ public interface CustomLocation { */ String regionName(); + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.extendedlocation.fluent.models.CustomLocationInner object. * diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/CustomLocationListResult.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/CustomLocationListResult.java index 0e78da985069..224e4d1e19f3 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/CustomLocationListResult.java +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/CustomLocationListResult.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.extendedlocation.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.extendedlocation.fluent.models.CustomLocationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** The List Custom Locations operation response. */ @Immutable public final class CustomLocationListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomLocationListResult.class); - /* * The URL to use for getting the next set of results. */ diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/CustomLocationOperationsList.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/CustomLocationOperationsList.java index ec2802f14e7a..be902d0a4564 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/CustomLocationOperationsList.java +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/CustomLocationOperationsList.java @@ -7,15 +7,12 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.extendedlocation.fluent.models.CustomLocationOperationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Lists of Custom Locations operations. */ @Fluent public final class CustomLocationOperationsList { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomLocationOperationsList.class); - /* * Next page of operations. */ @@ -75,7 +72,7 @@ public CustomLocationOperationsList withValue(List */ public void validate() { if (value() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property value in model CustomLocationOperationsList")); @@ -83,4 +80,6 @@ public void validate() { value().forEach(e -> e.validate()); } } + + private static final ClientLogger LOGGER = new ClientLogger(CustomLocationOperationsList.class); } diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/CustomLocationPropertiesAuthentication.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/CustomLocationPropertiesAuthentication.java index 9c15e995a351..507dceb76a0e 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/CustomLocationPropertiesAuthentication.java +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/CustomLocationPropertiesAuthentication.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.extendedlocation.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** This is optional input that contains the authentication that should be used to generate the namespace. */ @Fluent public final class CustomLocationPropertiesAuthentication { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomLocationPropertiesAuthentication.class); - /* * The type of the Custom Locations authentication */ diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/CustomLocations.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/CustomLocations.java index e461398960da..9b5467a6fb0f 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/CustomLocations.java +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/CustomLocations.java @@ -15,7 +15,7 @@ public interface CustomLocations { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lists of Custom Locations operations. + * @return lists of Custom Locations operations as paginated response with {@link PagedIterable}. */ PagedIterable listOperations(); @@ -26,7 +26,7 @@ public interface CustomLocations { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lists of Custom Locations operations. + * @return lists of Custom Locations operations as paginated response with {@link PagedIterable}. */ PagedIterable listOperations(Context context); @@ -36,7 +36,8 @@ public interface CustomLocations { * * @throws com.azure.core.management.exception.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 Custom Locations in the specified subscription. + * @return a list of Custom Locations in the specified subscription as paginated response with {@link + * PagedIterable}. */ PagedIterable list(); @@ -48,7 +49,8 @@ public interface CustomLocations { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Custom Locations in the specified subscription. + * @return a list of Custom Locations in the specified subscription as paginated response with {@link + * PagedIterable}. */ PagedIterable list(Context context); @@ -60,7 +62,8 @@ public interface CustomLocations { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Custom Locations in the specified subscription and resource group. + * @return a list of Custom Locations in the specified subscription and resource group as paginated response with + * {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); @@ -73,7 +76,8 @@ public interface CustomLocations { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Custom Locations in the specified subscription and resource group. + * @return a list of Custom Locations in the specified subscription and resource group as paginated response with + * {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName, Context context); @@ -98,7 +102,7 @@ public interface CustomLocations { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 details of the customLocation with a specified resource group and name. + * @return the details of the customLocation with a specified resource group and name along with {@link Response}. */ Response getByResourceGroupWithResponse( String resourceGroupName, String resourceName, Context context); @@ -134,7 +138,7 @@ Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 the Enabled Resource Types. + * @return the list of the Enabled Resource Types as paginated response with {@link PagedIterable}. */ PagedIterable listEnabledResourceTypes(String resourceGroupName, String resourceName); @@ -147,7 +151,7 @@ Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 the Enabled Resource Types. + * @return the list of the Enabled Resource Types as paginated response with {@link PagedIterable}. */ PagedIterable listEnabledResourceTypes( String resourceGroupName, String resourceName, Context context); @@ -159,7 +163,7 @@ PagedIterable listEnabledResourceTypes( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 details of the customLocation with a specified resource group and name. + * @return the details of the customLocation with a specified resource group and name along with {@link Response}. */ CustomLocation getById(String id); @@ -171,7 +175,7 @@ PagedIterable listEnabledResourceTypes( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 details of the customLocation with a specified resource group and name. + * @return the details of the customLocation with a specified resource group and name along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/EnabledResourceTypePropertiesTypesMetadataItem.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/EnabledResourceTypePropertiesTypesMetadataItem.java index d630b5ea4c36..c707c188a2cf 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/EnabledResourceTypePropertiesTypesMetadataItem.java +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/EnabledResourceTypePropertiesTypesMetadataItem.java @@ -5,16 +5,11 @@ package com.azure.resourcemanager.extendedlocation.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Metadata of the Resource Type. */ @Fluent public final class EnabledResourceTypePropertiesTypesMetadataItem { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(EnabledResourceTypePropertiesTypesMetadataItem.class); - /* * Api Version of Resource Type */ diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/EnabledResourceTypesListResult.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/EnabledResourceTypesListResult.java index 0ab3758ca745..d6fece71c178 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/EnabledResourceTypesListResult.java +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/EnabledResourceTypesListResult.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.extendedlocation.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.extendedlocation.fluent.models.EnabledResourceTypeInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** List of EnabledResourceTypes definition. */ @Immutable public final class EnabledResourceTypesListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EnabledResourceTypesListResult.class); - /* * The URL to use for getting the next set of results. */ diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/HostType.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/HostType.java index 48b3f2b9036d..5ad2355d2de5 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/HostType.java +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/HostType.java @@ -24,7 +24,11 @@ public static HostType fromString(String name) { return fromString(name, HostType.class); } - /** @return known HostType values. */ + /** + * Gets known HostType values. + * + * @return known HostType values. + */ public static Collection values() { return values(HostType.class); } diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/Identity.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/Identity.java index f8e3e6b3e07a..46b754aa9de7 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/Identity.java +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/Identity.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.extendedlocation.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Identity for the resource. */ @Fluent public class Identity { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Identity.class); - /* * The principal ID of resource identity. */ diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/PatchableCustomLocations.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/PatchableCustomLocations.java index 59858877baad..4d407575007c 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/PatchableCustomLocations.java +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/PatchableCustomLocations.java @@ -5,9 +5,7 @@ package com.azure.resourcemanager.extendedlocation.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.extendedlocation.fluent.models.CustomLocationProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -16,8 +14,6 @@ /** The Custom Locations patchable resource definition. */ @Fluent public final class PatchableCustomLocations { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PatchableCustomLocations.class); - /* * Identity for the resource. */ diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/ResourceIdentityType.java b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/ResourceIdentityType.java index 599f36c5195a..5555ad013d9f 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/ResourceIdentityType.java +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/models/ResourceIdentityType.java @@ -27,7 +27,11 @@ public static ResourceIdentityType fromString(String name) { return fromString(name, ResourceIdentityType.class); } - /** @return known ResourceIdentityType values. */ + /** + * Gets known ResourceIdentityType values. + * + * @return known ResourceIdentityType values. + */ public static Collection values() { return values(ResourceIdentityType.class); }