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 deleted file mode 100644 index 5f2401f33050..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/ResourceHealthManager.java +++ /dev/null @@ -1,256 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.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.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Configuration; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resourcehealth.fluent.MicrosoftResourceHealth; -import com.azure.resourcemanager.resourcehealth.implementation.AvailabilityStatusesImpl; -import com.azure.resourcemanager.resourcehealth.implementation.MicrosoftResourceHealthBuilder; -import com.azure.resourcemanager.resourcehealth.implementation.OperationsImpl; -import com.azure.resourcemanager.resourcehealth.models.AvailabilityStatuses; -import com.azure.resourcemanager.resourcehealth.models.Operations; -import java.time.Duration; -import java.time.temporal.ChronoUnit; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; -import java.util.stream.Collectors; - -/** Entry point to ResourceHealthManager. The Resource Health Client. */ -public final class ResourceHealthManager { - private AvailabilityStatuses availabilityStatuses; - - private Operations operations; - - private final MicrosoftResourceHealth clientObject; - - private ResourceHealthManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { - Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - this.clientObject = - new MicrosoftResourceHealthBuilder() - .pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) - .subscriptionId(profile.getSubscriptionId()) - .defaultPollInterval(defaultPollInterval) - .buildClient(); - } - - /** - * Creates an instance of ResourceHealth service API entry point. - * - * @param credential the credential to use. - * @param profile the Azure profile for client. - * @return the ResourceHealth service API instance. - */ - public static ResourceHealthManager authenticate(TokenCredential credential, AzureProfile profile) { - Objects.requireNonNull(credential, "'credential' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - return configure().authenticate(credential, profile); - } - - /** - * Gets a Configurable instance that can be used to create ResourceHealthManager with optional configuration. - * - * @return the Configurable instance allowing configurations. - */ - public static Configurable configure() { - return new ResourceHealthManager.Configurable(); - } - - /** The Configurable allowing configurations to be set. */ - public static final class Configurable { - private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); - - private HttpClient httpClient; - private HttpLogOptions httpLogOptions; - private final List policies = new ArrayList<>(); - private final List scopes = new ArrayList<>(); - private RetryPolicy retryPolicy; - private Duration defaultPollInterval; - - private Configurable() { - } - - /** - * Sets the http client. - * - * @param httpClient the HTTP client. - * @return the configurable object itself. - */ - public Configurable withHttpClient(HttpClient httpClient) { - this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); - return this; - } - - /** - * Sets the logging options to the HTTP pipeline. - * - * @param httpLogOptions the HTTP log options. - * @return the configurable object itself. - */ - public Configurable withLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); - return this; - } - - /** - * Adds the pipeline policy to the HTTP pipeline. - * - * @param policy the HTTP pipeline policy. - * @return the configurable object itself. - */ - public Configurable withPolicy(HttpPipelinePolicy policy) { - this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); - return this; - } - - /** - * Adds the scope to permission sets. - * - * @param scope the scope. - * @return the configurable object itself. - */ - public Configurable withScope(String scope) { - this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); - return this; - } - - /** - * Sets the retry policy to the HTTP pipeline. - * - * @param retryPolicy the HTTP pipeline retry policy. - * @return the configurable object itself. - */ - public Configurable withRetryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); - return this; - } - - /** - * Sets the default poll interval, used when service does not provide "Retry-After" header. - * - * @param defaultPollInterval the default poll interval. - * @return the configurable object itself. - */ - public Configurable withDefaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = - Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); - if (this.defaultPollInterval.isNegative()) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); - } - return this; - } - - /** - * Creates an instance of ResourceHealth service API entry point. - * - * @param credential the credential to use. - * @param profile the Azure profile for client. - * @return the ResourceHealth service API instance. - */ - public ResourceHealthManager authenticate(TokenCredential credential, AzureProfile profile) { - Objects.requireNonNull(credential, "'credential' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - - StringBuilder userAgentBuilder = new StringBuilder(); - userAgentBuilder - .append("azsdk-java") - .append("-") - .append("com.azure.resourcemanager.resourcehealth") - .append("/") - .append("1.0.0-beta.2"); - if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { - userAgentBuilder - .append(" (") - .append(Configuration.getGlobalConfiguration().get("java.version")) - .append("; ") - .append(Configuration.getGlobalConfiguration().get("os.name")) - .append("; ") - .append(Configuration.getGlobalConfiguration().get("os.version")) - .append("; auto-generated)"); - } else { - userAgentBuilder.append(" (auto-generated)"); - } - - if (scopes.isEmpty()) { - scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); - } - if (retryPolicy == null) { - retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); - } - List policies = new ArrayList<>(); - policies.add(new UserAgentPolicy(userAgentBuilder.toString())); - policies.add(new RequestIdPolicy()); - policies - .addAll( - this - .policies - .stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(retryPolicy); - policies.add(new AddDatePolicy()); - policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); - policies - .addAll( - this - .policies - .stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = - new HttpPipelineBuilder() - .httpClient(httpClient) - .policies(policies.toArray(new HttpPipelinePolicy[0])) - .build(); - return new ResourceHealthManager(httpPipeline, profile, defaultPollInterval); - } - } - - /** @return Resource collection API of AvailabilityStatuses. */ - public AvailabilityStatuses availabilityStatuses() { - if (this.availabilityStatuses == null) { - this.availabilityStatuses = new AvailabilityStatusesImpl(clientObject.getAvailabilityStatuses(), this); - } - return availabilityStatuses; - } - - /** @return Resource collection API of Operations. */ - public Operations operations() { - if (this.operations == null) { - this.operations = new OperationsImpl(clientObject.getOperations(), this); - } - return operations; - } - - /** - * @return Wrapped service client MicrosoftResourceHealth providing direct access to the underlying auto-generated - * API implementation, based on Azure REST API. - */ - public MicrosoftResourceHealth serviceClient() { - return this.clientObject; - } -} 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 deleted file mode 100644 index c0c086b78c5f..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/AvailabilityStatusesClient.java +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.resourcehealth.fluent.models.AvailabilityStatusInner; - -/** An instance of this class provides access to all the operations defined in AvailabilityStatusesClient. */ -public interface AvailabilityStatusesClient { - /** - * Lists the current availability status for all the resources in the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List availabilityStatus operation response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBySubscriptionId(); - - /** - * Lists the current availability status for all the resources in the subscription. - * - * @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 the List availabilityStatus operation response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBySubscriptionId(String filter, String expand, Context context); - - /** - * Lists the current availability status for all the resources in the resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List availabilityStatus operation response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Lists the current availability status for all the resources in the resource group. - * - * @param resourceGroupName The name of the resource group. - * @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 the List availabilityStatus operation response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup( - String resourceGroupName, String filter, String expand, Context context); - - /** - * 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}. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AvailabilityStatusInner getByResource(String resourceUri); - - /** - * 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 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceWithResponse( - String resourceUri, String filter, String expand, Context context); - - /** - * Lists all historical availability transitions and impacting events 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}. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List availabilityStatus operation response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceUri); - - /** - * Lists all historical availability transitions and impacting events 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List availabilityStatus operation response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceUri, String filter, String expand, Context context); -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/MicrosoftResourceHealth.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/MicrosoftResourceHealth.java deleted file mode 100644 index dad8232c60aa..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/MicrosoftResourceHealth.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.fluent; - -import com.azure.core.http.HttpPipeline; -import java.time.Duration; - -/** The interface for MicrosoftResourceHealth class. */ -public interface MicrosoftResourceHealth { - /** - * Gets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms - * part of the URI for every service call. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - String getEndpoint(); - - /** - * Gets Api Version. - * - * @return the apiVersion value. - */ - String getApiVersion(); - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - HttpPipeline getHttpPipeline(); - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - Duration getDefaultPollInterval(); - - /** - * Gets the AvailabilityStatusesClient object to access its operations. - * - * @return the AvailabilityStatusesClient object. - */ - AvailabilityStatusesClient getAvailabilityStatuses(); - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - OperationsClient getOperations(); -} 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 deleted file mode 100644 index da83d0af2b67..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/OperationsClient.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.resourcehealth.fluent.models.OperationListResultInner; - -/** An instance of this class provides access to all the operations defined in OperationsClient. */ -public interface OperationsClient { - /** - * Lists available operations for the resourcehealth resource provider. - * - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OperationListResultInner list(); - - /** - * 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(Context context); -} 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 deleted file mode 100644 index 6b0d94060095..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/AvailabilityStatusInner.java +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.resourcehealth.models.AvailabilityStatusProperties; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** availabilityStatus of a resource. */ -@Fluent -public final class AvailabilityStatusInner { - /* - * Azure Resource Manager Identity for the availabilityStatuses resource. - */ - @JsonProperty(value = "id") - private String id; - - /* - * current. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Microsoft.ResourceHealth/AvailabilityStatuses. - */ - @JsonProperty(value = "type") - private String type; - - /* - * Azure Resource Manager geo location of the resource. - */ - @JsonProperty(value = "location") - private String location; - - /* - * Properties of availability state. - */ - @JsonProperty(value = "properties") - private AvailabilityStatusProperties properties; - - /** - * Get the id property: Azure Resource Manager Identity for the availabilityStatuses resource. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Azure Resource Manager Identity for the availabilityStatuses resource. - * - * @param id the id value to set. - * @return the AvailabilityStatusInner object itself. - */ - public AvailabilityStatusInner withId(String id) { - this.id = id; - return this; - } - - /** - * Get the name property: current. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: current. - * - * @param name the name value to set. - * @return the AvailabilityStatusInner object itself. - */ - public AvailabilityStatusInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the type property: Microsoft.ResourceHealth/AvailabilityStatuses. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: Microsoft.ResourceHealth/AvailabilityStatuses. - * - * @param type the type value to set. - * @return the AvailabilityStatusInner object itself. - */ - public AvailabilityStatusInner withType(String type) { - this.type = type; - return this; - } - - /** - * Get the location property: Azure Resource Manager geo location of the resource. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: Azure Resource Manager geo location of the resource. - * - * @param location the location value to set. - * @return the AvailabilityStatusInner object itself. - */ - public AvailabilityStatusInner withLocation(String location) { - this.location = location; - return this; - } - - /** - * Get the properties property: Properties of availability state. - * - * @return the properties value. - */ - public AvailabilityStatusProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Properties of availability state. - * - * @param properties the properties value to set. - * @return the AvailabilityStatusInner object itself. - */ - public AvailabilityStatusInner withProperties(AvailabilityStatusProperties properties) { - this.properties = properties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } -} 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 deleted file mode 100644 index 0d803918dc0e..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/OperationListResultInner.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resourcehealth.models.Operation; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Lists the operations response. */ -@Fluent -public final class OperationListResultInner { - /* - * List of operations available in the resourcehealth resource provider. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /** - * Get the value property: List of operations available in the resourcehealth resource provider. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of operations available in the resourcehealth resource provider. - * - * @param value the value value to set. - * @return the OperationListResultInner object itself. - */ - public OperationListResultInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model OperationListResultInner")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(OperationListResultInner.class); -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/package-info.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/package-info.java deleted file mode 100644 index e85f5bc4badf..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the inner data models for MicrosoftResourceHealth. The Resource Health Client. */ -package com.azure.resourcemanager.resourcehealth.fluent.models; diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/package-info.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/package-info.java deleted file mode 100644 index d8f1375b5918..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the service clients for MicrosoftResourceHealth. The Resource Health Client. */ -package com.azure.resourcemanager.resourcehealth.fluent; diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/AvailabilityStatusImpl.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/AvailabilityStatusImpl.java deleted file mode 100644 index 6b58b14d591b..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/AvailabilityStatusImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.implementation; - -import com.azure.resourcemanager.resourcehealth.fluent.models.AvailabilityStatusInner; -import com.azure.resourcemanager.resourcehealth.models.AvailabilityStatus; -import com.azure.resourcemanager.resourcehealth.models.AvailabilityStatusProperties; - -public final class AvailabilityStatusImpl implements AvailabilityStatus { - private AvailabilityStatusInner innerObject; - - private final com.azure.resourcemanager.resourcehealth.ResourceHealthManager serviceManager; - - AvailabilityStatusImpl( - AvailabilityStatusInner innerObject, - com.azure.resourcemanager.resourcehealth.ResourceHealthManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String location() { - return this.innerModel().location(); - } - - public AvailabilityStatusProperties properties() { - return this.innerModel().properties(); - } - - public AvailabilityStatusInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager() { - return this.serviceManager; - } -} 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 deleted file mode 100644 index 3a9fa218ab9c..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/AvailabilityStatusesClientImpl.java +++ /dev/null @@ -1,1155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.resourcehealth.fluent.AvailabilityStatusesClient; -import com.azure.resourcemanager.resourcehealth.fluent.models.AvailabilityStatusInner; -import com.azure.resourcemanager.resourcehealth.models.AvailabilityStatusListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in AvailabilityStatusesClient. */ -public final class AvailabilityStatusesClientImpl implements AvailabilityStatusesClient { - /** The proxy service used to perform REST calls. */ - private final AvailabilityStatusesService service; - - /** The service client containing this operation class. */ - private final MicrosoftResourceHealthImpl client; - - /** - * Initializes an instance of AvailabilityStatusesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AvailabilityStatusesClientImpl(MicrosoftResourceHealthImpl client) { - this.service = - RestProxy - .create(AvailabilityStatusesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MicrosoftResourceHealthAvailabilityStatuses to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MicrosoftResourceHea") - private interface AvailabilityStatusesService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/availabilityStatuses") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionId( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @QueryParam("$filter") String filter, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$expand") String expand, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ResourceHealth" - + "/availabilityStatuses") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @QueryParam("$filter") String filter, - @QueryParam("$expand") String expand, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{resourceUri}/providers/Microsoft.ResourceHealth/availabilityStatuses/current") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResource( - @HostParam("$host") String endpoint, - @PathParam(value = "resourceUri", encoded = true) String resourceUri, - @QueryParam("api-version") String apiVersion, - @QueryParam("$filter") String filter, - @QueryParam("$expand") String expand, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{resourceUri}/providers/Microsoft.ResourceHealth/availabilityStatuses") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam(value = "resourceUri", encoded = true) String resourceUri, - @QueryParam("api-version") String apiVersion, - @QueryParam("$filter") String filter, - @QueryParam("$expand") String expand, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionIdNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists the current availability status for all the resources in the subscription. - * - * @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 the List availabilityStatus operation response along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionIdSinglePageAsync( - String filter, String expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listBySubscriptionId( - this.client.getEndpoint(), - this.client.getApiVersion(), - filter, - this.client.getSubscriptionId(), - expand, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the current availability status for all the resources in the subscription. - * - * @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 the List availabilityStatus operation response along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionIdSinglePageAsync( - String filter, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBySubscriptionId( - this.client.getEndpoint(), - this.client.getApiVersion(), - filter, - this.client.getSubscriptionId(), - expand, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists the current availability status for all the resources in the subscription. - * - * @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 the List availabilityStatus operation response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySubscriptionIdAsync(String filter, String expand) { - return new PagedFlux<>( - () -> listBySubscriptionIdSinglePageAsync(filter, expand), - nextLink -> listBySubscriptionIdNextSinglePageAsync(nextLink)); - } - - /** - * Lists the current availability status for all the resources in the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List availabilityStatus operation response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySubscriptionIdAsync() { - final String filter = null; - final String expand = null; - return new PagedFlux<>( - () -> listBySubscriptionIdSinglePageAsync(filter, expand), - nextLink -> listBySubscriptionIdNextSinglePageAsync(nextLink)); - } - - /** - * Lists the current availability status for all the resources in the subscription. - * - * @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 the List availabilityStatus operation response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySubscriptionIdAsync( - String filter, String expand, Context context) { - return new PagedFlux<>( - () -> listBySubscriptionIdSinglePageAsync(filter, expand, context), - nextLink -> listBySubscriptionIdNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the current availability status for all the resources in the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List availabilityStatus operation response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBySubscriptionId() { - final String filter = null; - final String expand = null; - return new PagedIterable<>(listBySubscriptionIdAsync(filter, expand)); - } - - /** - * Lists the current availability status for all the resources in the subscription. - * - * @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 the List availabilityStatus operation response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBySubscriptionId(String filter, String expand, Context context) { - return new PagedIterable<>(listBySubscriptionIdAsync(filter, expand, context)); - } - - /** - * Lists the current availability status for all the resources in the resource group. - * - * @param resourceGroupName The name of the resource group. - * @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 the List availabilityStatus operation response along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, String filter, String expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - this.client.getApiVersion(), - filter, - expand, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the current availability status for all the resources in the resource group. - * - * @param resourceGroupName The name of the resource group. - * @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 the List availabilityStatus operation response along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, String filter, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - this.client.getApiVersion(), - filter, - expand, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists the current availability status for all the resources in the resource group. - * - * @param resourceGroupName The name of the resource group. - * @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 the List availabilityStatus operation response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync( - String resourceGroupName, String filter, String expand) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, expand), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Lists the current availability status for all the resources in the resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List availabilityStatus operation response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - final String filter = null; - final String expand = null; - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, expand), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Lists the current availability status for all the resources in the resource group. - * - * @param resourceGroupName The name of the resource group. - * @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 the List availabilityStatus operation response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync( - String resourceGroupName, String filter, String expand, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, expand, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the current availability status for all the resources in the resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List availabilityStatus operation response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - final String filter = null; - final String expand = null; - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, expand)); - } - - /** - * Lists the current availability status for all the resources in the resource group. - * - * @param resourceGroupName The name of the resource group. - * @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 the List availabilityStatus operation response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup( - String resourceGroupName, String filter, String expand, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, expand, context)); - } - - /** - * 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. - * @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} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceWithResponseAsync( - String resourceUri, String filter, String expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResource( - this.client.getEndpoint(), - resourceUri, - this.client.getApiVersion(), - filter, - expand, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * 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} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceWithResponseAsync( - String resourceUri, String filter, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResource( - this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), filter, expand, accept, context); - } - - /** - * 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. - * @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) { - return getByResourceWithResponseAsync(resourceUri, filter, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * 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}. - * @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) { - 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(); - } - }); - } - - /** - * 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}. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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(); - } - - /** - * Lists all historical availability transitions and impacting events 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List availabilityStatus operation response along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceUri, String filter, String expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - resourceUri, - this.client.getApiVersion(), - filter, - expand, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all historical availability transitions and impacting events 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 the List availabilityStatus operation response along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceUri, String filter, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), filter, expand, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all historical availability transitions and impacting events 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List availabilityStatus operation response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceUri, String filter, String expand) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceUri, filter, expand), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all historical availability transitions and impacting events 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}. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List availabilityStatus operation response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceUri) { - final String filter = null; - final String expand = null; - return new PagedFlux<>( - () -> listSinglePageAsync(resourceUri, filter, expand), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all historical availability transitions and impacting events 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 the List availabilityStatus operation response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceUri, String filter, String expand, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceUri, filter, expand, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all historical availability transitions and impacting events 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}. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List availabilityStatus operation response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceUri) { - final String filter = null; - final String expand = null; - return new PagedIterable<>(listAsync(resourceUri, filter, expand)); - } - - /** - * Lists all historical availability transitions and impacting events 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 the List availabilityStatus operation response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceUri, String filter, String expand, Context context) { - return new PagedIterable<>(listAsync(resourceUri, filter, expand, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink 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. - * @return the List availabilityStatus operation response along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionIdNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listBySubscriptionIdNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink 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. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List availabilityStatus operation response along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionIdNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBySubscriptionIdNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink 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. - * @return the List availabilityStatus operation response along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink 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. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List availabilityStatus operation response along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink 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. - * @return the List availabilityStatus operation response along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink 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. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List availabilityStatus operation response along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} 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 deleted file mode 100644 index 0bba94049df7..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/AvailabilityStatusesImpl.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resourcehealth.fluent.AvailabilityStatusesClient; -import com.azure.resourcemanager.resourcehealth.fluent.models.AvailabilityStatusInner; -import com.azure.resourcemanager.resourcehealth.models.AvailabilityStatus; -import com.azure.resourcemanager.resourcehealth.models.AvailabilityStatuses; - -public final class AvailabilityStatusesImpl implements AvailabilityStatuses { - private static final ClientLogger LOGGER = new ClientLogger(AvailabilityStatusesImpl.class); - - private final AvailabilityStatusesClient innerClient; - - private final com.azure.resourcemanager.resourcehealth.ResourceHealthManager serviceManager; - - public AvailabilityStatusesImpl( - AvailabilityStatusesClient innerClient, - com.azure.resourcemanager.resourcehealth.ResourceHealthManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listBySubscriptionId() { - PagedIterable inner = this.serviceClient().listBySubscriptionId(); - return Utils.mapPage(inner, inner1 -> new AvailabilityStatusImpl(inner1, this.manager())); - } - - public PagedIterable listBySubscriptionId(String filter, String expand, Context context) { - PagedIterable inner = - this.serviceClient().listBySubscriptionId(filter, expand, context); - return Utils.mapPage(inner, inner1 -> new AvailabilityStatusImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new AvailabilityStatusImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup( - String resourceGroupName, String filter, String expand, Context context) { - PagedIterable inner = - this.serviceClient().listByResourceGroup(resourceGroupName, filter, expand, context); - 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 = - this.serviceClient().getByResourceWithResponse(resourceUri, filter, expand, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new AvailabilityStatusImpl(inner.getValue(), 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())); - } - - public PagedIterable list(String resourceUri, String filter, String expand, Context context) { - PagedIterable inner = this.serviceClient().list(resourceUri, filter, expand, context); - return Utils.mapPage(inner, inner1 -> new AvailabilityStatusImpl(inner1, this.manager())); - } - - private AvailabilityStatusesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager() { - return this.serviceManager; - } -} 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 deleted file mode 100644 index d08a0643b657..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/MicrosoftResourceHealthBuilder.java +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.implementation; - -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; -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerAdapter; -import java.time.Duration; - -/** A builder for creating a new instance of the MicrosoftResourceHealthImpl type. */ -@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. - */ - private String subscriptionId; - - /** - * Sets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms - * part of the URI for every service call. - * - * @param subscriptionId the subscriptionId value. - * @return the MicrosoftResourceHealthBuilder. - */ - public MicrosoftResourceHealthBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; - return this; - } - - /* - * server parameter - */ - private String endpoint; - - /** - * Sets server parameter. - * - * @param endpoint the endpoint value. - * @return the MicrosoftResourceHealthBuilder. - */ - public MicrosoftResourceHealthBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * The environment to connect to - */ - private AzureEnvironment environment; - - /** - * Sets The environment to connect to. - * - * @param environment the environment value. - * @return the MicrosoftResourceHealthBuilder. - */ - public MicrosoftResourceHealthBuilder environment(AzureEnvironment environment) { - this.environment = environment; - return this; - } - - /* - * The default poll interval for long-running operation - */ - private Duration defaultPollInterval; - - /** - * Sets The default poll interval for long-running operation. - * - * @param defaultPollInterval the defaultPollInterval value. - * @return the MicrosoftResourceHealthBuilder. - */ - public MicrosoftResourceHealthBuilder defaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = defaultPollInterval; - return this; - } - - /* - * The HTTP pipeline to send requests through - */ - private HttpPipeline pipeline; - - /** - * Sets The HTTP pipeline to send requests through. - * - * @param pipeline the pipeline value. - * @return the MicrosoftResourceHealthBuilder. - */ - public MicrosoftResourceHealthBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The serializer to serialize an object into a string - */ - private SerializerAdapter serializerAdapter; - - /** - * Sets The serializer to serialize an object into a string. - * - * @param serializerAdapter the serializerAdapter value. - * @return the MicrosoftResourceHealthBuilder. - */ - public MicrosoftResourceHealthBuilder serializerAdapter(SerializerAdapter serializerAdapter) { - this.serializerAdapter = serializerAdapter; - return this; - } - - /** - * Builds an instance of MicrosoftResourceHealthImpl with the provided parameters. - * - * @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(); - } - MicrosoftResourceHealthImpl client = - new MicrosoftResourceHealthImpl( - pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); - 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 deleted file mode 100644 index 136d1586af53..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/MicrosoftResourceHealthImpl.java +++ /dev/null @@ -1,312 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.implementation; - -import com.azure.core.annotation.ServiceClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.Response; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.exception.ManagementError; -import com.azure.core.management.exception.ManagementException; -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.logging.ClientLogger; -import com.azure.core.util.polling.AsyncPollResponse; -import com.azure.core.util.polling.LongRunningOperationStatus; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.serializer.SerializerAdapter; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.resourcehealth.fluent.AvailabilityStatusesClient; -import com.azure.resourcemanager.resourcehealth.fluent.MicrosoftResourceHealth; -import com.azure.resourcemanager.resourcehealth.fluent.OperationsClient; -import java.io.IOException; -import java.lang.reflect.Type; -import java.nio.ByteBuffer; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.time.Duration; -import java.util.Map; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the MicrosoftResourceHealthImpl type. */ -@ServiceClient(builder = MicrosoftResourceHealthBuilder.class) -public final class MicrosoftResourceHealthImpl implements MicrosoftResourceHealth { - /** - * Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of - * the URI for every service call. - */ - private final String subscriptionId; - - /** - * Gets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms - * part of the URI for every service call. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** server parameter. */ - private final String endpoint; - - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** Api Version. */ - private final String apiVersion; - - /** - * Gets Api Version. - * - * @return the apiVersion value. - */ - public String getApiVersion() { - return this.apiVersion; - } - - /** The HTTP pipeline to send requests through. */ - private final HttpPipeline httpPipeline; - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - public HttpPipeline getHttpPipeline() { - return this.httpPipeline; - } - - /** The serializer to serialize an object into a string. */ - private final SerializerAdapter serializerAdapter; - - /** - * Gets The serializer to serialize an object into a string. - * - * @return the serializerAdapter value. - */ - SerializerAdapter getSerializerAdapter() { - return this.serializerAdapter; - } - - /** The default poll interval for long-running operation. */ - private final Duration defaultPollInterval; - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - public Duration getDefaultPollInterval() { - return this.defaultPollInterval; - } - - /** The AvailabilityStatusesClient object to access its operations. */ - private final AvailabilityStatusesClient availabilityStatuses; - - /** - * Gets the AvailabilityStatusesClient object to access its operations. - * - * @return the AvailabilityStatusesClient object. - */ - public AvailabilityStatusesClient getAvailabilityStatuses() { - return this.availabilityStatuses; - } - - /** The OperationsClient object to access its operations. */ - private final OperationsClient operations; - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - public OperationsClient getOperations() { - return this.operations; - } - - /** - * Initializes an instance of MicrosoftResourceHealth client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param serializerAdapter The serializer to serialize an object into a string. - * @param defaultPollInterval The default poll interval for long-running operation. - * @param environment The Azure environment. - * @param subscriptionId Subscription credentials which uniquely identify Microsoft Azure subscription. The - * subscription ID forms part of the URI for every service call. - * @param endpoint server parameter. - */ - MicrosoftResourceHealthImpl( - HttpPipeline httpPipeline, - SerializerAdapter serializerAdapter, - Duration defaultPollInterval, - AzureEnvironment environment, - String subscriptionId, - String endpoint) { - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; - this.endpoint = endpoint; - this.apiVersion = "2020-05-01"; - this.availabilityStatuses = new AvailabilityStatusesClientImpl(this); - this.operations = new OperationsClientImpl(this); - } - - /** - * Gets default client context. - * - * @return the default client context. - */ - public Context getContext() { - return Context.NONE; - } - - /** - * Merges default client context with provided context. - * - * @param context the context to be merged with default client context. - * @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; - } - - /** - * Gets long running operation result. - * - * @param activationResponse the response of activation operation. - * @param httpPipeline the http pipeline. - * @param pollResultType type of poll result. - * @param finalResultType type of final result. - * @param context the context shared by all requests. - * @param type of poll result. - * @param type of final result. - * @return poller flux for poll result and final result. - */ - public PollerFlux, U> getLroResult( - Mono>> activationResponse, - HttpPipeline httpPipeline, - Type pollResultType, - Type finalResultType, - Context context) { - return PollerFactory - .create( - serializerAdapter, - httpPipeline, - pollResultType, - finalResultType, - defaultPollInterval, - activationResponse, - context); - } - - /** - * Gets the final result, or an error, based on last async poll response. - * - * @param response the last async poll response. - * @param type of poll result. - * @param type of final result. - * @return the final result, or an error. - */ - public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { - if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { - String errorMessage; - ManagementError managementError = null; - HttpResponse errorResponse = null; - PollResult.Error lroError = response.getValue().getError(); - if (lroError != null) { - errorResponse = - new HttpResponseImpl( - lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); - - errorMessage = response.getValue().getError().getMessage(); - String errorBody = response.getValue().getError().getResponseBody(); - if (errorBody != null) { - // try to deserialize error body to ManagementError - try { - managementError = - this - .getSerializerAdapter() - .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); - if (managementError.getCode() == null || managementError.getMessage() == null) { - managementError = null; - } - } catch (IOException | RuntimeException ioe) { - LOGGER.logThrowableAsWarning(ioe); - } - } - } else { - // fallback to default error message - errorMessage = "Long running operation failed."; - } - if (managementError == null) { - // fallback to default ManagementError - managementError = new ManagementError(response.getStatus().toString(), errorMessage); - } - return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); - } else { - return response.getFinalResult(); - } - } - - private static final class HttpResponseImpl extends HttpResponse { - private final int statusCode; - - private final byte[] responseBody; - - private final HttpHeaders httpHeaders; - - HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { - super(null); - this.statusCode = statusCode; - this.httpHeaders = httpHeaders; - this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); - } - - public int getStatusCode() { - return statusCode; - } - - public String getHeaderValue(String s) { - return httpHeaders.getValue(s); - } - - public HttpHeaders getHeaders() { - return httpHeaders; - } - - public Flux getBody() { - return Flux.just(ByteBuffer.wrap(responseBody)); - } - - public Mono getBodyAsByteArray() { - return Mono.just(responseBody); - } - - public Mono getBodyAsString() { - return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); - } - - public Mono getBodyAsString(Charset charset) { - return Mono.just(new String(responseBody, charset)); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(MicrosoftResourceHealthImpl.class); -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/OperationListResultImpl.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/OperationListResultImpl.java deleted file mode 100644 index 281e121f14fd..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/OperationListResultImpl.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.implementation; - -import com.azure.resourcemanager.resourcehealth.fluent.models.OperationListResultInner; -import com.azure.resourcemanager.resourcehealth.models.Operation; -import com.azure.resourcemanager.resourcehealth.models.OperationListResult; -import java.util.Collections; -import java.util.List; - -public final class OperationListResultImpl implements OperationListResult { - private OperationListResultInner innerObject; - - private final com.azure.resourcemanager.resourcehealth.ResourceHealthManager serviceManager; - - OperationListResultImpl( - OperationListResultInner innerObject, - com.azure.resourcemanager.resourcehealth.ResourceHealthManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public List value() { - List inner = this.innerModel().value(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public OperationListResultInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager() { - return this.serviceManager; - } -} 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 deleted file mode 100644 index 516f17ca3bb2..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/OperationsClientImpl.java +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.resourcehealth.fluent.OperationsClient; -import com.azure.resourcemanager.resourcehealth.fluent.models.OperationListResultInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in OperationsClient. */ -public final class OperationsClientImpl implements OperationsClient { - /** The proxy service used to perform REST calls. */ - private final OperationsService service; - - /** The service client containing this operation class. */ - private final MicrosoftResourceHealthImpl client; - - /** - * Initializes an instance of OperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - OperationsClientImpl(MicrosoftResourceHealthImpl client) { - this.service = - RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MicrosoftResourceHealthOperations to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MicrosoftResourceHea") - private interface OperationsService { - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.ResourceHealth/operations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists available operations for the resourcehealth resource provider. - * - * @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} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * 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} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); - } - - /** - * Lists available operations for the resourcehealth resource provider. - * - * @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 on successful completion of {@link Mono}. - */ - @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(); - } - }); - } - - /** - * Lists available operations for the resourcehealth resource provider. - * - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OperationListResultInner list() { - return listAsync().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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(Context context) { - return listWithResponseAsync(context).block(); - } -} 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 deleted file mode 100644 index 7e5467d8790b..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/OperationsImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resourcehealth.fluent.OperationsClient; -import com.azure.resourcemanager.resourcehealth.fluent.models.OperationListResultInner; -import com.azure.resourcemanager.resourcehealth.models.OperationListResult; -import com.azure.resourcemanager.resourcehealth.models.Operations; - -public final class OperationsImpl implements Operations { - private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); - - private final OperationsClient innerClient; - - private final com.azure.resourcemanager.resourcehealth.ResourceHealthManager serviceManager; - - public OperationsImpl( - OperationsClient innerClient, com.azure.resourcemanager.resourcehealth.ResourceHealthManager serviceManager) { - this.innerClient = innerClient; - 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) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new OperationListResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - private OperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/Utils.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/Utils.java deleted file mode 100644 index 38bcd13e9c61..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/Utils.java +++ /dev/null @@ -1,204 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.util.CoreUtils; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; -import java.util.function.Function; -import java.util.stream.Collectors; -import java.util.stream.Stream; -import reactor.core.publisher.Flux; - -final class Utils { - static String getValueFromIdByName(String id, String name) { - if (id == null) { - return null; - } - Iterator itr = Arrays.stream(id.split("/")).iterator(); - while (itr.hasNext()) { - String part = itr.next(); - if (part != null && !part.trim().isEmpty()) { - if (part.equalsIgnoreCase(name)) { - if (itr.hasNext()) { - return itr.next(); - } else { - return null; - } - } - } - } - return null; - } - - static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { - if (id == null || pathTemplate == null) { - return null; - } - String parameterNameParentheses = "{" + parameterName + "}"; - List idSegmentsReverted = Arrays.asList(id.split("/")); - List pathSegments = Arrays.asList(pathTemplate.split("/")); - Collections.reverse(idSegmentsReverted); - Iterator idItrReverted = idSegmentsReverted.iterator(); - int pathIndex = pathSegments.size(); - while (idItrReverted.hasNext() && pathIndex > 0) { - String idSegment = idItrReverted.next(); - String pathSegment = pathSegments.get(--pathIndex); - if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { - if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { - if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { - List segments = new ArrayList<>(); - segments.add(idSegment); - idItrReverted.forEachRemaining(segments::add); - Collections.reverse(segments); - if (segments.size() > 0 && segments.get(0).isEmpty()) { - segments.remove(0); - } - return String.join("/", segments); - } else { - return idSegment; - } - } - } - } - return null; - } - - static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { - return new PagedIterableImpl(pageIterable, mapper); - } - - private static final class PagedIterableImpl extends PagedIterable { - - private final PagedIterable pagedIterable; - private final Function mapper; - private final Function, PagedResponse> pageMapper; - - private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { - super( - PagedFlux - .create( - () -> - (continuationToken, pageSize) -> - Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); - this.pagedIterable = pagedIterable; - this.mapper = mapper; - this.pageMapper = getPageMapper(mapper); - } - - private static Function, PagedResponse> getPageMapper(Function mapper) { - return page -> - new PagedResponseBase( - page.getRequest(), - page.getStatusCode(), - page.getHeaders(), - page.getElements().stream().map(mapper).collect(Collectors.toList()), - page.getContinuationToken(), - null); - } - - @Override - public Stream stream() { - return pagedIterable.stream().map(mapper); - } - - @Override - public Stream> streamByPage() { - return pagedIterable.streamByPage().map(pageMapper); - } - - @Override - public Stream> streamByPage(String continuationToken) { - return pagedIterable.streamByPage(continuationToken).map(pageMapper); - } - - @Override - public Stream> streamByPage(int preferredPageSize) { - return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); - } - - @Override - public Stream> streamByPage(String continuationToken, int preferredPageSize) { - return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); - } - - @Override - public Iterator iterator() { - return new IteratorImpl(pagedIterable.iterator(), mapper); - } - - @Override - public Iterable> iterableByPage() { - return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); - } - - @Override - public Iterable> iterableByPage(String continuationToken) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken), pageMapper); - } - - @Override - public Iterable> iterableByPage(int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(preferredPageSize), pageMapper); - } - - @Override - public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); - } - } - - private static final class IteratorImpl implements Iterator { - - private final Iterator iterator; - private final Function mapper; - - private IteratorImpl(Iterator iterator, Function mapper) { - this.iterator = iterator; - this.mapper = mapper; - } - - @Override - public boolean hasNext() { - return iterator.hasNext(); - } - - @Override - public S next() { - return mapper.apply(iterator.next()); - } - - @Override - public void remove() { - iterator.remove(); - } - } - - private static final class IterableImpl implements Iterable { - - private final Iterable iterable; - private final Function mapper; - - private IterableImpl(Iterable iterable, Function mapper) { - this.iterable = iterable; - this.mapper = mapper; - } - - @Override - public Iterator iterator() { - return new IteratorImpl(iterable.iterator(), mapper); - } - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/package-info.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/package-info.java deleted file mode 100644 index aca02cb62766..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the implementations for MicrosoftResourceHealth. The Resource Health Client. */ -package com.azure.resourcemanager.resourcehealth.implementation; 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 deleted file mode 100644 index e1f35fdb3978..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStateValues.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for AvailabilityStateValues. */ -public final class AvailabilityStateValues extends ExpandableStringEnum { - /** Static value Available for AvailabilityStateValues. */ - public static final AvailabilityStateValues AVAILABLE = fromString("Available"); - - /** Static value Unavailable for AvailabilityStateValues. */ - public static final AvailabilityStateValues UNAVAILABLE = fromString("Unavailable"); - - /** Static value Degraded for AvailabilityStateValues. */ - public static final AvailabilityStateValues DEGRADED = fromString("Degraded"); - - /** Static value Unknown for AvailabilityStateValues. */ - public static final AvailabilityStateValues UNKNOWN = fromString("Unknown"); - - /** - * Creates or finds a AvailabilityStateValues from its string representation. - * - * @param name a name to look for. - * @return the corresponding AvailabilityStateValues. - */ - @JsonCreator - public static AvailabilityStateValues fromString(String name) { - return fromString(name, AvailabilityStateValues.class); - } - - /** @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/AvailabilityStatus.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatus.java deleted file mode 100644 index 996a909a2b49..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatus.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.models; - -import com.azure.resourcemanager.resourcehealth.fluent.models.AvailabilityStatusInner; - -/** An immutable client-side representation of AvailabilityStatus. */ -public interface AvailabilityStatus { - /** - * Gets the id property: Azure Resource Manager Identity for the availabilityStatuses resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: current. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: Microsoft.ResourceHealth/AvailabilityStatuses. - * - * @return the type value. - */ - String type(); - - /** - * Gets the location property: Azure Resource Manager geo location of the resource. - * - * @return the location value. - */ - String location(); - - /** - * Gets the properties property: Properties of availability state. - * - * @return the properties value. - */ - AvailabilityStatusProperties properties(); - - /** - * Gets the inner com.azure.resourcemanager.resourcehealth.fluent.models.AvailabilityStatusInner object. - * - * @return the inner object. - */ - AvailabilityStatusInner innerModel(); -} 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 deleted file mode 100644 index 43f64d81834b..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatusListResult.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resourcehealth.fluent.models.AvailabilityStatusInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The List availabilityStatus operation response. */ -@Fluent -public final class AvailabilityStatusListResult { - /* - * The list of availabilityStatuses. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * 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; - - /** - * Get the value property: The list of availabilityStatuses. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of availabilityStatuses. - * - * @param value the value value to set. - * @return the AvailabilityStatusListResult object itself. - */ - public AvailabilityStatusListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI to fetch the next page of availabilityStatuses. Call ListNext() with this URI - * to fetch the next page of availabilityStatuses. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URI to fetch the next page of availabilityStatuses. Call ListNext() with this URI - * to fetch the next page of availabilityStatuses. - * - * @param nextLink the nextLink value to set. - * @return the AvailabilityStatusListResult object itself. - */ - public AvailabilityStatusListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model AvailabilityStatusListResult")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AvailabilityStatusListResult.class); -} 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 deleted file mode 100644 index 9ca72b94ece6..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatusProperties.java +++ /dev/null @@ -1,509 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** Properties of availability state. */ -@Fluent -public final class AvailabilityStatusProperties { - /* - * Availability status of the resource. When it is null, this - * availabilityStatus object represents an availability impacting event - */ - @JsonProperty(value = "availabilityState") - private AvailabilityStateValues availabilityState; - - /* - * Title description of the availability status. - */ - @JsonProperty(value = "title") - private String title; - - /* - * Summary description of the availability status. - */ - @JsonProperty(value = "summary") - private String summary; - - /* - * Details of the availability status. - */ - @JsonProperty(value = "detailedStatus") - 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. - */ - @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. - */ - @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. - */ - @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. - */ - @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. - */ - @JsonProperty(value = "healthEventCategory") - private String healthEventCategory; - - /* - * It is a unique Id that identifies the event - */ - @JsonProperty(value = "healthEventId") - 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. - */ - @JsonProperty(value = "resolutionETA") - private OffsetDateTime resolutionEta; - - /* - * Timestamp for when last change in health status occurred. - */ - @JsonProperty(value = "occurredTime") - private OffsetDateTime occurredTime; - - /* - * Chronicity of the availability transition. - */ - @JsonProperty(value = "reasonChronicity") - private ReasonChronicityTypes reasonChronicity; - - /* - * Timestamp for when the health was last checked. - */ - @JsonProperty(value = "reportedTime") - private OffsetDateTime reportedTime; - - /* - * 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. - */ - @JsonProperty(value = "recommendedActions") - private List recommendedActions; - - /* - * Lists the service impacting events that may be affecting the health of - * the resource. - */ - @JsonProperty(value = "serviceImpactingEvents") - private List serviceImpactingEvents; - - /** - * Get the availabilityState property: Availability status of the resource. When it is null, this availabilityStatus - * object represents an availability impacting event. - * - * @return the availabilityState value. - */ - public AvailabilityStateValues availabilityState() { - return this.availabilityState; - } - - /** - * Set the availabilityState property: Availability status of the resource. When it is null, this availabilityStatus - * object represents an availability impacting event. - * - * @param availabilityState the availabilityState value to set. - * @return the AvailabilityStatusProperties object itself. - */ - public AvailabilityStatusProperties withAvailabilityState(AvailabilityStateValues availabilityState) { - this.availabilityState = availabilityState; - return this; - } - - /** - * Get the title property: Title description of the availability status. - * - * @return the title value. - */ - public String title() { - return this.title; - } - - /** - * Set the title property: Title description of the availability status. - * - * @param title the title value to set. - * @return the AvailabilityStatusProperties object itself. - */ - public AvailabilityStatusProperties withTitle(String title) { - this.title = title; - return this; - } - - /** - * Get the summary property: Summary description of the availability status. - * - * @return the summary value. - */ - public String summary() { - return this.summary; - } - - /** - * Set the summary property: Summary description of the availability status. - * - * @param summary the summary value to set. - * @return the AvailabilityStatusProperties object itself. - */ - public AvailabilityStatusProperties withSummary(String summary) { - this.summary = summary; - return this; - } - - /** - * Get the detailedStatus property: Details of the availability status. - * - * @return the detailedStatus value. - */ - public String detailedStatus() { - return this.detailedStatus; - } - - /** - * Set the detailedStatus property: Details of the availability status. - * - * @param detailedStatus the detailedStatus value to set. - * @return the AvailabilityStatusProperties object itself. - */ - public AvailabilityStatusProperties withDetailedStatus(String detailedStatus) { - this.detailedStatus = detailedStatus; - return this; - } - - /** - * Get the reasonType property: 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. - * - * @return the reasonType value. - */ - public String reasonType() { - return this.reasonType; - } - - /** - * Set the reasonType property: 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. - * - * @param reasonType the reasonType value to set. - * @return the AvailabilityStatusProperties object itself. - */ - public AvailabilityStatusProperties withReasonType(String reasonType) { - this.reasonType = reasonType; - return this; - } - - /** - * Get the rootCauseAttributionTime property: When the resource's availabilityState is Unavailable, it provides the - * Timestamp for when the health impacting event was received. - * - * @return the rootCauseAttributionTime value. - */ - public OffsetDateTime rootCauseAttributionTime() { - return this.rootCauseAttributionTime; - } - - /** - * Set the rootCauseAttributionTime property: When the resource's availabilityState is Unavailable, it provides the - * Timestamp for when the health impacting event was received. - * - * @param rootCauseAttributionTime the rootCauseAttributionTime value to set. - * @return the AvailabilityStatusProperties object itself. - */ - public AvailabilityStatusProperties withRootCauseAttributionTime(OffsetDateTime rootCauseAttributionTime) { - this.rootCauseAttributionTime = rootCauseAttributionTime; - return this; - } - - /** - * Get the healthEventType property: In case of an availability impacting event, it describes when the health - * impacting event was originated. Examples are Lifecycle, Downtime, Fault Analysis etc. - * - * @return the healthEventType value. - */ - public String healthEventType() { - return this.healthEventType; - } - - /** - * Set the healthEventType property: In case of an availability impacting event, it describes when the health - * impacting event was originated. Examples are Lifecycle, Downtime, Fault Analysis etc. - * - * @param healthEventType the healthEventType value to set. - * @return the AvailabilityStatusProperties object itself. - */ - public AvailabilityStatusProperties withHealthEventType(String healthEventType) { - this.healthEventType = healthEventType; - return this; - } - - /** - * Get the healthEventCause property: In case of an availability impacting event, it describes where the health - * impacting event was originated. Examples are PlatformInitiated, UserInitiated etc. - * - * @return the healthEventCause value. - */ - public String healthEventCause() { - return this.healthEventCause; - } - - /** - * Set the healthEventCause property: In case of an availability impacting event, it describes where the health - * impacting event was originated. Examples are PlatformInitiated, UserInitiated etc. - * - * @param healthEventCause the healthEventCause value to set. - * @return the AvailabilityStatusProperties object itself. - */ - public AvailabilityStatusProperties withHealthEventCause(String healthEventCause) { - this.healthEventCause = healthEventCause; - return this; - } - - /** - * Get the healthEventCategory property: In case of an availability impacting event, it describes the category of a - * PlatformInitiated health impacting event. Examples are Planned, Unplanned etc. - * - * @return the healthEventCategory value. - */ - public String healthEventCategory() { - return this.healthEventCategory; - } - - /** - * Set the healthEventCategory property: In case of an availability impacting event, it describes the category of a - * PlatformInitiated health impacting event. Examples are Planned, Unplanned etc. - * - * @param healthEventCategory the healthEventCategory value to set. - * @return the AvailabilityStatusProperties object itself. - */ - public AvailabilityStatusProperties withHealthEventCategory(String healthEventCategory) { - this.healthEventCategory = healthEventCategory; - return this; - } - - /** - * Get the healthEventId property: It is a unique Id that identifies the event. - * - * @return the healthEventId value. - */ - public String healthEventId() { - return this.healthEventId; - } - - /** - * Set the healthEventId property: It is a unique Id that identifies the event. - * - * @param healthEventId the healthEventId value to set. - * @return the AvailabilityStatusProperties object itself. - */ - public AvailabilityStatusProperties withHealthEventId(String healthEventId) { - this.healthEventId = healthEventId; - return this; - } - - /** - * Get the resolutionEta property: 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. - * - * @return the resolutionEta value. - */ - public OffsetDateTime resolutionEta() { - return this.resolutionEta; - } - - /** - * Set the resolutionEta property: 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. - * - * @param resolutionEta the resolutionEta value to set. - * @return the AvailabilityStatusProperties object itself. - */ - public AvailabilityStatusProperties withResolutionEta(OffsetDateTime resolutionEta) { - this.resolutionEta = resolutionEta; - return this; - } - - /** - * Get the occurredTime property: Timestamp for when last change in health status occurred. - * - * @return the occurredTime value. - */ - public OffsetDateTime occurredTime() { - return this.occurredTime; - } - - /** - * Set the occurredTime property: Timestamp for when last change in health status occurred. - * - * @param occurredTime the occurredTime value to set. - * @return the AvailabilityStatusProperties object itself. - */ - public AvailabilityStatusProperties withOccurredTime(OffsetDateTime occurredTime) { - this.occurredTime = occurredTime; - return this; - } - - /** - * Get the reasonChronicity property: Chronicity of the availability transition. - * - * @return the reasonChronicity value. - */ - public ReasonChronicityTypes reasonChronicity() { - return this.reasonChronicity; - } - - /** - * Set the reasonChronicity property: Chronicity of the availability transition. - * - * @param reasonChronicity the reasonChronicity value to set. - * @return the AvailabilityStatusProperties object itself. - */ - public AvailabilityStatusProperties withReasonChronicity(ReasonChronicityTypes reasonChronicity) { - this.reasonChronicity = reasonChronicity; - return this; - } - - /** - * Get the reportedTime property: Timestamp for when the health was last checked. - * - * @return the reportedTime value. - */ - public OffsetDateTime reportedTime() { - return this.reportedTime; - } - - /** - * Set the reportedTime property: Timestamp for when the health was last checked. - * - * @param reportedTime the reportedTime value to set. - * @return the AvailabilityStatusProperties object itself. - */ - public AvailabilityStatusProperties withReportedTime(OffsetDateTime reportedTime) { - this.reportedTime = reportedTime; - return this; - } - - /** - * Get the recentlyResolved property: An annotation describing a change in the availabilityState to Available from - * Unavailable with a reasonType of type Unplanned. - * - * @return the recentlyResolved value. - */ - public AvailabilityStatusPropertiesRecentlyResolved recentlyResolved() { - return this.recentlyResolved; - } - - /** - * Set the recentlyResolved property: An annotation describing a change in the availabilityState to Available from - * Unavailable with a reasonType of type Unplanned. - * - * @param recentlyResolved the recentlyResolved value to set. - * @return the AvailabilityStatusProperties object itself. - */ - public AvailabilityStatusProperties withRecentlyResolved( - AvailabilityStatusPropertiesRecentlyResolved recentlyResolved) { - this.recentlyResolved = recentlyResolved; - return this; - } - - /** - * Get the recommendedActions property: Lists actions the user can take based on the current availabilityState of - * the resource. - * - * @return the recommendedActions value. - */ - public List recommendedActions() { - return this.recommendedActions; - } - - /** - * Set the recommendedActions property: Lists actions the user can take based on the current availabilityState of - * the resource. - * - * @param recommendedActions the recommendedActions value to set. - * @return the AvailabilityStatusProperties object itself. - */ - public AvailabilityStatusProperties withRecommendedActions(List recommendedActions) { - this.recommendedActions = recommendedActions; - return this; - } - - /** - * Get the serviceImpactingEvents property: Lists the service impacting events that may be affecting the health of - * the resource. - * - * @return the serviceImpactingEvents value. - */ - public List serviceImpactingEvents() { - return this.serviceImpactingEvents; - } - - /** - * Set the serviceImpactingEvents property: Lists the service impacting events that may be affecting the health of - * the resource. - * - * @param serviceImpactingEvents the serviceImpactingEvents value to set. - * @return the AvailabilityStatusProperties object itself. - */ - public AvailabilityStatusProperties withServiceImpactingEvents(List serviceImpactingEvents) { - this.serviceImpactingEvents = serviceImpactingEvents; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (recentlyResolved() != null) { - recentlyResolved().validate(); - } - if (recommendedActions() != null) { - recommendedActions().forEach(e -> e.validate()); - } - if (serviceImpactingEvents() != null) { - serviceImpactingEvents().forEach(e -> e.validate()); - } - } -} 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 deleted file mode 100644 index fe089240f681..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatusPropertiesRecentlyResolved.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** - * An annotation describing a change in the availabilityState to Available from Unavailable with a reasonType of type - * Unplanned. - */ -@Fluent -public final class AvailabilityStatusPropertiesRecentlyResolved { - /* - * Timestamp for when the availabilityState changed to Unavailable - */ - @JsonProperty(value = "unavailableOccurredTime") - private OffsetDateTime unavailableOccurredTime; - - /* - * Timestamp when the availabilityState changes to Available. - */ - @JsonProperty(value = "resolvedTime") - private OffsetDateTime resolvedTime; - - /* - * Brief description of cause of the resource becoming unavailable. - */ - @JsonProperty(value = "unavailabilitySummary") - private String unavailabilitySummary; - - /** - * Get the unavailableOccurredTime property: Timestamp for when the availabilityState changed to Unavailable. - * - * @return the unavailableOccurredTime value. - */ - public OffsetDateTime unavailableOccurredTime() { - return this.unavailableOccurredTime; - } - - /** - * Set the unavailableOccurredTime property: Timestamp for when the availabilityState changed to Unavailable. - * - * @param unavailableOccurredTime the unavailableOccurredTime value to set. - * @return the AvailabilityStatusPropertiesRecentlyResolved object itself. - */ - public AvailabilityStatusPropertiesRecentlyResolved withUnavailableOccurredTime( - OffsetDateTime unavailableOccurredTime) { - this.unavailableOccurredTime = unavailableOccurredTime; - return this; - } - - /** - * Get the resolvedTime property: Timestamp when the availabilityState changes to Available. - * - * @return the resolvedTime value. - */ - public OffsetDateTime resolvedTime() { - return this.resolvedTime; - } - - /** - * Set the resolvedTime property: Timestamp when the availabilityState changes to Available. - * - * @param resolvedTime the resolvedTime value to set. - * @return the AvailabilityStatusPropertiesRecentlyResolved object itself. - */ - public AvailabilityStatusPropertiesRecentlyResolved withResolvedTime(OffsetDateTime resolvedTime) { - this.resolvedTime = resolvedTime; - return this; - } - - /** - * Get the unavailabilitySummary property: Brief description of cause of the resource becoming unavailable. - * - * @return the unavailabilitySummary value. - */ - public String unavailabilitySummary() { - return this.unavailabilitySummary; - } - - /** - * Set the unavailabilitySummary property: Brief description of cause of the resource becoming unavailable. - * - * @param unavailabilitySummary the unavailabilitySummary value to set. - * @return the AvailabilityStatusPropertiesRecentlyResolved object itself. - */ - public AvailabilityStatusPropertiesRecentlyResolved withUnavailabilitySummary(String unavailabilitySummary) { - this.unavailabilitySummary = unavailabilitySummary; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} 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 deleted file mode 100644 index 1088f560dd02..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatuses.java +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of AvailabilityStatuses. */ -public interface AvailabilityStatuses { - /** - * Lists the current availability status for all the resources in the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List availabilityStatus operation response as paginated response with {@link PagedIterable}. - */ - PagedIterable listBySubscriptionId(); - - /** - * Lists the current availability status for all the resources in the subscription. - * - * @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 the List availabilityStatus operation response as paginated response with {@link PagedIterable}. - */ - PagedIterable listBySubscriptionId(String filter, String expand, Context context); - - /** - * Lists the current availability status for all the resources in the resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List availabilityStatus operation response as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Lists the current availability status for all the resources in the resource group. - * - * @param resourceGroupName The name of the resource group. - * @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 the List availabilityStatus operation response as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup( - String resourceGroupName, String filter, String expand, Context context); - - /** - * 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}. - * @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. - */ - AvailabilityStatus getByResource(String resourceUri); - - /** - * 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 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}. - */ - Response getByResourceWithResponse( - String resourceUri, String filter, String expand, Context context); - - /** - * Lists all historical availability transitions and impacting events 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}. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List availabilityStatus operation response as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceUri); - - /** - * Lists all historical availability transitions and impacting events 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List availabilityStatus operation response as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceUri, String filter, String expand, Context context); -} 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 deleted file mode 100644 index 9c8d3433857f..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/Operation.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Operation available in the resourcehealth resource provider. */ -@Fluent -public final class Operation { - /* - * Name of the operation. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Properties of the operation. - */ - @JsonProperty(value = "display") - private OperationDisplay display; - - /** - * Get the name property: Name of the operation. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the operation. - * - * @param name the name value to set. - * @return the Operation object itself. - */ - public Operation withName(String name) { - this.name = name; - return this; - } - - /** - * Get the display property: Properties of the operation. - * - * @return the display value. - */ - public OperationDisplay display() { - return this.display; - } - - /** - * Set the display property: Properties of the operation. - * - * @param display the display value to set. - * @return the Operation object itself. - */ - public Operation withDisplay(OperationDisplay display) { - this.display = display; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (display() != null) { - display().validate(); - } - } -} 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 deleted file mode 100644 index 8b706512782f..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/OperationDisplay.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties of the operation. */ -@Fluent -public final class OperationDisplay { - /* - * Provider name. - */ - @JsonProperty(value = "provider") - private String provider; - - /* - * Resource name. - */ - @JsonProperty(value = "resource") - private String resource; - - /* - * Operation name. - */ - @JsonProperty(value = "operation") - private String operation; - - /* - * Description of the operation. - */ - @JsonProperty(value = "description") - private String description; - - /** - * Get the provider property: Provider name. - * - * @return the provider value. - */ - public String provider() { - return this.provider; - } - - /** - * Set the provider property: Provider name. - * - * @param provider the provider value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withProvider(String provider) { - this.provider = provider; - return this; - } - - /** - * Get the resource property: Resource name. - * - * @return the resource value. - */ - public String resource() { - return this.resource; - } - - /** - * Set the resource property: Resource name. - * - * @param resource the resource value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withResource(String resource) { - this.resource = resource; - return this; - } - - /** - * Get the operation property: Operation name. - * - * @return the operation value. - */ - public String operation() { - return this.operation; - } - - /** - * Set the operation property: Operation name. - * - * @param operation the operation value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withOperation(String operation) { - this.operation = operation; - return this; - } - - /** - * Get the description property: Description of the operation. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Description of the operation. - * - * @param description the description value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withDescription(String description) { - this.description = description; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/OperationListResult.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/OperationListResult.java deleted file mode 100644 index cf2fd4deb820..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/OperationListResult.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.models; - -import com.azure.resourcemanager.resourcehealth.fluent.models.OperationListResultInner; -import java.util.List; - -/** An immutable client-side representation of OperationListResult. */ -public interface OperationListResult { - /** - * Gets the value property: List of operations available in the resourcehealth resource provider. - * - * @return the value value. - */ - List value(); - - /** - * Gets the inner com.azure.resourcemanager.resourcehealth.fluent.models.OperationListResultInner object. - * - * @return the inner object. - */ - OperationListResultInner innerModel(); -} 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 deleted file mode 100644 index f519977cc1a3..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/Operations.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of Operations. */ -public interface Operations { - /** - * Lists available operations for the resourcehealth resource provider. - * - * @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. - */ - OperationListResult list(); - - /** - * 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}. - */ - Response listWithResponse(Context context); -} 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 deleted file mode 100644 index e3ff6160b649..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ReasonChronicityTypes.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ReasonChronicityTypes. */ -public final class ReasonChronicityTypes extends ExpandableStringEnum { - /** Static value Transient for ReasonChronicityTypes. */ - public static final ReasonChronicityTypes TRANSIENT = fromString("Transient"); - - /** Static value Persistent for ReasonChronicityTypes. */ - public static final ReasonChronicityTypes PERSISTENT = fromString("Persistent"); - - /** - * Creates or finds a ReasonChronicityTypes from its string representation. - * - * @param name a name to look for. - * @return the corresponding ReasonChronicityTypes. - */ - @JsonCreator - public static ReasonChronicityTypes fromString(String name) { - return fromString(name, ReasonChronicityTypes.class); - } - - /** @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 deleted file mode 100644 index b2b7307aeb6f..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/RecommendedAction.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Lists actions the user can take based on the current availabilityState of the resource. */ -@Fluent -public final class RecommendedAction { - /* - * Recommended action. - */ - @JsonProperty(value = "action") - private String action; - - /* - * Link to the action - */ - @JsonProperty(value = "actionUrl") - private String actionUrl; - - /* - * Substring of action, it describes which text should host the action url. - */ - @JsonProperty(value = "actionUrlText") - private String actionUrlText; - - /** - * Get the action property: Recommended action. - * - * @return the action value. - */ - public String action() { - return this.action; - } - - /** - * Set the action property: Recommended action. - * - * @param action the action value to set. - * @return the RecommendedAction object itself. - */ - public RecommendedAction withAction(String action) { - this.action = action; - return this; - } - - /** - * Get the actionUrl property: Link to the action. - * - * @return the actionUrl value. - */ - public String actionUrl() { - return this.actionUrl; - } - - /** - * Set the actionUrl property: Link to the action. - * - * @param actionUrl the actionUrl value to set. - * @return the RecommendedAction object itself. - */ - public RecommendedAction withActionUrl(String actionUrl) { - this.actionUrl = actionUrl; - return this; - } - - /** - * Get the actionUrlText property: Substring of action, it describes which text should host the action url. - * - * @return the actionUrlText value. - */ - public String actionUrlText() { - return this.actionUrlText; - } - - /** - * Set the actionUrlText property: Substring of action, it describes which text should host the action url. - * - * @param actionUrlText the actionUrlText value to set. - * @return the RecommendedAction object itself. - */ - public RecommendedAction withActionUrlText(String actionUrlText) { - this.actionUrlText = actionUrlText; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} 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 deleted file mode 100644 index 314eb06f09d2..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ServiceImpactingEvent.java +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Lists the service impacting events that may be affecting the health of the resource. */ -@Fluent -public final class ServiceImpactingEvent { - /* - * Timestamp for when the event started. - */ - @JsonProperty(value = "eventStartTime") - private OffsetDateTime eventStartTime; - - /* - * Timestamp for when event was submitted/detected. - */ - @JsonProperty(value = "eventStatusLastModifiedTime") - private OffsetDateTime eventStatusLastModifiedTime; - - /* - * Correlation id for the event - */ - @JsonProperty(value = "correlationId") - private String correlationId; - - /* - * Status of the service impacting event. - */ - @JsonProperty(value = "status") - private ServiceImpactingEventStatus status; - - /* - * Properties of the service impacting event. - */ - @JsonProperty(value = "incidentProperties") - private ServiceImpactingEventIncidentProperties incidentProperties; - - /** - * Get the eventStartTime property: Timestamp for when the event started. - * - * @return the eventStartTime value. - */ - public OffsetDateTime eventStartTime() { - return this.eventStartTime; - } - - /** - * Set the eventStartTime property: Timestamp for when the event started. - * - * @param eventStartTime the eventStartTime value to set. - * @return the ServiceImpactingEvent object itself. - */ - public ServiceImpactingEvent withEventStartTime(OffsetDateTime eventStartTime) { - this.eventStartTime = eventStartTime; - return this; - } - - /** - * Get the eventStatusLastModifiedTime property: Timestamp for when event was submitted/detected. - * - * @return the eventStatusLastModifiedTime value. - */ - public OffsetDateTime eventStatusLastModifiedTime() { - return this.eventStatusLastModifiedTime; - } - - /** - * Set the eventStatusLastModifiedTime property: Timestamp for when event was submitted/detected. - * - * @param eventStatusLastModifiedTime the eventStatusLastModifiedTime value to set. - * @return the ServiceImpactingEvent object itself. - */ - public ServiceImpactingEvent withEventStatusLastModifiedTime(OffsetDateTime eventStatusLastModifiedTime) { - this.eventStatusLastModifiedTime = eventStatusLastModifiedTime; - return this; - } - - /** - * Get the correlationId property: Correlation id for the event. - * - * @return the correlationId value. - */ - public String correlationId() { - return this.correlationId; - } - - /** - * Set the correlationId property: Correlation id for the event. - * - * @param correlationId the correlationId value to set. - * @return the ServiceImpactingEvent object itself. - */ - public ServiceImpactingEvent withCorrelationId(String correlationId) { - this.correlationId = correlationId; - return this; - } - - /** - * Get the status property: Status of the service impacting event. - * - * @return the status value. - */ - public ServiceImpactingEventStatus status() { - return this.status; - } - - /** - * Set the status property: Status of the service impacting event. - * - * @param status the status value to set. - * @return the ServiceImpactingEvent object itself. - */ - public ServiceImpactingEvent withStatus(ServiceImpactingEventStatus status) { - this.status = status; - return this; - } - - /** - * Get the incidentProperties property: Properties of the service impacting event. - * - * @return the incidentProperties value. - */ - public ServiceImpactingEventIncidentProperties incidentProperties() { - return this.incidentProperties; - } - - /** - * Set the incidentProperties property: Properties of the service impacting event. - * - * @param incidentProperties the incidentProperties value to set. - * @return the ServiceImpactingEvent object itself. - */ - public ServiceImpactingEvent withIncidentProperties(ServiceImpactingEventIncidentProperties incidentProperties) { - this.incidentProperties = incidentProperties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (status() != null) { - status().validate(); - } - if (incidentProperties() != null) { - incidentProperties().validate(); - } - } -} 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 deleted file mode 100644 index 2c1a0260dd36..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ServiceImpactingEventIncidentProperties.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties of the service impacting event. */ -@Fluent -public final class ServiceImpactingEventIncidentProperties { - /* - * Title of the incident. - */ - @JsonProperty(value = "title") - private String title; - - /* - * Service impacted by the event. - */ - @JsonProperty(value = "service") - private String service; - - /* - * Region impacted by the event. - */ - @JsonProperty(value = "region") - private String region; - - /* - * Type of Event. - */ - @JsonProperty(value = "incidentType") - private String incidentType; - - /** - * Get the title property: Title of the incident. - * - * @return the title value. - */ - public String title() { - return this.title; - } - - /** - * Set the title property: Title of the incident. - * - * @param title the title value to set. - * @return the ServiceImpactingEventIncidentProperties object itself. - */ - public ServiceImpactingEventIncidentProperties withTitle(String title) { - this.title = title; - return this; - } - - /** - * Get the service property: Service impacted by the event. - * - * @return the service value. - */ - public String service() { - return this.service; - } - - /** - * Set the service property: Service impacted by the event. - * - * @param service the service value to set. - * @return the ServiceImpactingEventIncidentProperties object itself. - */ - public ServiceImpactingEventIncidentProperties withService(String service) { - this.service = service; - return this; - } - - /** - * Get the region property: Region impacted by the event. - * - * @return the region value. - */ - public String region() { - return this.region; - } - - /** - * Set the region property: Region impacted by the event. - * - * @param region the region value to set. - * @return the ServiceImpactingEventIncidentProperties object itself. - */ - public ServiceImpactingEventIncidentProperties withRegion(String region) { - this.region = region; - return this; - } - - /** - * Get the incidentType property: Type of Event. - * - * @return the incidentType value. - */ - public String incidentType() { - return this.incidentType; - } - - /** - * Set the incidentType property: Type of Event. - * - * @param incidentType the incidentType value to set. - * @return the ServiceImpactingEventIncidentProperties object itself. - */ - public ServiceImpactingEventIncidentProperties withIncidentType(String incidentType) { - this.incidentType = incidentType; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} 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 deleted file mode 100644 index 28965361551c..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ServiceImpactingEventStatus.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Status of the service impacting event. */ -@Fluent -public final class ServiceImpactingEventStatus { - /* - * Current status of the event - */ - @JsonProperty(value = "value") - private String value; - - /** - * Get the value property: Current status of the event. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Set the value property: Current status of the event. - * - * @param value the value value to set. - * @return the ServiceImpactingEventStatus object itself. - */ - public ServiceImpactingEventStatus withValue(String value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/package-info.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/package-info.java deleted file mode 100644 index 291798f8ebf0..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the data models for MicrosoftResourceHealth. The Resource Health Client. */ -package com.azure.resourcemanager.resourcehealth.models; diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/package-info.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/package-info.java deleted file mode 100644 index 38272222a0a2..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the classes for MicrosoftResourceHealth. The Resource Health Client. */ -package com.azure.resourcemanager.resourcehealth; diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/module-info.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/module-info.java deleted file mode 100644 index aa67d74e86d9..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/module-info.java +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -module com.azure.resourcemanager.resourcehealth { - requires transitive com.azure.core.management; - - exports com.azure.resourcemanager.resourcehealth; - exports com.azure.resourcemanager.resourcehealth.fluent; - exports com.azure.resourcemanager.resourcehealth.fluent.models; - exports com.azure.resourcemanager.resourcehealth.models; - - opens com.azure.resourcemanager.resourcehealth.fluent.models to - com.azure.core, - com.fasterxml.jackson.databind; - opens com.azure.resourcemanager.resourcehealth.models to - com.azure.core, - com.fasterxml.jackson.databind; -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/AvailabilityStatusesGetByResourceSamples.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/AvailabilityStatusesGetByResourceSamples.java deleted file mode 100644 index e707e8bccfb3..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/AvailabilityStatusesGetByResourceSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.generated; - -import com.azure.core.util.Context; - -/** Samples for AvailabilityStatuses GetByResource. */ -public final class AvailabilityStatusesGetByResourceSamples { - /* - * x-ms-original-file: specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2020-05-01/examples/AvailabilityStatus_GetByResource.json - */ - /** - * Sample code: GetCurrentHealthByResource. - * - * @param manager Entry point to ResourceHealthManager. - */ - public static void getCurrentHealthByResource( - com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { - manager - .availabilityStatuses() - .getByResourceWithResponse("resourceUri", null, "recommendedactions", Context.NONE); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/AvailabilityStatusesListByResourceGroupSamples.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/AvailabilityStatusesListByResourceGroupSamples.java deleted file mode 100644 index ed3c63e5212f..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/AvailabilityStatusesListByResourceGroupSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.generated; - -import com.azure.core.util.Context; - -/** Samples for AvailabilityStatuses ListByResourceGroup. */ -public final class AvailabilityStatusesListByResourceGroupSamples { - /* - * x-ms-original-file: specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2020-05-01/examples/AvailabilityStatuses_ListByResourceGroup.json - */ - /** - * Sample code: ListByResourceGroup. - * - * @param manager Entry point to ResourceHealthManager. - */ - public static void listByResourceGroup(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { - manager - .availabilityStatuses() - .listByResourceGroup("resourceGroupName", null, "recommendedactions", Context.NONE); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/AvailabilityStatusesListBySubscriptionIdSamples.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/AvailabilityStatusesListBySubscriptionIdSamples.java deleted file mode 100644 index f7d5dc182ba0..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/AvailabilityStatusesListBySubscriptionIdSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.generated; - -import com.azure.core.util.Context; - -/** Samples for AvailabilityStatuses ListBySubscriptionId. */ -public final class AvailabilityStatusesListBySubscriptionIdSamples { - /* - * x-ms-original-file: specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2020-05-01/examples/AvailabilityStatuses_ListBySubscriptionId.json - */ - /** - * Sample code: ListHealthBySubscriptionId. - * - * @param manager Entry point to ResourceHealthManager. - */ - public static void listHealthBySubscriptionId( - com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { - manager.availabilityStatuses().listBySubscriptionId(null, "recommendedactions", Context.NONE); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/AvailabilityStatusesListSamples.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/AvailabilityStatusesListSamples.java deleted file mode 100644 index 7e9cbd1475dd..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/AvailabilityStatusesListSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.generated; - -import com.azure.core.util.Context; - -/** Samples for AvailabilityStatuses List. */ -public final class AvailabilityStatusesListSamples { - /* - * x-ms-original-file: specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2020-05-01/examples/AvailabilityStatuses_List.json - */ - /** - * Sample code: GetHealthHistoryByResource. - * - * @param manager Entry point to ResourceHealthManager. - */ - public static void getHealthHistoryByResource( - com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { - manager.availabilityStatuses().list("resourceUri", null, null, Context.NONE); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/OperationsListSamples.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/OperationsListSamples.java deleted file mode 100644 index e3e59d5e252c..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/OperationsListSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.generated; - -import com.azure.core.util.Context; - -/** Samples for Operations List. */ -public final class OperationsListSamples { - /* - * x-ms-original-file: specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2020-05-01/examples/Operations_List.json - */ - /** - * Sample code: GetHealthHistoryByResource. - * - * @param manager Entry point to ResourceHealthManager. - */ - public static void getHealthHistoryByResource( - com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { - manager.operations().listWithResponse(Context.NONE); - } -}