From 19cec99fd6825f178987da0d12a391887923def8 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 15 Sep 2022 00:29:38 +0000 Subject: [PATCH] CodeGen from PR 19956 in Azure/azure-rest-api-specs Merge 183dbd42aef82973d3fc506db21bae8b44cdbbb7 into f70b7953f5d54889cc1825b37ad938342ca93a2e --- .../CHANGELOG.md | 4 +- .../README.md | 2 +- .../resourcehealth/ResourceHealthManager.java | 50 ++++++++++++-- .../AvailabilityStatusesClientImpl.java | 36 ++++------ .../MicrosoftResourceHealthBuilder.java | 67 +++++++++---------- .../MicrosoftResourceHealthImpl.java | 7 +- .../implementation/OperationsClientImpl.java | 10 +-- .../models/AvailabilityStateValues.java | 8 ++- .../models/AvailabilityStatusListResult.java | 4 +- .../models/AvailabilityStatusProperties.java | 63 ++++++++--------- ...ilityStatusPropertiesRecentlyResolved.java | 42 ++++++------ .../models/ReasonChronicityTypes.java | 8 ++- 12 files changed, 162 insertions(+), 139 deletions(-) diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/CHANGELOG.md b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/CHANGELOG.md index d10214f5484f..38cda0d6212a 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-09-15) + +- 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..b767d809593a 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}) 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/implementation/AvailabilityStatusesClientImpl.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/AvailabilityStatusesClientImpl.java index 3a9fa218ab9c..f9f3ac2bb22c 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 @@ -639,14 +639,7 @@ private Mono> getByResourceWithResponseAsync( @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceAsync(String resourceUri, String filter, String expand) { 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())); } /** @@ -667,14 +660,7 @@ 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())); } /** @@ -933,7 +919,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 +957,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 +996,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 +1034,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 +1073,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 +1110,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/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..83292ba73717 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 @@ -114,15 +114,7 @@ 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())); } /** 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..94be6def078f 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,8 +20,8 @@ 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; 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..c0f217b98a86 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,22 +104,20 @@ 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; @@ -364,22 +357,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..b3a2c3ea09b5 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,27 @@ 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; /** - * 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 +74,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/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); }