From b4a48e45c9ce2b6a5dacf6fcc4b0d1d06ad020b3 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 1 Dec 2022 23:19:39 +0000 Subject: [PATCH] CodeGen from PR 21690 in Azure/azure-rest-api-specs Merge 1af201c99053c218b4f747123b5f2e402bc1338d into cb6219f411b14e368af6175587b302ac74b4263d --- .../CHANGELOG.md | 4 +- .../README.md | 25 +++--- .../resourcehealth/ResourceHealthManager.java | 50 ++++++++++- .../fluent/AvailabilityStatusesClient.java | 18 ++-- .../fluent/OperationsClient.java | 12 +-- .../models/AvailabilityStatusInner.java | 4 + .../models/OperationListResultInner.java | 4 + .../AvailabilityStatusesClientImpl.java | 82 ++++++------------- .../AvailabilityStatusesImpl.java | 18 ++-- .../MicrosoftResourceHealthBuilder.java | 67 ++++++++------- .../MicrosoftResourceHealthImpl.java | 7 +- .../implementation/OperationsClientImpl.java | 28 +++---- .../implementation/OperationsImpl.java | 18 ++-- .../models/AvailabilityStateValues.java | 8 +- .../models/AvailabilityStatusListResult.java | 8 +- .../models/AvailabilityStatusProperties.java | 67 ++++++++------- ...ilityStatusPropertiesRecentlyResolved.java | 46 ++++++----- .../models/AvailabilityStatuses.java | 18 ++-- .../resourcehealth/models/Operation.java | 4 + .../models/OperationDisplay.java | 4 + .../resourcehealth/models/Operations.java | 12 +-- .../models/ReasonChronicityTypes.java | 8 +- .../models/RecommendedAction.java | 4 + .../models/ServiceImpactingEvent.java | 4 + ...rviceImpactingEventIncidentProperties.java | 4 + .../models/ServiceImpactingEventStatus.java | 4 + 26 files changed, 288 insertions(+), 240 deletions(-) diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/CHANGELOG.md b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/CHANGELOG.md index d10214f5484f..88f7f02b6311 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/CHANGELOG.md +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.3 (Unreleased) +## 1.0.0-beta.1 (2022-12-01) + +- Azure Resource Manager ResourceHealth client library for Java. This package contains Microsoft Azure SDK for ResourceHealth Management SDK. The Resource Health Client. Package tag package-2020-05-01. 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/resourcehealth/azure-resourcemanager-resourcehealth/README.md b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/README.md index 7ac493972ce9..1fd90bd7bfed 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/README.md +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/README.md @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-resourcehealth - 1.0.0-beta.2 + 1.0.0-beta.3 ``` [//]: # ({x-version-update-end}) @@ -41,19 +41,19 @@ Various documentation is available to help you get started Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. -[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. +[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. ### Authentication -By default, Azure Active Directory token authentication depends on correct configure of following environment variables. +By default, Azure Active Directory token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. - `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. -In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. +In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. -With above configuration, `azure` client can be authenticated by following code: +With above configuration, `azure` client can be authenticated using the following code: ```java AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); @@ -83,13 +83,13 @@ See [API design][design] for general introduction on design and key concepts on ## Contributing -For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). +For details on contributing to this repository, see the [contributing guide][cg]. -1. Fork it -1. Create your feature branch (`git checkout -b my-new-feature`) -1. Commit your changes (`git commit -am 'Add some feature'`) -1. Push to the branch (`git push origin my-new-feature`) -1. Create new Pull Request +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. [survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS @@ -100,3 +100,6 @@ For details on contributing to this repository, see the [contributing guide](htt [azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty [authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md [design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/ResourceHealthManager.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/ResourceHealthManager.java index 5f2401f33050..81e4ebfe6277 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/ResourceHealthManager.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/ResourceHealthManager.java @@ -10,11 +10,13 @@ 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; @@ -67,6 +69,19 @@ public static ResourceHealthManager authenticate(TokenCredential credential, Azu return configure().authenticate(credential, profile); } + /** + * Creates an instance of ResourceHealth service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the ResourceHealth service API instance. + */ + public static ResourceHealthManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new ResourceHealthManager(httpPipeline, profile, null); + } + /** * Gets a Configurable instance that can be used to create ResourceHealthManager with optional configuration. * @@ -85,6 +100,7 @@ public static final class Configurable { private final List policies = new ArrayList<>(); private final List scopes = new ArrayList<>(); private RetryPolicy retryPolicy; + private RetryOptions retryOptions; private Duration defaultPollInterval; private Configurable() { @@ -145,6 +161,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. * @@ -178,7 +207,7 @@ public ResourceHealthManager authenticate(TokenCredential credential, AzureProfi .append("-") .append("com.azure.resourcemanager.resourcehealth") .append("/") - .append("1.0.0-beta.2"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -196,10 +225,15 @@ public ResourceHealthManager authenticate(TokenCredential credential, AzureProfi 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( @@ -230,7 +264,11 @@ public ResourceHealthManager authenticate(TokenCredential credential, AzureProfi } } - /** @return Resource collection API of AvailabilityStatuses. */ + /** + * Gets the resource collection API of AvailabilityStatuses. + * + * @return Resource collection API of AvailabilityStatuses. + */ public AvailabilityStatuses availabilityStatuses() { if (this.availabilityStatuses == null) { this.availabilityStatuses = new AvailabilityStatusesImpl(clientObject.getAvailabilityStatuses(), this); @@ -238,7 +276,11 @@ public AvailabilityStatuses availabilityStatuses() { return availabilityStatuses; } - /** @return Resource collection API of Operations. */ + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ public Operations operations() { if (this.operations == null) { this.operations = new OperationsImpl(clientObject.getOperations(), this); diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/AvailabilityStatusesClient.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/AvailabilityStatusesClient.java index c0c086b78c5f..27511c536c39 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/AvailabilityStatusesClient.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/AvailabilityStatusesClient.java @@ -75,13 +75,18 @@ PagedIterable listByResourceGroup( * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} * and * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}. + * @param filter The filter to apply on the operation. For more information please see + * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @param context The context to associate with this operation. * @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 current availability status for a single resource. + * @return current availability status for a single resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - AvailabilityStatusInner getByResource(String resourceUri); + Response getByResourceWithResponse( + String resourceUri, String filter, String expand, Context context); /** * Gets current availability status for a single resource. @@ -91,18 +96,13 @@ PagedIterable listByResourceGroup( * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} * and * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}. - * @param filter The filter to apply on the operation. For more information please see - * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. - * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. - * @param context The context to associate with this operation. * @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 current availability status for a single resource along with {@link Response}. + * @return current availability status for a single resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceWithResponse( - String resourceUri, String filter, String expand, Context context); + AvailabilityStatusInner getByResource(String resourceUri); /** * Lists all historical availability transitions and impacting events for a single resource. diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/OperationsClient.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/OperationsClient.java index da83d0af2b67..3d67f564748b 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/OperationsClient.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/OperationsClient.java @@ -15,22 +15,22 @@ public interface OperationsClient { /** * Lists available operations for the resourcehealth resource provider. * + * @param context The context to associate with this operation. + * @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 the operations response. + * @return lists the operations response along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - OperationListResultInner list(); + Response listWithResponse(Context context); /** * Lists available operations for the resourcehealth resource provider. * - * @param context The context to associate with this operation. - * @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 the operations response along with {@link Response}. + * @return lists the operations response. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(Context context); + OperationListResultInner list(); } diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/AvailabilityStatusInner.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/AvailabilityStatusInner.java index 6b0d94060095..df325e2a2fc9 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/AvailabilityStatusInner.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/AvailabilityStatusInner.java @@ -41,6 +41,10 @@ public final class AvailabilityStatusInner { @JsonProperty(value = "properties") private AvailabilityStatusProperties properties; + /** Creates an instance of AvailabilityStatusInner class. */ + public AvailabilityStatusInner() { + } + /** * Get the id property: Azure Resource Manager Identity for the availabilityStatuses resource. * diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/OperationListResultInner.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/OperationListResultInner.java index 0d803918dc0e..2c78b0dd5792 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/OperationListResultInner.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/OperationListResultInner.java @@ -19,6 +19,10 @@ public final class OperationListResultInner { @JsonProperty(value = "value", required = true) private List value; + /** Creates an instance of OperationListResultInner class. */ + public OperationListResultInner() { + } + /** * Get the value property: List of operations available in the resourcehealth resource provider. * diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/AvailabilityStatusesClientImpl.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/AvailabilityStatusesClientImpl.java index 3a9fa218ab9c..c38c1031fd67 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/AvailabilityStatusesClientImpl.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/AvailabilityStatusesClientImpl.java @@ -56,7 +56,7 @@ public final class AvailabilityStatusesClientImpl implements AvailabilityStatuse */ @Host("{$host}") @ServiceInterface(name = "MicrosoftResourceHea") - private interface AvailabilityStatusesService { + public interface AvailabilityStatusesService { @Headers({"Content-Type: application/json"}) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/availabilityStatuses") @ExpectedResponses({200}) @@ -628,25 +628,17 @@ private Mono> getByResourceWithResponseAsync( * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} * and * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}. - * @param filter The filter to apply on the operation. For more information please see - * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. - * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. * @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 current availability status for a single resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceAsync(String resourceUri, String filter, String expand) { + private Mono getByResourceAsync(String resourceUri) { + final String filter = null; + final String expand = null; return getByResourceWithResponseAsync(resourceUri, filter, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -657,24 +649,19 @@ private Mono getByResourceAsync(String resourceUri, Str * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} * and * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}. + * @param filter The filter to apply on the operation. For more information please see + * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return current availability status for a single resource on successful completion of {@link Mono}. + * @return current availability status for a single resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceAsync(String resourceUri) { - final String filter = null; - final String expand = null; - return getByResourceWithResponseAsync(resourceUri, filter, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + public Response getByResourceWithResponse( + String resourceUri, String filter, String expand, Context context) { + return getByResourceWithResponseAsync(resourceUri, filter, expand, context).block(); } /** @@ -694,30 +681,7 @@ private Mono getByResourceAsync(String resourceUri) { public AvailabilityStatusInner getByResource(String resourceUri) { final String filter = null; final String expand = null; - return getByResourceAsync(resourceUri, filter, expand).block(); - } - - /** - * Gets current availability status for a single resource. - * - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. - * Currently the API support not nested and one nesting level resource types : - * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} - * and - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}. - * @param filter The filter to apply on the operation. For more information please see - * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. - * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return current availability status for a single resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceWithResponse( - String resourceUri, String filter, String expand, Context context) { - return getByResourceWithResponseAsync(resourceUri, filter, expand, context).block(); + return getByResourceWithResponse(resourceUri, filter, expand, Context.NONE).getValue(); } /** @@ -933,7 +897,8 @@ public PagedIterable list( /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @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. @@ -970,7 +935,8 @@ private Mono> listBySubscriptionIdNextSin /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1008,7 +974,8 @@ private Mono> listBySubscriptionIdNextSin /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @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. @@ -1045,7 +1012,8 @@ private Mono> listByResourceGroupNextSing /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1083,7 +1051,8 @@ private Mono> listByResourceGroupNextSing /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @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. @@ -1119,7 +1088,8 @@ private Mono> listNextSinglePageAsync(Str /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/AvailabilityStatusesImpl.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/AvailabilityStatusesImpl.java index 0bba94049df7..d6181cd4f714 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/AvailabilityStatusesImpl.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/AvailabilityStatusesImpl.java @@ -51,15 +51,6 @@ public PagedIterable listByResourceGroup( return Utils.mapPage(inner, inner1 -> new AvailabilityStatusImpl(inner1, this.manager())); } - public AvailabilityStatus getByResource(String resourceUri) { - AvailabilityStatusInner inner = this.serviceClient().getByResource(resourceUri); - if (inner != null) { - return new AvailabilityStatusImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getByResourceWithResponse( String resourceUri, String filter, String expand, Context context) { Response inner = @@ -75,6 +66,15 @@ public Response getByResourceWithResponse( } } + public AvailabilityStatus getByResource(String resourceUri) { + AvailabilityStatusInner inner = this.serviceClient().getByResource(resourceUri); + if (inner != null) { + return new AvailabilityStatusImpl(inner, this.manager()); + } else { + return null; + } + } + public PagedIterable list(String resourceUri) { PagedIterable inner = this.serviceClient().list(resourceUri); return Utils.mapPage(inner, inner1 -> new AvailabilityStatusImpl(inner1, this.manager())); diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/MicrosoftResourceHealthBuilder.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/MicrosoftResourceHealthBuilder.java index d08a0643b657..2227b2982d87 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/MicrosoftResourceHealthBuilder.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/MicrosoftResourceHealthBuilder.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; @@ -19,9 +18,8 @@ @ServiceClientBuilder(serviceClients = {MicrosoftResourceHealthImpl.class}) public final class MicrosoftResourceHealthBuilder { /* - * Subscription credentials which uniquely identify Microsoft Azure - * subscription. The subscription ID forms part of the URI for every - * service call. + * Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of + * the URI for every service call. */ private String subscriptionId; @@ -70,34 +68,34 @@ public MicrosoftResourceHealthBuilder environment(AzureEnvironment environment) } /* - * 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 MicrosoftResourceHealthBuilder. */ - public MicrosoftResourceHealthBuilder defaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = defaultPollInterval; + public MicrosoftResourceHealthBuilder 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 MicrosoftResourceHealthBuilder. */ - public MicrosoftResourceHealthBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; + public MicrosoftResourceHealthBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; return this; } @@ -123,27 +121,26 @@ public MicrosoftResourceHealthBuilder serializerAdapter(SerializerAdapter serial * @return an instance of MicrosoftResourceHealthImpl. */ public MicrosoftResourceHealthImpl buildClient() { - if (endpoint == null) { - this.endpoint = "https://management.azure.com"; - } - if (environment == null) { - this.environment = AzureEnvironment.AZURE; - } - 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(); - } + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = + (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval = + (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = + (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); MicrosoftResourceHealthImpl client = new MicrosoftResourceHealthImpl( - pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + localPipeline, + localSerializerAdapter, + localDefaultPollInterval, + localEnvironment, + subscriptionId, + localEndpoint); return client; } } diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/MicrosoftResourceHealthImpl.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/MicrosoftResourceHealthImpl.java index 136d1586af53..7574172bf6cd 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/MicrosoftResourceHealthImpl.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/MicrosoftResourceHealthImpl.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; @@ -30,7 +31,6 @@ 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; @@ -181,10 +181,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); } /** diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/OperationsClientImpl.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/OperationsClientImpl.java index 516f17ca3bb2..b02d2f6e6b62 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/OperationsClientImpl.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/OperationsClientImpl.java @@ -49,7 +49,7 @@ public final class OperationsClientImpl implements OperationsClient { */ @Host("{$host}") @ServiceInterface(name = "MicrosoftResourceHea") - private interface OperationsService { + public interface OperationsService { @Headers({"Content-Type: application/json"}) @Get("/providers/Microsoft.ResourceHealth/operations") @ExpectedResponses({200}) @@ -114,40 +114,32 @@ private Mono> listWithResponseAsync(Context c */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono listAsync() { - return listWithResponseAsync() - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return listWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Lists available operations for the resourcehealth resource provider. * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lists the operations response. + * @return lists the operations response along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OperationListResultInner list() { - return listAsync().block(); + public Response listWithResponse(Context context) { + return listWithResponseAsync(context).block(); } /** * Lists available operations for the resourcehealth resource provider. * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lists the operations response along with {@link Response}. + * @return lists the operations response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(Context context) { - return listWithResponseAsync(context).block(); + public OperationListResultInner list() { + return listWithResponse(Context.NONE).getValue(); } } diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/OperationsImpl.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/OperationsImpl.java index 7e5467d8790b..1a7db9b8955f 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/OperationsImpl.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/OperationsImpl.java @@ -26,15 +26,6 @@ public OperationsImpl( this.serviceManager = serviceManager; } - public OperationListResult list() { - OperationListResultInner inner = this.serviceClient().list(); - if (inner != null) { - return new OperationListResultImpl(inner, this.manager()); - } else { - return null; - } - } - public Response listWithResponse(Context context) { Response inner = this.serviceClient().listWithResponse(context); if (inner != null) { @@ -48,6 +39,15 @@ public Response listWithResponse(Context context) { } } + public OperationListResult list() { + OperationListResultInner inner = this.serviceClient().list(); + if (inner != null) { + return new OperationListResultImpl(inner, this.manager()); + } else { + return null; + } + } + private OperationsClient serviceClient() { return this.innerClient; } diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStateValues.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStateValues.java index e1f35fdb3978..b0d85a46fadb 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStateValues.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStateValues.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for AvailabilityStateValues. */ +/** Impacted resource status of the resource. */ public final class AvailabilityStateValues extends ExpandableStringEnum { /** Static value Available for AvailabilityStateValues. */ public static final AvailabilityStateValues AVAILABLE = fromString("Available"); @@ -33,7 +33,11 @@ public static AvailabilityStateValues fromString(String name) { return fromString(name, AvailabilityStateValues.class); } - /** @return known AvailabilityStateValues values. */ + /** + * Gets known AvailabilityStateValues values. + * + * @return known AvailabilityStateValues values. + */ public static Collection values() { return values(AvailabilityStateValues.class); } diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatusListResult.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatusListResult.java index 43f64d81834b..de3b5640969d 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatusListResult.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatusListResult.java @@ -20,12 +20,16 @@ public final class AvailabilityStatusListResult { private List value; /* - * The URI to fetch the next page of availabilityStatuses. Call ListNext() - * with this URI to fetch the next page of availabilityStatuses. + * The URI to fetch the next page of availabilityStatuses. Call ListNext() with this URI to fetch the next page of + * availabilityStatuses. */ @JsonProperty(value = "nextLink") private String nextLink; + /** Creates an instance of AvailabilityStatusListResult class. */ + public AvailabilityStatusListResult() { + } + /** * Get the value property: The list of availabilityStatuses. * diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatusProperties.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatusProperties.java index 9ca72b94ece6..bba9900c1c08 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatusProperties.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatusProperties.java @@ -13,8 +13,8 @@ @Fluent public final class AvailabilityStatusProperties { /* - * Availability status of the resource. When it is null, this - * availabilityStatus object represents an availability impacting event + * Availability status of the resource. When it is null, this availabilityStatus object represents an availability + * impacting event */ @JsonProperty(value = "availabilityState") private AvailabilityStateValues availabilityState; @@ -38,40 +38,36 @@ public final class AvailabilityStatusProperties { private String detailedStatus; /* - * When the resource's availabilityState is Unavailable, it describes where - * the health impacting event was originated. Examples are planned, - * unplanned, user initiated or an outage etc. + * When the resource's availabilityState is Unavailable, it describes where the health impacting event was + * originated. Examples are planned, unplanned, user initiated or an outage etc. */ @JsonProperty(value = "reasonType") private String reasonType; /* - * When the resource's availabilityState is Unavailable, it provides the - * Timestamp for when the health impacting event was received. + * When the resource's availabilityState is Unavailable, it provides the Timestamp for when the health impacting + * event was received. */ @JsonProperty(value = "rootCauseAttributionTime") private OffsetDateTime rootCauseAttributionTime; /* - * In case of an availability impacting event, it describes when the health - * impacting event was originated. Examples are Lifecycle, Downtime, Fault - * Analysis etc. + * In case of an availability impacting event, it describes when the health impacting event was originated. + * Examples are Lifecycle, Downtime, Fault Analysis etc. */ @JsonProperty(value = "healthEventType") private String healthEventType; /* - * In case of an availability impacting event, it describes where the - * health impacting event was originated. Examples are PlatformInitiated, - * UserInitiated etc. + * In case of an availability impacting event, it describes where the health impacting event was originated. + * Examples are PlatformInitiated, UserInitiated etc. */ @JsonProperty(value = "healthEventCause") private String healthEventCause; /* - * In case of an availability impacting event, it describes the category of - * a PlatformInitiated health impacting event. Examples are Planned, - * Unplanned etc. + * In case of an availability impacting event, it describes the category of a PlatformInitiated health impacting + * event. Examples are Planned, Unplanned etc. */ @JsonProperty(value = "healthEventCategory") private String healthEventCategory; @@ -83,9 +79,8 @@ public final class AvailabilityStatusProperties { private String healthEventId; /* - * When the resource's availabilityState is Unavailable and the reasonType - * is not User Initiated, it provides the date and time for when the issue - * is expected to be resolved. + * When the resource's availabilityState is Unavailable and the reasonType is not User Initiated, it provides the + * date and time for when the issue is expected to be resolved. */ @JsonProperty(value = "resolutionETA") private OffsetDateTime resolutionEta; @@ -93,8 +88,8 @@ public final class AvailabilityStatusProperties { /* * Timestamp for when last change in health status occurred. */ - @JsonProperty(value = "occurredTime") - private OffsetDateTime occurredTime; + @JsonProperty(value = "occuredTime") + private OffsetDateTime occuredTime; /* * Chronicity of the availability transition. @@ -109,26 +104,28 @@ public final class AvailabilityStatusProperties { private OffsetDateTime reportedTime; /* - * An annotation describing a change in the availabilityState to Available - * from Unavailable with a reasonType of type Unplanned + * An annotation describing a change in the availabilityState to Available from Unavailable with a reasonType of + * type Unplanned */ @JsonProperty(value = "recentlyResolved") private AvailabilityStatusPropertiesRecentlyResolved recentlyResolved; /* - * Lists actions the user can take based on the current availabilityState - * of the resource. + * Lists actions the user can take based on the current availabilityState of the resource. */ @JsonProperty(value = "recommendedActions") private List recommendedActions; /* - * Lists the service impacting events that may be affecting the health of - * the resource. + * Lists the service impacting events that may be affecting the health of the resource. */ @JsonProperty(value = "serviceImpactingEvents") private List serviceImpactingEvents; + /** Creates an instance of AvailabilityStatusProperties class. */ + public AvailabilityStatusProperties() { + } + /** * Get the availabilityState property: Availability status of the resource. When it is null, this availabilityStatus * object represents an availability impacting event. @@ -364,22 +361,22 @@ public AvailabilityStatusProperties withResolutionEta(OffsetDateTime resolutionE } /** - * Get the occurredTime property: Timestamp for when last change in health status occurred. + * Get the occuredTime property: Timestamp for when last change in health status occurred. * - * @return the occurredTime value. + * @return the occuredTime value. */ - public OffsetDateTime occurredTime() { - return this.occurredTime; + public OffsetDateTime occuredTime() { + return this.occuredTime; } /** - * Set the occurredTime property: Timestamp for when last change in health status occurred. + * Set the occuredTime property: Timestamp for when last change in health status occurred. * - * @param occurredTime the occurredTime value to set. + * @param occuredTime the occuredTime value to set. * @return the AvailabilityStatusProperties object itself. */ - public AvailabilityStatusProperties withOccurredTime(OffsetDateTime occurredTime) { - this.occurredTime = occurredTime; + public AvailabilityStatusProperties withOccuredTime(OffsetDateTime occuredTime) { + this.occuredTime = occuredTime; return this; } diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatusPropertiesRecentlyResolved.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatusPropertiesRecentlyResolved.java index fe089240f681..493d529561bd 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatusPropertiesRecentlyResolved.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatusPropertiesRecentlyResolved.java @@ -17,8 +17,8 @@ public final class AvailabilityStatusPropertiesRecentlyResolved { /* * Timestamp for when the availabilityState changed to Unavailable */ - @JsonProperty(value = "unavailableOccurredTime") - private OffsetDateTime unavailableOccurredTime; + @JsonProperty(value = "unavailableOccuredTime") + private OffsetDateTime unavailableOccuredTime; /* * Timestamp when the availabilityState changes to Available. @@ -29,27 +29,31 @@ public final class AvailabilityStatusPropertiesRecentlyResolved { /* * Brief description of cause of the resource becoming unavailable. */ - @JsonProperty(value = "unavailabilitySummary") - private String unavailabilitySummary; + @JsonProperty(value = "unavailableSummary") + private String unavailableSummary; + + /** Creates an instance of AvailabilityStatusPropertiesRecentlyResolved class. */ + public AvailabilityStatusPropertiesRecentlyResolved() { + } /** - * Get the unavailableOccurredTime property: Timestamp for when the availabilityState changed to Unavailable. + * Get the unavailableOccuredTime property: Timestamp for when the availabilityState changed to Unavailable. * - * @return the unavailableOccurredTime value. + * @return the unavailableOccuredTime value. */ - public OffsetDateTime unavailableOccurredTime() { - return this.unavailableOccurredTime; + public OffsetDateTime unavailableOccuredTime() { + return this.unavailableOccuredTime; } /** - * Set the unavailableOccurredTime property: Timestamp for when the availabilityState changed to Unavailable. + * Set the unavailableOccuredTime property: Timestamp for when the availabilityState changed to Unavailable. * - * @param unavailableOccurredTime the unavailableOccurredTime value to set. + * @param unavailableOccuredTime the unavailableOccuredTime value to set. * @return the AvailabilityStatusPropertiesRecentlyResolved object itself. */ - public AvailabilityStatusPropertiesRecentlyResolved withUnavailableOccurredTime( - OffsetDateTime unavailableOccurredTime) { - this.unavailableOccurredTime = unavailableOccurredTime; + public AvailabilityStatusPropertiesRecentlyResolved withUnavailableOccuredTime( + OffsetDateTime unavailableOccuredTime) { + this.unavailableOccuredTime = unavailableOccuredTime; return this; } @@ -74,22 +78,22 @@ public AvailabilityStatusPropertiesRecentlyResolved withResolvedTime(OffsetDateT } /** - * Get the unavailabilitySummary property: Brief description of cause of the resource becoming unavailable. + * Get the unavailableSummary property: Brief description of cause of the resource becoming unavailable. * - * @return the unavailabilitySummary value. + * @return the unavailableSummary value. */ - public String unavailabilitySummary() { - return this.unavailabilitySummary; + public String unavailableSummary() { + return this.unavailableSummary; } /** - * Set the unavailabilitySummary property: Brief description of cause of the resource becoming unavailable. + * Set the unavailableSummary property: Brief description of cause of the resource becoming unavailable. * - * @param unavailabilitySummary the unavailabilitySummary value to set. + * @param unavailableSummary the unavailableSummary value to set. * @return the AvailabilityStatusPropertiesRecentlyResolved object itself. */ - public AvailabilityStatusPropertiesRecentlyResolved withUnavailabilitySummary(String unavailabilitySummary) { - this.unavailabilitySummary = unavailabilitySummary; + public AvailabilityStatusPropertiesRecentlyResolved withUnavailableSummary(String unavailableSummary) { + this.unavailableSummary = unavailableSummary; return this; } diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatuses.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatuses.java index 1088f560dd02..dfe1cdad0875 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatuses.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatuses.java @@ -68,12 +68,17 @@ PagedIterable listByResourceGroup( * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} * and * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}. + * @param filter The filter to apply on the operation. For more information please see + * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @param context The context to associate with this operation. * @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 current availability status for a single resource. + * @return current availability status for a single resource along with {@link Response}. */ - AvailabilityStatus getByResource(String resourceUri); + Response getByResourceWithResponse( + String resourceUri, String filter, String expand, Context context); /** * Gets current availability status for a single resource. @@ -83,17 +88,12 @@ PagedIterable listByResourceGroup( * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} * and * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}. - * @param filter The filter to apply on the operation. For more information please see - * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. - * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. - * @param context The context to associate with this operation. * @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 current availability status for a single resource along with {@link Response}. + * @return current availability status for a single resource. */ - Response getByResourceWithResponse( - String resourceUri, String filter, String expand, Context context); + AvailabilityStatus getByResource(String resourceUri); /** * Lists all historical availability transitions and impacting events for a single resource. diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/Operation.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/Operation.java index 9c8d3433857f..579057296d4a 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/Operation.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/Operation.java @@ -22,6 +22,10 @@ public final class Operation { @JsonProperty(value = "display") private OperationDisplay display; + /** Creates an instance of Operation class. */ + public Operation() { + } + /** * Get the name property: Name of the operation. * diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/OperationDisplay.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/OperationDisplay.java index 8b706512782f..359f6b37a0a6 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/OperationDisplay.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/OperationDisplay.java @@ -34,6 +34,10 @@ public final class OperationDisplay { @JsonProperty(value = "description") private String description; + /** Creates an instance of OperationDisplay class. */ + public OperationDisplay() { + } + /** * Get the provider property: Provider name. * diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/Operations.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/Operations.java index f519977cc1a3..f4c108f07c95 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/Operations.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/Operations.java @@ -12,20 +12,20 @@ public interface Operations { /** * Lists available operations for the resourcehealth resource provider. * + * @param context The context to associate with this operation. + * @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 the operations response. + * @return lists the operations response along with {@link Response}. */ - OperationListResult list(); + Response listWithResponse(Context context); /** * Lists available operations for the resourcehealth resource provider. * - * @param context The context to associate with this operation. - * @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 the operations response along with {@link Response}. + * @return lists the operations response. */ - Response listWithResponse(Context context); + OperationListResult list(); } diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ReasonChronicityTypes.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ReasonChronicityTypes.java index e3ff6160b649..136088ae0ecd 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ReasonChronicityTypes.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ReasonChronicityTypes.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ReasonChronicityTypes. */ +/** Chronicity of the availability transition. */ public final class ReasonChronicityTypes extends ExpandableStringEnum { /** Static value Transient for ReasonChronicityTypes. */ public static final ReasonChronicityTypes TRANSIENT = fromString("Transient"); @@ -27,7 +27,11 @@ public static ReasonChronicityTypes fromString(String name) { return fromString(name, ReasonChronicityTypes.class); } - /** @return known ReasonChronicityTypes values. */ + /** + * Gets known ReasonChronicityTypes values. + * + * @return known ReasonChronicityTypes values. + */ public static Collection values() { return values(ReasonChronicityTypes.class); } diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/RecommendedAction.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/RecommendedAction.java index b2b7307aeb6f..7e75ca66894b 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/RecommendedAction.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/RecommendedAction.java @@ -28,6 +28,10 @@ public final class RecommendedAction { @JsonProperty(value = "actionUrlText") private String actionUrlText; + /** Creates an instance of RecommendedAction class. */ + public RecommendedAction() { + } + /** * Get the action property: Recommended action. * diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ServiceImpactingEvent.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ServiceImpactingEvent.java index 314eb06f09d2..aa0c91ae0a39 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ServiceImpactingEvent.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ServiceImpactingEvent.java @@ -41,6 +41,10 @@ public final class ServiceImpactingEvent { @JsonProperty(value = "incidentProperties") private ServiceImpactingEventIncidentProperties incidentProperties; + /** Creates an instance of ServiceImpactingEvent class. */ + public ServiceImpactingEvent() { + } + /** * Get the eventStartTime property: Timestamp for when the event started. * diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ServiceImpactingEventIncidentProperties.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ServiceImpactingEventIncidentProperties.java index 2c1a0260dd36..e460d264833d 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ServiceImpactingEventIncidentProperties.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ServiceImpactingEventIncidentProperties.java @@ -34,6 +34,10 @@ public final class ServiceImpactingEventIncidentProperties { @JsonProperty(value = "incidentType") private String incidentType; + /** Creates an instance of ServiceImpactingEventIncidentProperties class. */ + public ServiceImpactingEventIncidentProperties() { + } + /** * Get the title property: Title of the incident. * diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ServiceImpactingEventStatus.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ServiceImpactingEventStatus.java index 28965361551c..c5a6c1ba9b7e 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ServiceImpactingEventStatus.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ServiceImpactingEventStatus.java @@ -16,6 +16,10 @@ public final class ServiceImpactingEventStatus { @JsonProperty(value = "value") private String value; + /** Creates an instance of ServiceImpactingEventStatus class. */ + public ServiceImpactingEventStatus() { + } + /** * Get the value property: Current status of the event. *