diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/CHANGELOG.md b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/CHANGELOG.md index 82d4071ad4693..7f44e7d510637 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/CHANGELOG.md +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.1 (2021-12-28) +- Azure Resource Manager ResourceHealth client library for Java. This package contains Microsoft Azure SDK for ResourceHealth Management SDK. The Resource Health Client. Package tag package-2017-07. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## 1.0.0-beta.1 (2021-04-08) diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/README.md b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/README.md index 88bdf255d1b10..95593e56ff282 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/README.md +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/README.md @@ -2,7 +2,7 @@ Azure Resource Manager ResourceHealth client library for Java. -This package contains Microsoft Azure SDK for ResourceHealth Management SDK. The Resource Health Client. Package tag package-2018-07-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for ResourceHealth Management SDK. The Resource Health Client. Package tag package-2017-07. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-resourcehealth - 1.0.0-beta.1 + 1.0.0-beta.2 ``` [//]: # ({x-version-update-end}) @@ -74,6 +74,9 @@ See [API design][design] for general introduction on design and key concepts on ## Examples +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcehealth/azure-resourcemanager-resourcehealth/SAMPLE.md) + + ## Troubleshooting ## Next steps diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/SAMPLE.md b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/SAMPLE.md new file mode 100644 index 0000000000000..b4ef21572d1de --- /dev/null +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/SAMPLE.md @@ -0,0 +1,224 @@ +# Code snippets and samples + + +## AvailabilityStatuses + +- [GetByResource](#availabilitystatuses_getbyresource) +- [List](#availabilitystatuses_list) +- [ListByResourceGroup](#availabilitystatuses_listbyresourcegroup) +- [ListBySubscriptionId](#availabilitystatuses_listbysubscriptionid) + +## ChildAvailabilityStatuses + +- [GetByResource](#childavailabilitystatuses_getbyresource) +- [List](#childavailabilitystatuses_list) + +## ChildResources + +- [List](#childresources_list) + +## EmergingIssues + +- [Get](#emergingissues_get) +- [List](#emergingissues_list) +### AvailabilityStatuses_GetByResource + +```java +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/2017-07-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); + } +} +``` + +### AvailabilityStatuses_List + +```java +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/2017-07-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); + } +} +``` + +### AvailabilityStatuses_ListByResourceGroup + +```java +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/2017-07-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); + } +} +``` + +### AvailabilityStatuses_ListBySubscriptionId + +```java +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/2017-07-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); + } +} +``` + +### ChildAvailabilityStatuses_GetByResource + +```java +import com.azure.core.util.Context; + +/** Samples for ChildAvailabilityStatuses GetByResource. */ +public final class ChildAvailabilityStatusesGetByResourceSamples { + /* + * x-ms-original-file: specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2017-07-01/examples/ChildAvailabilityStatus_GetByResource.json + */ + /** + * Sample code: GetCurrentHealthByResource. + * + * @param manager Entry point to ResourceHealthManager. + */ + public static void getCurrentHealthByResource( + com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { + manager + .childAvailabilityStatuses() + .getByResourceWithResponse("resourceUri", null, "recommendedactions", Context.NONE); + } +} +``` + +### ChildAvailabilityStatuses_List + +```java +import com.azure.core.util.Context; + +/** Samples for ChildAvailabilityStatuses List. */ +public final class ChildAvailabilityStatusesListSamples { + /* + * x-ms-original-file: specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2017-07-01/examples/ChildAvailabilityStatuses_List.json + */ + /** + * Sample code: GetHealthHistoryByResource. + * + * @param manager Entry point to ResourceHealthManager. + */ + public static void getHealthHistoryByResource( + com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { + manager.childAvailabilityStatuses().list("resourceUri", null, null, Context.NONE); + } +} +``` + +### ChildResources_List + +```java +import com.azure.core.util.Context; + +/** Samples for ChildResources List. */ +public final class ChildResourcesListSamples { + /* + * x-ms-original-file: specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2017-07-01/examples/ChildResources_List.json + */ + /** + * Sample code: GetHealthHistoryByResource. + * + * @param manager Entry point to ResourceHealthManager. + */ + public static void getHealthHistoryByResource( + com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { + manager.childResources().list("resourceUri", null, null, Context.NONE); + } +} +``` + +### EmergingIssues_Get + +```java +import com.azure.core.util.Context; + +/** Samples for EmergingIssues Get. */ +public final class EmergingIssuesGetSamples { + /* + * x-ms-original-file: specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2017-07-01/examples/EmergingIssues_Get.json + */ + /** + * Sample code: GetEmergingIssues. + * + * @param manager Entry point to ResourceHealthManager. + */ + public static void getEmergingIssues(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { + manager.emergingIssues().getWithResponse(Context.NONE); + } +} +``` + +### EmergingIssues_List + +```java +import com.azure.core.util.Context; + +/** Samples for EmergingIssues List. */ +public final class EmergingIssuesListSamples { + /* + * x-ms-original-file: specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2017-07-01/examples/EmergingIssues_List.json + */ + /** + * Sample code: GetEmergingIssues. + * + * @param manager Entry point to ResourceHealthManager. + */ + public static void getEmergingIssues(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { + manager.emergingIssues().list(Context.NONE); + } +} +``` + diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/pom.xml b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/pom.xml index 0f666da8946f9..7f842d7b27eac 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/pom.xml +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/pom.xml @@ -1,58 +1,81 @@ - 4.0.0 - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + - com.azure.resourcemanager - azure-resourcemanager-resourcehealth - 1.0.0-beta.2 - jar + com.azure.resourcemanager + azure-resourcemanager-resourcehealth + 1.0.0-beta.2 + jar - Microsoft Azure SDK for ResourceHealth Management - This package contains Microsoft Azure SDK for ResourceHealth Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Resource Health Client. Package tag package-2018-07-01. - https://github.com/Azure/azure-sdk-for-java + Microsoft Azure SDK for ResourceHealth Management + This package contains Microsoft Azure SDK for ResourceHealth Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Resource Health Client. Package tag package-2017-07. + https://github.com/Azure/azure-sdk-for-java - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + - - https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - microsoft - Microsoft - - - - UTF-8 - true + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true false - - - - com.azure - azure-core - 1.23.1 - - - com.azure - azure-core-management - 1.4.4 - - + + + + com.azure + azure-core + 1.23.1 + + + com.azure + azure-core-management + 1.4.4 + + + + + + org.revapi + revapi-maven-plugin + 0.11.2 + + + + + java.method.addedToInterface + + + true + .* + com\.azure\.resourcemanager(\.[^.]+)+\.fluent(\.[^.]+)* + + + + + + + diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/ResourceHealthManager.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/ResourceHealthManager.java index 17754bb40c2b5..a679d59fdb56a 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/ResourceHealthManager.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/ResourceHealthManager.java @@ -8,8 +8,8 @@ import com.azure.core.http.HttpClient; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; @@ -17,31 +17,37 @@ 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.ChildAvailabilityStatusesImpl; +import com.azure.resourcemanager.resourcehealth.implementation.ChildResourcesImpl; import com.azure.resourcemanager.resourcehealth.implementation.EmergingIssuesImpl; -import com.azure.resourcemanager.resourcehealth.implementation.EventsOperationsImpl; 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.ChildAvailabilityStatuses; +import com.azure.resourcemanager.resourcehealth.models.ChildResources; import com.azure.resourcemanager.resourcehealth.models.EmergingIssues; -import com.azure.resourcemanager.resourcehealth.models.EventsOperations; 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 EventsOperations eventsOperations; - private AvailabilityStatuses availabilityStatuses; + private ChildAvailabilityStatuses childAvailabilityStatuses; + + private ChildResources childResources; + private Operations operations; private EmergingIssues emergingIssues; @@ -89,6 +95,7 @@ public static final class Configurable { private HttpClient httpClient; private HttpLogOptions httpLogOptions; private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); private RetryPolicy retryPolicy; private Duration defaultPollInterval; @@ -128,6 +135,17 @@ public Configurable withPolicy(HttpPipelinePolicy policy) { return this; } + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + /** * Sets the retry policy to the HTTP pipeline. * @@ -184,20 +202,33 @@ public ResourceHealthManager authenticate(TokenCredential credential, AzureProfi userAgentBuilder.append(" (auto-generated)"); } + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } if (retryPolicy == null) { retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); } List policies = new ArrayList<>(); policies.add(new UserAgentPolicy(userAgentBuilder.toString())); policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); policies - .add( - new BearerTokenAuthenticationPolicy( - credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); - policies.addAll(this.policies); + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); HttpPipeline httpPipeline = @@ -209,14 +240,6 @@ public ResourceHealthManager authenticate(TokenCredential credential, AzureProfi } } - /** @return Resource collection API of EventsOperations. */ - public EventsOperations eventsOperations() { - if (this.eventsOperations == null) { - this.eventsOperations = new EventsOperationsImpl(clientObject.getEventsOperations(), this); - } - return eventsOperations; - } - /** @return Resource collection API of AvailabilityStatuses. */ public AvailabilityStatuses availabilityStatuses() { if (this.availabilityStatuses == null) { @@ -225,6 +248,23 @@ public AvailabilityStatuses availabilityStatuses() { return availabilityStatuses; } + /** @return Resource collection API of ChildAvailabilityStatuses. */ + public ChildAvailabilityStatuses childAvailabilityStatuses() { + if (this.childAvailabilityStatuses == null) { + this.childAvailabilityStatuses = + new ChildAvailabilityStatusesImpl(clientObject.getChildAvailabilityStatuses(), this); + } + return childAvailabilityStatuses; + } + + /** @return Resource collection API of ChildResources. */ + public ChildResources childResources() { + if (this.childResources == null) { + this.childResources = new ChildResourcesImpl(clientObject.getChildResources(), this); + } + return childResources; + } + /** @return Resource collection API of Operations. */ public Operations operations() { if (this.operations == null) { diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/AvailabilityStatusesClient.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/AvailabilityStatusesClient.java index 4168ea111f9e9..930bb2693b777 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/AvailabilityStatusesClient.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/AvailabilityStatusesClient.java @@ -14,7 +14,8 @@ /** 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. + * Lists the current availability status for all the resources in the subscription. Use the nextLink property in the + * response to get the next page of availability statuses. * * @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. @@ -24,7 +25,8 @@ public interface AvailabilityStatusesClient { PagedIterable listBySubscriptionId(); /** - * Lists the current availability status for all the resources in the subscription. + * Lists the current availability status for all the resources in the subscription. Use the nextLink property in the + * response to get the next page of availability statuses. * * @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. @@ -39,7 +41,8 @@ public interface AvailabilityStatusesClient { PagedIterable listBySubscriptionId(String filter, String expand, Context context); /** - * Lists the current availability status for all the resources in the resource group. + * Lists the current availability status for all the resources in the resource group. Use the nextLink property in + * the response to get the next page of availability statuses. * * @param resourceGroupName The name of the resource group. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -51,7 +54,8 @@ public interface AvailabilityStatusesClient { PagedIterable listByResourceGroup(String resourceGroupName); /** - * Lists the current availability status for all the resources in the resource group. + * Lists the current availability status for all the resources in the resource group. Use the nextLink property in + * the response to get the next page of availability statuses. * * @param resourceGroupName The name of the resource group. * @param filter The filter to apply on the operation. For more information please see @@ -105,7 +109,8 @@ Response getByResourceWithResponse( String resourceUri, String filter, String expand, Context context); /** - * Lists all historical availability transitions and impacting events for a single resource. + * Lists all historical availability transitions and impacting events for a single resource. Use the nextLink + * property in the response to get the next page of availability status. * * @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 : @@ -121,7 +126,8 @@ Response getByResourceWithResponse( PagedIterable list(String resourceUri); /** - * Lists all historical availability transitions and impacting events for a single resource. + * Lists all historical availability transitions and impacting events for a single resource. Use the nextLink + * property in the response to get the next page of availability status. * * @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 : diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/EventsOperationsClient.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/ChildAvailabilityStatusesClient.java similarity index 54% rename from sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/EventsOperationsClient.java rename to sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/ChildAvailabilityStatusesClient.java index 1c715de63ef0e..f9f14d22fbc7d 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/EventsOperationsClient.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/ChildAvailabilityStatusesClient.java @@ -7,69 +7,76 @@ 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.EventInner; +import com.azure.resourcemanager.resourcehealth.fluent.models.AvailabilityStatusInner; -/** An instance of this class provides access to all the operations defined in EventsOperationsClient. */ -public interface EventsOperationsClient { +/** An instance of this class provides access to all the operations defined in ChildAvailabilityStatusesClient. */ +public interface ChildAvailabilityStatusesClient { /** - * Lists current service health events in the subscription. + * 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 only support one nesting level resource types : + * /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 events operation response. + * @return current availability status for a single resource. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + @ServiceMethod(returns = ReturnType.SINGLE) + AvailabilityStatusInner getByResource(String resourceUri); /** - * Lists current service health events in the subscription. + * 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 only support one nesting level resource types : + * /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 view setting view=full expands the article parameters. + * @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 events operation response. + * @return current availability status for a single resource. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String filter, String view, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceWithResponse( + String resourceUri, String filter, String expand, Context context); /** - * Lists current service health events for given resource. + * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response + * to get the next page of availability status. * * @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 + * Currently the API only support one nesting level resource types : * /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 events operation response. + * @return the List availabilityStatus operation response. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBySingleResource(String resourceUri); + PagedIterable list(String resourceUri); /** - * Lists current service health events for given resource. + * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response + * to get the next page of availability status. * * @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 + * Currently the API only support one nesting level resource types : * /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 view setting view=full expands the article parameters. + * @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 events operation response. + * @return the List availabilityStatus operation response. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBySingleResource(String resourceUri, String filter, String view, Context context); + 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/ChildResourcesClient.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/ChildResourcesClient.java new file mode 100644 index 0000000000000..db98b3c234d53 --- /dev/null +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/ChildResourcesClient.java @@ -0,0 +1,48 @@ +// 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.util.Context; +import com.azure.resourcemanager.resourcehealth.fluent.models.AvailabilityStatusInner; + +/** An instance of this class provides access to all the operations defined in ChildResourcesClient. */ +public interface ChildResourcesClient { + /** + * Lists the all the children and its current health status for a parent resource. Use the nextLink property in the + * response to get the next page of children current health. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. + * Currently the API only support not nested parent resource type: + * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}. + * @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceUri); + + /** + * Lists the all the children and its current health status for a parent resource. Use the nextLink property in the + * response to get the next page of children current health. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. + * Currently the API only support not nested parent resource type: + * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}. + * @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. + */ + @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 index 1697cf46c4713..d77c0badd6d0e 100644 --- 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 @@ -46,18 +46,25 @@ public interface MicrosoftResourceHealth { Duration getDefaultPollInterval(); /** - * Gets the EventsOperationsClient object to access its operations. + * Gets the AvailabilityStatusesClient object to access its operations. * - * @return the EventsOperationsClient object. + * @return the AvailabilityStatusesClient object. */ - EventsOperationsClient getEventsOperations(); + AvailabilityStatusesClient getAvailabilityStatuses(); /** - * Gets the AvailabilityStatusesClient object to access its operations. + * Gets the ChildAvailabilityStatusesClient object to access its operations. * - * @return the AvailabilityStatusesClient object. + * @return the ChildAvailabilityStatusesClient object. */ - AvailabilityStatusesClient getAvailabilityStatuses(); + ChildAvailabilityStatusesClient getChildAvailabilityStatuses(); + + /** + * Gets the ChildResourcesClient object to access its operations. + * + * @return the ChildResourcesClient object. + */ + ChildResourcesClient getChildResources(); /** * Gets the OperationsClient object to access its operations. diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EmergingIssue.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EmergingIssue.java new file mode 100644 index 0000000000000..3faf26bfab482 --- /dev/null +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EmergingIssue.java @@ -0,0 +1,112 @@ +// 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.StatusActiveEvent; +import com.azure.resourcemanager.resourcehealth.models.StatusBanner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** On-going emerging issue from azure status. */ +@Fluent +public final class EmergingIssue { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EmergingIssue.class); + + /* + * Timestamp for when last time refreshed for ongoing emerging issue. + */ + @JsonProperty(value = "refreshTimestamp") + private OffsetDateTime refreshTimestamp; + + /* + * The list of emerging issues of banner type. + */ + @JsonProperty(value = "statusBanners") + private List statusBanners; + + /* + * The list of emerging issues of active event type. + */ + @JsonProperty(value = "statusActiveEvents") + private List statusActiveEvents; + + /** + * Get the refreshTimestamp property: Timestamp for when last time refreshed for ongoing emerging issue. + * + * @return the refreshTimestamp value. + */ + public OffsetDateTime refreshTimestamp() { + return this.refreshTimestamp; + } + + /** + * Set the refreshTimestamp property: Timestamp for when last time refreshed for ongoing emerging issue. + * + * @param refreshTimestamp the refreshTimestamp value to set. + * @return the EmergingIssue object itself. + */ + public EmergingIssue withRefreshTimestamp(OffsetDateTime refreshTimestamp) { + this.refreshTimestamp = refreshTimestamp; + return this; + } + + /** + * Get the statusBanners property: The list of emerging issues of banner type. + * + * @return the statusBanners value. + */ + public List statusBanners() { + return this.statusBanners; + } + + /** + * Set the statusBanners property: The list of emerging issues of banner type. + * + * @param statusBanners the statusBanners value to set. + * @return the EmergingIssue object itself. + */ + public EmergingIssue withStatusBanners(List statusBanners) { + this.statusBanners = statusBanners; + return this; + } + + /** + * Get the statusActiveEvents property: The list of emerging issues of active event type. + * + * @return the statusActiveEvents value. + */ + public List statusActiveEvents() { + return this.statusActiveEvents; + } + + /** + * Set the statusActiveEvents property: The list of emerging issues of active event type. + * + * @param statusActiveEvents the statusActiveEvents value to set. + * @return the EmergingIssue object itself. + */ + public EmergingIssue withStatusActiveEvents(List statusActiveEvents) { + this.statusActiveEvents = statusActiveEvents; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (statusBanners() != null) { + statusBanners().forEach(e -> e.validate()); + } + if (statusActiveEvents() != null) { + statusActiveEvents().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EmergingIssuesGetResultInner.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EmergingIssuesGetResultInner.java index 229cc6304cd4d..712a637c31e25 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EmergingIssuesGetResultInner.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EmergingIssuesGetResultInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.resourcehealth.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.resourcehealth.models.StatusActiveEvent; @@ -16,28 +15,24 @@ import java.util.List; /** The Get EmergingIssues operation response. */ -@JsonFlatten @Fluent -public class EmergingIssuesGetResultInner extends ProxyResource { +public final class EmergingIssuesGetResultInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(EmergingIssuesGetResultInner.class); /* - * Timestamp for when last time refreshed for ongoing emerging issue. + * The emerging issue entity properties. */ - @JsonProperty(value = "properties.refreshTimestamp") - private OffsetDateTime refreshTimestamp; + @JsonProperty(value = "properties") + private EmergingIssue innerProperties; - /* - * The list of emerging issues of banner type. - */ - @JsonProperty(value = "properties.statusBanners") - private List statusBanners; - - /* - * The list of emerging issues of active event type. + /** + * Get the innerProperties property: The emerging issue entity properties. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.statusActiveEvents") - private List statusActiveEvents; + private EmergingIssue innerProperties() { + return this.innerProperties; + } /** * Get the refreshTimestamp property: Timestamp for when last time refreshed for ongoing emerging issue. @@ -45,7 +40,7 @@ public class EmergingIssuesGetResultInner extends ProxyResource { * @return the refreshTimestamp value. */ public OffsetDateTime refreshTimestamp() { - return this.refreshTimestamp; + return this.innerProperties() == null ? null : this.innerProperties().refreshTimestamp(); } /** @@ -55,7 +50,10 @@ public OffsetDateTime refreshTimestamp() { * @return the EmergingIssuesGetResultInner object itself. */ public EmergingIssuesGetResultInner withRefreshTimestamp(OffsetDateTime refreshTimestamp) { - this.refreshTimestamp = refreshTimestamp; + if (this.innerProperties() == null) { + this.innerProperties = new EmergingIssue(); + } + this.innerProperties().withRefreshTimestamp(refreshTimestamp); return this; } @@ -65,7 +63,7 @@ public EmergingIssuesGetResultInner withRefreshTimestamp(OffsetDateTime refreshT * @return the statusBanners value. */ public List statusBanners() { - return this.statusBanners; + return this.innerProperties() == null ? null : this.innerProperties().statusBanners(); } /** @@ -75,7 +73,10 @@ public List statusBanners() { * @return the EmergingIssuesGetResultInner object itself. */ public EmergingIssuesGetResultInner withStatusBanners(List statusBanners) { - this.statusBanners = statusBanners; + if (this.innerProperties() == null) { + this.innerProperties = new EmergingIssue(); + } + this.innerProperties().withStatusBanners(statusBanners); return this; } @@ -85,7 +86,7 @@ public EmergingIssuesGetResultInner withStatusBanners(List statusB * @return the statusActiveEvents value. */ public List statusActiveEvents() { - return this.statusActiveEvents; + return this.innerProperties() == null ? null : this.innerProperties().statusActiveEvents(); } /** @@ -95,7 +96,10 @@ public List statusActiveEvents() { * @return the EmergingIssuesGetResultInner object itself. */ public EmergingIssuesGetResultInner withStatusActiveEvents(List statusActiveEvents) { - this.statusActiveEvents = statusActiveEvents; + if (this.innerProperties() == null) { + this.innerProperties = new EmergingIssue(); + } + this.innerProperties().withStatusActiveEvents(statusActiveEvents); return this; } @@ -105,11 +109,8 @@ public EmergingIssuesGetResultInner withStatusActiveEvents(List e.validate()); - } - if (statusActiveEvents() != null) { - statusActiveEvents().forEach(e -> e.validate()); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EventInner.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EventInner.java deleted file mode 100644 index ac531472a6378..0000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EventInner.java +++ /dev/null @@ -1,601 +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.annotation.JsonFlatten; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resourcehealth.models.EventLevelValues; -import com.azure.resourcemanager.resourcehealth.models.EventPropertiesArticle; -import com.azure.resourcemanager.resourcehealth.models.EventPropertiesRecommendedActions; -import com.azure.resourcemanager.resourcehealth.models.EventSourceValues; -import com.azure.resourcemanager.resourcehealth.models.EventStatusValues; -import com.azure.resourcemanager.resourcehealth.models.EventTypeValues; -import com.azure.resourcemanager.resourcehealth.models.Faq; -import com.azure.resourcemanager.resourcehealth.models.Impact; -import com.azure.resourcemanager.resourcehealth.models.LevelValues; -import com.azure.resourcemanager.resourcehealth.models.Link; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** Service health event. */ -@JsonFlatten -@Fluent -public class EventInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EventInner.class); - - /* - * Type of event. - */ - @JsonProperty(value = "properties.eventType") - private EventTypeValues eventType; - - /* - * Source of event. - */ - @JsonProperty(value = "properties.eventSource") - private EventSourceValues eventSource; - - /* - * Current status of event. - */ - @JsonProperty(value = "properties.status") - private EventStatusValues status; - - /* - * Title text of event. - */ - @JsonProperty(value = "properties.title") - private String title; - - /* - * Summary text of event. - */ - @JsonProperty(value = "properties.summary") - private String summary; - - /* - * Header text of event. - */ - @JsonProperty(value = "properties.header") - private String headerProperty; - - /* - * Level of insight. - */ - @JsonProperty(value = "properties.level") - private LevelValues level; - - /* - * Level of event. - */ - @JsonProperty(value = "properties.eventLevel") - private EventLevelValues eventLevel; - - /* - * Article of event. - */ - @JsonProperty(value = "properties.article") - private EventPropertiesArticle article; - - /* - * Useful links of event. - */ - @JsonProperty(value = "properties.links") - private List links; - - /* - * It provides the Timestamp for when the health impacting event started. - */ - @JsonProperty(value = "properties.impactStartTime") - private OffsetDateTime impactStartTime; - - /* - * It provides the Timestamp for when the health impacting event resolved. - */ - @JsonProperty(value = "properties.impactMitigationTime") - private OffsetDateTime impactMitigationTime; - - /* - * List services impacted by the service health event. - */ - @JsonProperty(value = "properties.impact") - private List impact; - - /* - * Recommended actions of event. - */ - @JsonProperty(value = "properties.recommendedActions") - private EventPropertiesRecommendedActions recommendedActions; - - /* - * Frequently asked questions for the service health event. - */ - @JsonProperty(value = "properties.faqs") - private List faqs; - - /* - * It provides information if the event is High incident rate event or not. - */ - @JsonProperty(value = "properties.isHIR") - private Boolean isHir; - - /* - * Tells if we want to enable or disable Microsoft Support for this event. - */ - @JsonProperty(value = "properties.enableMicrosoftSupport") - private Boolean enableMicrosoftSupport; - - /* - * Tells if we want to enable or disable Microsoft Support for this event. - */ - @JsonProperty(value = "properties.enableChatWithUs") - private Boolean enableChatWithUs; - - /* - * Priority level of the event. - */ - @JsonProperty(value = "properties.priority") - private Integer priority; - - /* - * It provides the Timestamp for when the health impacting event was last - * updated. - */ - @JsonProperty(value = "properties.lastUpdateTime") - private OffsetDateTime lastUpdateTime; - - /* - * Stage for HIR Document - */ - @JsonProperty(value = "properties.hirStage") - private String hirStage; - - /** - * Get the eventType property: Type of event. - * - * @return the eventType value. - */ - public EventTypeValues eventType() { - return this.eventType; - } - - /** - * Set the eventType property: Type of event. - * - * @param eventType the eventType value to set. - * @return the EventInner object itself. - */ - public EventInner withEventType(EventTypeValues eventType) { - this.eventType = eventType; - return this; - } - - /** - * Get the eventSource property: Source of event. - * - * @return the eventSource value. - */ - public EventSourceValues eventSource() { - return this.eventSource; - } - - /** - * Set the eventSource property: Source of event. - * - * @param eventSource the eventSource value to set. - * @return the EventInner object itself. - */ - public EventInner withEventSource(EventSourceValues eventSource) { - this.eventSource = eventSource; - return this; - } - - /** - * Get the status property: Current status of event. - * - * @return the status value. - */ - public EventStatusValues status() { - return this.status; - } - - /** - * Set the status property: Current status of event. - * - * @param status the status value to set. - * @return the EventInner object itself. - */ - public EventInner withStatus(EventStatusValues status) { - this.status = status; - return this; - } - - /** - * Get the title property: Title text of event. - * - * @return the title value. - */ - public String title() { - return this.title; - } - - /** - * Set the title property: Title text of event. - * - * @param title the title value to set. - * @return the EventInner object itself. - */ - public EventInner withTitle(String title) { - this.title = title; - return this; - } - - /** - * Get the summary property: Summary text of event. - * - * @return the summary value. - */ - public String summary() { - return this.summary; - } - - /** - * Set the summary property: Summary text of event. - * - * @param summary the summary value to set. - * @return the EventInner object itself. - */ - public EventInner withSummary(String summary) { - this.summary = summary; - return this; - } - - /** - * Get the headerProperty property: Header text of event. - * - * @return the headerProperty value. - */ - public String headerProperty() { - return this.headerProperty; - } - - /** - * Set the headerProperty property: Header text of event. - * - * @param headerProperty the headerProperty value to set. - * @return the EventInner object itself. - */ - public EventInner withHeaderProperty(String headerProperty) { - this.headerProperty = headerProperty; - return this; - } - - /** - * Get the level property: Level of insight. - * - * @return the level value. - */ - public LevelValues level() { - return this.level; - } - - /** - * Set the level property: Level of insight. - * - * @param level the level value to set. - * @return the EventInner object itself. - */ - public EventInner withLevel(LevelValues level) { - this.level = level; - return this; - } - - /** - * Get the eventLevel property: Level of event. - * - * @return the eventLevel value. - */ - public EventLevelValues eventLevel() { - return this.eventLevel; - } - - /** - * Set the eventLevel property: Level of event. - * - * @param eventLevel the eventLevel value to set. - * @return the EventInner object itself. - */ - public EventInner withEventLevel(EventLevelValues eventLevel) { - this.eventLevel = eventLevel; - return this; - } - - /** - * Get the article property: Article of event. - * - * @return the article value. - */ - public EventPropertiesArticle article() { - return this.article; - } - - /** - * Set the article property: Article of event. - * - * @param article the article value to set. - * @return the EventInner object itself. - */ - public EventInner withArticle(EventPropertiesArticle article) { - this.article = article; - return this; - } - - /** - * Get the links property: Useful links of event. - * - * @return the links value. - */ - public List links() { - return this.links; - } - - /** - * Set the links property: Useful links of event. - * - * @param links the links value to set. - * @return the EventInner object itself. - */ - public EventInner withLinks(List links) { - this.links = links; - return this; - } - - /** - * Get the impactStartTime property: It provides the Timestamp for when the health impacting event started. - * - * @return the impactStartTime value. - */ - public OffsetDateTime impactStartTime() { - return this.impactStartTime; - } - - /** - * Set the impactStartTime property: It provides the Timestamp for when the health impacting event started. - * - * @param impactStartTime the impactStartTime value to set. - * @return the EventInner object itself. - */ - public EventInner withImpactStartTime(OffsetDateTime impactStartTime) { - this.impactStartTime = impactStartTime; - return this; - } - - /** - * Get the impactMitigationTime property: It provides the Timestamp for when the health impacting event resolved. - * - * @return the impactMitigationTime value. - */ - public OffsetDateTime impactMitigationTime() { - return this.impactMitigationTime; - } - - /** - * Set the impactMitigationTime property: It provides the Timestamp for when the health impacting event resolved. - * - * @param impactMitigationTime the impactMitigationTime value to set. - * @return the EventInner object itself. - */ - public EventInner withImpactMitigationTime(OffsetDateTime impactMitigationTime) { - this.impactMitigationTime = impactMitigationTime; - return this; - } - - /** - * Get the impact property: List services impacted by the service health event. - * - * @return the impact value. - */ - public List impact() { - return this.impact; - } - - /** - * Set the impact property: List services impacted by the service health event. - * - * @param impact the impact value to set. - * @return the EventInner object itself. - */ - public EventInner withImpact(List impact) { - this.impact = impact; - return this; - } - - /** - * Get the recommendedActions property: Recommended actions of event. - * - * @return the recommendedActions value. - */ - public EventPropertiesRecommendedActions recommendedActions() { - return this.recommendedActions; - } - - /** - * Set the recommendedActions property: Recommended actions of event. - * - * @param recommendedActions the recommendedActions value to set. - * @return the EventInner object itself. - */ - public EventInner withRecommendedActions(EventPropertiesRecommendedActions recommendedActions) { - this.recommendedActions = recommendedActions; - return this; - } - - /** - * Get the faqs property: Frequently asked questions for the service health event. - * - * @return the faqs value. - */ - public List faqs() { - return this.faqs; - } - - /** - * Set the faqs property: Frequently asked questions for the service health event. - * - * @param faqs the faqs value to set. - * @return the EventInner object itself. - */ - public EventInner withFaqs(List faqs) { - this.faqs = faqs; - return this; - } - - /** - * Get the isHir property: It provides information if the event is High incident rate event or not. - * - * @return the isHir value. - */ - public Boolean isHir() { - return this.isHir; - } - - /** - * Set the isHir property: It provides information if the event is High incident rate event or not. - * - * @param isHir the isHir value to set. - * @return the EventInner object itself. - */ - public EventInner withIsHir(Boolean isHir) { - this.isHir = isHir; - return this; - } - - /** - * Get the enableMicrosoftSupport property: Tells if we want to enable or disable Microsoft Support for this event. - * - * @return the enableMicrosoftSupport value. - */ - public Boolean enableMicrosoftSupport() { - return this.enableMicrosoftSupport; - } - - /** - * Set the enableMicrosoftSupport property: Tells if we want to enable or disable Microsoft Support for this event. - * - * @param enableMicrosoftSupport the enableMicrosoftSupport value to set. - * @return the EventInner object itself. - */ - public EventInner withEnableMicrosoftSupport(Boolean enableMicrosoftSupport) { - this.enableMicrosoftSupport = enableMicrosoftSupport; - return this; - } - - /** - * Get the enableChatWithUs property: Tells if we want to enable or disable Microsoft Support for this event. - * - * @return the enableChatWithUs value. - */ - public Boolean enableChatWithUs() { - return this.enableChatWithUs; - } - - /** - * Set the enableChatWithUs property: Tells if we want to enable or disable Microsoft Support for this event. - * - * @param enableChatWithUs the enableChatWithUs value to set. - * @return the EventInner object itself. - */ - public EventInner withEnableChatWithUs(Boolean enableChatWithUs) { - this.enableChatWithUs = enableChatWithUs; - return this; - } - - /** - * Get the priority property: Priority level of the event. - * - * @return the priority value. - */ - public Integer priority() { - return this.priority; - } - - /** - * Set the priority property: Priority level of the event. - * - * @param priority the priority value to set. - * @return the EventInner object itself. - */ - public EventInner withPriority(Integer priority) { - this.priority = priority; - return this; - } - - /** - * Get the lastUpdateTime property: It provides the Timestamp for when the health impacting event was last updated. - * - * @return the lastUpdateTime value. - */ - public OffsetDateTime lastUpdateTime() { - return this.lastUpdateTime; - } - - /** - * Set the lastUpdateTime property: It provides the Timestamp for when the health impacting event was last updated. - * - * @param lastUpdateTime the lastUpdateTime value to set. - * @return the EventInner object itself. - */ - public EventInner withLastUpdateTime(OffsetDateTime lastUpdateTime) { - this.lastUpdateTime = lastUpdateTime; - return this; - } - - /** - * Get the hirStage property: Stage for HIR Document. - * - * @return the hirStage value. - */ - public String hirStage() { - return this.hirStage; - } - - /** - * Set the hirStage property: Stage for HIR Document. - * - * @param hirStage the hirStage value to set. - * @return the EventInner object itself. - */ - public EventInner withHirStage(String hirStage) { - this.hirStage = hirStage; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (article() != null) { - article().validate(); - } - if (links() != null) { - links().forEach(e -> e.validate()); - } - if (impact() != null) { - impact().forEach(e -> e.validate()); - } - if (recommendedActions() != null) { - recommendedActions().validate(); - } - if (faqs() != null) { - faqs().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/AvailabilityStatusesClientImpl.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/AvailabilityStatusesClientImpl.java index d1043f1ad547e..6c2695db8b962 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/AvailabilityStatusesClientImpl.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/AvailabilityStatusesClientImpl.java @@ -147,7 +147,8 @@ Mono> listNext( } /** - * Lists the current availability status for all the resources in the subscription. + * Lists the current availability status for all the resources in the subscription. Use the nextLink property in the + * response to get the next page of availability statuses. * * @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. @@ -198,7 +199,8 @@ private Mono> listBySubscriptionIdSingleP } /** - * Lists the current availability status for all the resources in the subscription. + * Lists the current availability status for all the resources in the subscription. Use the nextLink property in the + * response to get the next page of availability statuses. * * @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. @@ -247,7 +249,8 @@ private Mono> listBySubscriptionIdSingleP } /** - * Lists the current availability status for all the resources in the subscription. + * Lists the current availability status for all the resources in the subscription. Use the nextLink property in the + * response to get the next page of availability statuses. * * @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. @@ -265,7 +268,8 @@ private PagedFlux listBySubscriptionIdAsync(String filt } /** - * Lists the current availability status for all the resources in the subscription. + * Lists the current availability status for all the resources in the subscription. Use the nextLink property in the + * response to get the next page of availability statuses. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -281,7 +285,8 @@ private PagedFlux listBySubscriptionIdAsync() { } /** - * Lists the current availability status for all the resources in the subscription. + * Lists the current availability status for all the resources in the subscription. Use the nextLink property in the + * response to get the next page of availability statuses. * * @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. @@ -301,7 +306,8 @@ private PagedFlux listBySubscriptionIdAsync( } /** - * Lists the current availability status for all the resources in the subscription. + * Lists the current availability status for all the resources in the subscription. Use the nextLink property in the + * response to get the next page of availability statuses. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -315,7 +321,8 @@ public PagedIterable listBySubscriptionId() { } /** - * Lists the current availability status for all the resources in the subscription. + * Lists the current availability status for all the resources in the subscription. Use the nextLink property in the + * response to get the next page of availability statuses. * * @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. @@ -332,7 +339,8 @@ public PagedIterable listBySubscriptionId(String filter } /** - * Lists the current availability status for all the resources in the resource group. + * Lists the current availability status for all the resources in the resource group. Use the nextLink property in + * the response to get the next page of availability statuses. * * @param resourceGroupName The name of the resource group. * @param filter The filter to apply on the operation. For more information please see @@ -389,7 +397,8 @@ private Mono> listByResourceGroupSinglePa } /** - * Lists the current availability status for all the resources in the resource group. + * Lists the current availability status for all the resources in the resource group. Use the nextLink property in + * the response to get the next page of availability statuses. * * @param resourceGroupName The name of the resource group. * @param filter The filter to apply on the operation. For more information please see @@ -444,7 +453,8 @@ private Mono> listByResourceGroupSinglePa } /** - * Lists the current availability status for all the resources in the resource group. + * Lists the current availability status for all the resources in the resource group. Use the nextLink property in + * the response to get the next page of availability statuses. * * @param resourceGroupName The name of the resource group. * @param filter The filter to apply on the operation. For more information please see @@ -464,7 +474,8 @@ private PagedFlux listByResourceGroupAsync( } /** - * Lists the current availability status for all the resources in the resource group. + * Lists the current availability status for all the resources in the resource group. Use the nextLink property in + * the response to get the next page of availability statuses. * * @param resourceGroupName The name of the resource group. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -482,7 +493,8 @@ private PagedFlux listByResourceGroupAsync(String resou } /** - * Lists the current availability status for all the resources in the resource group. + * Lists the current availability status for all the resources in the resource group. Use the nextLink property in + * the response to get the next page of availability statuses. * * @param resourceGroupName The name of the resource group. * @param filter The filter to apply on the operation. For more information please see @@ -503,7 +515,8 @@ private PagedFlux listByResourceGroupAsync( } /** - * Lists the current availability status for all the resources in the resource group. + * Lists the current availability status for all the resources in the resource group. Use the nextLink property in + * the response to get the next page of availability statuses. * * @param resourceGroupName The name of the resource group. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -519,7 +532,8 @@ public PagedIterable listByResourceGroup(String resourc } /** - * Lists the current availability status for all the resources in the resource group. + * Lists the current availability status for all the resources in the resource group. Use the nextLink property in + * the response to get the next page of availability statuses. * * @param resourceGroupName The name of the resource group. * @param filter The filter to apply on the operation. For more information please see @@ -718,7 +732,8 @@ public Response getByResourceWithResponse( } /** - * Lists all historical availability transitions and impacting events for a single resource. + * Lists all historical availability transitions and impacting events for a single resource. Use the nextLink + * property in the response to get the next page of availability status. * * @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 : @@ -771,7 +786,8 @@ private Mono> listSinglePageAsync( } /** - * Lists all historical availability transitions and impacting events for a single resource. + * Lists all historical availability transitions and impacting events for a single resource. Use the nextLink + * property in the response to get the next page of availability status. * * @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 : @@ -815,7 +831,8 @@ private Mono> listSinglePageAsync( } /** - * Lists all historical availability transitions and impacting events for a single resource. + * Lists all historical availability transitions and impacting events for a single resource. Use the nextLink + * property in the response to get the next page of availability status. * * @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 : @@ -837,7 +854,8 @@ private PagedFlux listAsync(String resourceUri, String } /** - * Lists all historical availability transitions and impacting events for a single resource. + * Lists all historical availability transitions and impacting events for a single resource. Use the nextLink + * property in the response to get the next page of availability status. * * @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 : @@ -858,7 +876,8 @@ private PagedFlux listAsync(String resourceUri) { } /** - * Lists all historical availability transitions and impacting events for a single resource. + * Lists all historical availability transitions and impacting events for a single resource. Use the nextLink + * property in the response to get the next page of availability status. * * @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 : @@ -883,7 +902,8 @@ private PagedFlux listAsync( } /** - * Lists all historical availability transitions and impacting events for a single resource. + * Lists all historical availability transitions and impacting events for a single resource. Use the nextLink + * property in the response to get the next page of availability status. * * @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 : @@ -903,7 +923,8 @@ public PagedIterable list(String resourceUri) { } /** - * Lists all historical availability transitions and impacting events for a single resource. + * Lists all historical availability transitions and impacting events for a single resource. Use the nextLink + * property in the response to get the next page of availability status. * * @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 : diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EventsOperationsClientImpl.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/ChildAvailabilityStatusesClientImpl.java similarity index 56% rename from sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EventsOperationsClientImpl.java rename to sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/ChildAvailabilityStatusesClientImpl.java index 5e6ee032e4062..18bae774ee499 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EventsOperationsClientImpl.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/ChildAvailabilityStatusesClientImpl.java @@ -26,72 +26,64 @@ import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resourcehealth.fluent.EventsOperationsClient; -import com.azure.resourcemanager.resourcehealth.fluent.models.EventInner; -import com.azure.resourcemanager.resourcehealth.models.Events; +import com.azure.resourcemanager.resourcehealth.fluent.ChildAvailabilityStatusesClient; +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 EventsOperationsClient. */ -public final class EventsOperationsClientImpl implements EventsOperationsClient { - private final ClientLogger logger = new ClientLogger(EventsOperationsClientImpl.class); +/** An instance of this class provides access to all the operations defined in ChildAvailabilityStatusesClient. */ +public final class ChildAvailabilityStatusesClientImpl implements ChildAvailabilityStatusesClient { + private final ClientLogger logger = new ClientLogger(ChildAvailabilityStatusesClientImpl.class); /** The proxy service used to perform REST calls. */ - private final EventsOperationsService service; + private final ChildAvailabilityStatusesService service; /** The service client containing this operation class. */ private final MicrosoftResourceHealthImpl client; /** - * Initializes an instance of EventsOperationsClientImpl. + * Initializes an instance of ChildAvailabilityStatusesClientImpl. * * @param client the instance of the service client containing this operation class. */ - EventsOperationsClientImpl(MicrosoftResourceHealthImpl client) { + ChildAvailabilityStatusesClientImpl(MicrosoftResourceHealthImpl client) { this.service = - RestProxy.create(EventsOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + RestProxy + .create( + ChildAvailabilityStatusesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for MicrosoftResourceHealthEventsOperations to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for MicrosoftResourceHealthChildAvailabilityStatuses to be used by the + * proxy service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "MicrosoftResourceHea") - private interface EventsOperationsService { + private interface ChildAvailabilityStatusesService { @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/events") + @Get("/{resourceUri}/providers/Microsoft.ResourceHealth/childAvailabilityStatuses/current") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( + Mono> getByResource( @HostParam("$host") String endpoint, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("view") String view, + @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Get("/{resourceUri}/providers/Microsoft.ResourceHealth/events") + @Get("/{resourceUri}/providers/Microsoft.ResourceHealth/childAvailabilityStatuses") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySingleResource( + Mono> list( @HostParam("$host") String endpoint, @PathParam(value = "resourceUri", encoded = true) String resourceUri, @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, - @QueryParam("view") String view, - @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, + @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); @@ -99,7 +91,7 @@ Mono> listBySubscriptionIdNext( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySingleResourceNext( + Mono> listNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -107,204 +99,191 @@ Mono> listBySingleResourceNext( } /** - * Lists current service health events in the subscription. + * 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 only support one nesting level resource types : + * /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 view setting view=full expands the article parameters. + * @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 events operation response. + * @return current availability status for a single resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter, String view) { + 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 (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() 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( + .getByResource( this.client.getEndpoint(), + resourceUri, this.client.getApiVersion(), filter, - this.client.getSubscriptionId(), - view, + 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 current service health events in the subscription. + * 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 only support one nesting level resource types : + * /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 view setting view=full expands the article parameters. + * @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 events operation response. + * @return current availability status for a single resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter, String view, Context context) { + 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 (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() 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(), - this.client.getApiVersion(), - filter, - this.client.getSubscriptionId(), - view, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .getByResource( + this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), filter, expand, accept, context); } /** - * Lists current service health events in the subscription. + * 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 only support one nesting level resource types : + * /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 view setting view=full expands the article parameters. + * @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 events operation response. + * @return current availability status for a single resource. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter, String view) { - return new PagedFlux<>( - () -> listSinglePageAsync(filter, view), nextLink -> listBySubscriptionIdNextSinglePageAsync(nextLink)); + @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(); + } + }); } /** - * Lists current service health events in the subscription. + * 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 only support one nesting level resource types : + * /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 events operation response. + * @return current availability status for a single resource. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceAsync(String resourceUri) { final String filter = null; - final String view = null; - return new PagedFlux<>( - () -> listSinglePageAsync(filter, view), nextLink -> listBySubscriptionIdNextSinglePageAsync(nextLink)); + 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(); + } + }); } /** - * Lists current service health events in the subscription. + * Gets current availability status for a single resource. * - * @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 view setting view=full expands the article parameters. - * @param context The context to associate with this operation. + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. + * Currently the API only support one nesting level resource types : + * /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 events operation response. + * @return current availability status for a single resource. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter, String view, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(filter, view, context), - nextLink -> listBySubscriptionIdNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists current service health events 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 events operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { + @ServiceMethod(returns = ReturnType.SINGLE) + public AvailabilityStatusInner getByResource(String resourceUri) { final String filter = null; - final String view = null; - return new PagedIterable<>(listAsync(filter, view)); + final String expand = null; + return getByResourceAsync(resourceUri, filter, expand).block(); } /** - * Lists current service health events in the subscription. + * 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 only support one nesting level resource types : + * /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 view setting view=full expands the article parameters. + * @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 events operation response. + * @return current availability status for a single resource. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String filter, String view, Context context) { - return new PagedIterable<>(listAsync(filter, view, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceWithResponse( + String resourceUri, String filter, String expand, Context context) { + return getByResourceWithResponseAsync(resourceUri, filter, expand, context).block(); } /** - * Lists current service health events for given resource. + * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response + * to get the next page of availability status. * * @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 + * Currently the API only support one nesting level resource types : * /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 view setting view=full expands the article parameters. + * @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 events operation response. + * @return the List availabilityStatus operation response. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySingleResourceSinglePageAsync( - String resourceUri, String filter, String view) { + private Mono> listSinglePageAsync( + String resourceUri, String filter, String expand) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -319,15 +298,15 @@ private Mono> listBySingleResourceSinglePageAsync( .withContext( context -> service - .listBySingleResource( + .list( this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), filter, - view, + expand, accept, context)) - .>map( + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -340,25 +319,24 @@ private Mono> listBySingleResourceSinglePageAsync( } /** - * Lists current service health events for given resource. + * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response + * to get the next page of availability status. * * @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 + * Currently the API only support one nesting level resource types : * /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 view setting view=full expands the article parameters. + * @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 events operation response. + * @return the List availabilityStatus operation response. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySingleResourceSinglePageAsync( - String resourceUri, String filter, String view, Context context) { + private Mono> listSinglePageAsync( + String resourceUri, String filter, String expand, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -371,8 +349,7 @@ private Mono> listBySingleResourceSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listBySingleResource( - this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), filter, view, accept, context) + .list(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), filter, expand, accept, context) .map( res -> new PagedResponseBase<>( @@ -385,201 +362,122 @@ private Mono> listBySingleResourceSinglePageAsync( } /** - * Lists current service health events for given resource. + * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response + * to get the next page of availability status. * * @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 + * Currently the API only support one nesting level resource types : * /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 view setting view=full expands the article parameters. + * @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 events operation response. + * @return the List availabilityStatus operation response. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySingleResourceAsync(String resourceUri, String filter, String view) { + private PagedFlux listAsync(String resourceUri, String filter, String expand) { return new PagedFlux<>( - () -> listBySingleResourceSinglePageAsync(resourceUri, filter, view), - nextLink -> listBySingleResourceNextSinglePageAsync(nextLink)); + () -> listSinglePageAsync(resourceUri, filter, expand), nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Lists current service health events for given resource. + * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response + * to get the next page of availability status. * * @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 + * Currently the API only support one nesting level resource types : * /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 events operation response. + * @return the List availabilityStatus operation response. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySingleResourceAsync(String resourceUri) { + private PagedFlux listAsync(String resourceUri) { final String filter = null; - final String view = null; + final String expand = null; return new PagedFlux<>( - () -> listBySingleResourceSinglePageAsync(resourceUri, filter, view), - nextLink -> listBySingleResourceNextSinglePageAsync(nextLink)); + () -> listSinglePageAsync(resourceUri, filter, expand), nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Lists current service health events for given resource. + * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response + * to get the next page of availability status. * * @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 + * Currently the API only support one nesting level resource types : * /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 view setting view=full expands the article parameters. + * @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 events operation response. + * @return the List availabilityStatus operation response. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySingleResourceAsync( - String resourceUri, String filter, String view, Context context) { + private PagedFlux listAsync( + String resourceUri, String filter, String expand, Context context) { return new PagedFlux<>( - () -> listBySingleResourceSinglePageAsync(resourceUri, filter, view, context), - nextLink -> listBySingleResourceNextSinglePageAsync(nextLink, context)); + () -> listSinglePageAsync(resourceUri, filter, expand, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** - * Lists current service health events for given resource. + * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response + * to get the next page of availability status. * * @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 + * Currently the API only support one nesting level resource types : * /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 events operation response. + * @return the List availabilityStatus operation response. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBySingleResource(String resourceUri) { + public PagedIterable list(String resourceUri) { final String filter = null; - final String view = null; - return new PagedIterable<>(listBySingleResourceAsync(resourceUri, filter, view)); + final String expand = null; + return new PagedIterable<>(listAsync(resourceUri, filter, expand)); } /** - * Lists current service health events for given resource. + * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response + * to get the next page of availability status. * * @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 + * Currently the API only support one nesting level resource types : * /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 view setting view=full expands the article parameters. + * @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 events operation response. + * @return the List availabilityStatus operation response. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBySingleResource( - String resourceUri, String filter, String view, Context context) { - return new PagedIterable<>(listBySingleResourceAsync(resourceUri, filter, view, 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 events operation response. - */ - @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())); + 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. - * @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 events operation response. + * @return the List availabilityStatus operation response. */ @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 events operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySingleResourceNextSinglePageAsync(String nextLink) { + private Mono> listNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -591,9 +489,8 @@ private Mono> listBySingleResourceNextSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listBySingleResourceNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -613,10 +510,10 @@ private Mono> listBySingleResourceNextSinglePageAsync( * @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 events operation response. + * @return the List availabilityStatus operation response. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySingleResourceNextSinglePageAsync(String nextLink, Context context) { + private Mono> listNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -629,7 +526,7 @@ private Mono> listBySingleResourceNextSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listBySingleResourceNext(nextLink, this.client.getEndpoint(), accept, context) + .listNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/ChildAvailabilityStatusesImpl.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/ChildAvailabilityStatusesImpl.java new file mode 100644 index 0000000000000..13be76ffb1341 --- /dev/null +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/ChildAvailabilityStatusesImpl.java @@ -0,0 +1,73 @@ +// 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.ChildAvailabilityStatusesClient; +import com.azure.resourcemanager.resourcehealth.fluent.models.AvailabilityStatusInner; +import com.azure.resourcemanager.resourcehealth.models.AvailabilityStatus; +import com.azure.resourcemanager.resourcehealth.models.ChildAvailabilityStatuses; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ChildAvailabilityStatusesImpl implements ChildAvailabilityStatuses { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ChildAvailabilityStatusesImpl.class); + + private final ChildAvailabilityStatusesClient innerClient; + + private final com.azure.resourcemanager.resourcehealth.ResourceHealthManager serviceManager; + + public ChildAvailabilityStatusesImpl( + ChildAvailabilityStatusesClient innerClient, + com.azure.resourcemanager.resourcehealth.ResourceHealthManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + 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 ChildAvailabilityStatusesClient 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/ChildResourcesClientImpl.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/ChildResourcesClientImpl.java new file mode 100644 index 0000000000000..2b6e5d5b38fc6 --- /dev/null +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/ChildResourcesClientImpl.java @@ -0,0 +1,357 @@ +// 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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.resourcehealth.fluent.ChildResourcesClient; +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 ChildResourcesClient. */ +public final class ChildResourcesClientImpl implements ChildResourcesClient { + private final ClientLogger logger = new ClientLogger(ChildResourcesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ChildResourcesService service; + + /** The service client containing this operation class. */ + private final MicrosoftResourceHealthImpl client; + + /** + * Initializes an instance of ChildResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ChildResourcesClientImpl(MicrosoftResourceHealthImpl client) { + this.service = + RestProxy.create(ChildResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftResourceHealthChildResources to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftResourceHea") + private interface ChildResourcesService { + @Headers({"Content-Type: application/json"}) + @Get("/{resourceUri}/providers/Microsoft.ResourceHealth/childResources") + @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> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists the all the children and its current health status for a parent resource. Use the nextLink property in the + * response to get the next page of children current health. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. + * Currently the API only support not nested parent resource type: + * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}. + * @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. + */ + @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 the all the children and its current health status for a parent resource. Use the nextLink property in the + * response to get the next page of children current health. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. + * Currently the API only support not nested parent resource type: + * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}. + * @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. + */ + @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 the all the children and its current health status for a parent resource. Use the nextLink property in the + * response to get the next page of children current health. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. + * Currently the API only support not nested parent resource type: + * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}. + * @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceUri, String filter, String expand) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceUri, filter, expand), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the all the children and its current health status for a parent resource. Use the nextLink property in the + * response to get the next page of children current health. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. + * Currently the API only support not nested parent resource type: + * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}. + * @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. + */ + @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 the all the children and its current health status for a parent resource. Use the nextLink property in the + * response to get the next page of children current health. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. + * Currently the API only support not nested parent resource type: + * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}. + * @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. + */ + @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 the all the children and its current health status for a parent resource. Use the nextLink property in the + * response to get the next page of children current health. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. + * Currently the API only support not nested parent resource type: + * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}. + * @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. + */ + @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 the all the children and its current health status for a parent resource. Use the nextLink property in the + * response to get the next page of children current health. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. + * Currently the API only support not nested parent resource type: + * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}. + * @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. + */ + @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. + */ + @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. + */ + @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/ChildResourcesImpl.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/ChildResourcesImpl.java new file mode 100644 index 0000000000000..ec4e89b464a43 --- /dev/null +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/ChildResourcesImpl.java @@ -0,0 +1,47 @@ +// 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.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.resourcehealth.fluent.ChildResourcesClient; +import com.azure.resourcemanager.resourcehealth.fluent.models.AvailabilityStatusInner; +import com.azure.resourcemanager.resourcehealth.models.AvailabilityStatus; +import com.azure.resourcemanager.resourcehealth.models.ChildResources; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ChildResourcesImpl implements ChildResources { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ChildResourcesImpl.class); + + private final ChildResourcesClient innerClient; + + private final com.azure.resourcemanager.resourcehealth.ResourceHealthManager serviceManager; + + public ChildResourcesImpl( + ChildResourcesClient innerClient, + com.azure.resourcemanager.resourcehealth.ResourceHealthManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + 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 ChildResourcesClient 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/EventImpl.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EventImpl.java deleted file mode 100644 index 9640c2075cdef..0000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EventImpl.java +++ /dev/null @@ -1,151 +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.EventInner; -import com.azure.resourcemanager.resourcehealth.models.Event; -import com.azure.resourcemanager.resourcehealth.models.EventLevelValues; -import com.azure.resourcemanager.resourcehealth.models.EventPropertiesArticle; -import com.azure.resourcemanager.resourcehealth.models.EventPropertiesRecommendedActions; -import com.azure.resourcemanager.resourcehealth.models.EventSourceValues; -import com.azure.resourcemanager.resourcehealth.models.EventStatusValues; -import com.azure.resourcemanager.resourcehealth.models.EventTypeValues; -import com.azure.resourcemanager.resourcehealth.models.Faq; -import com.azure.resourcemanager.resourcehealth.models.Impact; -import com.azure.resourcemanager.resourcehealth.models.LevelValues; -import com.azure.resourcemanager.resourcehealth.models.Link; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.List; - -public final class EventImpl implements Event { - private EventInner innerObject; - - private final com.azure.resourcemanager.resourcehealth.ResourceHealthManager serviceManager; - - EventImpl(EventInner 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 EventTypeValues eventType() { - return this.innerModel().eventType(); - } - - public EventSourceValues eventSource() { - return this.innerModel().eventSource(); - } - - public EventStatusValues status() { - return this.innerModel().status(); - } - - public String title() { - return this.innerModel().title(); - } - - public String summary() { - return this.innerModel().summary(); - } - - public String headerProperty() { - return this.innerModel().headerProperty(); - } - - public LevelValues level() { - return this.innerModel().level(); - } - - public EventLevelValues eventLevel() { - return this.innerModel().eventLevel(); - } - - public EventPropertiesArticle article() { - return this.innerModel().article(); - } - - public List links() { - List inner = this.innerModel().links(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public OffsetDateTime impactStartTime() { - return this.innerModel().impactStartTime(); - } - - public OffsetDateTime impactMitigationTime() { - return this.innerModel().impactMitigationTime(); - } - - public List impact() { - List inner = this.innerModel().impact(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public EventPropertiesRecommendedActions recommendedActions() { - return this.innerModel().recommendedActions(); - } - - public List faqs() { - List inner = this.innerModel().faqs(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public Boolean isHir() { - return this.innerModel().isHir(); - } - - public Boolean enableMicrosoftSupport() { - return this.innerModel().enableMicrosoftSupport(); - } - - public Boolean enableChatWithUs() { - return this.innerModel().enableChatWithUs(); - } - - public Integer priority() { - return this.innerModel().priority(); - } - - public OffsetDateTime lastUpdateTime() { - return this.innerModel().lastUpdateTime(); - } - - public String hirStage() { - return this.innerModel().hirStage(); - } - - public EventInner 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/EventsOperationsImpl.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EventsOperationsImpl.java deleted file mode 100644 index 3288902df9524..0000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EventsOperationsImpl.java +++ /dev/null @@ -1,57 +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.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resourcehealth.fluent.EventsOperationsClient; -import com.azure.resourcemanager.resourcehealth.fluent.models.EventInner; -import com.azure.resourcemanager.resourcehealth.models.Event; -import com.azure.resourcemanager.resourcehealth.models.EventsOperations; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class EventsOperationsImpl implements EventsOperations { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EventsOperationsImpl.class); - - private final EventsOperationsClient innerClient; - - private final com.azure.resourcemanager.resourcehealth.ResourceHealthManager serviceManager; - - public EventsOperationsImpl( - EventsOperationsClient innerClient, - com.azure.resourcemanager.resourcehealth.ResourceHealthManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new EventImpl(inner1, this.manager())); - } - - public PagedIterable list(String filter, String view, Context context) { - PagedIterable inner = this.serviceClient().list(filter, view, context); - return Utils.mapPage(inner, inner1 -> new EventImpl(inner1, this.manager())); - } - - public PagedIterable listBySingleResource(String resourceUri) { - PagedIterable inner = this.serviceClient().listBySingleResource(resourceUri); - return Utils.mapPage(inner, inner1 -> new EventImpl(inner1, this.manager())); - } - - public PagedIterable listBySingleResource(String resourceUri, String filter, String view, Context context) { - PagedIterable inner = this.serviceClient().listBySingleResource(resourceUri, filter, view, context); - return Utils.mapPage(inner, inner1 -> new EventImpl(inner1, this.manager())); - } - - private EventsOperationsClient 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/MicrosoftResourceHealthImpl.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/MicrosoftResourceHealthImpl.java index 08bb8042b05d3..9252f91ca7665 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/MicrosoftResourceHealthImpl.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/MicrosoftResourceHealthImpl.java @@ -22,8 +22,9 @@ 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.ChildAvailabilityStatusesClient; +import com.azure.resourcemanager.resourcehealth.fluent.ChildResourcesClient; import com.azure.resourcemanager.resourcehealth.fluent.EmergingIssuesClient; -import com.azure.resourcemanager.resourcehealth.fluent.EventsOperationsClient; import com.azure.resourcemanager.resourcehealth.fluent.MicrosoftResourceHealth; import com.azure.resourcemanager.resourcehealth.fluent.OperationsClient; import java.io.IOException; @@ -117,18 +118,6 @@ public Duration getDefaultPollInterval() { return this.defaultPollInterval; } - /** The EventsOperationsClient object to access its operations. */ - private final EventsOperationsClient eventsOperations; - - /** - * Gets the EventsOperationsClient object to access its operations. - * - * @return the EventsOperationsClient object. - */ - public EventsOperationsClient getEventsOperations() { - return this.eventsOperations; - } - /** The AvailabilityStatusesClient object to access its operations. */ private final AvailabilityStatusesClient availabilityStatuses; @@ -141,6 +130,30 @@ public AvailabilityStatusesClient getAvailabilityStatuses() { return this.availabilityStatuses; } + /** The ChildAvailabilityStatusesClient object to access its operations. */ + private final ChildAvailabilityStatusesClient childAvailabilityStatuses; + + /** + * Gets the ChildAvailabilityStatusesClient object to access its operations. + * + * @return the ChildAvailabilityStatusesClient object. + */ + public ChildAvailabilityStatusesClient getChildAvailabilityStatuses() { + return this.childAvailabilityStatuses; + } + + /** The ChildResourcesClient object to access its operations. */ + private final ChildResourcesClient childResources; + + /** + * Gets the ChildResourcesClient object to access its operations. + * + * @return the ChildResourcesClient object. + */ + public ChildResourcesClient getChildResources() { + return this.childResources; + } + /** The OperationsClient object to access its operations. */ private final OperationsClient operations; @@ -188,9 +201,10 @@ public EmergingIssuesClient getEmergingIssues() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2018-07-01"; - this.eventsOperations = new EventsOperationsClientImpl(this); + this.apiVersion = "2017-07-01"; this.availabilityStatuses = new AvailabilityStatusesClientImpl(this); + this.childAvailabilityStatuses = new ChildAvailabilityStatusesClientImpl(this); + this.childResources = new ChildResourcesClientImpl(this); this.operations = new OperationsClientImpl(this); this.emergingIssues = new EmergingIssuesClientImpl(this); } diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStateValues.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStateValues.java index e1f35fdb3978d..9185ef66f784d 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStateValues.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStateValues.java @@ -4,37 +4,47 @@ package com.azure.resourcemanager.resourcehealth.models; -import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonValue; /** Defines values for AvailabilityStateValues. */ -public final class AvailabilityStateValues extends ExpandableStringEnum { - /** Static value Available for AvailabilityStateValues. */ - public static final AvailabilityStateValues AVAILABLE = fromString("Available"); +public enum AvailabilityStateValues { + /** Enum value Available. */ + AVAILABLE("Available"), - /** Static value Unavailable for AvailabilityStateValues. */ - public static final AvailabilityStateValues UNAVAILABLE = fromString("Unavailable"); + /** Enum value Unavailable. */ + UNAVAILABLE("Unavailable"), - /** Static value Degraded for AvailabilityStateValues. */ - public static final AvailabilityStateValues DEGRADED = fromString("Degraded"); + /** Enum value Unknown. */ + UNKNOWN("Unknown"); - /** Static value Unknown for AvailabilityStateValues. */ - public static final AvailabilityStateValues UNKNOWN = fromString("Unknown"); + /** The actual serialized value for a AvailabilityStateValues instance. */ + private final String value; + + AvailabilityStateValues(String value) { + this.value = value; + } /** - * Creates or finds a AvailabilityStateValues from its string representation. + * Parses a serialized value to a AvailabilityStateValues instance. * - * @param name a name to look for. - * @return the corresponding AvailabilityStateValues. + * @param value the serialized value to parse. + * @return the parsed AvailabilityStateValues object, or null if unable to parse. */ @JsonCreator - public static AvailabilityStateValues fromString(String name) { - return fromString(name, AvailabilityStateValues.class); + public static AvailabilityStateValues fromString(String value) { + AvailabilityStateValues[] items = AvailabilityStateValues.values(); + for (AvailabilityStateValues item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; } - /** @return known AvailabilityStateValues values. */ - public static Collection values() { - return values(AvailabilityStateValues.class); + @JsonValue + @Override + public String toString() { + return this.value; } } diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatusProperties.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatusProperties.java index 8ec23780b2843..ad538e780e978 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatusProperties.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatusProperties.java @@ -91,8 +91,8 @@ public final class AvailabilityStatusProperties { /* * Timestamp for when last change in health status occurred. */ - @JsonProperty(value = "occurredTime") - private OffsetDateTime occurredTime; + @JsonProperty(value = "occuredTime") + private OffsetDateTime occuredTime; /* * Chronicity of the availability transition. @@ -110,8 +110,8 @@ public final class AvailabilityStatusProperties { * An annotation describing a change in the availabilityState to Available * from Unavailable with a reasonType of type Unplanned */ - @JsonProperty(value = "recentlyResolved") - private AvailabilityStatusPropertiesRecentlyResolved recentlyResolved; + @JsonProperty(value = "recentlyResolvedState") + private AvailabilityStatusPropertiesRecentlyResolvedState recentlyResolvedState; /* * Lists actions the user can take based on the current availabilityState @@ -342,22 +342,22 @@ public AvailabilityStatusProperties withResolutionEta(OffsetDateTime resolutionE } /** - * Get the occurredTime property: Timestamp for when last change in health status occurred. + * Get the occuredTime property: Timestamp for when last change in health status occurred. * - * @return the occurredTime value. + * @return the occuredTime value. */ - public OffsetDateTime occurredTime() { - return this.occurredTime; + public OffsetDateTime occuredTime() { + return this.occuredTime; } /** - * Set the occurredTime property: Timestamp for when last change in health status occurred. + * Set the occuredTime property: Timestamp for when last change in health status occurred. * - * @param occurredTime the occurredTime value to set. + * @param occuredTime the occuredTime value to set. * @return the AvailabilityStatusProperties object itself. */ - public AvailabilityStatusProperties withOccurredTime(OffsetDateTime occurredTime) { - this.occurredTime = occurredTime; + public AvailabilityStatusProperties withOccuredTime(OffsetDateTime occuredTime) { + this.occuredTime = occuredTime; return this; } @@ -402,25 +402,25 @@ public AvailabilityStatusProperties withReportedTime(OffsetDateTime reportedTime } /** - * Get the recentlyResolved property: An annotation describing a change in the availabilityState to Available from - * Unavailable with a reasonType of type Unplanned. + * Get the recentlyResolvedState property: An annotation describing a change in the availabilityState to Available + * from Unavailable with a reasonType of type Unplanned. * - * @return the recentlyResolved value. + * @return the recentlyResolvedState value. */ - public AvailabilityStatusPropertiesRecentlyResolved recentlyResolved() { - return this.recentlyResolved; + public AvailabilityStatusPropertiesRecentlyResolvedState recentlyResolvedState() { + return this.recentlyResolvedState; } /** - * Set the recentlyResolved property: An annotation describing a change in the availabilityState to Available from - * Unavailable with a reasonType of type Unplanned. + * Set the recentlyResolvedState 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. + * @param recentlyResolvedState the recentlyResolvedState value to set. * @return the AvailabilityStatusProperties object itself. */ - public AvailabilityStatusProperties withRecentlyResolved( - AvailabilityStatusPropertiesRecentlyResolved recentlyResolved) { - this.recentlyResolved = recentlyResolved; + public AvailabilityStatusProperties withRecentlyResolvedState( + AvailabilityStatusPropertiesRecentlyResolvedState recentlyResolvedState) { + this.recentlyResolvedState = recentlyResolvedState; return this; } @@ -474,8 +474,8 @@ public AvailabilityStatusProperties withServiceImpactingEvents(List 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/AvailabilityStatusPropertiesRecentlyResolvedState.java similarity index 81% rename from sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatusPropertiesRecentlyResolved.java rename to sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatusPropertiesRecentlyResolvedState.java index 44df2d6d03af2..60b715abf3ff4 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatusPropertiesRecentlyResolved.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatusPropertiesRecentlyResolvedState.java @@ -15,9 +15,9 @@ * Unplanned. */ @Fluent -public final class AvailabilityStatusPropertiesRecentlyResolved { +public final class AvailabilityStatusPropertiesRecentlyResolvedState { @JsonIgnore - private final ClientLogger logger = new ClientLogger(AvailabilityStatusPropertiesRecentlyResolved.class); + private final ClientLogger logger = new ClientLogger(AvailabilityStatusPropertiesRecentlyResolvedState.class); /* * Timestamp for when the availabilityState changed to Unavailable @@ -50,9 +50,9 @@ public OffsetDateTime 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. + * @return the AvailabilityStatusPropertiesRecentlyResolvedState object itself. */ - public AvailabilityStatusPropertiesRecentlyResolved withUnavailableOccurredTime( + public AvailabilityStatusPropertiesRecentlyResolvedState withUnavailableOccurredTime( OffsetDateTime unavailableOccurredTime) { this.unavailableOccurredTime = unavailableOccurredTime; return this; @@ -71,9 +71,9 @@ public OffsetDateTime resolvedTime() { * Set the resolvedTime property: Timestamp when the availabilityState changes to Available. * * @param resolvedTime the resolvedTime value to set. - * @return the AvailabilityStatusPropertiesRecentlyResolved object itself. + * @return the AvailabilityStatusPropertiesRecentlyResolvedState object itself. */ - public AvailabilityStatusPropertiesRecentlyResolved withResolvedTime(OffsetDateTime resolvedTime) { + public AvailabilityStatusPropertiesRecentlyResolvedState withResolvedTime(OffsetDateTime resolvedTime) { this.resolvedTime = resolvedTime; return this; } @@ -91,9 +91,9 @@ public String 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. + * @return the AvailabilityStatusPropertiesRecentlyResolvedState object itself. */ - public AvailabilityStatusPropertiesRecentlyResolved withUnavailabilitySummary(String unavailabilitySummary) { + public AvailabilityStatusPropertiesRecentlyResolvedState withUnavailabilitySummary(String unavailabilitySummary) { this.unavailabilitySummary = unavailabilitySummary; return this; } diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatuses.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatuses.java index 46e5d5a3507df..27d47eff5fa9b 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatuses.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatuses.java @@ -11,7 +11,8 @@ /** Resource collection API of AvailabilityStatuses. */ public interface AvailabilityStatuses { /** - * Lists the current availability status for all the resources in the subscription. + * Lists the current availability status for all the resources in the subscription. Use the nextLink property in the + * response to get the next page of availability statuses. * * @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. @@ -20,7 +21,8 @@ public interface AvailabilityStatuses { PagedIterable listBySubscriptionId(); /** - * Lists the current availability status for all the resources in the subscription. + * Lists the current availability status for all the resources in the subscription. Use the nextLink property in the + * response to get the next page of availability statuses. * * @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. @@ -34,7 +36,8 @@ public interface AvailabilityStatuses { PagedIterable listBySubscriptionId(String filter, String expand, Context context); /** - * Lists the current availability status for all the resources in the resource group. + * Lists the current availability status for all the resources in the resource group. Use the nextLink property in + * the response to get the next page of availability statuses. * * @param resourceGroupName The name of the resource group. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -45,7 +48,8 @@ public interface AvailabilityStatuses { PagedIterable listByResourceGroup(String resourceGroupName); /** - * Lists the current availability status for all the resources in the resource group. + * Lists the current availability status for all the resources in the resource group. Use the nextLink property in + * the response to get the next page of availability statuses. * * @param resourceGroupName The name of the resource group. * @param filter The filter to apply on the operation. For more information please see @@ -96,7 +100,8 @@ Response getByResourceWithResponse( String resourceUri, String filter, String expand, Context context); /** - * Lists all historical availability transitions and impacting events for a single resource. + * Lists all historical availability transitions and impacting events for a single resource. Use the nextLink + * property in the response to get the next page of availability status. * * @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 : @@ -111,7 +116,8 @@ Response getByResourceWithResponse( PagedIterable list(String resourceUri); /** - * Lists all historical availability transitions and impacting events for a single resource. + * Lists all historical availability transitions and impacting events for a single resource. Use the nextLink + * property in the response to get the next page of availability status. * * @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 : diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventsOperations.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ChildAvailabilityStatuses.java similarity index 54% rename from sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventsOperations.java rename to sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ChildAvailabilityStatuses.java index 88c5f62ebeae7..78ef65201fc1a 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventsOperations.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ChildAvailabilityStatuses.java @@ -5,64 +5,71 @@ 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 EventsOperations. */ -public interface EventsOperations { +/** Resource collection API of ChildAvailabilityStatuses. */ +public interface ChildAvailabilityStatuses { /** - * Lists current service health events in the subscription. + * 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 only support one nesting level resource types : + * /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 events operation response. + * @return current availability status for a single resource. */ - PagedIterable list(); + AvailabilityStatus getByResource(String resourceUri); /** - * Lists current service health events in the subscription. + * 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 only support one nesting level resource types : + * /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 view setting view=full expands the article parameters. + * @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 events operation response. + * @return current availability status for a single resource. */ - PagedIterable list(String filter, String view, Context context); + Response getByResourceWithResponse( + String resourceUri, String filter, String expand, Context context); /** - * Lists current service health events for given resource. + * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response + * to get the next page of availability status. * * @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 + * Currently the API only support one nesting level resource types : * /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 events operation response. + * @return the List availabilityStatus operation response. */ - PagedIterable listBySingleResource(String resourceUri); + PagedIterable list(String resourceUri); /** - * Lists current service health events for given resource. + * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response + * to get the next page of availability status. * * @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 + * Currently the API only support one nesting level resource types : * /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 view setting view=full expands the article parameters. + * @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 events operation response. + * @return the List availabilityStatus operation response. */ - PagedIterable listBySingleResource(String resourceUri, String filter, String view, Context context); + 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/ChildResources.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ChildResources.java new file mode 100644 index 0000000000000..f0bf7c038a5f5 --- /dev/null +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ChildResources.java @@ -0,0 +1,43 @@ +// 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.util.Context; + +/** Resource collection API of ChildResources. */ +public interface ChildResources { + /** + * Lists the all the children and its current health status for a parent resource. Use the nextLink property in the + * response to get the next page of children current health. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. + * Currently the API only support not nested parent resource type: + * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}. + * @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. + */ + PagedIterable list(String resourceUri); + + /** + * Lists the all the children and its current health status for a parent resource. Use the nextLink property in the + * response to get the next page of children current health. + * + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. + * Currently the API only support not nested parent resource type: + * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}. + * @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. + */ + 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/Event.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/Event.java deleted file mode 100644 index f4b96c35199d6..0000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/Event.java +++ /dev/null @@ -1,187 +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.EventInner; -import java.time.OffsetDateTime; -import java.util.List; - -/** An immutable client-side representation of Event. */ -public interface Event { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the eventType property: Type of event. - * - * @return the eventType value. - */ - EventTypeValues eventType(); - - /** - * Gets the eventSource property: Source of event. - * - * @return the eventSource value. - */ - EventSourceValues eventSource(); - - /** - * Gets the status property: Current status of event. - * - * @return the status value. - */ - EventStatusValues status(); - - /** - * Gets the title property: Title text of event. - * - * @return the title value. - */ - String title(); - - /** - * Gets the summary property: Summary text of event. - * - * @return the summary value. - */ - String summary(); - - /** - * Gets the headerProperty property: Header text of event. - * - * @return the headerProperty value. - */ - String headerProperty(); - - /** - * Gets the level property: Level of insight. - * - * @return the level value. - */ - LevelValues level(); - - /** - * Gets the eventLevel property: Level of event. - * - * @return the eventLevel value. - */ - EventLevelValues eventLevel(); - - /** - * Gets the article property: Article of event. - * - * @return the article value. - */ - EventPropertiesArticle article(); - - /** - * Gets the links property: Useful links of event. - * - * @return the links value. - */ - List links(); - - /** - * Gets the impactStartTime property: It provides the Timestamp for when the health impacting event started. - * - * @return the impactStartTime value. - */ - OffsetDateTime impactStartTime(); - - /** - * Gets the impactMitigationTime property: It provides the Timestamp for when the health impacting event resolved. - * - * @return the impactMitigationTime value. - */ - OffsetDateTime impactMitigationTime(); - - /** - * Gets the impact property: List services impacted by the service health event. - * - * @return the impact value. - */ - List impact(); - - /** - * Gets the recommendedActions property: Recommended actions of event. - * - * @return the recommendedActions value. - */ - EventPropertiesRecommendedActions recommendedActions(); - - /** - * Gets the faqs property: Frequently asked questions for the service health event. - * - * @return the faqs value. - */ - List faqs(); - - /** - * Gets the isHir property: It provides information if the event is High incident rate event or not. - * - * @return the isHir value. - */ - Boolean isHir(); - - /** - * Gets the enableMicrosoftSupport property: Tells if we want to enable or disable Microsoft Support for this event. - * - * @return the enableMicrosoftSupport value. - */ - Boolean enableMicrosoftSupport(); - - /** - * Gets the enableChatWithUs property: Tells if we want to enable or disable Microsoft Support for this event. - * - * @return the enableChatWithUs value. - */ - Boolean enableChatWithUs(); - - /** - * Gets the priority property: Priority level of the event. - * - * @return the priority value. - */ - Integer priority(); - - /** - * Gets the lastUpdateTime property: It provides the Timestamp for when the health impacting event was last updated. - * - * @return the lastUpdateTime value. - */ - OffsetDateTime lastUpdateTime(); - - /** - * Gets the hirStage property: Stage for HIR Document. - * - * @return the hirStage value. - */ - String hirStage(); - - /** - * Gets the inner com.azure.resourcemanager.resourcehealth.fluent.models.EventInner object. - * - * @return the inner object. - */ - EventInner innerModel(); -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventLevelValues.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventLevelValues.java deleted file mode 100644 index 5804000305d7c..0000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventLevelValues.java +++ /dev/null @@ -1,37 +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 EventLevelValues. */ -public final class EventLevelValues extends ExpandableStringEnum { - /** Static value Critical for EventLevelValues. */ - public static final EventLevelValues CRITICAL = fromString("Critical"); - - /** Static value Warning for EventLevelValues. */ - public static final EventLevelValues WARNING = fromString("Warning"); - - /** Static value Informational for EventLevelValues. */ - public static final EventLevelValues INFORMATIONAL = fromString("Informational"); - - /** - * Creates or finds a EventLevelValues from its string representation. - * - * @param name a name to look for. - * @return the corresponding EventLevelValues. - */ - @JsonCreator - public static EventLevelValues fromString(String name) { - return fromString(name, EventLevelValues.class); - } - - /** @return known EventLevelValues values. */ - public static Collection values() { - return values(EventLevelValues.class); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventPropertiesArticle.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventPropertiesArticle.java deleted file mode 100644 index 93ba0c58e0b72..0000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventPropertiesArticle.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.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Article of event. */ -@Fluent -public final class EventPropertiesArticle { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EventPropertiesArticle.class); - - /* - * Article content of event. - */ - @JsonProperty(value = "articleContent") - private String articleContent; - - /** - * Get the articleContent property: Article content of event. - * - * @return the articleContent value. - */ - public String articleContent() { - return this.articleContent; - } - - /** - * Set the articleContent property: Article content of event. - * - * @param articleContent the articleContent value to set. - * @return the EventPropertiesArticle object itself. - */ - public EventPropertiesArticle withArticleContent(String articleContent) { - this.articleContent = articleContent; - 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/EventPropertiesRecommendedActions.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventPropertiesRecommendedActions.java deleted file mode 100644 index 6a658d9ec16b5..0000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventPropertiesRecommendedActions.java +++ /dev/null @@ -1,106 +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.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Recommended actions of event. */ -@Fluent -public final class EventPropertiesRecommendedActions { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EventPropertiesRecommendedActions.class); - - /* - * Recommended action title for the service health event. - */ - @JsonProperty(value = "message") - private String message; - - /* - * Recommended actions for the service health event. - */ - @JsonProperty(value = "actions") - private List actions; - - /* - * Recommended action locale for the service health event. - */ - @JsonProperty(value = "localeCode") - private String localeCode; - - /** - * Get the message property: Recommended action title for the service health event. - * - * @return the message value. - */ - public String message() { - return this.message; - } - - /** - * Set the message property: Recommended action title for the service health event. - * - * @param message the message value to set. - * @return the EventPropertiesRecommendedActions object itself. - */ - public EventPropertiesRecommendedActions withMessage(String message) { - this.message = message; - return this; - } - - /** - * Get the actions property: Recommended actions for the service health event. - * - * @return the actions value. - */ - public List actions() { - return this.actions; - } - - /** - * Set the actions property: Recommended actions for the service health event. - * - * @param actions the actions value to set. - * @return the EventPropertiesRecommendedActions object itself. - */ - public EventPropertiesRecommendedActions withActions(List actions) { - this.actions = actions; - return this; - } - - /** - * Get the localeCode property: Recommended action locale for the service health event. - * - * @return the localeCode value. - */ - public String localeCode() { - return this.localeCode; - } - - /** - * Set the localeCode property: Recommended action locale for the service health event. - * - * @param localeCode the localeCode value to set. - * @return the EventPropertiesRecommendedActions object itself. - */ - public EventPropertiesRecommendedActions withLocaleCode(String localeCode) { - this.localeCode = localeCode; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (actions() != null) { - actions().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventPropertiesRecommendedActionsItem.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventPropertiesRecommendedActionsItem.java deleted file mode 100644 index 31dead64d9eef..0000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventPropertiesRecommendedActionsItem.java +++ /dev/null @@ -1,76 +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.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Recommended action for the service health event. */ -@Fluent -public final class EventPropertiesRecommendedActionsItem { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EventPropertiesRecommendedActionsItem.class); - - /* - * Recommended action group Id for the service health event. - */ - @JsonProperty(value = "groupId") - private Integer groupId; - - /* - * Recommended action text - */ - @JsonProperty(value = "actionText") - private String actionText; - - /** - * Get the groupId property: Recommended action group Id for the service health event. - * - * @return the groupId value. - */ - public Integer groupId() { - return this.groupId; - } - - /** - * Set the groupId property: Recommended action group Id for the service health event. - * - * @param groupId the groupId value to set. - * @return the EventPropertiesRecommendedActionsItem object itself. - */ - public EventPropertiesRecommendedActionsItem withGroupId(Integer groupId) { - this.groupId = groupId; - return this; - } - - /** - * Get the actionText property: Recommended action text. - * - * @return the actionText value. - */ - public String actionText() { - return this.actionText; - } - - /** - * Set the actionText property: Recommended action text. - * - * @param actionText the actionText value to set. - * @return the EventPropertiesRecommendedActionsItem object itself. - */ - public EventPropertiesRecommendedActionsItem withActionText(String actionText) { - this.actionText = actionText; - 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/EventSourceValues.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventSourceValues.java deleted file mode 100644 index eb584c7223713..0000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventSourceValues.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 EventSourceValues. */ -public final class EventSourceValues extends ExpandableStringEnum { - /** Static value ResourceHealth for EventSourceValues. */ - public static final EventSourceValues RESOURCE_HEALTH = fromString("ResourceHealth"); - - /** Static value ServiceHealth for EventSourceValues. */ - public static final EventSourceValues SERVICE_HEALTH = fromString("ServiceHealth"); - - /** - * Creates or finds a EventSourceValues from its string representation. - * - * @param name a name to look for. - * @return the corresponding EventSourceValues. - */ - @JsonCreator - public static EventSourceValues fromString(String name) { - return fromString(name, EventSourceValues.class); - } - - /** @return known EventSourceValues values. */ - public static Collection values() { - return values(EventSourceValues.class); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventStatusValues.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventStatusValues.java deleted file mode 100644 index a5811edf1fe57..0000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventStatusValues.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 EventStatusValues. */ -public final class EventStatusValues extends ExpandableStringEnum { - /** Static value Active for EventStatusValues. */ - public static final EventStatusValues ACTIVE = fromString("Active"); - - /** Static value Resolved for EventStatusValues. */ - public static final EventStatusValues RESOLVED = fromString("Resolved"); - - /** - * Creates or finds a EventStatusValues from its string representation. - * - * @param name a name to look for. - * @return the corresponding EventStatusValues. - */ - @JsonCreator - public static EventStatusValues fromString(String name) { - return fromString(name, EventStatusValues.class); - } - - /** @return known EventStatusValues values. */ - public static Collection values() { - return values(EventStatusValues.class); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventTypeValues.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventTypeValues.java deleted file mode 100644 index df3dc0f57aaa8..0000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventTypeValues.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 EventTypeValues. */ -public final class EventTypeValues extends ExpandableStringEnum { - /** Static value ServiceIssue for EventTypeValues. */ - public static final EventTypeValues SERVICE_ISSUE = fromString("ServiceIssue"); - - /** Static value PlannedMaintenance for EventTypeValues. */ - public static final EventTypeValues PLANNED_MAINTENANCE = fromString("PlannedMaintenance"); - - /** Static value HealthAdvisory for EventTypeValues. */ - public static final EventTypeValues HEALTH_ADVISORY = fromString("HealthAdvisory"); - - /** Static value RCA for EventTypeValues. */ - public static final EventTypeValues RCA = fromString("RCA"); - - /** - * Creates or finds a EventTypeValues from its string representation. - * - * @param name a name to look for. - * @return the corresponding EventTypeValues. - */ - @JsonCreator - public static EventTypeValues fromString(String name) { - return fromString(name, EventTypeValues.class); - } - - /** @return known EventTypeValues values. */ - public static Collection values() { - return values(EventTypeValues.class); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/Events.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/Events.java deleted file mode 100644 index 49f4b4417b2de..0000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/Events.java +++ /dev/null @@ -1,87 +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.EventInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The List events operation response. */ -@Fluent -public final class Events { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Events.class); - - /* - * The list of event. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * The URI to fetch the next page of events. Call ListNext() with this URI - * to fetch the next page of events. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The list of event. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of event. - * - * @param value the value value to set. - * @return the Events object itself. - */ - public Events withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI to fetch the next page of events. Call ListNext() with this URI to fetch the - * next page of events. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URI to fetch the next page of events. Call ListNext() with this URI to fetch the - * next page of events. - * - * @param nextLink the nextLink value to set. - * @return the Events object itself. - */ - public Events 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 Events")); - } else { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/Faq.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/Faq.java deleted file mode 100644 index 4f3feb242b1b7..0000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/Faq.java +++ /dev/null @@ -1,102 +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.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Frequently asked question for the service health event. */ -@Fluent -public final class Faq { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Faq.class); - - /* - * FAQ question for the service health event. - */ - @JsonProperty(value = "question") - private String question; - - /* - * FAQ answer for the service health event. - */ - @JsonProperty(value = "answer") - private String answer; - - /* - * FAQ locale for the service health event. - */ - @JsonProperty(value = "localeCode") - private String localeCode; - - /** - * Get the question property: FAQ question for the service health event. - * - * @return the question value. - */ - public String question() { - return this.question; - } - - /** - * Set the question property: FAQ question for the service health event. - * - * @param question the question value to set. - * @return the Faq object itself. - */ - public Faq withQuestion(String question) { - this.question = question; - return this; - } - - /** - * Get the answer property: FAQ answer for the service health event. - * - * @return the answer value. - */ - public String answer() { - return this.answer; - } - - /** - * Set the answer property: FAQ answer for the service health event. - * - * @param answer the answer value to set. - * @return the Faq object itself. - */ - public Faq withAnswer(String answer) { - this.answer = answer; - return this; - } - - /** - * Get the localeCode property: FAQ locale for the service health event. - * - * @return the localeCode value. - */ - public String localeCode() { - return this.localeCode; - } - - /** - * Set the localeCode property: FAQ locale for the service health event. - * - * @param localeCode the localeCode value to set. - * @return the Faq object itself. - */ - public Faq withLocaleCode(String localeCode) { - this.localeCode = localeCode; - 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/Impact.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/Impact.java deleted file mode 100644 index 9a579d91c8f64..0000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/Impact.java +++ /dev/null @@ -1,80 +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.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Azure service impacted by the service health event. */ -@Fluent -public final class Impact { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Impact.class); - - /* - * Impacted service name. - */ - @JsonProperty(value = "impactedService") - private String impactedService; - - /* - * List regions impacted by the service health event. - */ - @JsonProperty(value = "impactedRegions") - private List impactedRegions; - - /** - * Get the impactedService property: Impacted service name. - * - * @return the impactedService value. - */ - public String impactedService() { - return this.impactedService; - } - - /** - * Set the impactedService property: Impacted service name. - * - * @param impactedService the impactedService value to set. - * @return the Impact object itself. - */ - public Impact withImpactedService(String impactedService) { - this.impactedService = impactedService; - return this; - } - - /** - * Get the impactedRegions property: List regions impacted by the service health event. - * - * @return the impactedRegions value. - */ - public List impactedRegions() { - return this.impactedRegions; - } - - /** - * Set the impactedRegions property: List regions impacted by the service health event. - * - * @param impactedRegions the impactedRegions value to set. - * @return the Impact object itself. - */ - public Impact withImpactedRegions(List impactedRegions) { - this.impactedRegions = impactedRegions; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (impactedRegions() != null) { - impactedRegions().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ImpactedServiceRegion.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ImpactedServiceRegion.java deleted file mode 100644 index f599df0d469fa..0000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ImpactedServiceRegion.java +++ /dev/null @@ -1,160 +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.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** Azure region impacted by the service health event. */ -@Fluent -public final class ImpactedServiceRegion { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ImpactedServiceRegion.class); - - /* - * Impacted region name. - */ - @JsonProperty(value = "impactedRegion") - private String impactedRegion; - - /* - * Current status of event in the region. - */ - @JsonProperty(value = "status") - private EventStatusValues status; - - /* - * List subscription impacted by the service health event. - */ - @JsonProperty(value = "impactedSubscriptions") - private List impactedSubscriptions; - - /* - * It provides the Timestamp for when the last update for the service - * health event. - */ - @JsonProperty(value = "lastUpdateTime") - private OffsetDateTime lastUpdateTime; - - /* - * List of updates for given service health event. - */ - @JsonProperty(value = "updates") - private List updates; - - /** - * Get the impactedRegion property: Impacted region name. - * - * @return the impactedRegion value. - */ - public String impactedRegion() { - return this.impactedRegion; - } - - /** - * Set the impactedRegion property: Impacted region name. - * - * @param impactedRegion the impactedRegion value to set. - * @return the ImpactedServiceRegion object itself. - */ - public ImpactedServiceRegion withImpactedRegion(String impactedRegion) { - this.impactedRegion = impactedRegion; - return this; - } - - /** - * Get the status property: Current status of event in the region. - * - * @return the status value. - */ - public EventStatusValues status() { - return this.status; - } - - /** - * Set the status property: Current status of event in the region. - * - * @param status the status value to set. - * @return the ImpactedServiceRegion object itself. - */ - public ImpactedServiceRegion withStatus(EventStatusValues status) { - this.status = status; - return this; - } - - /** - * Get the impactedSubscriptions property: List subscription impacted by the service health event. - * - * @return the impactedSubscriptions value. - */ - public List impactedSubscriptions() { - return this.impactedSubscriptions; - } - - /** - * Set the impactedSubscriptions property: List subscription impacted by the service health event. - * - * @param impactedSubscriptions the impactedSubscriptions value to set. - * @return the ImpactedServiceRegion object itself. - */ - public ImpactedServiceRegion withImpactedSubscriptions(List impactedSubscriptions) { - this.impactedSubscriptions = impactedSubscriptions; - return this; - } - - /** - * Get the lastUpdateTime property: It provides the Timestamp for when the last update for the service health event. - * - * @return the lastUpdateTime value. - */ - public OffsetDateTime lastUpdateTime() { - return this.lastUpdateTime; - } - - /** - * Set the lastUpdateTime property: It provides the Timestamp for when the last update for the service health event. - * - * @param lastUpdateTime the lastUpdateTime value to set. - * @return the ImpactedServiceRegion object itself. - */ - public ImpactedServiceRegion withLastUpdateTime(OffsetDateTime lastUpdateTime) { - this.lastUpdateTime = lastUpdateTime; - return this; - } - - /** - * Get the updates property: List of updates for given service health event. - * - * @return the updates value. - */ - public List updates() { - return this.updates; - } - - /** - * Set the updates property: List of updates for given service health event. - * - * @param updates the updates value to set. - * @return the ImpactedServiceRegion object itself. - */ - public ImpactedServiceRegion withUpdates(List updates) { - this.updates = updates; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (updates() != null) { - updates().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/LevelValues.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/LevelValues.java deleted file mode 100644 index 0c05f1be52104..0000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/LevelValues.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 LevelValues. */ -public final class LevelValues extends ExpandableStringEnum { - /** Static value Critical for LevelValues. */ - public static final LevelValues CRITICAL = fromString("Critical"); - - /** Static value Warning for LevelValues. */ - public static final LevelValues WARNING = fromString("Warning"); - - /** - * Creates or finds a LevelValues from its string representation. - * - * @param name a name to look for. - * @return the corresponding LevelValues. - */ - @JsonCreator - public static LevelValues fromString(String name) { - return fromString(name, LevelValues.class); - } - - /** @return known LevelValues values. */ - public static Collection values() { - return values(LevelValues.class); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/Link.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/Link.java deleted file mode 100644 index a5b0005a10b13..0000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/Link.java +++ /dev/null @@ -1,166 +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.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Useful links for service health event. */ -@Fluent -public final class Link { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Link.class); - - /* - * Type of link. - */ - @JsonProperty(value = "type") - private LinkTypeValues type; - - /* - * Display text of link. - */ - @JsonProperty(value = "displayText") - private LinkDisplayText displayText; - - /* - * It provides the name of portal extension to produce link for given - * service health event. - */ - @JsonProperty(value = "extensionName") - private String extensionName; - - /* - * It provides the name of portal extension blade to produce link for given - * service health event. - */ - @JsonProperty(value = "bladeName") - private String bladeName; - - /* - * It provides a map of parameter name and value for portal extension blade - * to produce lik for given service health event. - */ - @JsonProperty(value = "parameters") - private Object parameters; - - /** - * Get the type property: Type of link. - * - * @return the type value. - */ - public LinkTypeValues type() { - return this.type; - } - - /** - * Set the type property: Type of link. - * - * @param type the type value to set. - * @return the Link object itself. - */ - public Link withType(LinkTypeValues type) { - this.type = type; - return this; - } - - /** - * Get the displayText property: Display text of link. - * - * @return the displayText value. - */ - public LinkDisplayText displayText() { - return this.displayText; - } - - /** - * Set the displayText property: Display text of link. - * - * @param displayText the displayText value to set. - * @return the Link object itself. - */ - public Link withDisplayText(LinkDisplayText displayText) { - this.displayText = displayText; - return this; - } - - /** - * Get the extensionName property: It provides the name of portal extension to produce link for given service health - * event. - * - * @return the extensionName value. - */ - public String extensionName() { - return this.extensionName; - } - - /** - * Set the extensionName property: It provides the name of portal extension to produce link for given service health - * event. - * - * @param extensionName the extensionName value to set. - * @return the Link object itself. - */ - public Link withExtensionName(String extensionName) { - this.extensionName = extensionName; - return this; - } - - /** - * Get the bladeName property: It provides the name of portal extension blade to produce link for given service - * health event. - * - * @return the bladeName value. - */ - public String bladeName() { - return this.bladeName; - } - - /** - * Set the bladeName property: It provides the name of portal extension blade to produce link for given service - * health event. - * - * @param bladeName the bladeName value to set. - * @return the Link object itself. - */ - public Link withBladeName(String bladeName) { - this.bladeName = bladeName; - return this; - } - - /** - * Get the parameters property: It provides a map of parameter name and value for portal extension blade to produce - * lik for given service health event. - * - * @return the parameters value. - */ - public Object parameters() { - return this.parameters; - } - - /** - * Set the parameters property: It provides a map of parameter name and value for portal extension blade to produce - * lik for given service health event. - * - * @param parameters the parameters value to set. - * @return the Link object itself. - */ - public Link withParameters(Object parameters) { - this.parameters = parameters; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (displayText() != null) { - displayText().validate(); - } - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/LinkDisplayText.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/LinkDisplayText.java deleted file mode 100644 index ac26c9eec3c1e..0000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/LinkDisplayText.java +++ /dev/null @@ -1,76 +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.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Display text of link. */ -@Fluent -public final class LinkDisplayText { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LinkDisplayText.class); - - /* - * Display text of link. - */ - @JsonProperty(value = "value") - private String value; - - /* - * Localized display text of link. - */ - @JsonProperty(value = "localizedValue") - private String localizedValue; - - /** - * Get the value property: Display text of link. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Set the value property: Display text of link. - * - * @param value the value value to set. - * @return the LinkDisplayText object itself. - */ - public LinkDisplayText withValue(String value) { - this.value = value; - return this; - } - - /** - * Get the localizedValue property: Localized display text of link. - * - * @return the localizedValue value. - */ - public String localizedValue() { - return this.localizedValue; - } - - /** - * Set the localizedValue property: Localized display text of link. - * - * @param localizedValue the localizedValue value to set. - * @return the LinkDisplayText object itself. - */ - public LinkDisplayText withLocalizedValue(String localizedValue) { - this.localizedValue = localizedValue; - 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/LinkTypeValues.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/LinkTypeValues.java deleted file mode 100644 index 7abfce67e11b1..0000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/LinkTypeValues.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 LinkTypeValues. */ -public final class LinkTypeValues extends ExpandableStringEnum { - /** Static value Button for LinkTypeValues. */ - public static final LinkTypeValues BUTTON = fromString("Button"); - - /** Static value Hyperlink for LinkTypeValues. */ - public static final LinkTypeValues HYPERLINK = fromString("Hyperlink"); - - /** - * Creates or finds a LinkTypeValues from its string representation. - * - * @param name a name to look for. - * @return the corresponding LinkTypeValues. - */ - @JsonCreator - public static LinkTypeValues fromString(String name) { - return fromString(name, LinkTypeValues.class); - } - - /** @return known LinkTypeValues values. */ - public static Collection values() { - return values(LinkTypeValues.class); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/MetadataEntity.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/MetadataEntity.java deleted file mode 100644 index 3f53757da0fb3..0000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/MetadataEntity.java +++ /dev/null @@ -1,135 +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.annotation.JsonFlatten; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The metadata entity contract. */ -@JsonFlatten -@Fluent -public class MetadataEntity extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MetadataEntity.class); - - /* - * The display name. - */ - @JsonProperty(value = "properties.displayName") - private String displayName; - - /* - * The list of keys on which this entity depends on. - */ - @JsonProperty(value = "properties.dependsOn") - private List dependsOn; - - /* - * The list of scenarios applicable to this metadata entity. - */ - @JsonProperty(value = "properties.applicableScenarios") - private List applicableScenarios; - - /* - * The list of supported values. - */ - @JsonProperty(value = "properties.supportedValues") - private List supportedValues; - - /** - * Get the displayName property: The display name. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: The display name. - * - * @param displayName the displayName value to set. - * @return the MetadataEntity object itself. - */ - public MetadataEntity withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the dependsOn property: The list of keys on which this entity depends on. - * - * @return the dependsOn value. - */ - public List dependsOn() { - return this.dependsOn; - } - - /** - * Set the dependsOn property: The list of keys on which this entity depends on. - * - * @param dependsOn the dependsOn value to set. - * @return the MetadataEntity object itself. - */ - public MetadataEntity withDependsOn(List dependsOn) { - this.dependsOn = dependsOn; - return this; - } - - /** - * Get the applicableScenarios property: The list of scenarios applicable to this metadata entity. - * - * @return the applicableScenarios value. - */ - public List applicableScenarios() { - return this.applicableScenarios; - } - - /** - * Set the applicableScenarios property: The list of scenarios applicable to this metadata entity. - * - * @param applicableScenarios the applicableScenarios value to set. - * @return the MetadataEntity object itself. - */ - public MetadataEntity withApplicableScenarios(List applicableScenarios) { - this.applicableScenarios = applicableScenarios; - return this; - } - - /** - * Get the supportedValues property: The list of supported values. - * - * @return the supportedValues value. - */ - public List supportedValues() { - return this.supportedValues; - } - - /** - * Set the supportedValues property: The list of supported values. - * - * @param supportedValues the supportedValues value to set. - * @return the MetadataEntity object itself. - */ - public MetadataEntity withSupportedValues(List supportedValues) { - this.supportedValues = supportedValues; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (supportedValues() != null) { - supportedValues().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/MetadataSupportedValueDetail.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/MetadataSupportedValueDetail.java deleted file mode 100644 index 8a7b641c530aa..0000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/MetadataSupportedValueDetail.java +++ /dev/null @@ -1,76 +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.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The metadata supported value detail. */ -@Fluent -public final class MetadataSupportedValueDetail { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MetadataSupportedValueDetail.class); - - /* - * The id. - */ - @JsonProperty(value = "id") - private String id; - - /* - * The display name. - */ - @JsonProperty(value = "displayName") - private String displayName; - - /** - * Get the id property: The id. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: The id. - * - * @param id the id value to set. - * @return the MetadataSupportedValueDetail object itself. - */ - public MetadataSupportedValueDetail withId(String id) { - this.id = id; - return this; - } - - /** - * Get the displayName property: The display name. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: The display name. - * - * @param displayName the displayName value to set. - * @return the MetadataSupportedValueDetail object itself. - */ - public MetadataSupportedValueDetail withDisplayName(String displayName) { - this.displayName = displayName; - 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/ReasonChronicityTypes.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ReasonChronicityTypes.java index e3ff6160b6494..67f8689761649 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ReasonChronicityTypes.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ReasonChronicityTypes.java @@ -4,31 +4,44 @@ package com.azure.resourcemanager.resourcehealth.models; -import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonValue; /** Defines values for ReasonChronicityTypes. */ -public final class ReasonChronicityTypes extends ExpandableStringEnum { - /** Static value Transient for ReasonChronicityTypes. */ - public static final ReasonChronicityTypes TRANSIENT = fromString("Transient"); +public enum ReasonChronicityTypes { + /** Enum value Transient. */ + TRANSIENT("Transient"), - /** Static value Persistent for ReasonChronicityTypes. */ - public static final ReasonChronicityTypes PERSISTENT = fromString("Persistent"); + /** Enum value Persistent. */ + PERSISTENT("Persistent"); + + /** The actual serialized value for a ReasonChronicityTypes instance. */ + private final String value; + + ReasonChronicityTypes(String value) { + this.value = value; + } /** - * Creates or finds a ReasonChronicityTypes from its string representation. + * Parses a serialized value to a ReasonChronicityTypes instance. * - * @param name a name to look for. - * @return the corresponding ReasonChronicityTypes. + * @param value the serialized value to parse. + * @return the parsed ReasonChronicityTypes object, or null if unable to parse. */ @JsonCreator - public static ReasonChronicityTypes fromString(String name) { - return fromString(name, ReasonChronicityTypes.class); + public static ReasonChronicityTypes fromString(String value) { + ReasonChronicityTypes[] items = ReasonChronicityTypes.values(); + for (ReasonChronicityTypes item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; } - /** @return known ReasonChronicityTypes values. */ - public static Collection values() { - return values(ReasonChronicityTypes.class); + @JsonValue + @Override + public String toString() { + return this.value; } } diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/Scenario.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/Scenario.java deleted file mode 100644 index 4f49b6a0b2de5..0000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/Scenario.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.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for Scenario. */ -public final class Scenario extends ExpandableStringEnum { - /** Static value Alerts for Scenario. */ - public static final Scenario ALERTS = fromString("Alerts"); - - /** - * Creates or finds a Scenario from its string representation. - * - * @param name a name to look for. - * @return the corresponding Scenario. - */ - @JsonCreator - public static Scenario fromString(String name) { - return fromString(name, Scenario.class); - } - - /** @return known Scenario values. */ - public static Collection values() { - return values(Scenario.class); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/Update.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/Update.java deleted file mode 100644 index 799de4d3857ad..0000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/Update.java +++ /dev/null @@ -1,78 +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.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Update for service health event. */ -@Fluent -public final class Update { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Update.class); - - /* - * Summary text for the given update for the service health event. - */ - @JsonProperty(value = "summary") - private String summary; - - /* - * It provides the Timestamp for the given update for the service health - * event. - */ - @JsonProperty(value = "updateDateTime") - private OffsetDateTime updateDateTime; - - /** - * Get the summary property: Summary text for the given update for the service health event. - * - * @return the summary value. - */ - public String summary() { - return this.summary; - } - - /** - * Set the summary property: Summary text for the given update for the service health event. - * - * @param summary the summary value to set. - * @return the Update object itself. - */ - public Update withSummary(String summary) { - this.summary = summary; - return this; - } - - /** - * Get the updateDateTime property: It provides the Timestamp for the given update for the service health event. - * - * @return the updateDateTime value. - */ - public OffsetDateTime updateDateTime() { - return this.updateDateTime; - } - - /** - * Set the updateDateTime property: It provides the Timestamp for the given update for the service health event. - * - * @param updateDateTime the updateDateTime value to set. - * @return the Update object itself. - */ - public Update withUpdateDateTime(OffsetDateTime updateDateTime) { - this.updateDateTime = updateDateTime; - 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/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 new file mode 100644 index 0000000000000..a3d6097894e3c --- /dev/null +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/AvailabilityStatusesGetByResourceSamples.java @@ -0,0 +1,25 @@ +// 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/2017-07-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 new file mode 100644 index 0000000000000..01b3e171ed71f --- /dev/null +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/AvailabilityStatusesListByResourceGroupSamples.java @@ -0,0 +1,24 @@ +// 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/2017-07-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 new file mode 100644 index 0000000000000..fee22b34a936b --- /dev/null +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/AvailabilityStatusesListBySubscriptionIdSamples.java @@ -0,0 +1,23 @@ +// 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/2017-07-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 new file mode 100644 index 0000000000000..516fb52307b42 --- /dev/null +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/AvailabilityStatusesListSamples.java @@ -0,0 +1,23 @@ +// 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/2017-07-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/ChildAvailabilityStatusesGetByResourceSamples.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/ChildAvailabilityStatusesGetByResourceSamples.java new file mode 100644 index 0000000000000..7c8c1a5391115 --- /dev/null +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/ChildAvailabilityStatusesGetByResourceSamples.java @@ -0,0 +1,25 @@ +// 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 ChildAvailabilityStatuses GetByResource. */ +public final class ChildAvailabilityStatusesGetByResourceSamples { + /* + * x-ms-original-file: specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2017-07-01/examples/ChildAvailabilityStatus_GetByResource.json + */ + /** + * Sample code: GetCurrentHealthByResource. + * + * @param manager Entry point to ResourceHealthManager. + */ + public static void getCurrentHealthByResource( + com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { + manager + .childAvailabilityStatuses() + .getByResourceWithResponse("resourceUri", null, "recommendedactions", Context.NONE); + } +} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/ChildAvailabilityStatusesListSamples.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/ChildAvailabilityStatusesListSamples.java new file mode 100644 index 0000000000000..666649487cb57 --- /dev/null +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/ChildAvailabilityStatusesListSamples.java @@ -0,0 +1,23 @@ +// 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 ChildAvailabilityStatuses List. */ +public final class ChildAvailabilityStatusesListSamples { + /* + * x-ms-original-file: specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2017-07-01/examples/ChildAvailabilityStatuses_List.json + */ + /** + * Sample code: GetHealthHistoryByResource. + * + * @param manager Entry point to ResourceHealthManager. + */ + public static void getHealthHistoryByResource( + com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { + manager.childAvailabilityStatuses().list("resourceUri", null, null, Context.NONE); + } +} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/ChildResourcesListSamples.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/ChildResourcesListSamples.java new file mode 100644 index 0000000000000..5b79839299344 --- /dev/null +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/ChildResourcesListSamples.java @@ -0,0 +1,23 @@ +// 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 ChildResources List. */ +public final class ChildResourcesListSamples { + /* + * x-ms-original-file: specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2017-07-01/examples/ChildResources_List.json + */ + /** + * Sample code: GetHealthHistoryByResource. + * + * @param manager Entry point to ResourceHealthManager. + */ + public static void getHealthHistoryByResource( + com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { + manager.childResources().list("resourceUri", null, null, Context.NONE); + } +} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/EmergingIssuesGetSamples.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/EmergingIssuesGetSamples.java new file mode 100644 index 0000000000000..348a7339f0b19 --- /dev/null +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/EmergingIssuesGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourcehealth.generated; + +import com.azure.core.util.Context; + +/** Samples for EmergingIssues Get. */ +public final class EmergingIssuesGetSamples { + /* + * x-ms-original-file: specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2017-07-01/examples/EmergingIssues_Get.json + */ + /** + * Sample code: GetEmergingIssues. + * + * @param manager Entry point to ResourceHealthManager. + */ + public static void getEmergingIssues(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { + manager.emergingIssues().getWithResponse(Context.NONE); + } +} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/EmergingIssuesListSamples.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/EmergingIssuesListSamples.java new file mode 100644 index 0000000000000..79674975fa4c5 --- /dev/null +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/EmergingIssuesListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourcehealth.generated; + +import com.azure.core.util.Context; + +/** Samples for EmergingIssues List. */ +public final class EmergingIssuesListSamples { + /* + * x-ms-original-file: specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2017-07-01/examples/EmergingIssues_List.json + */ + /** + * Sample code: GetEmergingIssues. + * + * @param manager Entry point to ResourceHealthManager. + */ + public static void getEmergingIssues(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { + manager.emergingIssues().list(Context.NONE); + } +}