From 799f6dc9a04968cea1b4d14d3485f0c315744cce Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 13 May 2025 23:15:16 +0000 Subject: [PATCH] CodeGen from PR 34658 in Azure/azure-rest-api-specs Merge 81b4da1586c23826c4c60ac46347c475314fce9b into edbd28afa64f2782a12786c7dbf4fdebe0d3cf49 --- .../CHANGELOG.md | 152 ++++- .../README.md | 8 +- .../SAMPLE.md | 426 +++++++------- .../pom.xml | 3 +- .../resourcehealth/ResourceHealthManager.java | 9 +- .../fluent/EventOperationsClient.java | 20 +- .../fluent/EventsOperationsClient.java | 8 +- .../models/EventImpactedResourceInner.java | 45 -- .../EventImpactedResourceProperties.java | 80 --- .../fluent/models/EventInner.java | 147 ++--- .../fluent/models/EventProperties.java | 195 +++---- .../AvailabilityStatusesClientImpl.java | 543 ++++++++++++------ .../ChildAvailabilityStatusesClientImpl.java | 208 ++++--- .../ChildResourcesClientImpl.java | 154 +++-- .../EmergingIssuesClientImpl.java | 167 ++++-- .../EventImpactedResourceImpl.java | 20 - .../implementation/EventImpl.java | 26 +- .../EventOperationsClientImpl.java | 268 ++++----- .../EventsOperationsClientImpl.java | 481 +++++++++++----- .../ImpactedResourcesClientImpl.java | 451 +++++++++------ .../implementation/MetadatasClientImpl.java | 163 ++++-- .../MicrosoftResourceHealthImpl.java | 22 +- .../implementation/OperationsClientImpl.java | 38 +- ...tyAdvisoryImpactedResourcesClientImpl.java | 324 +++++++---- .../resourcehealth/models/Event.java | 53 +- .../models/EventImpactedResource.java | 35 -- .../models/EventOperations.java | 20 +- .../models/EventPropertiesArticle.java | 4 +- .../models/EventSubTypeValues.java | 46 -- .../models/EventsOperations.java | 8 +- .../resourcehealth/models/Impact.java | 30 + .../models/ImpactedServiceRegion.java | 9 +- .../resourcehealth/models/Link.java | 4 +- .../models/MetadataSupportedValueDetail.java | 62 +- .../resourcehealth/models/Update.java | 60 ++ ...-resourcemanager-resourcehealth.properties | 1 + ...ilabilityStatusesGetByResourceSamples.java | 2 +- ...ityStatusesListByResourceGroupSamples.java | 2 +- ...tyStatusesListBySubscriptionIdSamples.java | 2 +- .../AvailabilityStatusesListSamples.java | 2 +- ...ilabilityStatusesGetByResourceSamples.java | 2 +- .../ChildAvailabilityStatusesListSamples.java | 2 +- .../generated/ChildResourcesListSamples.java | 2 +- .../generated/EmergingIssuesGetSamples.java | 2 +- .../generated/EmergingIssuesListSamples.java | 2 +- ...sBySubscriptionIdAndTrackingIdSamples.java | 2 +- ...DetailsByTenantIdAndTrackingIdSamples.java | 2 +- ...tBySubscriptionIdAndTrackingIdSamples.java | 4 +- ...tionGetByTenantIdAndTrackingIdSamples.java | 2 +- ...sOperationListBySingleResourceSamples.java | 2 +- .../EventsOperationListByTenantIdSamples.java | 2 +- .../generated/EventsOperationListSamples.java | 4 +- ...ImpactedResourcesGetByTenantIdSamples.java | 2 +- .../ImpactedResourcesGetSamples.java | 2 +- ...ListBySubscriptionIdAndEventIdSamples.java | 2 +- ...ourcesListByTenantIdAndEventIdSamples.java | 2 +- .../generated/MetadataGetEntitySamples.java | 2 +- .../generated/MetadataListSamples.java | 4 +- .../generated/OperationsListSamples.java | 4 +- ...ListBySubscriptionIdAndEventIdSamples.java | 2 +- ...ourcesListByTenantIdAndEventIdSamples.java | 2 +- .../AvailabilityStatusInnerTests.java | 184 ------ .../AvailabilityStatusListResultTests.java | 270 --------- ...StatusPropertiesRecentlyResolvedTests.java | 34 -- .../AvailabilityStatusPropertiesTests.java | 142 ----- ...sesGetByResourceWithResponseMockTests.java | 85 --- ...yStatusesListByResourceGroupMockTests.java | 101 ---- ...StatusesListBySubscriptionIdMockTests.java | 100 ---- .../AvailabilityStatusesListMockTests.java | 101 ---- ...sesGetByResourceWithResponseMockTests.java | 86 --- ...hildAvailabilityStatusesListMockTests.java | 100 ---- .../ChildResourcesListMockTests.java | 101 ---- .../generated/EmergingIssueImpactTests.java | 37 -- .../EmergingIssueListResultTests.java | 239 -------- .../generated/EmergingIssueTests.java | 95 --- .../EmergingIssuesGetResultInnerTests.java | 128 ----- ...mergingIssuesGetWithResponseMockTests.java | 58 -- .../EmergingIssuesListMockTests.java | 59 -- ...tPropertiesAdditionalInformationTests.java | 25 - .../EventPropertiesArticleTests.java | 31 - ...PropertiesRecommendedActionsItemTests.java | 29 - .../resourcehealth/generated/ImpactTests.java | 56 -- .../generated/ImpactedRegionTests.java | 27 - .../generated/ImpactedServiceRegionTests.java | 51 -- .../generated/LinkDisplayTextTests.java | 27 - .../resourcehealth/generated/LinkTests.java | 40 -- .../generated/MetadataEntityInnerTests.java | 44 -- .../MetadataEntityListResultTests.java | 95 --- .../MetadataEntityPropertiesTests.java | 48 -- .../MetadataSupportedValueDetailTests.java | 33 -- ...tadatasGetEntityWithResponseMockTests.java | 44 -- .../generated/MetadatasListMockTests.java | 45 -- .../generated/OperationDisplayTests.java | 35 -- .../OperationListResultInnerTests.java | 52 -- .../generated/OperationTests.java | 39 -- .../OperationsListWithResponseMockTests.java | 42 -- .../generated/RecommendedActionTests.java | 32 -- ...ImpactingEventIncidentPropertiesTests.java | 37 -- .../ServiceImpactingEventStatusTests.java | 25 - .../generated/ServiceImpactingEventTests.java | 51 -- .../generated/StatusActiveEventTests.java | 81 --- .../generated/StatusBannerTests.java | 36 -- .../resourcehealth/generated/UpdateTests.java | 29 - 103 files changed, 2562 insertions(+), 4760 deletions(-) delete mode 100644 sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventSubTypeValues.java create mode 100644 sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/resources/azure-resourcemanager-resourcehealth.properties delete mode 100644 sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/AvailabilityStatusInnerTests.java delete mode 100644 sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/AvailabilityStatusListResultTests.java delete mode 100644 sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/AvailabilityStatusPropertiesRecentlyResolvedTests.java delete mode 100644 sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/AvailabilityStatusPropertiesTests.java delete mode 100644 sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/AvailabilityStatusesGetByResourceWithResponseMockTests.java delete mode 100644 sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/AvailabilityStatusesListByResourceGroupMockTests.java delete mode 100644 sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/AvailabilityStatusesListBySubscriptionIdMockTests.java delete mode 100644 sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/AvailabilityStatusesListMockTests.java delete mode 100644 sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/ChildAvailabilityStatusesGetByResourceWithResponseMockTests.java delete mode 100644 sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/ChildAvailabilityStatusesListMockTests.java delete mode 100644 sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/ChildResourcesListMockTests.java delete mode 100644 sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/EmergingIssueImpactTests.java delete mode 100644 sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/EmergingIssueListResultTests.java delete mode 100644 sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/EmergingIssueTests.java delete mode 100644 sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/EmergingIssuesGetResultInnerTests.java delete mode 100644 sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/EmergingIssuesGetWithResponseMockTests.java delete mode 100644 sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/EmergingIssuesListMockTests.java delete mode 100644 sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/EventPropertiesAdditionalInformationTests.java delete mode 100644 sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/EventPropertiesArticleTests.java delete mode 100644 sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/EventPropertiesRecommendedActionsItemTests.java delete mode 100644 sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/ImpactTests.java delete mode 100644 sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/ImpactedRegionTests.java delete mode 100644 sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/ImpactedServiceRegionTests.java delete mode 100644 sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/LinkDisplayTextTests.java delete mode 100644 sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/LinkTests.java delete mode 100644 sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/MetadataEntityInnerTests.java delete mode 100644 sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/MetadataEntityListResultTests.java delete mode 100644 sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/MetadataEntityPropertiesTests.java delete mode 100644 sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/MetadataSupportedValueDetailTests.java delete mode 100644 sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/MetadatasGetEntityWithResponseMockTests.java delete mode 100644 sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/MetadatasListMockTests.java delete mode 100644 sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/OperationDisplayTests.java delete mode 100644 sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/OperationListResultInnerTests.java delete mode 100644 sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/OperationTests.java delete mode 100644 sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/OperationsListWithResponseMockTests.java delete mode 100644 sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/RecommendedActionTests.java delete mode 100644 sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/ServiceImpactingEventIncidentPropertiesTests.java delete mode 100644 sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/ServiceImpactingEventStatusTests.java delete mode 100644 sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/ServiceImpactingEventTests.java delete mode 100644 sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/StatusActiveEventTests.java delete mode 100644 sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/StatusBannerTests.java delete mode 100644 sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/UpdateTests.java diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/CHANGELOG.md b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/CHANGELOG.md index 862d2c155e45..faa60a2b574b 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/CHANGELOG.md +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/CHANGELOG.md @@ -1,14 +1,158 @@ # Release History -## 1.1.0-beta.4 (Unreleased) +## 1.0.0-beta.1 (2025-05-13) + +- 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-2025-05-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added -### Breaking Changes +* `models.EventsOperations` was added + +* `models.EventLevelValues` was added + +* `models.IssueNameParameter` was added + +* `models.SecurityAdvisoryImpactedResources` was added + +* `models.KeyValueItem` was added + +* `models.Impact` was added + +* `models.ImpactedResources` was added + +* `models.EventTypeValues` was added + +* `models.MetadataEntity` was added + +* `models.StatusBanner` was added + +* `models.EventPropertiesRecommendedActionsItem` was added + +* `models.Events` was added + +* `models.ImpactedServiceRegion` was added + +* `models.EventStatusValues` was added + +* `models.EmergingIssueImpact` was added + +* `models.EventOperations` was added + +* `models.Event` was added + +* `models.ChildAvailabilityStatuses` was added + +* `models.EmergingIssues` was added + +* `models.EmergingIssuesGetResult` was added + +* `models.Metadatas` was added + +* `models.SeverityValues` was added + +* `models.StageValues` was added + +* `models.ChildResources` was added + +* `models.ImpactedRegion` was added + +* `models.EventPropertiesRecommendedActions` was added + +* `models.EventImpactedResourceListResult` was added + +* `models.StatusActiveEvent` was added + +* `models.MetadataEntityListResult` was added + +* `models.LinkTypeValues` was added + +* `models.EventImpactedResource` was added + +* `models.LevelValues` was added + +* `models.EmergingIssueListResult` was added + +* `models.Faq` was added + +* `models.EventSourceValues` was added + +* `models.Link` was added + +* `models.Scenario` was added + +* `models.LinkDisplayText` was added + +* `models.Update` was added + +* `models.EventPropertiesArticle` was added + +* `models.EventPropertiesAdditionalInformation` was added + +* `models.MetadataSupportedValueDetail` was added + +#### `models.ServiceImpactingEventStatus` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.RecommendedAction` was modified + +* `actionUrlComment()` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `withActionUrlComment(java.lang.String)` was added + +#### `ResourceHealthManager` was modified + +* `eventOperations()` was added +* `eventsOperations()` was added +* `impactedResources()` was added +* `childAvailabilityStatuses()` was added +* `securityAdvisoryImpactedResources()` was added +* `emergingIssues()` was added +* `childResources()` was added +* `metadatas()` was added + +#### `models.AvailabilityStatusProperties` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `withCategory(java.lang.String)` was added +* `withContext(java.lang.String)` was added +* `category()` was added +* `articleId()` was added +* `withArticleId(java.lang.String)` was added +* `context()` was added + +#### `models.OperationDisplay` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ServiceImpactingEvent` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ServiceImpactingEventIncidentProperties` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.Operation` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.AvailabilityStatusPropertiesRecentlyResolved` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added -### Bugs Fixed +#### `models.AvailabilityStatusListResult` was modified -### Other Changes +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added ## 1.1.0-beta.3 (2024-12-06) diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/README.md b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/README.md index bbef5482494d..1b5f8f9d2480 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-preview-2023-10. 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-2025-05-01. 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 @@ -52,7 +52,7 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java -AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); TokenCredential credential = new DefaultAzureCredentialBuilder() .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) .build(); @@ -60,7 +60,7 @@ ResourceHealthManager manager = ResourceHealthManager .authenticate(credential, profile); ``` -The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. See [Authentication][authenticate] for more options. @@ -100,5 +100,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ - - diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/SAMPLE.md b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/SAMPLE.md index 1432eb3f78a9..2e98822a39da 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/SAMPLE.md +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/SAMPLE.md @@ -59,23 +59,22 @@ ```java /** - * Samples for AvailabilityStatuses GetByResource. + * Samples for AvailabilityStatuses ListByResourceGroup. */ -public final class AvailabilityStatusesGetByResourceSamples { +public final class AvailabilityStatusesListByResourceGroupSamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * AvailabilityStatus_GetByResource.json + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/ + * AvailabilityStatuses_ListByResourceGroup.json */ /** - * Sample code: GetCurrentHealthByResource. + * Sample code: ListByResourceGroup. * * @param manager Entry point to ResourceHealthManager. */ - public static void - getCurrentHealthByResource(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { + public static void listByResourceGroup(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { manager.availabilityStatuses() - .getByResourceWithResponse("resourceUri", null, "recommendedactions", com.azure.core.util.Context.NONE); + .listByResourceGroup("resourceGroupName", null, "recommendedactions", com.azure.core.util.Context.NONE); } } ``` @@ -84,22 +83,21 @@ public final class AvailabilityStatusesGetByResourceSamples { ```java /** - * Samples for AvailabilityStatuses List. + * Samples for Metadata List. */ -public final class AvailabilityStatusesListSamples { +public final class MetadataListSamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * AvailabilityStatuses_List.json + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/Metadata_List. + * json */ /** - * Sample code: GetHealthHistoryByResource. + * Sample code: GetMetadata. * * @param manager Entry point to ResourceHealthManager. */ - public static void - getHealthHistoryByResource(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { - manager.availabilityStatuses().list("resourceUri", null, null, com.azure.core.util.Context.NONE); + public static void getMetadata(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { + manager.metadatas().list(com.azure.core.util.Context.NONE); } } ``` @@ -108,22 +106,21 @@ public final class AvailabilityStatusesListSamples { ```java /** - * Samples for AvailabilityStatuses ListByResourceGroup. + * Samples for EmergingIssues List. */ -public final class AvailabilityStatusesListByResourceGroupSamples { +public final class EmergingIssuesListSamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * AvailabilityStatuses_ListByResourceGroup.json + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/ + * EmergingIssues_List.json */ /** - * Sample code: ListByResourceGroup. + * Sample code: GetEmergingIssues. * * @param manager Entry point to ResourceHealthManager. */ - public static void listByResourceGroup(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { - manager.availabilityStatuses() - .listByResourceGroup("resourceGroupName", null, "recommendedactions", com.azure.core.util.Context.NONE); + public static void getEmergingIssues(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { + manager.emergingIssues().list(com.azure.core.util.Context.NONE); } } ``` @@ -132,23 +129,21 @@ public final class AvailabilityStatusesListByResourceGroupSamples { ```java /** - * Samples for AvailabilityStatuses ListBySubscriptionId. + * Samples for Metadata GetEntity. */ -public final class AvailabilityStatusesListBySubscriptionIdSamples { +public final class MetadataGetEntitySamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * AvailabilityStatuses_ListBySubscriptionId.json + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/ + * Metadata_GetEntity.json */ /** - * Sample code: ListHealthBySubscriptionId. + * Sample code: GetMetadata. * * @param manager Entry point to ResourceHealthManager. */ - public static void - listHealthBySubscriptionId(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { - manager.availabilityStatuses() - .listBySubscriptionId(null, "recommendedactions", com.azure.core.util.Context.NONE); + public static void getMetadata(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { + manager.metadatas().getEntityWithResponse("status", com.azure.core.util.Context.NONE); } } ``` @@ -157,25 +152,23 @@ public final class AvailabilityStatusesListBySubscriptionIdSamples { ```java /** - * Samples for ChildAvailabilityStatuses GetByResource. + * Samples for SecurityAdvisoryImpactedResources ListByTenantIdAndEventId. */ -public final class ChildAvailabilityStatusesGetByResourceSamples { +public final class SecurityAdvisoryImpactedResourcesListByTenantIdAndEventIdSamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * ChildAvailabilityStatus_GetByResource.json + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/ + * SecurityAdvisoryImpactedResources_ListByTenantId_ListByEventId.json */ /** - * Sample code: GetChildCurrentHealthByResource. + * Sample code: ListSecurityAdvisoryImpactedResourcesByTenantId. * * @param manager Entry point to ResourceHealthManager. */ - public static void - getChildCurrentHealthByResource(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { - manager.childAvailabilityStatuses() - .getByResourceWithResponse( - "subscriptions/227b734f-e14f-4de6-b7fc-3190c21e69f6/resourceGroups/JUHACKETRHCTEST/providers/Microsoft.Compute/virtualMachineScaleSets/rhctest/virtualMachines/4", - null, "recommendedactions", com.azure.core.util.Context.NONE); + public static void listSecurityAdvisoryImpactedResourcesByTenantId( + com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { + manager.securityAdvisoryImpactedResources() + .listByTenantIdAndEventId("BC_1-FXZ", null, com.azure.core.util.Context.NONE); } } ``` @@ -184,25 +177,21 @@ public final class ChildAvailabilityStatusesGetByResourceSamples { ```java /** - * Samples for ChildAvailabilityStatuses List. + * Samples for ImpactedResources Get. */ -public final class ChildAvailabilityStatusesListSamples { +public final class ImpactedResourcesGetSamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * ChildAvailabilityStatuses_List.json + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/ + * ImpactedResources_Get.json */ /** - * Sample code: GetChildHealthHistoryByResource. + * Sample code: ImpactedResourcesGet. * * @param manager Entry point to ResourceHealthManager. */ - public static void - getChildHealthHistoryByResource(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { - manager.childAvailabilityStatuses() - .list( - "subscriptions/227b734f-e14f-4de6-b7fc-3190c21e69f6/resourceGroups/JUHACKETRHCTEST/providers/Microsoft.Compute/virtualMachineScaleSets/rhctest/virtualMachines/4", - null, null, com.azure.core.util.Context.NONE); + public static void impactedResourcesGet(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { + manager.impactedResources().getWithResponse("BC_1-FXZ", "abc-123-ghj-456", com.azure.core.util.Context.NONE); } } ``` @@ -211,22 +200,24 @@ public final class ChildAvailabilityStatusesListSamples { ```java /** - * Samples for ChildResources List. + * Samples for EventsOperation List. */ -public final class ChildResourcesListSamples { +public final class EventsOperationListSamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * ChildResources_List.json + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/ + * Events_ListBySubscriptionId.json */ /** - * Sample code: GetCurrentChildHealthByResource. + * Sample code: ListEventsBySubscriptionId. * * @param manager Entry point to ResourceHealthManager. */ public static void - getCurrentChildHealthByResource(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { - manager.childResources().list("resourceUri", null, null, com.azure.core.util.Context.NONE); + listEventsBySubscriptionId(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { + manager.eventsOperations() + .list("service eq 'Virtual Machines' or region eq 'West US'", "5/12/2025", + com.azure.core.util.Context.NONE); } } ``` @@ -234,24 +225,26 @@ public final class ChildResourcesListSamples { ### EmergingIssues_Get ```java -import com.azure.resourcemanager.resourcehealth.models.IssueNameParameter; - /** - * Samples for EmergingIssues Get. + * Samples for EventsOperation ListBySingleResource. */ -public final class EmergingIssuesGetSamples { +public final class EventsOperationListBySingleResourceSamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * EmergingIssues_Get.json + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/ + * Events_ListBySingleResource.json */ /** - * Sample code: GetEmergingIssues. + * Sample code: ListEventsBySingleResource. * * @param manager Entry point to ResourceHealthManager. */ - public static void getEmergingIssues(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { - manager.emergingIssues().getWithResponse(IssueNameParameter.DEFAULT, com.azure.core.util.Context.NONE); + public static void + listEventsBySingleResource(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { + manager.eventsOperations() + .listBySingleResource( + "subscriptions/4abcdefgh-ijkl-mnop-qrstuvwxyz/resourceGroups/rhctestenv/providers/Microsoft.Compute/virtualMachines/rhctestenvV1PI", + null, com.azure.core.util.Context.NONE); } } ``` @@ -260,21 +253,24 @@ public final class EmergingIssuesGetSamples { ```java /** - * Samples for EmergingIssues List. + * Samples for EventOperation GetBySubscriptionIdAndTrackingId. */ -public final class EmergingIssuesListSamples { +public final class EventOperationGetBySubscriptionIdAndTrackingIdSamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * EmergingIssues_List.json + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/ + * Event_GetBySubscriptionIdAndTrackingId.json */ /** - * Sample code: GetEmergingIssues. + * Sample code: SecurityAdvisoriesEventBySubscriptionIdAndTrackingId. * * @param manager Entry point to ResourceHealthManager. */ - public static void getEmergingIssues(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { - manager.emergingIssues().list(com.azure.core.util.Context.NONE); + public static void securityAdvisoriesEventBySubscriptionIdAndTrackingId( + com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { + manager.eventOperations() + .getBySubscriptionIdAndTrackingIdWithResponse("eventTrackingId", "properties/status eq 'Active'", + "5/12/2025", com.azure.core.util.Context.NONE); } } ``` @@ -282,24 +278,24 @@ public final class EmergingIssuesListSamples { ### EventOperation_FetchDetailsBySubscriptionIdAndTrackingId ```java +import com.azure.resourcemanager.resourcehealth.models.IssueNameParameter; + /** - * Samples for EventOperation FetchDetailsBySubscriptionIdAndTrackingId. + * Samples for EmergingIssues Get. */ -public final class EventOperationFetchDetailsBySubscriptionIdAndTrackingIdSamples { +public final class EmergingIssuesGetSamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * Event_fetchDetailsBySubscriptionIdAndTrackingId.json + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/ + * EmergingIssues_Get.json */ /** - * Sample code: EventDetailsBySubscriptionIdAndTrackingId. + * Sample code: GetEmergingIssues. * * @param manager Entry point to ResourceHealthManager. */ - public static void eventDetailsBySubscriptionIdAndTrackingId( - com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { - manager.eventOperations() - .fetchDetailsBySubscriptionIdAndTrackingIdWithResponse("eventTrackingId", com.azure.core.util.Context.NONE); + public static void getEmergingIssues(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { + manager.emergingIssues().getWithResponse(IssueNameParameter.DEFAULT, com.azure.core.util.Context.NONE); } } ``` @@ -308,23 +304,22 @@ public final class EventOperationFetchDetailsBySubscriptionIdAndTrackingIdSample ```java /** - * Samples for EventOperation FetchDetailsByTenantIdAndTrackingId. + * Samples for ImpactedResources ListByTenantIdAndEventId. */ -public final class EventOperationFetchDetailsByTenantIdAndTrackingIdSamples { +public final class ImpactedResourcesListByTenantIdAndEventIdSamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * Event_fetchDetailsByTenantIdAndTrackingId.json + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/ + * ImpactedResources_ListByTenantId_ListByEventId.json */ /** - * Sample code: EventDetailsByTenantIdAndTrackingId. + * Sample code: ListEventsByTenantId. * * @param manager Entry point to ResourceHealthManager. */ - public static void - eventDetailsByTenantIdAndTrackingId(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { - manager.eventOperations() - .fetchDetailsByTenantIdAndTrackingIdWithResponse("eventTrackingId", com.azure.core.util.Context.NONE); + public static void listEventsByTenantId(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { + manager.impactedResources() + .listByTenantIdAndEventId("BC_1-FXZ", "targetRegion eq 'westus'", com.azure.core.util.Context.NONE); } } ``` @@ -333,24 +328,23 @@ public final class EventOperationFetchDetailsByTenantIdAndTrackingIdSamples { ```java /** - * Samples for EventOperation GetBySubscriptionIdAndTrackingId. + * Samples for EventsOperation ListByTenantId. */ -public final class EventOperationGetBySubscriptionIdAndTrackingIdSamples { +public final class EventsOperationListByTenantIdSamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * Event_GetBySubscriptionIdAndTrackingId.json + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/ + * Events_ListByTenantId.json */ /** - * Sample code: SecurityAdvisoriesEventBySubscriptionIdAndTrackingId. + * Sample code: ListEventsByTenantId. * * @param manager Entry point to ResourceHealthManager. */ - public static void securityAdvisoriesEventBySubscriptionIdAndTrackingId( - com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { - manager.eventOperations() - .getBySubscriptionIdAndTrackingIdWithResponse("eventTrackingId", "properties/status eq 'Active'", - "7/10/2022", com.azure.core.util.Context.NONE); + public static void listEventsByTenantId(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { + manager.eventsOperations() + .listByTenantId("service eq 'Virtual Machines' or region eq 'West US'", "7/24/2020", + com.azure.core.util.Context.NONE); } } ``` @@ -359,24 +353,25 @@ public final class EventOperationGetBySubscriptionIdAndTrackingIdSamples { ```java /** - * Samples for EventOperation GetByTenantIdAndTrackingId. + * Samples for ChildAvailabilityStatuses GetByResource. */ -public final class EventOperationGetByTenantIdAndTrackingIdSamples { +public final class ChildAvailabilityStatusesGetByResourceSamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * Event_GetByTenantIdAndTrackingId.json + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/ + * ChildAvailabilityStatus_GetByResource.json */ /** - * Sample code: EventByTenantIdAndTrackingId. + * Sample code: GetChildCurrentHealthByResource. * * @param manager Entry point to ResourceHealthManager. */ public static void - eventByTenantIdAndTrackingId(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { - manager.eventOperations() - .getByTenantIdAndTrackingIdWithResponse("eventTrackingId", "properties/status eq 'Active'", "7/10/2022", - com.azure.core.util.Context.NONE); + getChildCurrentHealthByResource(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { + manager.childAvailabilityStatuses() + .getByResourceWithResponse( + "subscriptions/227b734f-e14f-4de6-b7fc-3190c21e69f6/resourceGroups/JUHACKETRHCTEST/providers/Microsoft.Compute/virtualMachineScaleSets/rhctest/virtualMachines/4", + null, "recommendedactions", com.azure.core.util.Context.NONE); } } ``` @@ -385,24 +380,22 @@ public final class EventOperationGetByTenantIdAndTrackingIdSamples { ```java /** - * Samples for EventsOperation List. + * Samples for ChildResources List. */ -public final class EventsOperationListSamples { +public final class ChildResourcesListSamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * Events_ListBySubscriptionId.json + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/ + * ChildResources_List.json */ /** - * Sample code: ListEventsBySubscriptionId. + * Sample code: GetCurrentChildHealthByResource. * * @param manager Entry point to ResourceHealthManager. */ public static void - listEventsBySubscriptionId(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { - manager.eventsOperations() - .list("service eq 'Virtual Machines' or region eq 'West US'", "7/24/2020", - com.azure.core.util.Context.NONE); + getCurrentChildHealthByResource(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { + manager.childResources().list("resourceUri", null, null, com.azure.core.util.Context.NONE); } } ``` @@ -411,25 +404,23 @@ public final class EventsOperationListSamples { ```java /** - * Samples for EventsOperation ListBySingleResource. + * Samples for EventOperation FetchDetailsByTenantIdAndTrackingId. */ -public final class EventsOperationListBySingleResourceSamples { +public final class EventOperationFetchDetailsByTenantIdAndTrackingIdSamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * Events_ListBySingleResource.json + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/ + * Event_fetchDetailsByTenantIdAndTrackingId.json */ /** - * Sample code: ListEventsBySingleResource. + * Sample code: EventDetailsByTenantIdAndTrackingId. * * @param manager Entry point to ResourceHealthManager. */ public static void - listEventsBySingleResource(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { - manager.eventsOperations() - .listBySingleResource( - "subscriptions/4abcdefgh-ijkl-mnop-qrstuvwxyz/resourceGroups/rhctestenv/providers/Microsoft.Compute/virtualMachines/rhctestenvV1PI", - null, com.azure.core.util.Context.NONE); + eventDetailsByTenantIdAndTrackingId(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { + manager.eventOperations() + .fetchDetailsByTenantIdAndTrackingIdWithResponse("eventTrackingId", com.azure.core.util.Context.NONE); } } ``` @@ -438,23 +429,23 @@ public final class EventsOperationListBySingleResourceSamples { ```java /** - * Samples for EventsOperation ListByTenantId. + * Samples for EventOperation FetchDetailsBySubscriptionIdAndTrackingId. */ -public final class EventsOperationListByTenantIdSamples { +public final class EventOperationFetchDetailsBySubscriptionIdAndTrackingIdSamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * Events_ListByTenantId.json + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/ + * Event_fetchDetailsBySubscriptionIdAndTrackingId.json */ /** - * Sample code: ListEventsByTenantId. + * Sample code: EventDetailsBySubscriptionIdAndTrackingId. * * @param manager Entry point to ResourceHealthManager. */ - public static void listEventsByTenantId(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { - manager.eventsOperations() - .listByTenantId("service eq 'Virtual Machines' or region eq 'West US'", "7/24/2020", - com.azure.core.util.Context.NONE); + public static void eventDetailsBySubscriptionIdAndTrackingId( + com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { + manager.eventOperations() + .fetchDetailsBySubscriptionIdAndTrackingIdWithResponse("eventTrackingId", com.azure.core.util.Context.NONE); } } ``` @@ -463,21 +454,23 @@ public final class EventsOperationListByTenantIdSamples { ```java /** - * Samples for ImpactedResources Get. + * Samples for AvailabilityStatuses GetByResource. */ -public final class ImpactedResourcesGetSamples { +public final class AvailabilityStatusesGetByResourceSamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * ImpactedResources_Get.json + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/ + * AvailabilityStatus_GetByResource.json */ /** - * Sample code: ImpactedResourcesGet. + * Sample code: GetCurrentHealthByResource. * * @param manager Entry point to ResourceHealthManager. */ - public static void impactedResourcesGet(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { - manager.impactedResources().getWithResponse("BC_1-FXZ", "abc-123-ghj-456", com.azure.core.util.Context.NONE); + public static void + getCurrentHealthByResource(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { + manager.availabilityStatuses() + .getByResourceWithResponse("resourceUri", null, "recommendedactions", com.azure.core.util.Context.NONE); } } ``` @@ -486,22 +479,25 @@ public final class ImpactedResourcesGetSamples { ```java /** - * Samples for ImpactedResources GetByTenantId. + * Samples for ChildAvailabilityStatuses List. */ -public final class ImpactedResourcesGetByTenantIdSamples { +public final class ChildAvailabilityStatusesListSamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * ImpactedResources_GetByTenantId.json + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/ + * ChildAvailabilityStatuses_List.json */ /** - * Sample code: ImpactedResourcesGet. + * Sample code: GetChildHealthHistoryByResource. * * @param manager Entry point to ResourceHealthManager. */ - public static void impactedResourcesGet(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { - manager.impactedResources() - .getByTenantIdWithResponse("BC_1-FXZ", "abc-123-ghj-456", com.azure.core.util.Context.NONE); + public static void + getChildHealthHistoryByResource(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { + manager.childAvailabilityStatuses() + .list( + "subscriptions/227b734f-e14f-4de6-b7fc-3190c21e69f6/resourceGroups/JUHACKETRHCTEST/providers/Microsoft.Compute/virtualMachineScaleSets/rhctest/virtualMachines/4", + null, null, com.azure.core.util.Context.NONE); } } ``` @@ -510,23 +506,23 @@ public final class ImpactedResourcesGetByTenantIdSamples { ```java /** - * Samples for ImpactedResources ListBySubscriptionIdAndEventId. + * Samples for AvailabilityStatuses ListBySubscriptionId. */ -public final class ImpactedResourcesListBySubscriptionIdAndEventIdSamples { +public final class AvailabilityStatusesListBySubscriptionIdSamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * ImpactedResources_ListBySubscriptionId_ListByEventId.json + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/ + * AvailabilityStatuses_ListBySubscriptionId.json */ /** - * Sample code: ListImpactedResourcesBySubscriptionId. + * Sample code: ListHealthBySubscriptionId. * * @param manager Entry point to ResourceHealthManager. */ public static void - listImpactedResourcesBySubscriptionId(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { - manager.impactedResources() - .listBySubscriptionIdAndEventId("BC_1-FXZ", "targetRegion eq 'westus'", com.azure.core.util.Context.NONE); + listHealthBySubscriptionId(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { + manager.availabilityStatuses() + .listBySubscriptionId(null, "recommendedactions", com.azure.core.util.Context.NONE); } } ``` @@ -535,22 +531,24 @@ public final class ImpactedResourcesListBySubscriptionIdAndEventIdSamples { ```java /** - * Samples for ImpactedResources ListByTenantIdAndEventId. + * Samples for EventOperation GetByTenantIdAndTrackingId. */ -public final class ImpactedResourcesListByTenantIdAndEventIdSamples { +public final class EventOperationGetByTenantIdAndTrackingIdSamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * ImpactedResources_ListByTenantId_ListByEventId.json + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/ + * Event_GetByTenantIdAndTrackingId.json */ /** - * Sample code: ListEventsByTenantId. + * Sample code: EventByTenantIdAndTrackingId. * * @param manager Entry point to ResourceHealthManager. */ - public static void listEventsByTenantId(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { - manager.impactedResources() - .listByTenantIdAndEventId("BC_1-FXZ", "targetRegion eq 'westus'", com.azure.core.util.Context.NONE); + public static void + eventByTenantIdAndTrackingId(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { + manager.eventOperations() + .getByTenantIdAndTrackingIdWithResponse("eventTrackingId", "properties/status eq 'Active'", "7/10/2022", + com.azure.core.util.Context.NONE); } } ``` @@ -559,21 +557,23 @@ public final class ImpactedResourcesListByTenantIdAndEventIdSamples { ```java /** - * Samples for Metadata GetEntity. + * Samples for SecurityAdvisoryImpactedResources ListBySubscriptionIdAndEventId. */ -public final class MetadataGetEntitySamples { +public final class SecurityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdSamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * Metadata_GetEntity.json + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/ + * SecurityAdvisoryImpactedResources_ListBySubscriptionId_ListByEventId.json */ /** - * Sample code: GetMetadata. + * Sample code: ListSecurityAdvisoryImpactedResourcesBySubscriptionId. * * @param manager Entry point to ResourceHealthManager. */ - public static void getMetadata(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { - manager.metadatas().getEntityWithResponse("status", com.azure.core.util.Context.NONE); + public static void listSecurityAdvisoryImpactedResourcesBySubscriptionId( + com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { + manager.securityAdvisoryImpactedResources() + .listBySubscriptionIdAndEventId("BC_1-FXZ", null, com.azure.core.util.Context.NONE); } } ``` @@ -582,21 +582,22 @@ public final class MetadataGetEntitySamples { ```java /** - * Samples for Metadata List. + * Samples for AvailabilityStatuses List. */ -public final class MetadataListSamples { +public final class AvailabilityStatusesListSamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * Metadata_List.json + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/ + * AvailabilityStatuses_List.json */ /** - * Sample code: GetMetadata. + * Sample code: GetHealthHistoryByResource. * * @param manager Entry point to ResourceHealthManager. */ - public static void getMetadata(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { - manager.metadatas().list(com.azure.core.util.Context.NONE); + public static void + getHealthHistoryByResource(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { + manager.availabilityStatuses().list("resourceUri", null, null, com.azure.core.util.Context.NONE); } } ``` @@ -605,21 +606,23 @@ public final class MetadataListSamples { ```java /** - * Samples for Operations List. + * Samples for ImpactedResources ListBySubscriptionIdAndEventId. */ -public final class OperationsListSamples { +public final class ImpactedResourcesListBySubscriptionIdAndEventIdSamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * Operations_List.json + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/ + * ImpactedResources_ListBySubscriptionId_ListByEventId.json */ /** - * Sample code: GetOperationsList. + * Sample code: ListImpactedResourcesBySubscriptionId. * * @param manager Entry point to ResourceHealthManager. */ - public static void getOperationsList(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { - manager.operations().listWithResponse(com.azure.core.util.Context.NONE); + public static void + listImpactedResourcesBySubscriptionId(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { + manager.impactedResources() + .listBySubscriptionIdAndEventId("BC_1-FXZ", "targetRegion eq 'westus'", com.azure.core.util.Context.NONE); } } ``` @@ -628,23 +631,22 @@ public final class OperationsListSamples { ```java /** - * Samples for SecurityAdvisoryImpactedResources ListBySubscriptionIdAndEventId. + * Samples for ImpactedResources GetByTenantId. */ -public final class SecurityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdSamples { +public final class ImpactedResourcesGetByTenantIdSamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * SecurityAdvisoryImpactedResources_ListBySubscriptionId_ListByEventId.json + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/ + * ImpactedResources_GetByTenantId.json */ /** - * Sample code: ListSecurityAdvisoryImpactedResourcesBySubscriptionId. + * Sample code: ImpactedResourcesGet. * * @param manager Entry point to ResourceHealthManager. */ - public static void listSecurityAdvisoryImpactedResourcesBySubscriptionId( - com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { - manager.securityAdvisoryImpactedResources() - .listBySubscriptionIdAndEventId("BC_1-FXZ", null, com.azure.core.util.Context.NONE); + public static void impactedResourcesGet(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { + manager.impactedResources() + .getByTenantIdWithResponse("BC_1-FXZ", "abc-123-ghj-456", com.azure.core.util.Context.NONE); } } ``` @@ -653,23 +655,21 @@ public final class SecurityAdvisoryImpactedResourcesListBySubscriptionIdAndEvent ```java /** - * Samples for SecurityAdvisoryImpactedResources ListByTenantIdAndEventId. + * Samples for Operations List. */ -public final class SecurityAdvisoryImpactedResourcesListByTenantIdAndEventIdSamples { +public final class OperationsListSamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * SecurityAdvisoryImpactedResources_ListByTenantId_ListByEventId.json + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/Operations_List + * .json */ /** - * Sample code: ListSecurityAdvisoryImpactedResourcesByTenantId. + * Sample code: GetOperationsList. * * @param manager Entry point to ResourceHealthManager. */ - public static void listSecurityAdvisoryImpactedResourcesByTenantId( - com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { - manager.securityAdvisoryImpactedResources() - .listByTenantIdAndEventId("BC_1-FXZ", null, com.azure.core.util.Context.NONE); + public static void getOperationsList(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { + manager.operations().listWithResponse(com.azure.core.util.Context.NONE); } } ``` diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/pom.xml b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/pom.xml index ae1ab2868b1a..eedb21debdf7 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/pom.xml +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/pom.xml @@ -18,7 +18,7 @@ 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-preview-2023-10. + 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-2025-05-01. https://github.com/Azure/azure-sdk-for-java @@ -46,7 +46,6 @@ 0 0 true - false 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 9f8bc6e49d27..b195cca20b5a 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 @@ -22,6 +22,7 @@ import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.resourcehealth.fluent.MicrosoftResourceHealth; import com.azure.resourcemanager.resourcehealth.implementation.AvailabilityStatusesImpl; @@ -49,6 +50,7 @@ import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; @@ -129,6 +131,9 @@ public static Configurable configure() { */ public static final class Configurable { private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-resourcehealth.properties"); private HttpClient httpClient; private HttpLogOptions httpLogOptions; @@ -236,12 +241,14 @@ public ResourceHealthManager authenticate(TokenCredential credential, AzureProfi Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + StringBuilder userAgentBuilder = new StringBuilder(); userAgentBuilder.append("azsdk-java") .append("-") .append("com.azure.resourcemanager.resourcehealth") .append("/") - .append("1.1.0-beta.3"); + .append(clientVersion); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/EventOperationsClient.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/EventOperationsClient.java index 2702bc16ac1a..b6ecb56cac3d 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/EventOperationsClient.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/EventOperationsClient.java @@ -20,8 +20,8 @@ public interface EventOperationsClient { * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. * @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 queryStartTime Specifies from when to return events, based on the lastUpdateTime property. For example, - * queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. + * @param queryStartTime Specifies from when to return events (default is 3 days), based on the lastUpdateTime + * property. For example, queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. * @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. @@ -46,7 +46,8 @@ Response getBySubscriptionIdAndTrackingIdWithResponse(String eventTr /** * Service health event details in the subscription by event tracking id. This can be used to fetch sensitive - * properties for Security Advisory events. + * properties for Security Advisory events. Please see + * https://learn.microsoft.com/en-us/azure/service-health/security-advisories-elevated-access. * * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. * @param context The context to associate with this operation. @@ -60,7 +61,8 @@ Response getBySubscriptionIdAndTrackingIdWithResponse(String eventTr /** * Service health event details in the subscription by event tracking id. This can be used to fetch sensitive - * properties for Security Advisory events. + * properties for Security Advisory events. Please see + * https://learn.microsoft.com/en-us/azure/service-health/security-advisories-elevated-access. * * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -77,8 +79,8 @@ Response getBySubscriptionIdAndTrackingIdWithResponse(String eventTr * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. * @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 queryStartTime Specifies from when to return events, based on the lastUpdateTime property. For example, - * queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. + * @param queryStartTime Specifies from when to return events (default is 3 days), based on the lastUpdateTime + * property. For example, queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. * @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. @@ -103,7 +105,8 @@ Response getByTenantIdAndTrackingIdWithResponse(String eventTracking /** * Service health event details in the tenant by event tracking id. This can be used to fetch sensitive properties - * for Security Advisory events. + * for Security Advisory events. Please see + * https://learn.microsoft.com/en-us/azure/service-health/security-advisories-elevated-access. * * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. * @param context The context to associate with this operation. @@ -117,7 +120,8 @@ Response getByTenantIdAndTrackingIdWithResponse(String eventTracking /** * Service health event details in the tenant by event tracking id. This can be used to fetch sensitive properties - * for Security Advisory events. + * for Security Advisory events. Please see + * https://learn.microsoft.com/en-us/azure/service-health/security-advisories-elevated-access. * * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. * @throws IllegalArgumentException thrown if parameters fail the validation. 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/EventsOperationsClient.java index 902133437630..214b51367922 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/EventsOperationsClient.java @@ -29,8 +29,8 @@ public interface EventsOperationsClient { * * @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 queryStartTime Specifies from when to return events, based on the lastUpdateTime property. For example, - * queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. + * @param queryStartTime Specifies from when to return events (default is 3 days), based on the lastUpdateTime + * property. For example, queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. * @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. @@ -55,8 +55,8 @@ public interface EventsOperationsClient { * * @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 queryStartTime Specifies from when to return events, based on the lastUpdateTime property. For example, - * queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. + * @param queryStartTime Specifies from when to return events (default is 3 days), based on the lastUpdateTime + * property. For example, queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. * @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. diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EventImpactedResourceInner.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EventImpactedResourceInner.java index 85b243165baa..a22565a87edf 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EventImpactedResourceInner.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EventImpactedResourceInner.java @@ -125,51 +125,6 @@ public String targetRegion() { return this.innerProperties() == null ? null : this.innerProperties().targetRegion(); } - /** - * Get the resourceName property: Resource name of the impacted resource. - * - * @return the resourceName value. - */ - public String resourceName() { - return this.innerProperties() == null ? null : this.innerProperties().resourceName(); - } - - /** - * Get the resourceGroup property: Resource group name of the impacted resource. - * - * @return the resourceGroup value. - */ - public String resourceGroup() { - return this.innerProperties() == null ? null : this.innerProperties().resourceGroup(); - } - - /** - * Get the status property: Status of the impacted resource. - * - * @return the status value. - */ - public String status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Get the maintenanceStartTime property: Start time of maintenance for the impacted resource. - * - * @return the maintenanceStartTime value. - */ - public String maintenanceStartTime() { - return this.innerProperties() == null ? null : this.innerProperties().maintenanceStartTime(); - } - - /** - * Get the maintenanceEndTime property: End time of maintenance for the impacted resource. - * - * @return the maintenanceEndTime value. - */ - public String maintenanceEndTime() { - return this.innerProperties() == null ? null : this.innerProperties().maintenanceEndTime(); - } - /** * Get the info property: Additional information. * diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EventImpactedResourceProperties.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EventImpactedResourceProperties.java index 6c1c5910be76..2686aa2204db 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EventImpactedResourceProperties.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EventImpactedResourceProperties.java @@ -33,31 +33,6 @@ public final class EventImpactedResourceProperties implements JsonSerializable info = reader.readArray(reader1 -> KeyValueItem.fromJson(reader1)); deserializedEventImpactedResourceProperties.info = info; 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 index e26a5f1fb6c7..1e03c0692676 100644 --- 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 @@ -16,7 +16,6 @@ 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.EventSubTypeValues; import com.azure.resourcemanager.resourcehealth.models.EventTypeValues; import com.azure.resourcemanager.resourcehealth.models.Faq; import com.azure.resourcemanager.resourcehealth.models.Impact; @@ -133,31 +132,6 @@ public EventInner withEventType(EventTypeValues eventType) { return this; } - /** - * Get the eventSubType property: Sub type of the event. Currently used to determine retirement communications for - * health advisory events. - * - * @return the eventSubType value. - */ - public EventSubTypeValues eventSubType() { - return this.innerProperties() == null ? null : this.innerProperties().eventSubType(); - } - - /** - * Set the eventSubType property: Sub type of the event. Currently used to determine retirement communications for - * health advisory events. - * - * @param eventSubType the eventSubType value to set. - * @return the EventInner object itself. - */ - public EventInner withEventSubType(EventSubTypeValues eventSubType) { - if (this.innerProperties() == null) { - this.innerProperties = new EventProperties(); - } - this.innerProperties().withEventSubType(eventSubType); - return this; - } - /** * Get the eventSource property: Source of event. * @@ -228,7 +202,8 @@ public EventInner withTitle(String title) { } /** - * Get the summary property: Summary text of event. + * Get the summary property: Summary text of event. Use fetchEventDetails endpoint to get summary of sensitive + * events. * * @return the summary value. */ @@ -237,7 +212,8 @@ public String summary() { } /** - * Set the summary property: Summary text of event. + * Set the summary property: Summary text of event. Use fetchEventDetails endpoint to get summary of sensitive + * events. * * @param summary the summary value to set. * @return the EventInner object itself. @@ -319,6 +295,33 @@ public EventInner withEventLevel(EventLevelValues eventLevel) { return this; } + /** + * Get the isEventSensitive property: If true the event may contains sensitive data. Use the post + * events/{trackingId}/fetchEventDetails endpoint to fetch sensitive data see + * https://learn.microsoft.com/en-us/azure/service-health/security-advisories-elevated-access. + * + * @return the isEventSensitive value. + */ + public Boolean isEventSensitive() { + return this.innerProperties() == null ? null : this.innerProperties().isEventSensitive(); + } + + /** + * Set the isEventSensitive property: If true the event may contains sensitive data. Use the post + * events/{trackingId}/fetchEventDetails endpoint to fetch sensitive data see + * https://learn.microsoft.com/en-us/azure/service-health/security-advisories-elevated-access. + * + * @param isEventSensitive the isEventSensitive value to set. + * @return the EventInner object itself. + */ + public EventInner withIsEventSensitive(Boolean isEventSensitive) { + if (this.innerProperties() == null) { + this.innerProperties = new EventProperties(); + } + this.innerProperties().withIsEventSensitive(isEventSensitive); + return this; + } + /** * Get the externalIncidentId property: The id of the Incident. * @@ -574,7 +577,7 @@ public EventInner withEnableMicrosoftSupport(Boolean enableMicrosoftSupport) { /** * Get the description property: Contains the communication message for the event, that could include summary, root - * cause and other details. + * cause and other details. Use fetchEventDetails endpoint to get description of sensitive events. * * @return the description value. */ @@ -584,7 +587,7 @@ public String description() { /** * Set the description property: Contains the communication message for the event, that could include summary, root - * cause and other details. + * cause and other details. Use fetchEventDetails endpoint to get description of sensitive events. * * @param description the description value to set. * @return the EventInner object itself. @@ -788,73 +791,45 @@ public EventInner withImpactType(String impactType) { } /** - * Get the maintenanceId property: Unique identifier for planned maintenance event. - * - * @return the maintenanceId value. - */ - public String maintenanceId() { - return this.innerProperties() == null ? null : this.innerProperties().maintenanceId(); - } - - /** - * Set the maintenanceId property: Unique identifier for planned maintenance event. - * - * @param maintenanceId the maintenanceId value to set. - * @return the EventInner object itself. - */ - public EventInner withMaintenanceId(String maintenanceId) { - if (this.innerProperties() == null) { - this.innerProperties = new EventProperties(); - } - this.innerProperties().withMaintenanceId(maintenanceId); - return this; - } - - /** - * Get the maintenanceType property: The type of planned maintenance event. - * - * @return the maintenanceType value. - */ - public String maintenanceType() { - return this.innerProperties() == null ? null : this.innerProperties().maintenanceType(); - } - - /** - * Set the maintenanceType property: The type of planned maintenance event. - * - * @param maintenanceType the maintenanceType value to set. - * @return the EventInner object itself. - */ - public EventInner withMaintenanceType(String maintenanceType) { - if (this.innerProperties() == null) { - this.innerProperties = new EventProperties(); - } - this.innerProperties().withMaintenanceType(maintenanceType); - return this; - } - - /** - * Get the argQuery property: Azure Resource Graph query to fetch the affected resources from their existing Azure - * Resource Graph locations. + * Get the eventTags property: A list of metadata tags associated with the event. Possible values include: + * -Action Recommended: Action may be required by you to avoid possible disruptions or mitigate risks for your + * services. It is recommended to evaluate these actions and the potential impact on your services. + * - False Positive: After investigation, we've determined your service is healthy and service issues did not impact + * your services as originally communicated. + * - Preliminary PIR: For our largest, most impactful service issues a Preliminary Post Incident Review (PIR) is + * published generally within 72 hours of mitigation, to summarize what we have learned so far from the + * still-in-progress investigation. + * - Final PIR: For service issues, a Final Post Incident Review (PIR) may be published to provide additional + * details or learnings. Sometimes this requires us to complete an internal retrospective, generally within 14 days + * of mitigation. * - * @return the argQuery value. + * @return the eventTags value. */ - public String argQuery() { - return this.innerProperties() == null ? null : this.innerProperties().argQuery(); + public List eventTags() { + return this.innerProperties() == null ? null : this.innerProperties().eventTags(); } /** - * Set the argQuery property: Azure Resource Graph query to fetch the affected resources from their existing Azure - * Resource Graph locations. + * Set the eventTags property: A list of metadata tags associated with the event. Possible values include: + * -Action Recommended: Action may be required by you to avoid possible disruptions or mitigate risks for your + * services. It is recommended to evaluate these actions and the potential impact on your services. + * - False Positive: After investigation, we've determined your service is healthy and service issues did not impact + * your services as originally communicated. + * - Preliminary PIR: For our largest, most impactful service issues a Preliminary Post Incident Review (PIR) is + * published generally within 72 hours of mitigation, to summarize what we have learned so far from the + * still-in-progress investigation. + * - Final PIR: For service issues, a Final Post Incident Review (PIR) may be published to provide additional + * details or learnings. Sometimes this requires us to complete an internal retrospective, generally within 14 days + * of mitigation. * - * @param argQuery the argQuery value to set. + * @param eventTags the eventTags value to set. * @return the EventInner object itself. */ - public EventInner withArgQuery(String argQuery) { + public EventInner withEventTags(List eventTags) { if (this.innerProperties() == null) { this.innerProperties = new EventProperties(); } - this.innerProperties().withArgQuery(argQuery); + this.innerProperties().withEventTags(eventTags); return this; } diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EventProperties.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EventProperties.java index c4959ce3e569..c24dd3879537 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EventProperties.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EventProperties.java @@ -16,7 +16,6 @@ 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.EventSubTypeValues; import com.azure.resourcemanager.resourcehealth.models.EventTypeValues; import com.azure.resourcemanager.resourcehealth.models.Faq; import com.azure.resourcemanager.resourcehealth.models.Impact; @@ -37,11 +36,6 @@ public final class EventProperties implements JsonSerializable */ private EventTypeValues eventType; - /* - * Sub type of the event. Currently used to determine retirement communications for health advisory events - */ - private EventSubTypeValues eventSubType; - /* * Source of event. */ @@ -58,7 +52,7 @@ public final class EventProperties implements JsonSerializable private String title; /* - * Summary text of event. + * Summary text of event. Use fetchEventDetails endpoint to get summary of sensitive events. */ private String summary; @@ -77,6 +71,13 @@ public final class EventProperties implements JsonSerializable */ private EventLevelValues eventLevel; + /* + * If true the event may contains sensitive data. Use the post events/{trackingId}/fetchEventDetails endpoint to + * fetch sensitive data see + * https://learn.microsoft.com/en-us/azure/service-health/security-advisories-elevated-access + */ + private Boolean isEventSensitive; + /* * The id of the Incident */ @@ -133,7 +134,8 @@ public final class EventProperties implements JsonSerializable private Boolean enableMicrosoftSupport; /* - * Contains the communication message for the event, that could include summary, root cause and other details. + * Contains the communication message for the event, that could include summary, root cause and other details. Use + * fetchEventDetails endpoint to get description of sensitive events. */ private String description; @@ -180,19 +182,19 @@ public final class EventProperties implements JsonSerializable private String impactType; /* - * Unique identifier for planned maintenance event. + * A list of metadata tags associated with the event. Possible values include: + * -Action Recommended: Action may be required by you to avoid possible disruptions or mitigate risks for your + * services. It is recommended to evaluate these actions and the potential impact on your services. + * - False Positive: After investigation, we've determined your service is healthy and service issues did not impact + * your services as originally communicated. + * - Preliminary PIR: For our largest, most impactful service issues a Preliminary Post Incident Review (PIR) is + * published generally within 72 hours of mitigation, to summarize what we have learned so far from the + * still-in-progress investigation. + * - Final PIR: For service issues, a Final Post Incident Review (PIR) may be published to provide additional + * details or learnings. Sometimes this requires us to complete an internal retrospective, generally within 14 days + * of mitigation. */ - private String maintenanceId; - - /* - * The type of planned maintenance event. - */ - private String maintenanceType; - - /* - * Azure Resource Graph query to fetch the affected resources from their existing Azure Resource Graph locations. - */ - private String argQuery; + private List eventTags; /** * Creates an instance of EventProperties class. @@ -220,28 +222,6 @@ public EventProperties withEventType(EventTypeValues eventType) { return this; } - /** - * Get the eventSubType property: Sub type of the event. Currently used to determine retirement communications for - * health advisory events. - * - * @return the eventSubType value. - */ - public EventSubTypeValues eventSubType() { - return this.eventSubType; - } - - /** - * Set the eventSubType property: Sub type of the event. Currently used to determine retirement communications for - * health advisory events. - * - * @param eventSubType the eventSubType value to set. - * @return the EventProperties object itself. - */ - public EventProperties withEventSubType(EventSubTypeValues eventSubType) { - this.eventSubType = eventSubType; - return this; - } - /** * Get the eventSource property: Source of event. * @@ -303,7 +283,8 @@ public EventProperties withTitle(String title) { } /** - * Get the summary property: Summary text of event. + * Get the summary property: Summary text of event. Use fetchEventDetails endpoint to get summary of sensitive + * events. * * @return the summary value. */ @@ -312,7 +293,8 @@ public String summary() { } /** - * Set the summary property: Summary text of event. + * Set the summary property: Summary text of event. Use fetchEventDetails endpoint to get summary of sensitive + * events. * * @param summary the summary value to set. * @return the EventProperties object itself. @@ -382,6 +364,30 @@ public EventProperties withEventLevel(EventLevelValues eventLevel) { return this; } + /** + * Get the isEventSensitive property: If true the event may contains sensitive data. Use the post + * events/{trackingId}/fetchEventDetails endpoint to fetch sensitive data see + * https://learn.microsoft.com/en-us/azure/service-health/security-advisories-elevated-access. + * + * @return the isEventSensitive value. + */ + public Boolean isEventSensitive() { + return this.isEventSensitive; + } + + /** + * Set the isEventSensitive property: If true the event may contains sensitive data. Use the post + * events/{trackingId}/fetchEventDetails endpoint to fetch sensitive data see + * https://learn.microsoft.com/en-us/azure/service-health/security-advisories-elevated-access. + * + * @param isEventSensitive the isEventSensitive value to set. + * @return the EventProperties object itself. + */ + public EventProperties withIsEventSensitive(Boolean isEventSensitive) { + this.isEventSensitive = isEventSensitive; + return this; + } + /** * Get the externalIncidentId property: The id of the Incident. * @@ -604,7 +610,7 @@ public EventProperties withEnableMicrosoftSupport(Boolean enableMicrosoftSupport /** * Get the description property: Contains the communication message for the event, that could include summary, root - * cause and other details. + * cause and other details. Use fetchEventDetails endpoint to get description of sensitive events. * * @return the description value. */ @@ -614,7 +620,7 @@ public String description() { /** * Set the description property: Contains the communication message for the event, that could include summary, root - * cause and other details. + * cause and other details. Use fetchEventDetails endpoint to get description of sensitive events. * * @param description the description value to set. * @return the EventProperties object itself. @@ -791,64 +797,42 @@ public EventProperties withImpactType(String impactType) { } /** - * Get the maintenanceId property: Unique identifier for planned maintenance event. - * - * @return the maintenanceId value. - */ - public String maintenanceId() { - return this.maintenanceId; - } - - /** - * Set the maintenanceId property: Unique identifier for planned maintenance event. - * - * @param maintenanceId the maintenanceId value to set. - * @return the EventProperties object itself. - */ - public EventProperties withMaintenanceId(String maintenanceId) { - this.maintenanceId = maintenanceId; - return this; - } - - /** - * Get the maintenanceType property: The type of planned maintenance event. - * - * @return the maintenanceType value. - */ - public String maintenanceType() { - return this.maintenanceType; - } - - /** - * Set the maintenanceType property: The type of planned maintenance event. - * - * @param maintenanceType the maintenanceType value to set. - * @return the EventProperties object itself. - */ - public EventProperties withMaintenanceType(String maintenanceType) { - this.maintenanceType = maintenanceType; - return this; - } - - /** - * Get the argQuery property: Azure Resource Graph query to fetch the affected resources from their existing Azure - * Resource Graph locations. + * Get the eventTags property: A list of metadata tags associated with the event. Possible values include: + * -Action Recommended: Action may be required by you to avoid possible disruptions or mitigate risks for your + * services. It is recommended to evaluate these actions and the potential impact on your services. + * - False Positive: After investigation, we've determined your service is healthy and service issues did not impact + * your services as originally communicated. + * - Preliminary PIR: For our largest, most impactful service issues a Preliminary Post Incident Review (PIR) is + * published generally within 72 hours of mitigation, to summarize what we have learned so far from the + * still-in-progress investigation. + * - Final PIR: For service issues, a Final Post Incident Review (PIR) may be published to provide additional + * details or learnings. Sometimes this requires us to complete an internal retrospective, generally within 14 days + * of mitigation. * - * @return the argQuery value. + * @return the eventTags value. */ - public String argQuery() { - return this.argQuery; + public List eventTags() { + return this.eventTags; } /** - * Set the argQuery property: Azure Resource Graph query to fetch the affected resources from their existing Azure - * Resource Graph locations. + * Set the eventTags property: A list of metadata tags associated with the event. Possible values include: + * -Action Recommended: Action may be required by you to avoid possible disruptions or mitigate risks for your + * services. It is recommended to evaluate these actions and the potential impact on your services. + * - False Positive: After investigation, we've determined your service is healthy and service issues did not impact + * your services as originally communicated. + * - Preliminary PIR: For our largest, most impactful service issues a Preliminary Post Incident Review (PIR) is + * published generally within 72 hours of mitigation, to summarize what we have learned so far from the + * still-in-progress investigation. + * - Final PIR: For service issues, a Final Post Incident Review (PIR) may be published to provide additional + * details or learnings. Sometimes this requires us to complete an internal retrospective, generally within 14 days + * of mitigation. * - * @param argQuery the argQuery value to set. + * @param eventTags the eventTags value to set. * @return the EventProperties object itself. */ - public EventProperties withArgQuery(String argQuery) { - this.argQuery = argQuery; + public EventProperties withEventTags(List eventTags) { + this.eventTags = eventTags; return this; } @@ -885,7 +869,6 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("eventType", this.eventType == null ? null : this.eventType.toString()); - jsonWriter.writeStringField("eventSubType", this.eventSubType == null ? null : this.eventSubType.toString()); jsonWriter.writeStringField("eventSource", this.eventSource == null ? null : this.eventSource.toString()); jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); jsonWriter.writeStringField("title", this.title); @@ -893,6 +876,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("header", this.headerProperty); jsonWriter.writeStringField("level", this.level == null ? null : this.level.toString()); jsonWriter.writeStringField("eventLevel", this.eventLevel == null ? null : this.eventLevel.toString()); + jsonWriter.writeBooleanField("isEventSensitive", this.isEventSensitive); jsonWriter.writeStringField("externalIncidentId", this.externalIncidentId); jsonWriter.writeStringField("reason", this.reason); jsonWriter.writeJsonField("article", this.article); @@ -918,9 +902,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeJsonField("additionalInformation", this.additionalInformation); jsonWriter.writeNumberField("duration", this.duration); jsonWriter.writeStringField("impactType", this.impactType); - jsonWriter.writeStringField("maintenanceId", this.maintenanceId); - jsonWriter.writeStringField("maintenanceType", this.maintenanceType); - jsonWriter.writeStringField("argQuery", this.argQuery); + jsonWriter.writeArrayField("eventTags", this.eventTags, (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } @@ -941,8 +923,6 @@ public static EventProperties fromJson(JsonReader jsonReader) throws IOException if ("eventType".equals(fieldName)) { deserializedEventProperties.eventType = EventTypeValues.fromString(reader.getString()); - } else if ("eventSubType".equals(fieldName)) { - deserializedEventProperties.eventSubType = EventSubTypeValues.fromString(reader.getString()); } else if ("eventSource".equals(fieldName)) { deserializedEventProperties.eventSource = EventSourceValues.fromString(reader.getString()); } else if ("status".equals(fieldName)) { @@ -957,6 +937,8 @@ public static EventProperties fromJson(JsonReader jsonReader) throws IOException deserializedEventProperties.level = LevelValues.fromString(reader.getString()); } else if ("eventLevel".equals(fieldName)) { deserializedEventProperties.eventLevel = EventLevelValues.fromString(reader.getString()); + } else if ("isEventSensitive".equals(fieldName)) { + deserializedEventProperties.isEventSensitive = reader.getNullable(JsonReader::getBoolean); } else if ("externalIncidentId".equals(fieldName)) { deserializedEventProperties.externalIncidentId = reader.getString(); } else if ("reason".equals(fieldName)) { @@ -1004,12 +986,9 @@ public static EventProperties fromJson(JsonReader jsonReader) throws IOException deserializedEventProperties.duration = reader.getNullable(JsonReader::getInt); } else if ("impactType".equals(fieldName)) { deserializedEventProperties.impactType = reader.getString(); - } else if ("maintenanceId".equals(fieldName)) { - deserializedEventProperties.maintenanceId = reader.getString(); - } else if ("maintenanceType".equals(fieldName)) { - deserializedEventProperties.maintenanceType = reader.getString(); - } else if ("argQuery".equals(fieldName)) { - deserializedEventProperties.argQuery = reader.getString(); + } else if ("eventTags".equals(fieldName)) { + List eventTags = reader.readArray(reader1 -> reader1.getString()); + deserializedEventProperties.eventTags = eventTags; } else { reader.skipChildren(); } 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 bc92739a9149..ea330ad1cdbc 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 @@ -25,6 +25,7 @@ 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.AvailabilityStatusesClient; import com.azure.resourcemanager.resourcehealth.fluent.models.AvailabilityStatusInner; import com.azure.resourcemanager.resourcehealth.models.AvailabilityStatusListResult; @@ -71,6 +72,15 @@ Mono> listBySubscriptionId(@HostParam("$h @PathParam("subscriptionId") String subscriptionId, @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/availabilityStatuses") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySubscriptionIdSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ResourceHealth/availabilityStatuses") @ExpectedResponses({ 200 }) @@ -81,6 +91,16 @@ Mono> listByResourceGroup(@HostParam("$ho @QueryParam("$filter") String filter, @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ResourceHealth/availabilityStatuses") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/{resourceUri}/providers/Microsoft.ResourceHealth/availabilityStatuses/current") @ExpectedResponses({ 200 }) @@ -90,6 +110,15 @@ Mono> getByResource(@HostParam("$host") String @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/{resourceUri}/providers/Microsoft.ResourceHealth/availabilityStatuses/current") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getByResourceSync(@HostParam("$host") String endpoint, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, + @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/{resourceUri}/providers/Microsoft.ResourceHealth/availabilityStatuses") @ExpectedResponses({ 200 }) @@ -99,6 +128,15 @@ Mono> list(@HostParam("$host") String end @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/{resourceUri}/providers/Microsoft.ResourceHealth/availabilityStatuses") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@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 }) @@ -107,6 +145,14 @@ Mono> listBySubscriptionIdNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySubscriptionIdNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -115,6 +161,14 @@ Mono> listByResourceGroupNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -122,6 +176,14 @@ Mono> listByResourceGroupNext( Mono> listNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -156,39 +218,6 @@ private Mono> listBySubscriptionIdSingleP .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Lists the current availability status for all the resources in the subscription. - * - * @param filter The filter to apply on the operation. For more information please see - * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. - * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List availabilityStatus operation response along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionIdSinglePageAsync(String filter, - String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBySubscriptionId(this.client.getEndpoint(), this.client.getApiVersion(), filter, - this.client.getSubscriptionId(), expand, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - /** * Lists the current availability status for all the resources in the subscription. * @@ -221,6 +250,36 @@ private PagedFlux listBySubscriptionIdAsync() { nextLink -> listBySubscriptionIdNextSinglePageAsync(nextLink)); } + /** + * Lists the current availability status for all the resources in the subscription. + * + * @param filter The filter to apply on the operation. For more information please see + * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List availabilityStatus operation response along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionIdSinglePage(String filter, String expand) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listBySubscriptionIdSync(this.client.getEndpoint(), + this.client.getApiVersion(), filter, this.client.getSubscriptionId(), expand, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Lists the current availability status for all the resources in the subscription. * @@ -231,13 +290,26 @@ private PagedFlux listBySubscriptionIdAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List availabilityStatus operation response as paginated response with {@link PagedFlux}. + * @return the List availabilityStatus operation response along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySubscriptionIdAsync(String filter, String expand, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionIdSinglePage(String filter, String expand, Context context) { - return new PagedFlux<>(() -> listBySubscriptionIdSinglePageAsync(filter, expand, context), - nextLink -> listBySubscriptionIdNextSinglePageAsync(nextLink, context)); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listBySubscriptionIdSync(this.client.getEndpoint(), + this.client.getApiVersion(), filter, this.client.getSubscriptionId(), expand, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -251,7 +323,8 @@ private PagedFlux listBySubscriptionIdAsync(String filt public PagedIterable listBySubscriptionId() { final String filter = null; final String expand = null; - return new PagedIterable<>(listBySubscriptionIdAsync(filter, expand)); + return new PagedIterable<>(() -> listBySubscriptionIdSinglePage(filter, expand), + nextLink -> listBySubscriptionIdNextSinglePage(nextLink)); } /** @@ -268,7 +341,8 @@ public PagedIterable listBySubscriptionId() { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listBySubscriptionId(String filter, String expand, Context context) { - return new PagedIterable<>(listBySubscriptionIdAsync(filter, expand, context)); + return new PagedIterable<>(() -> listBySubscriptionIdSinglePage(filter, expand, context), + nextLink -> listBySubscriptionIdNextSinglePage(nextLink, context)); } /** @@ -316,52 +390,31 @@ private Mono> listByResourceGroupSinglePa * @param filter The filter to apply on the operation. For more information please see * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List availabilityStatus operation response along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the List availabilityStatus operation response as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - String filter, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), filter, expand, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter, + String expand) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, expand), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** * Lists the current availability status for all the resources in the resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter The filter to apply on the operation. For more information please see - * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. - * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the List availabilityStatus operation response as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter, - String expand) { + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + final String filter = null; + final String expand = null; return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, expand), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } @@ -370,17 +423,37 @@ private PagedFlux listByResourceGroupAsync(String resou * Lists the current availability status for all the resources in the resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter The filter to apply on the operation. For more information please see + * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List availabilityStatus operation response as paginated response with {@link PagedFlux}. + * @return the List availabilityStatus operation response along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - final String filter = null; - final String expand = null; - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, expand), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, + String filter, String expand) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByResourceGroupSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, this.client.getApiVersion(), filter, expand, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -394,13 +467,31 @@ private PagedFlux listByResourceGroupAsync(String resou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List availabilityStatus operation response as paginated response with {@link PagedFlux}. + * @return the List availabilityStatus operation response along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter, - String expand, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, expand, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, + String filter, String expand, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByResourceGroupSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, this.client.getApiVersion(), filter, expand, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -416,7 +507,8 @@ private PagedFlux listByResourceGroupAsync(String resou public PagedIterable listByResourceGroup(String resourceGroupName) { final String filter = null; final String expand = null; - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, expand)); + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, filter, expand), + nextLink -> listByResourceGroupNextSinglePage(nextLink)); } /** @@ -435,7 +527,8 @@ public PagedIterable listByResourceGroup(String resourc @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, String filter, String expand, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, expand, context)); + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, filter, expand, context), + nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); } /** @@ -472,40 +565,6 @@ private Mono> getByResourceWithResponseAsync(S .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets current availability status for a single resource. - * - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. - * Currently the API support not nested and one nesting level resource types : - * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} - * and - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}. - * @param filter The filter to apply on the operation. For more information please see - * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. - * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return current availability status for a single resource along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceWithResponseAsync(String resourceUri, String filter, - String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getByResource(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), filter, - expand, accept, context); - } - /** * Gets current availability status for a single resource. * @@ -547,7 +606,18 @@ private Mono getByResourceAsync(String resourceUri) { @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceWithResponse(String resourceUri, String filter, String expand, Context context) { - return getByResourceWithResponseAsync(resourceUri, filter, expand, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getByResourceSync(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), filter, + expand, accept, context); } /** @@ -617,29 +687,15 @@ private Mono> listSinglePageAsync(String * @param filter The filter to apply on the operation. For more information please see * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List availabilityStatus operation response along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the List availabilityStatus operation response as paginated response with {@link PagedFlux}. */ - @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)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceUri, String filter, String expand) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceUri, filter, expand), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -650,16 +706,15 @@ private Mono> listSinglePageAsync(String * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} * and * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}. - * @param filter The filter to apply on the operation. For more information please see - * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. - * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the List availabilityStatus operation response as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceUri, String filter, String expand) { + private PagedFlux listAsync(String resourceUri) { + final String filter = null; + final String expand = null; return new PagedFlux<>(() -> listSinglePageAsync(resourceUri, filter, expand), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -672,17 +727,30 @@ private PagedFlux listAsync(String resourceUri, String * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} * and * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}. + * @param filter The filter to apply on the operation. For more information please see + * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List availabilityStatus operation response as paginated response with {@link PagedFlux}. + * @return the List availabilityStatus operation response along with {@link PagedResponse}. */ - @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)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceUri, String filter, String expand) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), resourceUri, + this.client.getApiVersion(), filter, expand, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -700,13 +768,25 @@ private PagedFlux listAsync(String resourceUri) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List availabilityStatus operation response as paginated response with {@link PagedFlux}. + * @return the List availabilityStatus operation response along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceUri, String filter, String expand, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceUri, String filter, String expand, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceUri, filter, expand, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), resourceUri, + this.client.getApiVersion(), filter, expand, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -726,7 +806,8 @@ private PagedFlux listAsync(String resourceUri, String public PagedIterable list(String resourceUri) { final String filter = null; final String expand = null; - return new PagedIterable<>(listAsync(resourceUri, filter, expand)); + return new PagedIterable<>(() -> listSinglePage(resourceUri, filter, expand), + nextLink -> listNextSinglePage(nextLink)); } /** @@ -749,7 +830,8 @@ public PagedIterable list(String resourceUri) { @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceUri, String filter, String expand, Context context) { - return new PagedIterable<>(listAsync(resourceUri, filter, expand, context)); + return new PagedIterable<>(() -> listSinglePage(resourceUri, filter, expand, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -780,6 +862,33 @@ private Mono> listBySubscriptionIdNextSin .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List availabilityStatus operation response along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionIdNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listBySubscriptionIdNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -788,24 +897,25 @@ private Mono> listBySubscriptionIdNextSin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List availabilityStatus operation response along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the List availabilityStatus operation response along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionIdNextSinglePageAsync(String nextLink, + private PagedResponse listBySubscriptionIdNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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)); + Response res + = service.listBySubscriptionIdNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -836,6 +946,33 @@ private Mono> listByResourceGroupNextSing .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List availabilityStatus operation response along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -844,24 +981,24 @@ private Mono> listByResourceGroupNextSing * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List availabilityStatus operation response along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the List availabilityStatus operation response along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, - Context context) { + private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -890,6 +1027,33 @@ private Mono> listNextSinglePageAsync(Str .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List availabilityStatus operation response along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -898,22 +1062,25 @@ private Mono> listNextSinglePageAsync(Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List availabilityStatus operation response along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the List availabilityStatus operation response along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private PagedResponse listNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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)); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(AvailabilityStatusesClientImpl.class); } diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/ChildAvailabilityStatusesClientImpl.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/ChildAvailabilityStatusesClientImpl.java index 08998a98a13d..2394a0079dc4 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/ChildAvailabilityStatusesClientImpl.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/ChildAvailabilityStatusesClientImpl.java @@ -25,6 +25,7 @@ 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.ChildAvailabilityStatusesClient; import com.azure.resourcemanager.resourcehealth.fluent.models.AvailabilityStatusInner; import com.azure.resourcemanager.resourcehealth.models.AvailabilityStatusListResult; @@ -71,6 +72,15 @@ Mono> getByResource(@HostParam("$host") String @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/{resourceUri}/providers/Microsoft.ResourceHealth/childAvailabilityStatuses/current") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getByResourceSync(@HostParam("$host") String endpoint, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, + @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/{resourceUri}/providers/Microsoft.ResourceHealth/childAvailabilityStatuses") @ExpectedResponses({ 200 }) @@ -80,6 +90,15 @@ Mono> list(@HostParam("$host") String end @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/{resourceUri}/providers/Microsoft.ResourceHealth/childAvailabilityStatuses") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@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 }) @@ -87,6 +106,14 @@ Mono> list(@HostParam("$host") String end Mono> listNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -121,38 +148,6 @@ private Mono> getByResourceWithResponseAsync(S .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets current availability status for a single resource. - * - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. - * Currently the API 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 expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return current availability status for a single resource along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceWithResponseAsync(String resourceUri, String filter, - String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getByResource(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), filter, - expand, accept, context); - } - /** * Gets current availability status for a single resource. * @@ -190,7 +185,18 @@ private Mono getByResourceAsync(String resourceUri) { @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceWithResponse(String resourceUri, String filter, String expand, Context context) { - return getByResourceWithResponseAsync(resourceUri, filter, expand, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getByResourceSync(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), filter, + expand, accept, context); } /** @@ -256,29 +262,15 @@ private Mono> listSinglePageAsync(String * @param filter The filter to apply on the operation. For more information please see * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List availabilityStatus operation response along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the List availabilityStatus operation response as paginated response with {@link PagedFlux}. */ - @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)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceUri, String filter, String expand) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceUri, filter, expand), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -288,16 +280,15 @@ private Mono> listSinglePageAsync(String * @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 expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the List availabilityStatus operation response as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceUri, String filter, String expand) { + private PagedFlux listAsync(String resourceUri) { + final String filter = null; + final String expand = null; return new PagedFlux<>(() -> listSinglePageAsync(resourceUri, filter, expand), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -309,17 +300,30 @@ private PagedFlux listAsync(String resourceUri, String * @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 expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List availabilityStatus operation response as paginated response with {@link PagedFlux}. + * @return the List availabilityStatus operation response along with {@link PagedResponse}. */ - @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)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceUri, String filter, String expand) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), resourceUri, + this.client.getApiVersion(), filter, expand, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -336,13 +340,25 @@ private PagedFlux listAsync(String resourceUri) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List availabilityStatus operation response as paginated response with {@link PagedFlux}. + * @return the List availabilityStatus operation response along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceUri, String filter, String expand, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceUri, String filter, String expand, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceUri, filter, expand, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), resourceUri, + this.client.getApiVersion(), filter, expand, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -361,7 +377,8 @@ private PagedFlux listAsync(String resourceUri, String public PagedIterable list(String resourceUri) { final String filter = null; final String expand = null; - return new PagedIterable<>(listAsync(resourceUri, filter, expand)); + return new PagedIterable<>(() -> listSinglePage(resourceUri, filter, expand), + nextLink -> listNextSinglePage(nextLink)); } /** @@ -383,7 +400,8 @@ public PagedIterable list(String resourceUri) { @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceUri, String filter, String expand, Context context) { - return new PagedIterable<>(listAsync(resourceUri, filter, expand, context)); + return new PagedIterable<>(() -> listSinglePage(resourceUri, filter, expand, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -412,6 +430,33 @@ private Mono> listNextSinglePageAsync(Str .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List availabilityStatus operation response along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -420,22 +465,25 @@ private Mono> listNextSinglePageAsync(Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List availabilityStatus operation response along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the List availabilityStatus operation response along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private PagedResponse listNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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)); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(ChildAvailabilityStatusesClientImpl.class); } 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 index e6b1c9604736..3978a89c5d82 100644 --- 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 @@ -25,6 +25,7 @@ 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; @@ -71,6 +72,15 @@ Mono> list(@HostParam("$host") String end @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/{resourceUri}/providers/Microsoft.ResourceHealth/childResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@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 }) @@ -78,6 +88,14 @@ Mono> list(@HostParam("$host") String end Mono> listNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -125,29 +143,15 @@ private Mono> listSinglePageAsync(String * @param filter The filter to apply on the operation. For more information please see * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List availabilityStatus operation response along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the List availabilityStatus operation response as paginated response with {@link PagedFlux}. */ - @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)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceUri, String filter, String expand) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceUri, filter, expand), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -157,16 +161,15 @@ private Mono> listSinglePageAsync(String * @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 as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceUri, String filter, String expand) { + private PagedFlux listAsync(String resourceUri) { + final String filter = null; + final String expand = null; return new PagedFlux<>(() -> listSinglePageAsync(resourceUri, filter, expand), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -178,17 +181,30 @@ private PagedFlux listAsync(String resourceUri, String * @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 as paginated response with {@link PagedFlux}. + * @return the List availabilityStatus operation response along with {@link PagedResponse}. */ - @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)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceUri, String filter, String expand) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), resourceUri, + this.client.getApiVersion(), filter, expand, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -205,13 +221,25 @@ private PagedFlux listAsync(String resourceUri) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List availabilityStatus operation response as paginated response with {@link PagedFlux}. + * @return the List availabilityStatus operation response along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceUri, String filter, String expand, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceUri, String filter, String expand, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceUri, filter, expand, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), resourceUri, + this.client.getApiVersion(), filter, expand, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -230,7 +258,8 @@ private PagedFlux listAsync(String resourceUri, String public PagedIterable list(String resourceUri) { final String filter = null; final String expand = null; - return new PagedIterable<>(listAsync(resourceUri, filter, expand)); + return new PagedIterable<>(() -> listSinglePage(resourceUri, filter, expand), + nextLink -> listNextSinglePage(nextLink)); } /** @@ -252,7 +281,8 @@ public PagedIterable list(String resourceUri) { @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceUri, String filter, String expand, Context context) { - return new PagedIterable<>(listAsync(resourceUri, filter, expand, context)); + return new PagedIterable<>(() -> listSinglePage(resourceUri, filter, expand, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -281,6 +311,33 @@ private Mono> listNextSinglePageAsync(Str .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List availabilityStatus operation response along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -289,22 +346,25 @@ private Mono> listNextSinglePageAsync(Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List availabilityStatus operation response along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the List availabilityStatus operation response along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private PagedResponse listNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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)); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(ChildResourcesClientImpl.class); } diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EmergingIssuesClientImpl.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EmergingIssuesClientImpl.java index 5c0566f5bf14..882f8adc50a1 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EmergingIssuesClientImpl.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EmergingIssuesClientImpl.java @@ -25,6 +25,7 @@ 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.EmergingIssuesClient; import com.azure.resourcemanager.resourcehealth.fluent.models.EmergingIssuesGetResultInner; import com.azure.resourcemanager.resourcehealth.models.EmergingIssueListResult; @@ -70,6 +71,13 @@ public interface EmergingIssuesService { Mono> list(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.ResourceHealth/emergingIssues") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.ResourceHealth/emergingIssues/{issueName}") @ExpectedResponses({ 200 }) @@ -78,12 +86,27 @@ Mono> get(@HostParam("$host") String endp @PathParam("issueName") IssueNameParameter issueName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.ResourceHealth/emergingIssues/{issueName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("$host") String endpoint, + @PathParam("issueName") IssueNameParameter issueName, @QueryParam("api-version") String apiVersion, + @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); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -111,23 +134,13 @@ private Mono> listSinglePageAsync() /** * Lists Azure services' emerging issues. * - * @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 of emerging issues along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the list of emerging issues as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -135,11 +148,20 @@ private Mono> listSinglePageAsync(Co * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of emerging issues as paginated response with {@link PagedFlux}. + * @return the list of emerging issues along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -149,12 +171,20 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of emerging issues as paginated response with {@link PagedFlux}. + * @return the list of emerging issues along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -166,7 +196,7 @@ private PagedFlux listAsync(Context context) { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { - return new PagedIterable<>(listAsync()); + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); } /** @@ -180,7 +210,7 @@ public PagedIterable list() { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -207,31 +237,6 @@ private Mono> getWithResponseAsync(IssueN .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets Azure services' emerging issues. - * - * @param issueName The name of the emerging issue. - * @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 azure services' emerging issues along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(IssueNameParameter issueName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (issueName == null) { - return Mono.error(new IllegalArgumentException("Parameter issueName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), issueName, this.client.getApiVersion(), accept, context); - } - /** * Gets Azure services' emerging issues. * @@ -258,7 +263,17 @@ private Mono getAsync(IssueNameParameter issueName */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(IssueNameParameter issueName, Context context) { - return getWithResponseAsync(issueName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (issueName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter issueName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), issueName, this.client.getApiVersion(), accept, context); } /** @@ -300,6 +315,33 @@ private Mono> listNextSinglePageAsyn .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of emerging issues along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -308,22 +350,25 @@ private Mono> listNextSinglePageAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of emerging issues along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the list of emerging issues along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, - Context context) { + private PagedResponse listNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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)); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(EmergingIssuesClientImpl.class); } diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EventImpactedResourceImpl.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EventImpactedResourceImpl.java index 6320d53e5ab2..75746bba5df8 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EventImpactedResourceImpl.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EventImpactedResourceImpl.java @@ -50,26 +50,6 @@ public String targetRegion() { return this.innerModel().targetRegion(); } - public String resourceName() { - return this.innerModel().resourceName(); - } - - public String resourceGroup() { - return this.innerModel().resourceGroup(); - } - - public String status() { - return this.innerModel().status(); - } - - public String maintenanceStartTime() { - return this.innerModel().maintenanceStartTime(); - } - - public String maintenanceEndTime() { - return this.innerModel().maintenanceEndTime(); - } - public List info() { List inner = this.innerModel().info(); if (inner != null) { 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 index 94ccd1b69e59..ed5b5b130af4 100644 --- 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 @@ -13,7 +13,6 @@ 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.EventSubTypeValues; import com.azure.resourcemanager.resourcehealth.models.EventTypeValues; import com.azure.resourcemanager.resourcehealth.models.Faq; import com.azure.resourcemanager.resourcehealth.models.Impact; @@ -53,10 +52,6 @@ public EventTypeValues eventType() { return this.innerModel().eventType(); } - public EventSubTypeValues eventSubType() { - return this.innerModel().eventSubType(); - } - public EventSourceValues eventSource() { return this.innerModel().eventSource(); } @@ -85,6 +80,10 @@ public EventLevelValues eventLevel() { return this.innerModel().eventLevel(); } + public Boolean isEventSensitive() { + return this.innerModel().isEventSensitive(); + } + public String externalIncidentId() { return this.innerModel().externalIncidentId(); } @@ -180,16 +179,13 @@ public String impactType() { return this.innerModel().impactType(); } - public String maintenanceId() { - return this.innerModel().maintenanceId(); - } - - public String maintenanceType() { - return this.innerModel().maintenanceType(); - } - - public String argQuery() { - return this.innerModel().argQuery(); + public List eventTags() { + List inner = this.innerModel().eventTags(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } } public EventInner innerModel() { diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EventOperationsClientImpl.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EventOperationsClientImpl.java index d03670d4f7b1..9387a343de3b 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EventOperationsClientImpl.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EventOperationsClientImpl.java @@ -22,6 +22,7 @@ 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.EventOperationsClient; import com.azure.resourcemanager.resourcehealth.fluent.models.EventInner; import reactor.core.publisher.Mono; @@ -68,6 +69,16 @@ Mono> getBySubscriptionIdAndTrackingId(@HostParam("$host") @PathParam("eventTrackingId") String eventTrackingId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/events/{eventTrackingId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getBySubscriptionIdAndTrackingIdSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, + @QueryParam("queryStartTime") String queryStartTime, @PathParam("subscriptionId") String subscriptionId, + @PathParam("eventTrackingId") String eventTrackingId, @HeaderParam("Accept") String accept, + Context context); + @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/events/{eventTrackingId}/fetchEventDetails") @ExpectedResponses({ 200 }) @@ -77,6 +88,15 @@ Mono> fetchDetailsBySubscriptionIdAndTrackingId(@HostParam( @PathParam("eventTrackingId") String eventTrackingId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/events/{eventTrackingId}/fetchEventDetails") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response fetchDetailsBySubscriptionIdAndTrackingIdSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("eventTrackingId") String eventTrackingId, @HeaderParam("Accept") String accept, + Context context); + @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.ResourceHealth/events/{eventTrackingId}") @ExpectedResponses({ 200 }) @@ -86,6 +106,15 @@ Mono> getByTenantIdAndTrackingId(@HostParam("$host") String @QueryParam("queryStartTime") String queryStartTime, @PathParam("eventTrackingId") String eventTrackingId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.ResourceHealth/events/{eventTrackingId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getByTenantIdAndTrackingIdSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, + @QueryParam("queryStartTime") String queryStartTime, @PathParam("eventTrackingId") String eventTrackingId, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Post("/providers/Microsoft.ResourceHealth/events/{eventTrackingId}/fetchEventDetails") @ExpectedResponses({ 200 }) @@ -93,6 +122,14 @@ Mono> getByTenantIdAndTrackingId(@HostParam("$host") String Mono> fetchDetailsByTenantIdAndTrackingId(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("eventTrackingId") String eventTrackingId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/providers/Microsoft.ResourceHealth/events/{eventTrackingId}/fetchEventDetails") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response fetchDetailsByTenantIdAndTrackingIdSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("eventTrackingId") String eventTrackingId, + @HeaderParam("Accept") String accept, Context context); } /** @@ -101,8 +138,8 @@ Mono> fetchDetailsByTenantIdAndTrackingId(@HostParam("$host * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. * @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 queryStartTime Specifies from when to return events, based on the lastUpdateTime property. For example, - * queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. + * @param queryStartTime Specifies from when to return events (default is 3 days), based on the lastUpdateTime + * property. For example, queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. * @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. @@ -131,41 +168,6 @@ private Mono> getBySubscriptionIdAndTrackingIdWithResponseA .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Service health event in the subscription by event tracking id. - * - * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. - * @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 queryStartTime Specifies from when to return events, based on the lastUpdateTime property. For example, - * queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. - * @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 service health event along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getBySubscriptionIdAndTrackingIdWithResponseAsync(String eventTrackingId, - String filter, String queryStartTime, 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 (eventTrackingId == null) { - return Mono - .error(new IllegalArgumentException("Parameter eventTrackingId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getBySubscriptionIdAndTrackingId(this.client.getEndpoint(), this.client.getApiVersion(), filter, - queryStartTime, this.client.getSubscriptionId(), eventTrackingId, accept, context); - } - /** * Service health event in the subscription by event tracking id. * @@ -189,8 +191,8 @@ private Mono getBySubscriptionIdAndTrackingIdAsync(String eventTrack * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. * @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 queryStartTime Specifies from when to return events, based on the lastUpdateTime property. For example, - * queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. + * @param queryStartTime Specifies from when to return events (default is 3 days), based on the lastUpdateTime + * property. For example, queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. * @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. @@ -200,8 +202,23 @@ private Mono getBySubscriptionIdAndTrackingIdAsync(String eventTrack @ServiceMethod(returns = ReturnType.SINGLE) public Response getBySubscriptionIdAndTrackingIdWithResponse(String eventTrackingId, String filter, String queryStartTime, Context context) { - return getBySubscriptionIdAndTrackingIdWithResponseAsync(eventTrackingId, filter, queryStartTime, context) - .block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (eventTrackingId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter eventTrackingId is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getBySubscriptionIdAndTrackingIdSync(this.client.getEndpoint(), this.client.getApiVersion(), + filter, queryStartTime, this.client.getSubscriptionId(), eventTrackingId, accept, context); } /** @@ -223,7 +240,8 @@ public EventInner getBySubscriptionIdAndTrackingId(String eventTrackingId) { /** * Service health event details in the subscription by event tracking id. This can be used to fetch sensitive - * properties for Security Advisory events. + * properties for Security Advisory events. Please see + * https://learn.microsoft.com/en-us/azure/service-health/security-advisories-elevated-access. * * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -255,39 +273,8 @@ public EventInner getBySubscriptionIdAndTrackingId(String eventTrackingId) { /** * Service health event details in the subscription by event tracking id. This can be used to fetch sensitive - * properties for Security Advisory events. - * - * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. - * @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 service health event along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - fetchDetailsBySubscriptionIdAndTrackingIdWithResponseAsync(String eventTrackingId, 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 (eventTrackingId == null) { - return Mono - .error(new IllegalArgumentException("Parameter eventTrackingId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.fetchDetailsBySubscriptionIdAndTrackingId(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), eventTrackingId, accept, context); - } - - /** - * Service health event details in the subscription by event tracking id. This can be used to fetch sensitive - * properties for Security Advisory events. + * properties for Security Advisory events. Please see + * https://learn.microsoft.com/en-us/azure/service-health/security-advisories-elevated-access. * * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -303,7 +290,8 @@ private Mono fetchDetailsBySubscriptionIdAndTrackingIdAsync(String e /** * Service health event details in the subscription by event tracking id. This can be used to fetch sensitive - * properties for Security Advisory events. + * properties for Security Advisory events. Please see + * https://learn.microsoft.com/en-us/azure/service-health/security-advisories-elevated-access. * * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. * @param context The context to associate with this operation. @@ -315,12 +303,29 @@ private Mono fetchDetailsBySubscriptionIdAndTrackingIdAsync(String e @ServiceMethod(returns = ReturnType.SINGLE) public Response fetchDetailsBySubscriptionIdAndTrackingIdWithResponse(String eventTrackingId, Context context) { - return fetchDetailsBySubscriptionIdAndTrackingIdWithResponseAsync(eventTrackingId, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (eventTrackingId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter eventTrackingId is required and cannot be null.")); + } + final String accept = "application/json"; + return service.fetchDetailsBySubscriptionIdAndTrackingIdSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), eventTrackingId, accept, context); } /** * Service health event details in the subscription by event tracking id. This can be used to fetch sensitive - * properties for Security Advisory events. + * properties for Security Advisory events. Please see + * https://learn.microsoft.com/en-us/azure/service-health/security-advisories-elevated-access. * * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -339,8 +344,8 @@ public EventInner fetchDetailsBySubscriptionIdAndTrackingId(String eventTracking * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. * @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 queryStartTime Specifies from when to return events, based on the lastUpdateTime property. For example, - * queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. + * @param queryStartTime Specifies from when to return events (default is 3 days), based on the lastUpdateTime + * property. For example, queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. * @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. @@ -364,37 +369,6 @@ private Mono> getByTenantIdAndTrackingIdWithResponseAsync(S .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Service health event in the tenant by event tracking id. - * - * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. - * @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 queryStartTime Specifies from when to return events, based on the lastUpdateTime property. For example, - * queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. - * @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 service health event along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByTenantIdAndTrackingIdWithResponseAsync(String eventTrackingId, - String filter, String queryStartTime, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (eventTrackingId == null) { - return Mono - .error(new IllegalArgumentException("Parameter eventTrackingId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getByTenantIdAndTrackingId(this.client.getEndpoint(), this.client.getApiVersion(), filter, - queryStartTime, eventTrackingId, accept, context); - } - /** * Service health event in the tenant by event tracking id. * @@ -418,8 +392,8 @@ private Mono getByTenantIdAndTrackingIdAsync(String eventTrackingId) * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. * @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 queryStartTime Specifies from when to return events, based on the lastUpdateTime property. For example, - * queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. + * @param queryStartTime Specifies from when to return events (default is 3 days), based on the lastUpdateTime + * property. For example, queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. * @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. @@ -429,7 +403,18 @@ private Mono getByTenantIdAndTrackingIdAsync(String eventTrackingId) @ServiceMethod(returns = ReturnType.SINGLE) public Response getByTenantIdAndTrackingIdWithResponse(String eventTrackingId, String filter, String queryStartTime, Context context) { - return getByTenantIdAndTrackingIdWithResponseAsync(eventTrackingId, filter, queryStartTime, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (eventTrackingId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter eventTrackingId is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getByTenantIdAndTrackingIdSync(this.client.getEndpoint(), this.client.getApiVersion(), filter, + queryStartTime, eventTrackingId, accept, context); } /** @@ -450,7 +435,8 @@ public EventInner getByTenantIdAndTrackingId(String eventTrackingId) { /** * Service health event details in the tenant by event tracking id. This can be used to fetch sensitive properties - * for Security Advisory events. + * for Security Advisory events. Please see + * https://learn.microsoft.com/en-us/azure/service-health/security-advisories-elevated-access. * * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -477,35 +463,8 @@ private Mono> fetchDetailsByTenantIdAndTrackingIdWithRespon /** * Service health event details in the tenant by event tracking id. This can be used to fetch sensitive properties - * for Security Advisory events. - * - * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. - * @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 service health event along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> fetchDetailsByTenantIdAndTrackingIdWithResponseAsync(String eventTrackingId, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (eventTrackingId == null) { - return Mono - .error(new IllegalArgumentException("Parameter eventTrackingId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.fetchDetailsByTenantIdAndTrackingId(this.client.getEndpoint(), this.client.getApiVersion(), - eventTrackingId, accept, context); - } - - /** - * Service health event details in the tenant by event tracking id. This can be used to fetch sensitive properties - * for Security Advisory events. + * for Security Advisory events. Please see + * https://learn.microsoft.com/en-us/azure/service-health/security-advisories-elevated-access. * * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -521,7 +480,8 @@ private Mono fetchDetailsByTenantIdAndTrackingIdAsync(String eventTr /** * Service health event details in the tenant by event tracking id. This can be used to fetch sensitive properties - * for Security Advisory events. + * for Security Advisory events. Please see + * https://learn.microsoft.com/en-us/azure/service-health/security-advisories-elevated-access. * * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. * @param context The context to associate with this operation. @@ -533,12 +493,24 @@ private Mono fetchDetailsByTenantIdAndTrackingIdAsync(String eventTr @ServiceMethod(returns = ReturnType.SINGLE) public Response fetchDetailsByTenantIdAndTrackingIdWithResponse(String eventTrackingId, Context context) { - return fetchDetailsByTenantIdAndTrackingIdWithResponseAsync(eventTrackingId, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (eventTrackingId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter eventTrackingId is required and cannot be null.")); + } + final String accept = "application/json"; + return service.fetchDetailsByTenantIdAndTrackingIdSync(this.client.getEndpoint(), this.client.getApiVersion(), + eventTrackingId, accept, context); } /** * Service health event details in the tenant by event tracking id. This can be used to fetch sensitive properties - * for Security Advisory events. + * for Security Advisory events. Please see + * https://learn.microsoft.com/en-us/azure/service-health/security-advisories-elevated-access. * * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -550,4 +522,6 @@ public Response fetchDetailsByTenantIdAndTrackingIdWithResponse(Stri public EventInner fetchDetailsByTenantIdAndTrackingId(String eventTrackingId) { return fetchDetailsByTenantIdAndTrackingIdWithResponse(eventTrackingId, Context.NONE).getValue(); } + + private static final ClientLogger LOGGER = new ClientLogger(EventOperationsClientImpl.class); } 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/EventsOperationsClientImpl.java index 45ff567e7674..449e8a40245a 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/EventsOperationsClientImpl.java @@ -25,6 +25,7 @@ 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.EventsOperationsClient; import com.azure.resourcemanager.resourcehealth.fluent.models.EventInner; import com.azure.resourcemanager.resourcehealth.models.Events; @@ -70,6 +71,14 @@ Mono> list(@HostParam("$host") String endpoint, @QueryParam("ap @QueryParam("$filter") String filter, @QueryParam("queryStartTime") String queryStartTime, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/events") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, @QueryParam("queryStartTime") String queryStartTime, + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.ResourceHealth/events") @ExpectedResponses({ 200 }) @@ -78,6 +87,14 @@ Mono> listByTenantId(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, @QueryParam("queryStartTime") String queryStartTime, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.ResourceHealth/events") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByTenantIdSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, + @QueryParam("queryStartTime") String queryStartTime, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/{resourceUri}/providers/Microsoft.ResourceHealth/events") @ExpectedResponses({ 200 }) @@ -87,6 +104,15 @@ Mono> listBySingleResource(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/{resourceUri}/providers/Microsoft.ResourceHealth/events") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySingleResourceSync(@HostParam("$host") String endpoint, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -94,6 +120,13 @@ Mono> listBySingleResource(@HostParam("$host") String endpoint, Mono> listBySubscriptionIdNext(@PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySubscriptionIdNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -101,12 +134,26 @@ Mono> listBySubscriptionIdNext(@PathParam(value = "nextLink", e Mono> listByTenantIdNext(@PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByTenantIdNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySingleResourceNext(@PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySingleResourceNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -114,8 +161,8 @@ Mono> listBySingleResourceNext(@PathParam(value = "nextLink", e * * @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 queryStartTime Specifies from when to return events, based on the lastUpdateTime property. For example, - * queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. + * @param queryStartTime Specifies from when to return events (default is 3 days), based on the lastUpdateTime + * property. For example, queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. * @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. @@ -146,41 +193,8 @@ private Mono> listSinglePageAsync(String filter, Strin * * @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 queryStartTime Specifies from when to return events, based on the lastUpdateTime property. For example, - * queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. - * @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 along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter, String queryStartTime, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), filter, queryStartTime, - this.client.getSubscriptionId(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Lists service health events in the subscription. - * - * @param filter The filter to apply on the operation. For more information please see - * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. - * @param queryStartTime Specifies from when to return events, based on the lastUpdateTime property. For example, - * queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. + * @param queryStartTime Specifies from when to return events (default is 3 days), based on the lastUpdateTime + * property. For example, queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. * @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. @@ -212,18 +226,62 @@ private PagedFlux listAsync() { * * @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 queryStartTime Specifies from when to return events, based on the lastUpdateTime property. For example, - * queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. + * @param queryStartTime Specifies from when to return events (default is 3 days), based on the lastUpdateTime + * property. For example, queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. + * @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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String filter, String queryStartTime) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), filter, + queryStartTime, this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists service health events in the subscription. + * + * @param filter The filter to apply on the operation. For more information please see + * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. + * @param queryStartTime Specifies from when to return events (default is 3 days), based on the lastUpdateTime + * property. For example, queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. * @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 as paginated response with {@link PagedFlux}. + * @return the List events operation response along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter, String queryStartTime, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(filter, queryStartTime, context), - nextLink -> listBySubscriptionIdNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String filter, String queryStartTime, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), filter, + queryStartTime, this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -237,7 +295,8 @@ private PagedFlux listAsync(String filter, String queryStartTime, Co public PagedIterable list() { final String filter = null; final String queryStartTime = null; - return new PagedIterable<>(listAsync(filter, queryStartTime)); + return new PagedIterable<>(() -> listSinglePage(filter, queryStartTime), + nextLink -> listBySubscriptionIdNextSinglePage(nextLink)); } /** @@ -245,8 +304,8 @@ public PagedIterable list() { * * @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 queryStartTime Specifies from when to return events, based on the lastUpdateTime property. For example, - * queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. + * @param queryStartTime Specifies from when to return events (default is 3 days), based on the lastUpdateTime + * property. For example, queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. * @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. @@ -255,7 +314,8 @@ public PagedIterable list() { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String filter, String queryStartTime, Context context) { - return new PagedIterable<>(listAsync(filter, queryStartTime, context)); + return new PagedIterable<>(() -> listSinglePage(filter, queryStartTime, context), + nextLink -> listBySubscriptionIdNextSinglePage(nextLink, context)); } /** @@ -263,8 +323,8 @@ public PagedIterable list(String filter, String queryStartTime, Cont * * @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 queryStartTime Specifies from when to return events, based on the lastUpdateTime property. For example, - * queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. + * @param queryStartTime Specifies from when to return events (default is 3 days), based on the lastUpdateTime + * property. For example, queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. * @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. @@ -291,38 +351,8 @@ private Mono> listByTenantIdSinglePageAsync(String fil * * @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 queryStartTime Specifies from when to return events, based on the lastUpdateTime property. For example, - * queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. - * @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 along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByTenantIdSinglePageAsync(String filter, String queryStartTime, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByTenantId(this.client.getEndpoint(), this.client.getApiVersion(), filter, queryStartTime, accept, - context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Lists current service health events in the tenant. - * - * @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 queryStartTime Specifies from when to return events, based on the lastUpdateTime property. For example, - * queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. + * @param queryStartTime Specifies from when to return events (default is 3 days), based on the lastUpdateTime + * property. For example, queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. * @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. @@ -354,18 +384,52 @@ private PagedFlux listByTenantIdAsync() { * * @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 queryStartTime Specifies from when to return events, based on the lastUpdateTime property. For example, - * queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. + * @param queryStartTime Specifies from when to return events (default is 3 days), based on the lastUpdateTime + * property. For example, queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. + * @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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByTenantIdSinglePage(String filter, String queryStartTime) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listByTenantIdSync(this.client.getEndpoint(), this.client.getApiVersion(), + filter, queryStartTime, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists current service health events in the tenant. + * + * @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 queryStartTime Specifies from when to return events (default is 3 days), based on the lastUpdateTime + * property. For example, queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. * @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 as paginated response with {@link PagedFlux}. + * @return the List events operation response along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByTenantIdAsync(String filter, String queryStartTime, Context context) { - return new PagedFlux<>(() -> listByTenantIdSinglePageAsync(filter, queryStartTime, context), - nextLink -> listByTenantIdNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByTenantIdSinglePage(String filter, String queryStartTime, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listByTenantIdSync(this.client.getEndpoint(), this.client.getApiVersion(), + filter, queryStartTime, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -379,7 +443,8 @@ private PagedFlux listByTenantIdAsync(String filter, String querySta public PagedIterable listByTenantId() { final String filter = null; final String queryStartTime = null; - return new PagedIterable<>(listByTenantIdAsync(filter, queryStartTime)); + return new PagedIterable<>(() -> listByTenantIdSinglePage(filter, queryStartTime), + nextLink -> listByTenantIdNextSinglePage(nextLink)); } /** @@ -387,8 +452,8 @@ public PagedIterable listByTenantId() { * * @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 queryStartTime Specifies from when to return events, based on the lastUpdateTime property. For example, - * queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. + * @param queryStartTime Specifies from when to return events (default is 3 days), based on the lastUpdateTime + * property. For example, queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. * @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. @@ -397,7 +462,8 @@ public PagedIterable listByTenantId() { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByTenantId(String filter, String queryStartTime, Context context) { - return new PagedIterable<>(listByTenantIdAsync(filter, queryStartTime, context)); + return new PagedIterable<>(() -> listByTenantIdSinglePage(filter, queryStartTime, context), + nextLink -> listByTenantIdNextSinglePage(nextLink, context)); } /** @@ -444,30 +510,15 @@ private Mono> listBySingleResourceSinglePageAsync(Stri * /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 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 along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the List events operation response as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySingleResourceSinglePageAsync(String resourceUri, String filter, - 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 - .listBySingleResource(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), filter, accept, - context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySingleResourceAsync(String resourceUri, String filter) { + return new PagedFlux<>(() -> listBySingleResourceSinglePageAsync(resourceUri, filter), + nextLink -> listBySingleResourceNextSinglePageAsync(nextLink)); } /** @@ -478,15 +529,14 @@ private Mono> listBySingleResourceSinglePageAsync(Stri * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} * and * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}. - * @param filter The filter to apply on the operation. For more information please see - * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. * @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 as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySingleResourceAsync(String resourceUri, String filter) { + private PagedFlux listBySingleResourceAsync(String resourceUri) { + final String filter = null; return new PagedFlux<>(() -> listBySingleResourceSinglePageAsync(resourceUri, filter), nextLink -> listBySingleResourceNextSinglePageAsync(nextLink)); } @@ -499,16 +549,29 @@ private PagedFlux listBySingleResourceAsync(String resourceUri, Stri * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} * and * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}. + * @param filter The filter to apply on the operation. For more information please see + * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. * @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 as paginated response with {@link PagedFlux}. + * @return the List events operation response along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySingleResourceAsync(String resourceUri) { - final String filter = null; - return new PagedFlux<>(() -> listBySingleResourceSinglePageAsync(resourceUri, filter), - nextLink -> listBySingleResourceNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySingleResourceSinglePage(String resourceUri, String filter) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listBySingleResourceSync(this.client.getEndpoint(), resourceUri, + this.client.getApiVersion(), filter, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -525,12 +588,25 @@ private PagedFlux listBySingleResourceAsync(String resourceUri) { * @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 as paginated response with {@link PagedFlux}. + * @return the List events operation response along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySingleResourceAsync(String resourceUri, String filter, Context context) { - return new PagedFlux<>(() -> listBySingleResourceSinglePageAsync(resourceUri, filter, context), - nextLink -> listBySingleResourceNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySingleResourceSinglePage(String resourceUri, String filter, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listBySingleResourceSync(this.client.getEndpoint(), resourceUri, + this.client.getApiVersion(), filter, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -549,7 +625,8 @@ private PagedFlux listBySingleResourceAsync(String resourceUri, Stri @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listBySingleResource(String resourceUri) { final String filter = null; - return new PagedIterable<>(listBySingleResourceAsync(resourceUri, filter)); + return new PagedIterable<>(() -> listBySingleResourceSinglePage(resourceUri, filter), + nextLink -> listBySingleResourceNextSinglePage(nextLink)); } /** @@ -570,7 +647,8 @@ public PagedIterable listBySingleResource(String resourceUri) { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listBySingleResource(String resourceUri, String filter, Context context) { - return new PagedIterable<>(listBySingleResourceAsync(resourceUri, filter, context)); + return new PagedIterable<>(() -> listBySingleResourceSinglePage(resourceUri, filter, context), + nextLink -> listBySingleResourceNextSinglePage(nextLink, context)); } /** @@ -601,6 +679,33 @@ private Mono> listBySubscriptionIdNextSinglePageAsync( .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionIdNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listBySubscriptionIdNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -609,23 +714,24 @@ private Mono> listBySubscriptionIdNextSinglePageAsync( * @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 along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the List events operation response along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionIdNextSinglePageAsync(String nextLink, Context context) { + private PagedResponse listBySubscriptionIdNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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)); + Response res + = service.listBySubscriptionIdNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -655,6 +761,33 @@ private Mono> listByTenantIdNextSinglePageAsync(String .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByTenantIdNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByTenantIdNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -663,23 +796,23 @@ private Mono> listByTenantIdNextSinglePageAsync(String * @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 along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the List events operation response along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByTenantIdNextSinglePageAsync(String nextLink, Context context) { + private PagedResponse listByTenantIdNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByTenantIdNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res = service.listByTenantIdNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -710,6 +843,33 @@ private Mono> listBySingleResourceNextSinglePageAsync( .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySingleResourceNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listBySingleResourceNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -718,22 +878,25 @@ 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 along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the List events operation response along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySingleResourceNextSinglePageAsync(String nextLink, Context context) { + private PagedResponse listBySingleResourceNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listBySingleResourceNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listBySingleResourceNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(EventsOperationsClientImpl.class); } diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/ImpactedResourcesClientImpl.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/ImpactedResourcesClientImpl.java index 439614cdc872..2214cb24a689 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/ImpactedResourcesClientImpl.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/ImpactedResourcesClientImpl.java @@ -25,6 +25,7 @@ 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.ImpactedResourcesClient; import com.azure.resourcemanager.resourcehealth.fluent.models.EventImpactedResourceInner; import com.azure.resourcemanager.resourcehealth.models.EventImpactedResourceListResult; @@ -71,6 +72,15 @@ Mono> listBySubscriptionIdAndEventId( @PathParam("eventTrackingId") String eventTrackingId, @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/events/{eventTrackingId}/impactedResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySubscriptionIdAndEventIdSync( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, + @PathParam("eventTrackingId") String eventTrackingId, @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/events/{eventTrackingId}/impactedResources/{impactedResourceName}") @ExpectedResponses({ 200 }) @@ -80,6 +90,15 @@ Mono> get(@HostParam("$host") String endpoi @PathParam("impactedResourceName") String impactedResourceName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/events/{eventTrackingId}/impactedResources/{impactedResourceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @PathParam("eventTrackingId") String eventTrackingId, + @PathParam("impactedResourceName") String impactedResourceName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.ResourceHealth/events/{eventTrackingId}/impactedResources") @ExpectedResponses({ 200 }) @@ -88,6 +107,14 @@ Mono> listByTenantIdAndEventId(@HostPa @PathParam("eventTrackingId") String eventTrackingId, @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.ResourceHealth/events/{eventTrackingId}/impactedResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByTenantIdAndEventIdSync(@HostParam("$host") String endpoint, + @PathParam("eventTrackingId") String eventTrackingId, @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.ResourceHealth/events/{eventTrackingId}/impactedResources/{impactedResourceName}") @ExpectedResponses({ 200 }) @@ -97,6 +124,15 @@ Mono> getByTenantId(@HostParam("$host") Str @PathParam("impactedResourceName") String impactedResourceName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.ResourceHealth/events/{eventTrackingId}/impactedResources/{impactedResourceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getByTenantIdSync(@HostParam("$host") String endpoint, + @PathParam("eventTrackingId") String eventTrackingId, + @PathParam("impactedResourceName") String impactedResourceName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -105,6 +141,14 @@ Mono> listBySubscriptionIdAndEventIdNe @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySubscriptionIdAndEventIdNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -112,6 +156,14 @@ Mono> listBySubscriptionIdAndEventIdNe Mono> listByTenantIdAndEventIdNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByTenantIdAndEventIdNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -156,51 +208,30 @@ Mono> listByTenantIdAndEventIdNext( * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. * @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 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 of eventImpactedResources operation response along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the List of eventImpactedResources operation response as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listBySubscriptionIdAndEventIdSinglePageAsync(String eventTrackingId, String filter, 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 (eventTrackingId == null) { - return Mono - .error(new IllegalArgumentException("Parameter eventTrackingId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBySubscriptionIdAndEventId(this.client.getEndpoint(), this.client.getSubscriptionId(), eventTrackingId, - this.client.getApiVersion(), filter, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySubscriptionIdAndEventIdAsync(String eventTrackingId, + String filter) { + return new PagedFlux<>(() -> listBySubscriptionIdAndEventIdSinglePageAsync(eventTrackingId, filter), + nextLink -> listBySubscriptionIdAndEventIdNextSinglePageAsync(nextLink)); } /** * Lists impacted resources in the subscription by an event. * * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. - * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the List of eventImpactedResources operation response as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySubscriptionIdAndEventIdAsync(String eventTrackingId, - String filter) { + private PagedFlux listBySubscriptionIdAndEventIdAsync(String eventTrackingId) { + final String filter = null; return new PagedFlux<>(() -> listBySubscriptionIdAndEventIdSinglePageAsync(eventTrackingId, filter), nextLink -> listBySubscriptionIdAndEventIdNextSinglePageAsync(nextLink)); } @@ -209,16 +240,36 @@ private PagedFlux listBySubscriptionIdAndEventIdAsyn * Lists impacted resources in the subscription by an event. * * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. + * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List of eventImpactedResources operation response as paginated response with {@link PagedFlux}. + * @return the List of eventImpactedResources operation response along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySubscriptionIdAndEventIdAsync(String eventTrackingId) { - final String filter = null; - return new PagedFlux<>(() -> listBySubscriptionIdAndEventIdSinglePageAsync(eventTrackingId, filter), - nextLink -> listBySubscriptionIdAndEventIdNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionIdAndEventIdSinglePage(String eventTrackingId, + String filter) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (eventTrackingId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter eventTrackingId is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listBySubscriptionIdAndEventIdSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + eventTrackingId, this.client.getApiVersion(), filter, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -231,13 +282,31 @@ private PagedFlux listBySubscriptionIdAndEventIdAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List of eventImpactedResources operation response as paginated response with {@link PagedFlux}. + * @return the List of eventImpactedResources operation response along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySubscriptionIdAndEventIdAsync(String eventTrackingId, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionIdAndEventIdSinglePage(String eventTrackingId, String filter, Context context) { - return new PagedFlux<>(() -> listBySubscriptionIdAndEventIdSinglePageAsync(eventTrackingId, filter, context), - nextLink -> listBySubscriptionIdAndEventIdNextSinglePageAsync(nextLink, context)); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (eventTrackingId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter eventTrackingId is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listBySubscriptionIdAndEventIdSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + eventTrackingId, this.client.getApiVersion(), filter, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -252,7 +321,8 @@ private PagedFlux listBySubscriptionIdAndEventIdAsyn @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listBySubscriptionIdAndEventId(String eventTrackingId) { final String filter = null; - return new PagedIterable<>(listBySubscriptionIdAndEventIdAsync(eventTrackingId, filter)); + return new PagedIterable<>(() -> listBySubscriptionIdAndEventIdSinglePage(eventTrackingId, filter), + nextLink -> listBySubscriptionIdAndEventIdNextSinglePage(nextLink)); } /** @@ -270,7 +340,8 @@ public PagedIterable listBySubscriptionIdAndEventId( @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listBySubscriptionIdAndEventId(String eventTrackingId, String filter, Context context) { - return new PagedIterable<>(listBySubscriptionIdAndEventIdAsync(eventTrackingId, filter, context)); + return new PagedIterable<>(() -> listBySubscriptionIdAndEventIdSinglePage(eventTrackingId, filter, context), + nextLink -> listBySubscriptionIdAndEventIdNextSinglePage(nextLink, context)); } /** @@ -310,43 +381,6 @@ private Mono> getWithResponseAsync(String e .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets the specific impacted resource in the subscription by an event. - * - * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. - * @param impactedResourceName Name of the Impacted Resource. - * @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 specific impacted resource in the subscription by an event along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String eventTrackingId, - String impactedResourceName, 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 (eventTrackingId == null) { - return Mono - .error(new IllegalArgumentException("Parameter eventTrackingId is required and cannot be null.")); - } - if (impactedResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter impactedResourceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), eventTrackingId, - impactedResourceName, this.client.getApiVersion(), accept, context); - } - /** * Gets the specific impacted resource in the subscription by an event. * @@ -377,7 +411,27 @@ private Mono getAsync(String eventTrackingId, String @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String eventTrackingId, String impactedResourceName, Context context) { - return getWithResponseAsync(eventTrackingId, impactedResourceName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (eventTrackingId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter eventTrackingId is required and cannot be null.")); + } + if (impactedResourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter impactedResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getSubscriptionId(), eventTrackingId, + impactedResourceName, this.client.getApiVersion(), accept, context); } /** @@ -433,46 +487,29 @@ public EventImpactedResourceInner get(String eventTrackingId, String impactedRes * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. * @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 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 of eventImpactedResources operation response along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the List of eventImpactedResources operation response as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByTenantIdAndEventIdSinglePageAsync(String eventTrackingId, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (eventTrackingId == null) { - return Mono - .error(new IllegalArgumentException("Parameter eventTrackingId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByTenantIdAndEventId(this.client.getEndpoint(), eventTrackingId, this.client.getApiVersion(), filter, - accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByTenantIdAndEventIdAsync(String eventTrackingId, String filter) { + return new PagedFlux<>(() -> listByTenantIdAndEventIdSinglePageAsync(eventTrackingId, filter), + nextLink -> listByTenantIdAndEventIdNextSinglePageAsync(nextLink)); } /** * Lists impacted resources in the tenant by an event. * * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. - * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the List of eventImpactedResources operation response as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByTenantIdAndEventIdAsync(String eventTrackingId, String filter) { + private PagedFlux listByTenantIdAndEventIdAsync(String eventTrackingId) { + final String filter = null; return new PagedFlux<>(() -> listByTenantIdAndEventIdSinglePageAsync(eventTrackingId, filter), nextLink -> listByTenantIdAndEventIdNextSinglePageAsync(nextLink)); } @@ -481,16 +518,30 @@ private PagedFlux listByTenantIdAndEventIdAsync(Stri * Lists impacted resources in the tenant by an event. * * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. + * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List of eventImpactedResources operation response as paginated response with {@link PagedFlux}. + * @return the List of eventImpactedResources operation response along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByTenantIdAndEventIdAsync(String eventTrackingId) { - final String filter = null; - return new PagedFlux<>(() -> listByTenantIdAndEventIdSinglePageAsync(eventTrackingId, filter), - nextLink -> listByTenantIdAndEventIdNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByTenantIdAndEventIdSinglePage(String eventTrackingId, + String filter) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (eventTrackingId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter eventTrackingId is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listByTenantIdAndEventIdSync(this.client.getEndpoint(), + eventTrackingId, this.client.getApiVersion(), filter, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -503,13 +554,25 @@ private PagedFlux listByTenantIdAndEventIdAsync(Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List of eventImpactedResources operation response as paginated response with {@link PagedFlux}. + * @return the List of eventImpactedResources operation response along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByTenantIdAndEventIdAsync(String eventTrackingId, String filter, - Context context) { - return new PagedFlux<>(() -> listByTenantIdAndEventIdSinglePageAsync(eventTrackingId, filter, context), - nextLink -> listByTenantIdAndEventIdNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByTenantIdAndEventIdSinglePage(String eventTrackingId, + String filter, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (eventTrackingId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter eventTrackingId is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listByTenantIdAndEventIdSync(this.client.getEndpoint(), + eventTrackingId, this.client.getApiVersion(), filter, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -524,7 +587,8 @@ private PagedFlux listByTenantIdAndEventIdAsync(Stri @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByTenantIdAndEventId(String eventTrackingId) { final String filter = null; - return new PagedIterable<>(listByTenantIdAndEventIdAsync(eventTrackingId, filter)); + return new PagedIterable<>(() -> listByTenantIdAndEventIdSinglePage(eventTrackingId, filter), + nextLink -> listByTenantIdAndEventIdNextSinglePage(nextLink)); } /** @@ -542,7 +606,8 @@ public PagedIterable listByTenantIdAndEventId(String @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByTenantIdAndEventId(String eventTrackingId, String filter, Context context) { - return new PagedIterable<>(listByTenantIdAndEventIdAsync(eventTrackingId, filter, context)); + return new PagedIterable<>(() -> listByTenantIdAndEventIdSinglePage(eventTrackingId, filter, context), + nextLink -> listByTenantIdAndEventIdNextSinglePage(nextLink, context)); } /** @@ -578,39 +643,6 @@ private Mono> getByTenantIdWithResponseAsyn .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets the specific impacted resource in the tenant by an event. - * - * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. - * @param impactedResourceName Name of the Impacted Resource. - * @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 specific impacted resource in the tenant by an event along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByTenantIdWithResponseAsync(String eventTrackingId, - String impactedResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (eventTrackingId == null) { - return Mono - .error(new IllegalArgumentException("Parameter eventTrackingId is required and cannot be null.")); - } - if (impactedResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter impactedResourceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getByTenantId(this.client.getEndpoint(), eventTrackingId, impactedResourceName, - this.client.getApiVersion(), accept, context); - } - /** * Gets the specific impacted resource in the tenant by an event. * @@ -641,7 +673,22 @@ private Mono getByTenantIdAsync(String eventTracking @ServiceMethod(returns = ReturnType.SINGLE) public Response getByTenantIdWithResponse(String eventTrackingId, String impactedResourceName, Context context) { - return getByTenantIdWithResponseAsync(eventTrackingId, impactedResourceName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (eventTrackingId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter eventTrackingId is required and cannot be null.")); + } + if (impactedResourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter impactedResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getByTenantIdSync(this.client.getEndpoint(), eventTrackingId, impactedResourceName, + this.client.getApiVersion(), accept, context); } /** @@ -687,6 +734,33 @@ public EventImpactedResourceInner getByTenantId(String eventTrackingId, String i .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List of eventImpactedResources operation response along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionIdAndEventIdNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listBySubscriptionIdAndEventIdNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -695,24 +769,25 @@ public EventImpactedResourceInner getByTenantId(String eventTrackingId, String i * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List of eventImpactedResources operation response along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the List of eventImpactedResources operation response along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listBySubscriptionIdAndEventIdNextSinglePageAsync(String nextLink, Context context) { + private PagedResponse listBySubscriptionIdAndEventIdNextSinglePage(String nextLink, + Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listBySubscriptionIdAndEventIdNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listBySubscriptionIdAndEventIdNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -744,6 +819,33 @@ public EventImpactedResourceInner getByTenantId(String eventTrackingId, String i .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List of eventImpactedResources operation response along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByTenantIdAndEventIdNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByTenantIdAndEventIdNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -752,23 +854,26 @@ public EventImpactedResourceInner getByTenantId(String eventTrackingId, String i * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List of eventImpactedResources operation response along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the List of eventImpactedResources operation response along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByTenantIdAndEventIdNextSinglePageAsync(String nextLink, + private PagedResponse listByTenantIdAndEventIdNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByTenantIdAndEventIdNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByTenantIdAndEventIdNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(ImpactedResourcesClientImpl.class); } diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/MetadatasClientImpl.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/MetadatasClientImpl.java index 20ff218c574e..2fb67f19fef9 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/MetadatasClientImpl.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/MetadatasClientImpl.java @@ -25,6 +25,7 @@ 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.MetadatasClient; import com.azure.resourcemanager.resourcehealth.fluent.models.MetadataEntityInner; import com.azure.resourcemanager.resourcehealth.models.MetadataEntityListResult; @@ -69,6 +70,13 @@ public interface MetadatasService { Mono> list(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.ResourceHealth/metadata") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.ResourceHealth/metadata/{name}") @ExpectedResponses({ 200 }) @@ -77,6 +85,13 @@ Mono> getEntity(@HostParam("$host") String endpoin @PathParam("name") String name, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.ResourceHealth/metadata/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getEntitySync(@HostParam("$host") String endpoint, @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -84,6 +99,13 @@ Mono> getEntity(@HostParam("$host") String endpoin Mono> listNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -111,23 +133,13 @@ private Mono> listSinglePageAsync() { /** * Gets the list of metadata entities. * - * @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 of metadata entities along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the list of metadata entities as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -135,11 +147,20 @@ private Mono> listSinglePageAsync(Context con * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of metadata entities as paginated response with {@link PagedFlux}. + * @return the list of metadata entities along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -149,12 +170,20 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of metadata entities as paginated response with {@link PagedFlux}. + * @return the list of metadata entities along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -166,7 +195,7 @@ private PagedFlux listAsync(Context context) { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { - return new PagedIterable<>(listAsync()); + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); } /** @@ -180,7 +209,7 @@ public PagedIterable list() { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -207,30 +236,6 @@ private Mono> getEntityWithResponseAsync(String na .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets the list of metadata entities. - * - * @param name Name of metadata entity. - * @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 of metadata entities along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getEntityWithResponseAsync(String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getEntity(this.client.getEndpoint(), name, this.client.getApiVersion(), accept, context); - } - /** * Gets the list of metadata entities. * @@ -257,7 +262,16 @@ private Mono getEntityAsync(String name) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getEntityWithResponse(String name, Context context) { - return getEntityWithResponseAsync(name, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (name == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getEntitySync(this.client.getEndpoint(), name, this.client.getApiVersion(), accept, context); } /** @@ -299,6 +313,33 @@ private Mono> listNextSinglePageAsync(String .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of metadata entities along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -307,21 +348,25 @@ private Mono> listNextSinglePageAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of metadata entities along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the list of metadata entities along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private PagedResponse listNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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)); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(MetadatasClientImpl.class); } 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 0d6aa5c50c4a..748909579b1e 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/MicrosoftResourceHealthImpl.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/MicrosoftResourceHealthImpl.java @@ -15,12 +15,15 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; import com.azure.core.management.polling.PollerFactory; +import com.azure.core.management.polling.SyncPollerFactory; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; import com.azure.core.util.polling.LongRunningOperationStatus; import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.resourcehealth.fluent.AvailabilityStatusesClient; @@ -289,7 +292,7 @@ public EmergingIssuesClient getEmergingIssues() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2023-10-01-preview"; + this.apiVersion = "2025-05-01"; this.availabilityStatuses = new AvailabilityStatusesClientImpl(this); this.operations = new OperationsClientImpl(this); this.metadatas = new MetadatasClientImpl(this); @@ -339,6 +342,23 @@ public PollerFlux, U> getLroResult(Mono type of poll result. + * @param type of final result. + * @return SyncPoller for poll result and final result. + */ + public SyncPoller, U> getLroResult(Response activationResponse, + Type pollResultType, Type finalResultType, Context context) { + return SyncPollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, () -> activationResponse, context); + } + /** * Gets the final result, or an error, based on last async poll response. * diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/OperationsClientImpl.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/OperationsClientImpl.java index da16606ec29a..71ea32c7708f 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/OperationsClientImpl.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/OperationsClientImpl.java @@ -20,6 +20,7 @@ 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.OperationsClient; import com.azure.resourcemanager.resourcehealth.fluent.models.OperationListResultInner; import reactor.core.publisher.Mono; @@ -62,6 +63,13 @@ public interface OperationsService { @UnexpectedResponseExceptionType(ManagementException.class) Mono> list(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.ResourceHealth/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); } /** @@ -84,26 +92,6 @@ private Mono> listWithResponseAsync() { .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Lists available operations for the resourcehealth resource provider. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lists the operations response along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); - } - /** * Lists available operations for the resourcehealth resource provider. * @@ -127,7 +115,13 @@ private Mono listAsync() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response listWithResponse(Context context) { - return listWithResponseAsync(context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); } /** @@ -141,4 +135,6 @@ public Response listWithResponse(Context context) { public OperationListResultInner list() { return listWithResponse(Context.NONE).getValue(); } + + private static final ClientLogger LOGGER = new ClientLogger(OperationsClientImpl.class); } diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/SecurityAdvisoryImpactedResourcesClientImpl.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/SecurityAdvisoryImpactedResourcesClientImpl.java index 251a0edc8d24..5c2a0d699031 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/SecurityAdvisoryImpactedResourcesClientImpl.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/SecurityAdvisoryImpactedResourcesClientImpl.java @@ -26,6 +26,7 @@ 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.SecurityAdvisoryImpactedResourcesClient; import com.azure.resourcemanager.resourcehealth.fluent.models.EventImpactedResourceInner; import com.azure.resourcemanager.resourcehealth.models.EventImpactedResourceListResult; @@ -72,6 +73,15 @@ Mono> listBySubscriptionIdAndEventId( @PathParam("eventTrackingId") String eventTrackingId, @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/events/{eventTrackingId}/listSecurityAdvisoryImpactedResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySubscriptionIdAndEventIdSync( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, + @PathParam("eventTrackingId") String eventTrackingId, @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Post("/providers/Microsoft.ResourceHealth/events/{eventTrackingId}/listSecurityAdvisoryImpactedResources") @ExpectedResponses({ 200 }) @@ -80,6 +90,14 @@ Mono> listByTenantIdAndEventId(@HostPa @PathParam("eventTrackingId") String eventTrackingId, @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Post("/providers/Microsoft.ResourceHealth/events/{eventTrackingId}/listSecurityAdvisoryImpactedResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByTenantIdAndEventIdSync(@HostParam("$host") String endpoint, + @PathParam("eventTrackingId") String eventTrackingId, @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -88,6 +106,14 @@ Mono> listBySubscriptionIdAndEventIdNe @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySubscriptionIdAndEventIdNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -95,6 +121,14 @@ Mono> listBySubscriptionIdAndEventIdNe Mono> listByTenantIdAndEventIdNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByTenantIdAndEventIdNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -139,51 +173,30 @@ Mono> listByTenantIdAndEventIdNext( * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. * @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 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 of eventImpactedResources operation response along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the List of eventImpactedResources operation response as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listBySubscriptionIdAndEventIdSinglePageAsync(String eventTrackingId, String filter, 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 (eventTrackingId == null) { - return Mono - .error(new IllegalArgumentException("Parameter eventTrackingId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBySubscriptionIdAndEventId(this.client.getEndpoint(), this.client.getSubscriptionId(), eventTrackingId, - this.client.getApiVersion(), filter, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySubscriptionIdAndEventIdAsync(String eventTrackingId, + String filter) { + return new PagedFlux<>(() -> listBySubscriptionIdAndEventIdSinglePageAsync(eventTrackingId, filter), + nextLink -> listBySubscriptionIdAndEventIdNextSinglePageAsync(nextLink)); } /** * Lists impacted resources in the subscription by an event (Security Advisory). * * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. - * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the List of eventImpactedResources operation response as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySubscriptionIdAndEventIdAsync(String eventTrackingId, - String filter) { + private PagedFlux listBySubscriptionIdAndEventIdAsync(String eventTrackingId) { + final String filter = null; return new PagedFlux<>(() -> listBySubscriptionIdAndEventIdSinglePageAsync(eventTrackingId, filter), nextLink -> listBySubscriptionIdAndEventIdNextSinglePageAsync(nextLink)); } @@ -192,16 +205,36 @@ private PagedFlux listBySubscriptionIdAndEventIdAsyn * Lists impacted resources in the subscription by an event (Security Advisory). * * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. + * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List of eventImpactedResources operation response as paginated response with {@link PagedFlux}. + * @return the List of eventImpactedResources operation response along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySubscriptionIdAndEventIdAsync(String eventTrackingId) { - final String filter = null; - return new PagedFlux<>(() -> listBySubscriptionIdAndEventIdSinglePageAsync(eventTrackingId, filter), - nextLink -> listBySubscriptionIdAndEventIdNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionIdAndEventIdSinglePage(String eventTrackingId, + String filter) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (eventTrackingId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter eventTrackingId is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listBySubscriptionIdAndEventIdSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + eventTrackingId, this.client.getApiVersion(), filter, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -214,13 +247,31 @@ private PagedFlux listBySubscriptionIdAndEventIdAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List of eventImpactedResources operation response as paginated response with {@link PagedFlux}. + * @return the List of eventImpactedResources operation response along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySubscriptionIdAndEventIdAsync(String eventTrackingId, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionIdAndEventIdSinglePage(String eventTrackingId, String filter, Context context) { - return new PagedFlux<>(() -> listBySubscriptionIdAndEventIdSinglePageAsync(eventTrackingId, filter, context), - nextLink -> listBySubscriptionIdAndEventIdNextSinglePageAsync(nextLink, context)); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (eventTrackingId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter eventTrackingId is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listBySubscriptionIdAndEventIdSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + eventTrackingId, this.client.getApiVersion(), filter, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -235,7 +286,8 @@ private PagedFlux listBySubscriptionIdAndEventIdAsyn @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listBySubscriptionIdAndEventId(String eventTrackingId) { final String filter = null; - return new PagedIterable<>(listBySubscriptionIdAndEventIdAsync(eventTrackingId, filter)); + return new PagedIterable<>(() -> listBySubscriptionIdAndEventIdSinglePage(eventTrackingId, filter), + nextLink -> listBySubscriptionIdAndEventIdNextSinglePage(nextLink)); } /** @@ -253,7 +305,8 @@ public PagedIterable listBySubscriptionIdAndEventId( @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listBySubscriptionIdAndEventId(String eventTrackingId, String filter, Context context) { - return new PagedIterable<>(listBySubscriptionIdAndEventIdAsync(eventTrackingId, filter, context)); + return new PagedIterable<>(() -> listBySubscriptionIdAndEventIdSinglePage(eventTrackingId, filter, context), + nextLink -> listBySubscriptionIdAndEventIdNextSinglePage(nextLink, context)); } /** @@ -294,46 +347,29 @@ public PagedIterable listBySubscriptionIdAndEventId( * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. * @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 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 of eventImpactedResources operation response along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the List of eventImpactedResources operation response as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByTenantIdAndEventIdSinglePageAsync(String eventTrackingId, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (eventTrackingId == null) { - return Mono - .error(new IllegalArgumentException("Parameter eventTrackingId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByTenantIdAndEventId(this.client.getEndpoint(), eventTrackingId, this.client.getApiVersion(), filter, - accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByTenantIdAndEventIdAsync(String eventTrackingId, String filter) { + return new PagedFlux<>(() -> listByTenantIdAndEventIdSinglePageAsync(eventTrackingId, filter), + nextLink -> listByTenantIdAndEventIdNextSinglePageAsync(nextLink)); } /** * Lists impacted resources in the tenant by an event (Security Advisory). * * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. - * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the List of eventImpactedResources operation response as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByTenantIdAndEventIdAsync(String eventTrackingId, String filter) { + private PagedFlux listByTenantIdAndEventIdAsync(String eventTrackingId) { + final String filter = null; return new PagedFlux<>(() -> listByTenantIdAndEventIdSinglePageAsync(eventTrackingId, filter), nextLink -> listByTenantIdAndEventIdNextSinglePageAsync(nextLink)); } @@ -342,16 +378,30 @@ private PagedFlux listByTenantIdAndEventIdAsync(Stri * Lists impacted resources in the tenant by an event (Security Advisory). * * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. + * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List of eventImpactedResources operation response as paginated response with {@link PagedFlux}. + * @return the List of eventImpactedResources operation response along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByTenantIdAndEventIdAsync(String eventTrackingId) { - final String filter = null; - return new PagedFlux<>(() -> listByTenantIdAndEventIdSinglePageAsync(eventTrackingId, filter), - nextLink -> listByTenantIdAndEventIdNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByTenantIdAndEventIdSinglePage(String eventTrackingId, + String filter) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (eventTrackingId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter eventTrackingId is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listByTenantIdAndEventIdSync(this.client.getEndpoint(), + eventTrackingId, this.client.getApiVersion(), filter, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -364,13 +414,25 @@ private PagedFlux listByTenantIdAndEventIdAsync(Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List of eventImpactedResources operation response as paginated response with {@link PagedFlux}. + * @return the List of eventImpactedResources operation response along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByTenantIdAndEventIdAsync(String eventTrackingId, String filter, - Context context) { - return new PagedFlux<>(() -> listByTenantIdAndEventIdSinglePageAsync(eventTrackingId, filter, context), - nextLink -> listByTenantIdAndEventIdNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByTenantIdAndEventIdSinglePage(String eventTrackingId, + String filter, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (eventTrackingId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter eventTrackingId is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listByTenantIdAndEventIdSync(this.client.getEndpoint(), + eventTrackingId, this.client.getApiVersion(), filter, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -385,7 +447,8 @@ private PagedFlux listByTenantIdAndEventIdAsync(Stri @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByTenantIdAndEventId(String eventTrackingId) { final String filter = null; - return new PagedIterable<>(listByTenantIdAndEventIdAsync(eventTrackingId, filter)); + return new PagedIterable<>(() -> listByTenantIdAndEventIdSinglePage(eventTrackingId, filter), + nextLink -> listByTenantIdAndEventIdNextSinglePage(nextLink)); } /** @@ -403,7 +466,8 @@ public PagedIterable listByTenantIdAndEventId(String @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByTenantIdAndEventId(String eventTrackingId, String filter, Context context) { - return new PagedIterable<>(listByTenantIdAndEventIdAsync(eventTrackingId, filter, context)); + return new PagedIterable<>(() -> listByTenantIdAndEventIdSinglePage(eventTrackingId, filter, context), + nextLink -> listByTenantIdAndEventIdNextSinglePage(nextLink, context)); } /** @@ -434,6 +498,33 @@ public PagedIterable listByTenantIdAndEventId(String .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List of eventImpactedResources operation response along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionIdAndEventIdNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listBySubscriptionIdAndEventIdNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -442,24 +533,25 @@ public PagedIterable listByTenantIdAndEventId(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List of eventImpactedResources operation response along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the List of eventImpactedResources operation response along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listBySubscriptionIdAndEventIdNextSinglePageAsync(String nextLink, Context context) { + private PagedResponse listBySubscriptionIdAndEventIdNextSinglePage(String nextLink, + Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listBySubscriptionIdAndEventIdNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listBySubscriptionIdAndEventIdNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -491,6 +583,33 @@ public PagedIterable listByTenantIdAndEventId(String .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List of eventImpactedResources operation response along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByTenantIdAndEventIdNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByTenantIdAndEventIdNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -499,23 +618,26 @@ public PagedIterable listByTenantIdAndEventId(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List of eventImpactedResources operation response along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the List of eventImpactedResources operation response along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByTenantIdAndEventIdNextSinglePageAsync(String nextLink, + private PagedResponse listByTenantIdAndEventIdNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByTenantIdAndEventIdNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByTenantIdAndEventIdNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(SecurityAdvisoryImpactedResourcesClientImpl.class); } 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 index 392696297ece..5665b1ce8de6 100644 --- 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 @@ -48,14 +48,6 @@ public interface Event { */ EventTypeValues eventType(); - /** - * Gets the eventSubType property: Sub type of the event. Currently used to determine retirement communications for - * health advisory events. - * - * @return the eventSubType value. - */ - EventSubTypeValues eventSubType(); - /** * Gets the eventSource property: Source of event. * @@ -78,7 +70,8 @@ public interface Event { String title(); /** - * Gets the summary property: Summary text of event. + * Gets the summary property: Summary text of event. Use fetchEventDetails endpoint to get summary of sensitive + * events. * * @return the summary value. */ @@ -105,6 +98,15 @@ public interface Event { */ EventLevelValues eventLevel(); + /** + * Gets the isEventSensitive property: If true the event may contains sensitive data. Use the post + * events/{trackingId}/fetchEventDetails endpoint to fetch sensitive data see + * https://learn.microsoft.com/en-us/azure/service-health/security-advisories-elevated-access. + * + * @return the isEventSensitive value. + */ + Boolean isEventSensitive(); + /** * Gets the externalIncidentId property: The id of the Incident. * @@ -184,7 +186,7 @@ public interface Event { /** * Gets the description property: Contains the communication message for the event, that could include summary, root - * cause and other details. + * cause and other details. Use fetchEventDetails endpoint to get description of sensitive events. * * @return the description value. */ @@ -250,26 +252,21 @@ public interface Event { String impactType(); /** - * Gets the maintenanceId property: Unique identifier for planned maintenance event. - * - * @return the maintenanceId value. - */ - String maintenanceId(); - - /** - * Gets the maintenanceType property: The type of planned maintenance event. - * - * @return the maintenanceType value. - */ - String maintenanceType(); - - /** - * Gets the argQuery property: Azure Resource Graph query to fetch the affected resources from their existing Azure - * Resource Graph locations. + * Gets the eventTags property: A list of metadata tags associated with the event. Possible values include: + * -Action Recommended: Action may be required by you to avoid possible disruptions or mitigate risks for your + * services. It is recommended to evaluate these actions and the potential impact on your services. + * - False Positive: After investigation, we've determined your service is healthy and service issues did not impact + * your services as originally communicated. + * - Preliminary PIR: For our largest, most impactful service issues a Preliminary Post Incident Review (PIR) is + * published generally within 72 hours of mitigation, to summarize what we have learned so far from the + * still-in-progress investigation. + * - Final PIR: For service issues, a Final Post Incident Review (PIR) may be published to provide additional + * details or learnings. Sometimes this requires us to complete an internal retrospective, generally within 14 days + * of mitigation. * - * @return the argQuery value. + * @return the eventTags value. */ - String argQuery(); + List eventTags(); /** * Gets the inner com.azure.resourcemanager.resourcehealth.fluent.models.EventInner object. diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventImpactedResource.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventImpactedResource.java index 40ec5cb51b35..341e7986d2f9 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventImpactedResource.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventImpactedResource.java @@ -61,41 +61,6 @@ public interface EventImpactedResource { */ String targetRegion(); - /** - * Gets the resourceName property: Resource name of the impacted resource. - * - * @return the resourceName value. - */ - String resourceName(); - - /** - * Gets the resourceGroup property: Resource group name of the impacted resource. - * - * @return the resourceGroup value. - */ - String resourceGroup(); - - /** - * Gets the status property: Status of the impacted resource. - * - * @return the status value. - */ - String status(); - - /** - * Gets the maintenanceStartTime property: Start time of maintenance for the impacted resource. - * - * @return the maintenanceStartTime value. - */ - String maintenanceStartTime(); - - /** - * Gets the maintenanceEndTime property: End time of maintenance for the impacted resource. - * - * @return the maintenanceEndTime value. - */ - String maintenanceEndTime(); - /** * Gets the info property: Additional information. * diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventOperations.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventOperations.java index c97860a7c5cf..3813b7b21f1d 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventOperations.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventOperations.java @@ -17,8 +17,8 @@ public interface EventOperations { * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. * @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 queryStartTime Specifies from when to return events, based on the lastUpdateTime property. For example, - * queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. + * @param queryStartTime Specifies from when to return events (default is 3 days), based on the lastUpdateTime + * property. For example, queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. * @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. @@ -41,7 +41,8 @@ Response getBySubscriptionIdAndTrackingIdWithResponse(String eventTrackin /** * Service health event details in the subscription by event tracking id. This can be used to fetch sensitive - * properties for Security Advisory events. + * properties for Security Advisory events. Please see + * https://learn.microsoft.com/en-us/azure/service-health/security-advisories-elevated-access. * * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. * @param context The context to associate with this operation. @@ -54,7 +55,8 @@ Response getBySubscriptionIdAndTrackingIdWithResponse(String eventTrackin /** * Service health event details in the subscription by event tracking id. This can be used to fetch sensitive - * properties for Security Advisory events. + * properties for Security Advisory events. Please see + * https://learn.microsoft.com/en-us/azure/service-health/security-advisories-elevated-access. * * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -70,8 +72,8 @@ Response getBySubscriptionIdAndTrackingIdWithResponse(String eventTrackin * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. * @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 queryStartTime Specifies from when to return events, based on the lastUpdateTime property. For example, - * queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. + * @param queryStartTime Specifies from when to return events (default is 3 days), based on the lastUpdateTime + * property. For example, queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. * @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. @@ -94,7 +96,8 @@ Response getByTenantIdAndTrackingIdWithResponse(String eventTrackingId, S /** * Service health event details in the tenant by event tracking id. This can be used to fetch sensitive properties - * for Security Advisory events. + * for Security Advisory events. Please see + * https://learn.microsoft.com/en-us/azure/service-health/security-advisories-elevated-access. * * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. * @param context The context to associate with this operation. @@ -107,7 +110,8 @@ Response getByTenantIdAndTrackingIdWithResponse(String eventTrackingId, S /** * Service health event details in the tenant by event tracking id. This can be used to fetch sensitive properties - * for Security Advisory events. + * for Security Advisory events. Please see + * https://learn.microsoft.com/en-us/azure/service-health/security-advisories-elevated-access. * * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. * @throws IllegalArgumentException thrown if parameters fail the validation. 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 index 2ee4ec57d065..d123373e8c53 100644 --- 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 @@ -113,7 +113,9 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("articleContent", this.articleContent); jsonWriter.writeStringField("articleId", this.articleId); - jsonWriter.writeUntypedField("parameters", this.parameters); + if (this.parameters != null) { + jsonWriter.writeUntypedField("parameters", this.parameters); + } return jsonWriter.writeEndObject(); } diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventSubTypeValues.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventSubTypeValues.java deleted file mode 100644 index 30fe2776f44d..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventSubTypeValues.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Sub type of the event. Currently used to determine retirement communications for health advisory events. - */ -public final class EventSubTypeValues extends ExpandableStringEnum { - /** - * Static value Retirement for EventSubTypeValues. - */ - public static final EventSubTypeValues RETIREMENT = fromString("Retirement"); - - /** - * Creates a new instance of EventSubTypeValues value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public EventSubTypeValues() { - } - - /** - * Creates or finds a EventSubTypeValues from its string representation. - * - * @param name a name to look for. - * @return the corresponding EventSubTypeValues. - */ - public static EventSubTypeValues fromString(String name) { - return fromString(name, EventSubTypeValues.class); - } - - /** - * Gets known EventSubTypeValues values. - * - * @return known EventSubTypeValues values. - */ - public static Collection values() { - return values(EventSubTypeValues.class); - } -} 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/EventsOperations.java index 4520d31061e4..d8b27620314d 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/EventsOperations.java @@ -25,8 +25,8 @@ public interface EventsOperations { * * @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 queryStartTime Specifies from when to return events, based on the lastUpdateTime property. For example, - * queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. + * @param queryStartTime Specifies from when to return events (default is 3 days), based on the lastUpdateTime + * property. For example, queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. * @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. @@ -49,8 +49,8 @@ public interface EventsOperations { * * @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 queryStartTime Specifies from when to return events, based on the lastUpdateTime property. For example, - * queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. + * @param queryStartTime Specifies from when to return events (default is 3 days), based on the lastUpdateTime + * property. For example, queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. * @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. 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 index 21557fd0ba10..cc03e8bc1ab5 100644 --- 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 @@ -22,6 +22,11 @@ public final class Impact implements JsonSerializable { */ private String impactedService; + /* + * Impacted service guid. This is the permanent identifier for the impacted service. + */ + private String impactedServiceGuid; + /* * List regions impacted by the service health event. */ @@ -53,6 +58,28 @@ public Impact withImpactedService(String impactedService) { return this; } + /** + * Get the impactedServiceGuid property: Impacted service guid. This is the permanent identifier for the impacted + * service. + * + * @return the impactedServiceGuid value. + */ + public String impactedServiceGuid() { + return this.impactedServiceGuid; + } + + /** + * Set the impactedServiceGuid property: Impacted service guid. This is the permanent identifier for the impacted + * service. + * + * @param impactedServiceGuid the impactedServiceGuid value to set. + * @return the Impact object itself. + */ + public Impact withImpactedServiceGuid(String impactedServiceGuid) { + this.impactedServiceGuid = impactedServiceGuid; + return this; + } + /** * Get the impactedRegions property: List regions impacted by the service health event. * @@ -91,6 +118,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("impactedService", this.impactedService); + jsonWriter.writeStringField("impactedServiceGuid", this.impactedServiceGuid); jsonWriter.writeArrayField("impactedRegions", this.impactedRegions, (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); @@ -113,6 +141,8 @@ public static Impact fromJson(JsonReader jsonReader) throws IOException { if ("impactedService".equals(fieldName)) { deserializedImpact.impactedService = reader.getString(); + } else if ("impactedServiceGuid".equals(fieldName)) { + deserializedImpact.impactedServiceGuid = reader.getString(); } else if ("impactedRegions".equals(fieldName)) { List impactedRegions = reader.readArray(reader1 -> ImpactedServiceRegion.fromJson(reader1)); 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 index 55301f93c969..0556d9d78f1d 100644 --- 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 @@ -46,7 +46,8 @@ public final class ImpactedServiceRegion implements JsonSerializable updates; @@ -157,7 +158,8 @@ public ImpactedServiceRegion withLastUpdateTime(OffsetDateTime lastUpdateTime) { } /** - * Get the updates property: List of updates for given service health event. + * Get the updates property: List of updates for given service health event. Use fetchEventDetails endpoint to get + * updates of sensitive events. * * @return the updates value. */ @@ -166,7 +168,8 @@ public List updates() { } /** - * Set the updates property: List of updates for given service health event. + * Set the updates property: List of updates for given service health event. Use fetchEventDetails endpoint to get + * updates of sensitive events. * * @param updates the updates value to set. * @return the ImpactedServiceRegion object itself. 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 index fdec081240ee..93bea0d43bee 100644 --- 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 @@ -175,7 +175,9 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeJsonField("displayText", this.displayText); jsonWriter.writeStringField("extensionName", this.extensionName); jsonWriter.writeStringField("bladeName", this.bladeName); - jsonWriter.writeUntypedField("parameters", this.parameters); + if (this.parameters != null) { + jsonWriter.writeUntypedField("parameters", this.parameters); + } return jsonWriter.writeEndObject(); } 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 index 1cd5d2c84f1b..aed752630171 100644 --- 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 @@ -18,10 +18,20 @@ @Fluent public final class MetadataSupportedValueDetail implements JsonSerializable { /* - * The id. + * The id of the metadata value */ private String id; + /* + * The previous value of the id field incase the data has changed. + */ + private String previousId; + + /* + * The permanent guid for the service. Used when the id is a service name. + */ + private String serviceGuid; + /* * The display name. */ @@ -39,7 +49,7 @@ public MetadataSupportedValueDetail() { } /** - * Get the id property: The id. + * Get the id property: The id of the metadata value. * * @return the id value. */ @@ -48,7 +58,7 @@ public String id() { } /** - * Set the id property: The id. + * Set the id property: The id of the metadata value. * * @param id the id value to set. * @return the MetadataSupportedValueDetail object itself. @@ -58,6 +68,46 @@ public MetadataSupportedValueDetail withId(String id) { return this; } + /** + * Get the previousId property: The previous value of the id field incase the data has changed. + * + * @return the previousId value. + */ + public String previousId() { + return this.previousId; + } + + /** + * Set the previousId property: The previous value of the id field incase the data has changed. + * + * @param previousId the previousId value to set. + * @return the MetadataSupportedValueDetail object itself. + */ + public MetadataSupportedValueDetail withPreviousId(String previousId) { + this.previousId = previousId; + return this; + } + + /** + * Get the serviceGuid property: The permanent guid for the service. Used when the id is a service name. + * + * @return the serviceGuid value. + */ + public String serviceGuid() { + return this.serviceGuid; + } + + /** + * Set the serviceGuid property: The permanent guid for the service. Used when the id is a service name. + * + * @param serviceGuid the serviceGuid value to set. + * @return the MetadataSupportedValueDetail object itself. + */ + public MetadataSupportedValueDetail withServiceGuid(String serviceGuid) { + this.serviceGuid = serviceGuid; + return this; + } + /** * Get the displayName property: The display name. * @@ -113,6 +163,8 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("previousId", this.previousId); + jsonWriter.writeStringField("serviceGuid", this.serviceGuid); jsonWriter.writeStringField("displayName", this.displayName); jsonWriter.writeArrayField("resourceTypes", this.resourceTypes, (writer, element) -> writer.writeString(element)); @@ -136,6 +188,10 @@ public static MetadataSupportedValueDetail fromJson(JsonReader jsonReader) throw if ("id".equals(fieldName)) { deserializedMetadataSupportedValueDetail.id = reader.getString(); + } else if ("previousId".equals(fieldName)) { + deserializedMetadataSupportedValueDetail.previousId = reader.getString(); + } else if ("serviceGuid".equals(fieldName)) { + deserializedMetadataSupportedValueDetail.serviceGuid = reader.getString(); } else if ("displayName".equals(fieldName)) { deserializedMetadataSupportedValueDetail.displayName = reader.getString(); } else if ("resourceTypes".equals(fieldName)) { 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 index bb2a8c3ee2ee..d66fb50f46e8 100644 --- 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 @@ -13,6 +13,7 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; +import java.util.List; /** * Update for service health event. @@ -29,6 +30,21 @@ public final class Update implements JsonSerializable { */ private OffsetDateTime updateDateTime; + /* + * A list of metadata tags associated with the event. Possible values include: + * -Action Recommended: Action may be required by you to avoid possible disruptions or mitigate risks for your + * services. It is recommended to evaluate these actions and the potential impact on your services. + * - False Positive: After investigation, we've determined your service is healthy and service issues did not impact + * your services as originally communicated. + * - Preliminary PIR: For our largest, most impactful service issues a Preliminary Post Incident Review (PIR) is + * published generally within 72 hours of mitigation, to summarize what we have learned so far from the + * still-in-progress investigation. + * - Final PIR: For service issues, a Final Post Incident Review (PIR) may be published to provide additional + * details or learnings. Sometimes this requires us to complete an internal retrospective, generally within 14 days + * of mitigation. + */ + private List eventTags; + /** * Creates an instance of Update class. */ @@ -75,6 +91,46 @@ public Update withUpdateDateTime(OffsetDateTime updateDateTime) { return this; } + /** + * Get the eventTags property: A list of metadata tags associated with the event. Possible values include: + * -Action Recommended: Action may be required by you to avoid possible disruptions or mitigate risks for your + * services. It is recommended to evaluate these actions and the potential impact on your services. + * - False Positive: After investigation, we've determined your service is healthy and service issues did not impact + * your services as originally communicated. + * - Preliminary PIR: For our largest, most impactful service issues a Preliminary Post Incident Review (PIR) is + * published generally within 72 hours of mitigation, to summarize what we have learned so far from the + * still-in-progress investigation. + * - Final PIR: For service issues, a Final Post Incident Review (PIR) may be published to provide additional + * details or learnings. Sometimes this requires us to complete an internal retrospective, generally within 14 days + * of mitigation. + * + * @return the eventTags value. + */ + public List eventTags() { + return this.eventTags; + } + + /** + * Set the eventTags property: A list of metadata tags associated with the event. Possible values include: + * -Action Recommended: Action may be required by you to avoid possible disruptions or mitigate risks for your + * services. It is recommended to evaluate these actions and the potential impact on your services. + * - False Positive: After investigation, we've determined your service is healthy and service issues did not impact + * your services as originally communicated. + * - Preliminary PIR: For our largest, most impactful service issues a Preliminary Post Incident Review (PIR) is + * published generally within 72 hours of mitigation, to summarize what we have learned so far from the + * still-in-progress investigation. + * - Final PIR: For service issues, a Final Post Incident Review (PIR) may be published to provide additional + * details or learnings. Sometimes this requires us to complete an internal retrospective, generally within 14 days + * of mitigation. + * + * @param eventTags the eventTags value to set. + * @return the Update object itself. + */ + public Update withEventTags(List eventTags) { + this.eventTags = eventTags; + return this; + } + /** * Validates the instance. * @@ -92,6 +148,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("summary", this.summary); jsonWriter.writeStringField("updateDateTime", this.updateDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.updateDateTime)); + jsonWriter.writeArrayField("eventTags", this.eventTags, (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } @@ -115,6 +172,9 @@ public static Update fromJson(JsonReader jsonReader) throws IOException { } else if ("updateDateTime".equals(fieldName)) { deserializedUpdate.updateDateTime = reader .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("eventTags".equals(fieldName)) { + List eventTags = reader.readArray(reader1 -> reader1.getString()); + deserializedUpdate.eventTags = eventTags; } else { reader.skipChildren(); } diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/resources/azure-resourcemanager-resourcehealth.properties b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/resources/azure-resourcemanager-resourcehealth.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/resources/azure-resourcemanager-resourcehealth.properties @@ -0,0 +1 @@ +version=${project.version} 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 index d81ada9c0ae3..e98654a968b2 100644 --- 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 @@ -10,7 +10,7 @@ public final class AvailabilityStatusesGetByResourceSamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/ * AvailabilityStatus_GetByResource.json */ /** 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 index ccb8369106a4..00579719dcde 100644 --- 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 @@ -10,7 +10,7 @@ public final class AvailabilityStatusesListByResourceGroupSamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/ * AvailabilityStatuses_ListByResourceGroup.json */ /** 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 index 503901d24f7e..59fad63f16d8 100644 --- 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 @@ -10,7 +10,7 @@ public final class AvailabilityStatusesListBySubscriptionIdSamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/ * AvailabilityStatuses_ListBySubscriptionId.json */ /** 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 index 42677556787e..8267b9046438 100644 --- 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 @@ -10,7 +10,7 @@ public final class AvailabilityStatusesListSamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/ * AvailabilityStatuses_List.json */ /** 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 index 6348ec29ccbe..3fc8f7192ce1 100644 --- 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 @@ -10,7 +10,7 @@ public final class ChildAvailabilityStatusesGetByResourceSamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/ * ChildAvailabilityStatus_GetByResource.json */ /** 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 index 8d61f79435f5..10e727eda60b 100644 --- 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 @@ -10,7 +10,7 @@ public final class ChildAvailabilityStatusesListSamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/ * ChildAvailabilityStatuses_List.json */ /** 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 index 19b018b17967..509386dd6ba3 100644 --- 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 @@ -10,7 +10,7 @@ public final class ChildResourcesListSamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/ * ChildResources_List.json */ /** 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 index 8895228e6970..eac7e883d81b 100644 --- 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 @@ -12,7 +12,7 @@ public final class EmergingIssuesGetSamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/ * EmergingIssues_Get.json */ /** 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 index 770cf1e7357b..5bf4fdf4c2ca 100644 --- 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 @@ -10,7 +10,7 @@ public final class EmergingIssuesListSamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/ * EmergingIssues_List.json */ /** diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/EventOperationFetchDetailsBySubscriptionIdAndTrackingIdSamples.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/EventOperationFetchDetailsBySubscriptionIdAndTrackingIdSamples.java index e66203d8e312..df34c9acf56e 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/EventOperationFetchDetailsBySubscriptionIdAndTrackingIdSamples.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/EventOperationFetchDetailsBySubscriptionIdAndTrackingIdSamples.java @@ -10,7 +10,7 @@ public final class EventOperationFetchDetailsBySubscriptionIdAndTrackingIdSamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/ * Event_fetchDetailsBySubscriptionIdAndTrackingId.json */ /** diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/EventOperationFetchDetailsByTenantIdAndTrackingIdSamples.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/EventOperationFetchDetailsByTenantIdAndTrackingIdSamples.java index ccd7e618073b..b82e886e9069 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/EventOperationFetchDetailsByTenantIdAndTrackingIdSamples.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/EventOperationFetchDetailsByTenantIdAndTrackingIdSamples.java @@ -10,7 +10,7 @@ public final class EventOperationFetchDetailsByTenantIdAndTrackingIdSamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/ * Event_fetchDetailsByTenantIdAndTrackingId.json */ /** diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/EventOperationGetBySubscriptionIdAndTrackingIdSamples.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/EventOperationGetBySubscriptionIdAndTrackingIdSamples.java index cdbaed795b1b..ac377e8e49ad 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/EventOperationGetBySubscriptionIdAndTrackingIdSamples.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/EventOperationGetBySubscriptionIdAndTrackingIdSamples.java @@ -10,7 +10,7 @@ public final class EventOperationGetBySubscriptionIdAndTrackingIdSamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/ * Event_GetBySubscriptionIdAndTrackingId.json */ /** @@ -22,6 +22,6 @@ public static void securityAdvisoriesEventBySubscriptionIdAndTrackingId( com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { manager.eventOperations() .getBySubscriptionIdAndTrackingIdWithResponse("eventTrackingId", "properties/status eq 'Active'", - "7/10/2022", com.azure.core.util.Context.NONE); + "5/12/2025", com.azure.core.util.Context.NONE); } } diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/EventOperationGetByTenantIdAndTrackingIdSamples.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/EventOperationGetByTenantIdAndTrackingIdSamples.java index ec2eef504a39..a07db6bb9097 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/EventOperationGetByTenantIdAndTrackingIdSamples.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/EventOperationGetByTenantIdAndTrackingIdSamples.java @@ -10,7 +10,7 @@ public final class EventOperationGetByTenantIdAndTrackingIdSamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/ * Event_GetByTenantIdAndTrackingId.json */ /** diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/EventsOperationListBySingleResourceSamples.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/EventsOperationListBySingleResourceSamples.java index 8d508e4def45..2c4d148a9e9a 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/EventsOperationListBySingleResourceSamples.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/EventsOperationListBySingleResourceSamples.java @@ -10,7 +10,7 @@ public final class EventsOperationListBySingleResourceSamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/ * Events_ListBySingleResource.json */ /** diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/EventsOperationListByTenantIdSamples.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/EventsOperationListByTenantIdSamples.java index d03e5e86e128..63508721e152 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/EventsOperationListByTenantIdSamples.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/EventsOperationListByTenantIdSamples.java @@ -10,7 +10,7 @@ public final class EventsOperationListByTenantIdSamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/ * Events_ListByTenantId.json */ /** diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/EventsOperationListSamples.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/EventsOperationListSamples.java index 89ed01d71463..79dc964c3f37 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/EventsOperationListSamples.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/EventsOperationListSamples.java @@ -10,7 +10,7 @@ public final class EventsOperationListSamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/ * Events_ListBySubscriptionId.json */ /** @@ -21,7 +21,7 @@ public final class EventsOperationListSamples { public static void listEventsBySubscriptionId(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { manager.eventsOperations() - .list("service eq 'Virtual Machines' or region eq 'West US'", "7/24/2020", + .list("service eq 'Virtual Machines' or region eq 'West US'", "5/12/2025", com.azure.core.util.Context.NONE); } } diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/ImpactedResourcesGetByTenantIdSamples.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/ImpactedResourcesGetByTenantIdSamples.java index f7c7804258a3..3822b4fa9d79 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/ImpactedResourcesGetByTenantIdSamples.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/ImpactedResourcesGetByTenantIdSamples.java @@ -10,7 +10,7 @@ public final class ImpactedResourcesGetByTenantIdSamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/ * ImpactedResources_GetByTenantId.json */ /** diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/ImpactedResourcesGetSamples.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/ImpactedResourcesGetSamples.java index 33a639c1b4fb..5692c74a938a 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/ImpactedResourcesGetSamples.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/ImpactedResourcesGetSamples.java @@ -10,7 +10,7 @@ public final class ImpactedResourcesGetSamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/ * ImpactedResources_Get.json */ /** diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/ImpactedResourcesListBySubscriptionIdAndEventIdSamples.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/ImpactedResourcesListBySubscriptionIdAndEventIdSamples.java index 08d0dcccc249..235ef0c497a6 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/ImpactedResourcesListBySubscriptionIdAndEventIdSamples.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/ImpactedResourcesListBySubscriptionIdAndEventIdSamples.java @@ -10,7 +10,7 @@ public final class ImpactedResourcesListBySubscriptionIdAndEventIdSamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/ * ImpactedResources_ListBySubscriptionId_ListByEventId.json */ /** diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/ImpactedResourcesListByTenantIdAndEventIdSamples.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/ImpactedResourcesListByTenantIdAndEventIdSamples.java index f467573bedb3..bf29e9f1c33e 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/ImpactedResourcesListByTenantIdAndEventIdSamples.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/ImpactedResourcesListByTenantIdAndEventIdSamples.java @@ -10,7 +10,7 @@ public final class ImpactedResourcesListByTenantIdAndEventIdSamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/ * ImpactedResources_ListByTenantId_ListByEventId.json */ /** diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/MetadataGetEntitySamples.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/MetadataGetEntitySamples.java index 3bb0bad61d54..778fed6b62f6 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/MetadataGetEntitySamples.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/MetadataGetEntitySamples.java @@ -10,7 +10,7 @@ public final class MetadataGetEntitySamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/ * Metadata_GetEntity.json */ /** diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/MetadataListSamples.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/MetadataListSamples.java index ee0ab260d55f..6e6e36e3fa1a 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/MetadataListSamples.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/MetadataListSamples.java @@ -10,8 +10,8 @@ public final class MetadataListSamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * Metadata_List.json + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/Metadata_List. + * json */ /** * Sample code: GetMetadata. diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/OperationsListSamples.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/OperationsListSamples.java index 9b37efe054bb..ab535b81357f 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/OperationsListSamples.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/OperationsListSamples.java @@ -10,8 +10,8 @@ public final class OperationsListSamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * Operations_List.json + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/Operations_List + * .json */ /** * Sample code: GetOperationsList. diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/SecurityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdSamples.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/SecurityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdSamples.java index bc015360c614..e9fe5be7be96 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/SecurityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdSamples.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/SecurityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdSamples.java @@ -10,7 +10,7 @@ public final class SecurityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdSamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/ * SecurityAdvisoryImpactedResources_ListBySubscriptionId_ListByEventId.json */ /** diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/SecurityAdvisoryImpactedResourcesListByTenantIdAndEventIdSamples.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/SecurityAdvisoryImpactedResourcesListByTenantIdAndEventIdSamples.java index 0eef54939b4a..2dce74538a45 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/SecurityAdvisoryImpactedResourcesListByTenantIdAndEventIdSamples.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/SecurityAdvisoryImpactedResourcesListByTenantIdAndEventIdSamples.java @@ -10,7 +10,7 @@ public final class SecurityAdvisoryImpactedResourcesListByTenantIdAndEventIdSamples { /* * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ + * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/ * SecurityAdvisoryImpactedResources_ListByTenantId_ListByEventId.json */ /** diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/AvailabilityStatusInnerTests.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/AvailabilityStatusInnerTests.java deleted file mode 100644 index a5c636fcb8fa..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/AvailabilityStatusInnerTests.java +++ /dev/null @@ -1,184 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.resourcehealth.fluent.models.AvailabilityStatusInner; -import com.azure.resourcemanager.resourcehealth.models.AvailabilityStateValues; -import com.azure.resourcemanager.resourcehealth.models.AvailabilityStatusProperties; -import com.azure.resourcemanager.resourcehealth.models.AvailabilityStatusPropertiesRecentlyResolved; -import com.azure.resourcemanager.resourcehealth.models.ReasonChronicityTypes; -import com.azure.resourcemanager.resourcehealth.models.RecommendedAction; -import com.azure.resourcemanager.resourcehealth.models.ServiceImpactingEvent; -import com.azure.resourcemanager.resourcehealth.models.ServiceImpactingEventIncidentProperties; -import com.azure.resourcemanager.resourcehealth.models.ServiceImpactingEventStatus; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AvailabilityStatusInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AvailabilityStatusInner model = BinaryData.fromString( - "{\"id\":\"dgeablgphu\",\"name\":\"cndvkaozwyiftyhx\",\"type\":\"rokft\",\"location\":\"olniwpwcukjf\",\"properties\":{\"availabilityState\":\"Unavailable\",\"title\":\"xklrypl\",\"summary\":\"kbasyypn\",\"detailedStatus\":\"hsgcbacphejkot\",\"reasonType\":\"qgoulznd\",\"context\":\"kwy\",\"category\":\"gfgibm\",\"articleId\":\"gakeqsr\",\"rootCauseAttributionTime\":\"2021-11-20T03:29:22Z\",\"healthEventType\":\"qqedqytbciqfou\",\"healthEventCause\":\"mmnkzsmodmgl\",\"healthEventCategory\":\"gpbkwtmut\",\"healthEventId\":\"qktapspwgcuert\",\"resolutionETA\":\"2021-07-11T20:02:52Z\",\"occuredTime\":\"2021-08-11T17:15:33Z\",\"reasonChronicity\":\"Persistent\",\"reportedTime\":\"2021-09-13T02:52:42Z\",\"recentlyResolved\":{\"unavailableOccuredTime\":\"2021-10-25T23:23:25Z\",\"resolvedTime\":\"2021-11-07T14:56:07Z\",\"unavailableSummary\":\"bjf\"},\"recommendedActions\":[{\"action\":\"bmbexppbhtqqro\",\"actionUrl\":\"p\",\"_ActionUrl.Comment\":\"s\",\"actionUrlText\":\"gbquxigj\"},{\"action\":\"gzjaoyfhrtxilne\",\"actionUrl\":\"ujysvle\",\"_ActionUrl.Comment\":\"vfqawrlyxwjkcpr\",\"actionUrlText\":\"wbxgjvt\"},{\"action\":\"p\",\"actionUrl\":\"szdnr\",\"_ActionUrl.Comment\":\"qguhmuo\",\"actionUrlText\":\"f\"}],\"serviceImpactingEvents\":[{\"eventStartTime\":\"2021-05-15T10:56:25Z\",\"eventStatusLastModifiedTime\":\"2021-05-23T15:38:51Z\",\"correlationId\":\"uitnwuiz\",\"status\":{\"value\":\"x\"},\"incidentProperties\":{\"title\":\"zuckyfi\",\"service\":\"fidfvzw\",\"region\":\"uht\",\"incidentType\":\"wisdkft\"}},{\"eventStartTime\":\"2021-06-08T12:42:14Z\",\"eventStatusLastModifiedTime\":\"2021-10-31T03:21:56Z\",\"correlationId\":\"eiwaopvkmi\",\"status\":{\"value\":\"mxdcufufsrp\"},\"incidentProperties\":{\"title\":\"idnsezcxtb\",\"service\":\"gfycc\",\"region\":\"ewmdw\",\"incidentType\":\"eiachboosflnr\"}},{\"eventStartTime\":\"2021-04-28T23:01:46Z\",\"eventStatusLastModifiedTime\":\"2021-02-19T13:41:36Z\",\"correlationId\":\"eeh\",\"status\":{\"value\":\"ypyqrimzinp\"},\"incidentProperties\":{\"title\":\"jdkirsoodqx\",\"service\":\"rmnohj\",\"region\":\"kwh\",\"incidentType\":\"oifiyipjxsqwpgr\"}}]}}") - .toObject(AvailabilityStatusInner.class); - Assertions.assertEquals("dgeablgphu", model.id()); - Assertions.assertEquals("cndvkaozwyiftyhx", model.name()); - Assertions.assertEquals("rokft", model.type()); - Assertions.assertEquals("olniwpwcukjf", model.location()); - Assertions.assertEquals(AvailabilityStateValues.UNAVAILABLE, model.properties().availabilityState()); - Assertions.assertEquals("xklrypl", model.properties().title()); - Assertions.assertEquals("kbasyypn", model.properties().summary()); - Assertions.assertEquals("hsgcbacphejkot", model.properties().detailedStatus()); - Assertions.assertEquals("qgoulznd", model.properties().reasonType()); - Assertions.assertEquals("kwy", model.properties().context()); - Assertions.assertEquals("gfgibm", model.properties().category()); - Assertions.assertEquals("gakeqsr", model.properties().articleId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-20T03:29:22Z"), - model.properties().rootCauseAttributionTime()); - Assertions.assertEquals("qqedqytbciqfou", model.properties().healthEventType()); - Assertions.assertEquals("mmnkzsmodmgl", model.properties().healthEventCause()); - Assertions.assertEquals("gpbkwtmut", model.properties().healthEventCategory()); - Assertions.assertEquals("qktapspwgcuert", model.properties().healthEventId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-11T20:02:52Z"), model.properties().resolutionEta()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-11T17:15:33Z"), model.properties().occuredTime()); - Assertions.assertEquals(ReasonChronicityTypes.PERSISTENT, model.properties().reasonChronicity()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-13T02:52:42Z"), model.properties().reportedTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-25T23:23:25Z"), - model.properties().recentlyResolved().unavailableOccuredTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-07T14:56:07Z"), - model.properties().recentlyResolved().resolvedTime()); - Assertions.assertEquals("bjf", model.properties().recentlyResolved().unavailableSummary()); - Assertions.assertEquals("bmbexppbhtqqro", model.properties().recommendedActions().get(0).action()); - Assertions.assertEquals("p", model.properties().recommendedActions().get(0).actionUrl()); - Assertions.assertEquals("gbquxigj", model.properties().recommendedActions().get(0).actionUrlText()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-15T10:56:25Z"), - model.properties().serviceImpactingEvents().get(0).eventStartTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-23T15:38:51Z"), - model.properties().serviceImpactingEvents().get(0).eventStatusLastModifiedTime()); - Assertions.assertEquals("uitnwuiz", model.properties().serviceImpactingEvents().get(0).correlationId()); - Assertions.assertEquals("x", model.properties().serviceImpactingEvents().get(0).status().value()); - Assertions.assertEquals("zuckyfi", - model.properties().serviceImpactingEvents().get(0).incidentProperties().title()); - Assertions.assertEquals("fidfvzw", - model.properties().serviceImpactingEvents().get(0).incidentProperties().service()); - Assertions.assertEquals("uht", - model.properties().serviceImpactingEvents().get(0).incidentProperties().region()); - Assertions.assertEquals("wisdkft", - model.properties().serviceImpactingEvents().get(0).incidentProperties().incidentType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AvailabilityStatusInner model - = new AvailabilityStatusInner().withId("dgeablgphu") - .withName("cndvkaozwyiftyhx") - .withType("rokft") - .withLocation("olniwpwcukjf") - .withProperties(new AvailabilityStatusProperties() - .withAvailabilityState(AvailabilityStateValues.UNAVAILABLE) - .withTitle("xklrypl") - .withSummary("kbasyypn") - .withDetailedStatus("hsgcbacphejkot") - .withReasonType("qgoulznd") - .withContext("kwy") - .withCategory("gfgibm") - .withArticleId("gakeqsr") - .withRootCauseAttributionTime(OffsetDateTime.parse("2021-11-20T03:29:22Z")) - .withHealthEventType("qqedqytbciqfou") - .withHealthEventCause("mmnkzsmodmgl") - .withHealthEventCategory("gpbkwtmut") - .withHealthEventId("qktapspwgcuert") - .withResolutionEta(OffsetDateTime.parse("2021-07-11T20:02:52Z")) - .withOccuredTime(OffsetDateTime.parse("2021-08-11T17:15:33Z")) - .withReasonChronicity(ReasonChronicityTypes.PERSISTENT) - .withReportedTime(OffsetDateTime.parse("2021-09-13T02:52:42Z")) - .withRecentlyResolved(new AvailabilityStatusPropertiesRecentlyResolved() - .withUnavailableOccuredTime(OffsetDateTime.parse("2021-10-25T23:23:25Z")) - .withResolvedTime(OffsetDateTime.parse("2021-11-07T14:56:07Z")) - .withUnavailableSummary("bjf")) - .withRecommendedActions(Arrays - .asList( - new RecommendedAction().withAction("bmbexppbhtqqro") - .withActionUrl("p") - .withActionUrlText("gbquxigj"), - new RecommendedAction().withAction("gzjaoyfhrtxilne") - .withActionUrl("ujysvle") - .withActionUrlText("wbxgjvt"), - new RecommendedAction().withAction("p").withActionUrl("szdnr").withActionUrlText("f"))) - .withServiceImpactingEvents(Arrays.asList( - new ServiceImpactingEvent().withEventStartTime(OffsetDateTime.parse("2021-05-15T10:56:25Z")) - .withEventStatusLastModifiedTime(OffsetDateTime.parse("2021-05-23T15:38:51Z")) - .withCorrelationId("uitnwuiz") - .withStatus(new ServiceImpactingEventStatus().withValue("x")) - .withIncidentProperties(new ServiceImpactingEventIncidentProperties().withTitle("zuckyfi") - .withService("fidfvzw") - .withRegion("uht") - .withIncidentType("wisdkft")), - new ServiceImpactingEvent().withEventStartTime(OffsetDateTime.parse("2021-06-08T12:42:14Z")) - .withEventStatusLastModifiedTime(OffsetDateTime.parse("2021-10-31T03:21:56Z")) - .withCorrelationId("eiwaopvkmi") - .withStatus(new ServiceImpactingEventStatus().withValue("mxdcufufsrp")) - .withIncidentProperties(new ServiceImpactingEventIncidentProperties() - .withTitle("idnsezcxtb") - .withService("gfycc") - .withRegion("ewmdw") - .withIncidentType("eiachboosflnr")), - new ServiceImpactingEvent().withEventStartTime(OffsetDateTime.parse("2021-04-28T23:01:46Z")) - .withEventStatusLastModifiedTime(OffsetDateTime.parse("2021-02-19T13:41:36Z")) - .withCorrelationId("eeh") - .withStatus(new ServiceImpactingEventStatus().withValue("ypyqrimzinp")) - .withIncidentProperties( - new ServiceImpactingEventIncidentProperties().withTitle("jdkirsoodqx") - .withService("rmnohj") - .withRegion("kwh") - .withIncidentType("oifiyipjxsqwpgr"))))); - model = BinaryData.fromObject(model).toObject(AvailabilityStatusInner.class); - Assertions.assertEquals("dgeablgphu", model.id()); - Assertions.assertEquals("cndvkaozwyiftyhx", model.name()); - Assertions.assertEquals("rokft", model.type()); - Assertions.assertEquals("olniwpwcukjf", model.location()); - Assertions.assertEquals(AvailabilityStateValues.UNAVAILABLE, model.properties().availabilityState()); - Assertions.assertEquals("xklrypl", model.properties().title()); - Assertions.assertEquals("kbasyypn", model.properties().summary()); - Assertions.assertEquals("hsgcbacphejkot", model.properties().detailedStatus()); - Assertions.assertEquals("qgoulznd", model.properties().reasonType()); - Assertions.assertEquals("kwy", model.properties().context()); - Assertions.assertEquals("gfgibm", model.properties().category()); - Assertions.assertEquals("gakeqsr", model.properties().articleId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-20T03:29:22Z"), - model.properties().rootCauseAttributionTime()); - Assertions.assertEquals("qqedqytbciqfou", model.properties().healthEventType()); - Assertions.assertEquals("mmnkzsmodmgl", model.properties().healthEventCause()); - Assertions.assertEquals("gpbkwtmut", model.properties().healthEventCategory()); - Assertions.assertEquals("qktapspwgcuert", model.properties().healthEventId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-11T20:02:52Z"), model.properties().resolutionEta()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-11T17:15:33Z"), model.properties().occuredTime()); - Assertions.assertEquals(ReasonChronicityTypes.PERSISTENT, model.properties().reasonChronicity()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-13T02:52:42Z"), model.properties().reportedTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-25T23:23:25Z"), - model.properties().recentlyResolved().unavailableOccuredTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-07T14:56:07Z"), - model.properties().recentlyResolved().resolvedTime()); - Assertions.assertEquals("bjf", model.properties().recentlyResolved().unavailableSummary()); - Assertions.assertEquals("bmbexppbhtqqro", model.properties().recommendedActions().get(0).action()); - Assertions.assertEquals("p", model.properties().recommendedActions().get(0).actionUrl()); - Assertions.assertEquals("gbquxigj", model.properties().recommendedActions().get(0).actionUrlText()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-15T10:56:25Z"), - model.properties().serviceImpactingEvents().get(0).eventStartTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-23T15:38:51Z"), - model.properties().serviceImpactingEvents().get(0).eventStatusLastModifiedTime()); - Assertions.assertEquals("uitnwuiz", model.properties().serviceImpactingEvents().get(0).correlationId()); - Assertions.assertEquals("x", model.properties().serviceImpactingEvents().get(0).status().value()); - Assertions.assertEquals("zuckyfi", - model.properties().serviceImpactingEvents().get(0).incidentProperties().title()); - Assertions.assertEquals("fidfvzw", - model.properties().serviceImpactingEvents().get(0).incidentProperties().service()); - Assertions.assertEquals("uht", - model.properties().serviceImpactingEvents().get(0).incidentProperties().region()); - Assertions.assertEquals("wisdkft", - model.properties().serviceImpactingEvents().get(0).incidentProperties().incidentType()); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/AvailabilityStatusListResultTests.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/AvailabilityStatusListResultTests.java deleted file mode 100644 index ca86113e7705..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/AvailabilityStatusListResultTests.java +++ /dev/null @@ -1,270 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.resourcehealth.fluent.models.AvailabilityStatusInner; -import com.azure.resourcemanager.resourcehealth.models.AvailabilityStateValues; -import com.azure.resourcemanager.resourcehealth.models.AvailabilityStatusListResult; -import com.azure.resourcemanager.resourcehealth.models.AvailabilityStatusProperties; -import com.azure.resourcemanager.resourcehealth.models.AvailabilityStatusPropertiesRecentlyResolved; -import com.azure.resourcemanager.resourcehealth.models.ReasonChronicityTypes; -import com.azure.resourcemanager.resourcehealth.models.RecommendedAction; -import com.azure.resourcemanager.resourcehealth.models.ServiceImpactingEvent; -import com.azure.resourcemanager.resourcehealth.models.ServiceImpactingEventIncidentProperties; -import com.azure.resourcemanager.resourcehealth.models.ServiceImpactingEventStatus; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AvailabilityStatusListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AvailabilityStatusListResult model = BinaryData.fromString( - "{\"value\":[{\"id\":\"hq\",\"name\":\"gjxpybczmehmt\",\"type\":\"pbsphrupidgs\",\"location\":\"bejhphoycmsxa\",\"properties\":{\"availabilityState\":\"Degraded\",\"title\":\"bmtqioq\",\"summary\":\"ehtbm\",\"detailedStatus\":\"p\",\"reasonType\":\"noi\",\"context\":\"wlrxyb\",\"category\":\"oqijgkdmbpaz\",\"articleId\":\"bc\",\"rootCauseAttributionTime\":\"2021-08-16T12:22:59Z\",\"healthEventType\":\"znrb\",\"healthEventCause\":\"qqjnqgl\",\"healthEventCategory\":\"gnufoooj\",\"healthEventId\":\"ifsqesaagdfmg\",\"resolutionETA\":\"2021-05-15T08:16:53Z\",\"occuredTime\":\"2021-07-04T01:57:27Z\",\"reasonChronicity\":\"Transient\",\"reportedTime\":\"2021-05-21T02:09:04Z\",\"recentlyResolved\":{\"unavailableOccuredTime\":\"2021-09-21T00:46:54Z\",\"resolvedTime\":\"2021-07-30T15:17:55Z\",\"unavailableSummary\":\"tsizntocipaoua\"},\"recommendedActions\":[{\"action\":\"ucmpoyfd\",\"actionUrl\":\"ogknygjofjdd\",\"_ActionUrl.Comment\":\"s\",\"actionUrlText\":\"eupewnwreitjz\"}],\"serviceImpactingEvents\":[{\"eventStartTime\":\"2021-03-07T10:33:04Z\",\"eventStatusLastModifiedTime\":\"2021-05-22T22:11:04Z\",\"correlationId\":\"mofcq\",\"status\":{},\"incidentProperties\":{}},{\"eventStartTime\":\"2021-01-26T19:26:10Z\",\"eventStatusLastModifiedTime\":\"2021-02-14T18:03:27Z\",\"correlationId\":\"tmlxhekuksjtx\",\"status\":{},\"incidentProperties\":{}}]}},{\"id\":\"mparcryuanzw\",\"name\":\"zdxtayrlhmwhf\",\"type\":\"rqobmtuk\",\"location\":\"ryrtihfxtijbpzv\",\"properties\":{\"availabilityState\":\"Unknown\",\"title\":\"ymglzufcyz\",\"summary\":\"hdbihan\",\"detailedStatus\":\"hfcbjysa\",\"reasonType\":\"th\",\"context\":\"hab\",\"category\":\"pikxwczbyscnpqxu\",\"articleId\":\"vyq\",\"rootCauseAttributionTime\":\"2021-07-08T16:34:06Z\",\"healthEventType\":\"ybrk\",\"healthEventCause\":\"dumjgrtfwvuk\",\"healthEventCategory\":\"audccsnhs\",\"healthEventId\":\"nyejhkryhtnap\",\"resolutionETA\":\"2021-02-17T09:01:43Z\",\"occuredTime\":\"2021-08-11T07:28:39Z\",\"reasonChronicity\":\"Transient\",\"reportedTime\":\"2021-07-30T00:54:04Z\",\"recentlyResolved\":{\"unavailableOccuredTime\":\"2021-12-06T06:12:28Z\",\"resolvedTime\":\"2021-05-20T15:17:09Z\",\"unavailableSummary\":\"pjoxzjnch\"},\"recommendedActions\":[{\"action\":\"podmailzydehojwy\",\"actionUrl\":\"uxinpmqnjaq\",\"_ActionUrl.Comment\":\"xj\",\"actionUrlText\":\"r\"},{\"action\":\"vcputegj\",\"actionUrl\":\"mfdatscmdvpj\",\"_ActionUrl.Comment\":\"lsuuvmkjozkrwfnd\",\"actionUrlText\":\"djpslw\"},{\"action\":\"dpvwryoqpsoaccta\",\"actionUrl\":\"kljla\",\"_ActionUrl.Comment\":\"cr\",\"actionUrlText\":\"fdfdosygexpa\"},{\"action\":\"akhmsbzjhcrz\",\"actionUrl\":\"dphlxaolt\",\"_ActionUrl.Comment\":\"trg\",\"actionUrlText\":\"bpf\"}],\"serviceImpactingEvents\":[{\"eventStartTime\":\"2021-08-10T01:28:04Z\",\"eventStatusLastModifiedTime\":\"2021-06-30T00:58:21Z\",\"correlationId\":\"f\",\"status\":{},\"incidentProperties\":{}}]}},{\"id\":\"zoxxjtf\",\"name\":\"luwfzitonpeqfpjk\",\"type\":\"xofpdvhpfxxypi\",\"location\":\"nmayhuybb\",\"properties\":{\"availabilityState\":\"Unavailable\",\"title\":\"po\",\"summary\":\"inuvamiheogn\",\"detailedStatus\":\"xzxtheo\",\"reasonType\":\"si\",\"context\":\"evcciqihnhun\",\"category\":\"wjzrnfygxgisp\",\"articleId\":\"vtz\",\"rootCauseAttributionTime\":\"2021-09-18T00:19:24Z\",\"healthEventType\":\"ubljofxqe\",\"healthEventCause\":\"jaeq\",\"healthEventCategory\":\"qjbasvms\",\"healthEventId\":\"qulngsntnbybkzgc\",\"resolutionETA\":\"2021-05-07T11:10:21Z\",\"occuredTime\":\"2021-09-26T22:03:54Z\",\"reasonChronicity\":\"Persistent\",\"reportedTime\":\"2021-01-10T02:04:56Z\",\"recentlyResolved\":{\"unavailableOccuredTime\":\"2021-07-19T21:40:35Z\",\"resolvedTime\":\"2021-04-09T18:31:52Z\",\"unavailableSummary\":\"kcqvkocrc\"},\"recommendedActions\":[{\"action\":\"tnhxbn\",\"actionUrl\":\"iksqr\",\"_ActionUrl.Comment\":\"ssainqpjwnzll\",\"actionUrlText\":\"mppeebvmgxs\"}],\"serviceImpactingEvents\":[{\"eventStartTime\":\"2021-03-02T20:03:02Z\",\"eventStatusLastModifiedTime\":\"2021-03-09T00:46:41Z\",\"correlationId\":\"jitcjczdzevn\",\"status\":{},\"incidentProperties\":{}},{\"eventStartTime\":\"2021-08-08T02:03:21Z\",\"eventStatusLastModifiedTime\":\"2021-01-31T02:53:03Z\",\"correlationId\":\"ppdsbdkvwrwj\",\"status\":{},\"incidentProperties\":{}},{\"eventStartTime\":\"2021-06-21T23:42:54Z\",\"eventStatusLastModifiedTime\":\"2021-04-13T11:18:15Z\",\"correlationId\":\"je\",\"status\":{},\"incidentProperties\":{}}]}}],\"nextLink\":\"ldhugjzzdatqxh\"}") - .toObject(AvailabilityStatusListResult.class); - Assertions.assertEquals("hq", model.value().get(0).id()); - Assertions.assertEquals("gjxpybczmehmt", model.value().get(0).name()); - Assertions.assertEquals("pbsphrupidgs", model.value().get(0).type()); - Assertions.assertEquals("bejhphoycmsxa", model.value().get(0).location()); - Assertions.assertEquals(AvailabilityStateValues.DEGRADED, - model.value().get(0).properties().availabilityState()); - Assertions.assertEquals("bmtqioq", model.value().get(0).properties().title()); - Assertions.assertEquals("ehtbm", model.value().get(0).properties().summary()); - Assertions.assertEquals("p", model.value().get(0).properties().detailedStatus()); - Assertions.assertEquals("noi", model.value().get(0).properties().reasonType()); - Assertions.assertEquals("wlrxyb", model.value().get(0).properties().context()); - Assertions.assertEquals("oqijgkdmbpaz", model.value().get(0).properties().category()); - Assertions.assertEquals("bc", model.value().get(0).properties().articleId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-16T12:22:59Z"), - model.value().get(0).properties().rootCauseAttributionTime()); - Assertions.assertEquals("znrb", model.value().get(0).properties().healthEventType()); - Assertions.assertEquals("qqjnqgl", model.value().get(0).properties().healthEventCause()); - Assertions.assertEquals("gnufoooj", model.value().get(0).properties().healthEventCategory()); - Assertions.assertEquals("ifsqesaagdfmg", model.value().get(0).properties().healthEventId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-15T08:16:53Z"), - model.value().get(0).properties().resolutionEta()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-04T01:57:27Z"), - model.value().get(0).properties().occuredTime()); - Assertions.assertEquals(ReasonChronicityTypes.TRANSIENT, model.value().get(0).properties().reasonChronicity()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-21T02:09:04Z"), - model.value().get(0).properties().reportedTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-21T00:46:54Z"), - model.value().get(0).properties().recentlyResolved().unavailableOccuredTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-30T15:17:55Z"), - model.value().get(0).properties().recentlyResolved().resolvedTime()); - Assertions.assertEquals("tsizntocipaoua", - model.value().get(0).properties().recentlyResolved().unavailableSummary()); - Assertions.assertEquals("ucmpoyfd", model.value().get(0).properties().recommendedActions().get(0).action()); - Assertions.assertEquals("ogknygjofjdd", - model.value().get(0).properties().recommendedActions().get(0).actionUrl()); - Assertions.assertEquals("eupewnwreitjz", - model.value().get(0).properties().recommendedActions().get(0).actionUrlText()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-07T10:33:04Z"), - model.value().get(0).properties().serviceImpactingEvents().get(0).eventStartTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-22T22:11:04Z"), - model.value().get(0).properties().serviceImpactingEvents().get(0).eventStatusLastModifiedTime()); - Assertions.assertEquals("mofcq", - model.value().get(0).properties().serviceImpactingEvents().get(0).correlationId()); - Assertions.assertEquals("ldhugjzzdatqxh", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AvailabilityStatusListResult model - = new AvailabilityStatusListResult() - .withValue( - Arrays - .asList( - new AvailabilityStatusInner().withId("hq") - .withName("gjxpybczmehmt") - .withType("pbsphrupidgs") - .withLocation("bejhphoycmsxa") - .withProperties(new AvailabilityStatusProperties() - .withAvailabilityState(AvailabilityStateValues.DEGRADED) - .withTitle("bmtqioq") - .withSummary("ehtbm") - .withDetailedStatus("p") - .withReasonType("noi") - .withContext("wlrxyb") - .withCategory("oqijgkdmbpaz") - .withArticleId("bc") - .withRootCauseAttributionTime(OffsetDateTime.parse("2021-08-16T12:22:59Z")) - .withHealthEventType("znrb") - .withHealthEventCause("qqjnqgl") - .withHealthEventCategory("gnufoooj") - .withHealthEventId("ifsqesaagdfmg") - .withResolutionEta(OffsetDateTime.parse("2021-05-15T08:16:53Z")) - .withOccuredTime(OffsetDateTime.parse("2021-07-04T01:57:27Z")) - .withReasonChronicity(ReasonChronicityTypes.TRANSIENT) - .withReportedTime(OffsetDateTime.parse("2021-05-21T02:09:04Z")) - .withRecentlyResolved(new AvailabilityStatusPropertiesRecentlyResolved() - .withUnavailableOccuredTime(OffsetDateTime.parse("2021-09-21T00:46:54Z")) - .withResolvedTime(OffsetDateTime.parse("2021-07-30T15:17:55Z")) - .withUnavailableSummary("tsizntocipaoua")) - .withRecommendedActions(Arrays.asList(new RecommendedAction().withAction("ucmpoyfd") - .withActionUrl("ogknygjofjdd") - .withActionUrlText("eupewnwreitjz"))) - .withServiceImpactingEvents(Arrays.asList( - new ServiceImpactingEvent() - .withEventStartTime(OffsetDateTime.parse("2021-03-07T10:33:04Z")) - .withEventStatusLastModifiedTime( - OffsetDateTime.parse("2021-05-22T22:11:04Z")) - .withCorrelationId("mofcq") - .withStatus(new ServiceImpactingEventStatus()) - .withIncidentProperties(new ServiceImpactingEventIncidentProperties()), - new ServiceImpactingEvent() - .withEventStartTime(OffsetDateTime.parse("2021-01-26T19:26:10Z")) - .withEventStatusLastModifiedTime( - OffsetDateTime.parse("2021-02-14T18:03:27Z")) - .withCorrelationId("tmlxhekuksjtx") - .withStatus(new ServiceImpactingEventStatus()) - .withIncidentProperties(new ServiceImpactingEventIncidentProperties())))), - new AvailabilityStatusInner().withId("mparcryuanzw") - .withName("zdxtayrlhmwhf") - .withType("rqobmtuk") - .withLocation("ryrtihfxtijbpzv") - .withProperties( - new AvailabilityStatusProperties() - .withAvailabilityState(AvailabilityStateValues.UNKNOWN) - .withTitle("ymglzufcyz") - .withSummary("hdbihan") - .withDetailedStatus("hfcbjysa") - .withReasonType("th") - .withContext("hab") - .withCategory("pikxwczbyscnpqxu") - .withArticleId("vyq") - .withRootCauseAttributionTime(OffsetDateTime.parse("2021-07-08T16:34:06Z")) - .withHealthEventType("ybrk") - .withHealthEventCause("dumjgrtfwvuk") - .withHealthEventCategory("audccsnhs") - .withHealthEventId("nyejhkryhtnap") - .withResolutionEta(OffsetDateTime.parse("2021-02-17T09:01:43Z")) - .withOccuredTime(OffsetDateTime.parse("2021-08-11T07:28:39Z")) - .withReasonChronicity(ReasonChronicityTypes.TRANSIENT) - .withReportedTime(OffsetDateTime.parse("2021-07-30T00:54:04Z")) - .withRecentlyResolved(new AvailabilityStatusPropertiesRecentlyResolved() - .withUnavailableOccuredTime(OffsetDateTime.parse("2021-12-06T06:12:28Z")) - .withResolvedTime(OffsetDateTime.parse("2021-05-20T15:17:09Z")) - .withUnavailableSummary("pjoxzjnch")) - .withRecommendedActions(Arrays.asList( - new RecommendedAction().withAction("podmailzydehojwy") - .withActionUrl("uxinpmqnjaq") - .withActionUrlText("r"), - new RecommendedAction().withAction("vcputegj") - .withActionUrl("mfdatscmdvpj") - .withActionUrlText("djpslw"), - new RecommendedAction().withAction("dpvwryoqpsoaccta") - .withActionUrl("kljla") - .withActionUrlText("fdfdosygexpa"), - new RecommendedAction().withAction("akhmsbzjhcrz") - .withActionUrl("dphlxaolt") - .withActionUrlText("bpf"))) - .withServiceImpactingEvents(Arrays.asList(new ServiceImpactingEvent() - .withEventStartTime(OffsetDateTime.parse("2021-08-10T01:28:04Z")) - .withEventStatusLastModifiedTime( - OffsetDateTime.parse("2021-06-30T00:58:21Z")) - .withCorrelationId("f") - .withStatus(new ServiceImpactingEventStatus()) - .withIncidentProperties(new ServiceImpactingEventIncidentProperties())))), - new AvailabilityStatusInner().withId("zoxxjtf") - .withName("luwfzitonpeqfpjk") - .withType("xofpdvhpfxxypi") - .withLocation("nmayhuybb") - .withProperties(new AvailabilityStatusProperties() - .withAvailabilityState(AvailabilityStateValues.UNAVAILABLE) - .withTitle("po") - .withSummary("inuvamiheogn") - .withDetailedStatus("xzxtheo") - .withReasonType("si") - .withContext("evcciqihnhun") - .withCategory("wjzrnfygxgisp") - .withArticleId("vtz") - .withRootCauseAttributionTime(OffsetDateTime.parse("2021-09-18T00:19:24Z")) - .withHealthEventType("ubljofxqe") - .withHealthEventCause("jaeq") - .withHealthEventCategory("qjbasvms") - .withHealthEventId("qulngsntnbybkzgc") - .withResolutionEta(OffsetDateTime.parse("2021-05-07T11:10:21Z")) - .withOccuredTime(OffsetDateTime.parse("2021-09-26T22:03:54Z")) - .withReasonChronicity(ReasonChronicityTypes.PERSISTENT) - .withReportedTime(OffsetDateTime.parse("2021-01-10T02:04:56Z")) - .withRecentlyResolved(new AvailabilityStatusPropertiesRecentlyResolved() - .withUnavailableOccuredTime(OffsetDateTime.parse("2021-07-19T21:40:35Z")) - .withResolvedTime(OffsetDateTime.parse("2021-04-09T18:31:52Z")) - .withUnavailableSummary("kcqvkocrc")) - .withRecommendedActions(Arrays.asList(new RecommendedAction().withAction("tnhxbn") - .withActionUrl("iksqr") - .withActionUrlText("mppeebvmgxs"))) - .withServiceImpactingEvents(Arrays.asList( - new ServiceImpactingEvent() - .withEventStartTime(OffsetDateTime.parse("2021-03-02T20:03:02Z")) - .withEventStatusLastModifiedTime( - OffsetDateTime.parse("2021-03-09T00:46:41Z")) - .withCorrelationId("jitcjczdzevn") - .withStatus(new ServiceImpactingEventStatus()) - .withIncidentProperties(new ServiceImpactingEventIncidentProperties()), - new ServiceImpactingEvent() - .withEventStartTime(OffsetDateTime.parse("2021-08-08T02:03:21Z")) - .withEventStatusLastModifiedTime( - OffsetDateTime.parse("2021-01-31T02:53:03Z")) - .withCorrelationId("ppdsbdkvwrwj") - .withStatus(new ServiceImpactingEventStatus()) - .withIncidentProperties(new ServiceImpactingEventIncidentProperties()), - new ServiceImpactingEvent() - .withEventStartTime(OffsetDateTime.parse("2021-06-21T23:42:54Z")) - .withEventStatusLastModifiedTime( - OffsetDateTime.parse("2021-04-13T11:18:15Z")) - .withCorrelationId("je") - .withStatus(new ServiceImpactingEventStatus()) - .withIncidentProperties(new ServiceImpactingEventIncidentProperties())))))) - .withNextLink("ldhugjzzdatqxh"); - model = BinaryData.fromObject(model).toObject(AvailabilityStatusListResult.class); - Assertions.assertEquals("hq", model.value().get(0).id()); - Assertions.assertEquals("gjxpybczmehmt", model.value().get(0).name()); - Assertions.assertEquals("pbsphrupidgs", model.value().get(0).type()); - Assertions.assertEquals("bejhphoycmsxa", model.value().get(0).location()); - Assertions.assertEquals(AvailabilityStateValues.DEGRADED, - model.value().get(0).properties().availabilityState()); - Assertions.assertEquals("bmtqioq", model.value().get(0).properties().title()); - Assertions.assertEquals("ehtbm", model.value().get(0).properties().summary()); - Assertions.assertEquals("p", model.value().get(0).properties().detailedStatus()); - Assertions.assertEquals("noi", model.value().get(0).properties().reasonType()); - Assertions.assertEquals("wlrxyb", model.value().get(0).properties().context()); - Assertions.assertEquals("oqijgkdmbpaz", model.value().get(0).properties().category()); - Assertions.assertEquals("bc", model.value().get(0).properties().articleId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-16T12:22:59Z"), - model.value().get(0).properties().rootCauseAttributionTime()); - Assertions.assertEquals("znrb", model.value().get(0).properties().healthEventType()); - Assertions.assertEquals("qqjnqgl", model.value().get(0).properties().healthEventCause()); - Assertions.assertEquals("gnufoooj", model.value().get(0).properties().healthEventCategory()); - Assertions.assertEquals("ifsqesaagdfmg", model.value().get(0).properties().healthEventId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-15T08:16:53Z"), - model.value().get(0).properties().resolutionEta()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-04T01:57:27Z"), - model.value().get(0).properties().occuredTime()); - Assertions.assertEquals(ReasonChronicityTypes.TRANSIENT, model.value().get(0).properties().reasonChronicity()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-21T02:09:04Z"), - model.value().get(0).properties().reportedTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-21T00:46:54Z"), - model.value().get(0).properties().recentlyResolved().unavailableOccuredTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-30T15:17:55Z"), - model.value().get(0).properties().recentlyResolved().resolvedTime()); - Assertions.assertEquals("tsizntocipaoua", - model.value().get(0).properties().recentlyResolved().unavailableSummary()); - Assertions.assertEquals("ucmpoyfd", model.value().get(0).properties().recommendedActions().get(0).action()); - Assertions.assertEquals("ogknygjofjdd", - model.value().get(0).properties().recommendedActions().get(0).actionUrl()); - Assertions.assertEquals("eupewnwreitjz", - model.value().get(0).properties().recommendedActions().get(0).actionUrlText()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-07T10:33:04Z"), - model.value().get(0).properties().serviceImpactingEvents().get(0).eventStartTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-22T22:11:04Z"), - model.value().get(0).properties().serviceImpactingEvents().get(0).eventStatusLastModifiedTime()); - Assertions.assertEquals("mofcq", - model.value().get(0).properties().serviceImpactingEvents().get(0).correlationId()); - Assertions.assertEquals("ldhugjzzdatqxh", model.nextLink()); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/AvailabilityStatusPropertiesRecentlyResolvedTests.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/AvailabilityStatusPropertiesRecentlyResolvedTests.java deleted file mode 100644 index 9e28f2a5eddb..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/AvailabilityStatusPropertiesRecentlyResolvedTests.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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.resourcehealth.models.AvailabilityStatusPropertiesRecentlyResolved; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class AvailabilityStatusPropertiesRecentlyResolvedTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AvailabilityStatusPropertiesRecentlyResolved model = BinaryData.fromString( - "{\"unavailableOccuredTime\":\"2021-09-14T02:51:19Z\",\"resolvedTime\":\"2021-06-25T18:07:24Z\",\"unavailableSummary\":\"oqfbowskanyk\"}") - .toObject(AvailabilityStatusPropertiesRecentlyResolved.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-14T02:51:19Z"), model.unavailableOccuredTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-25T18:07:24Z"), model.resolvedTime()); - Assertions.assertEquals("oqfbowskanyk", model.unavailableSummary()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AvailabilityStatusPropertiesRecentlyResolved model = new AvailabilityStatusPropertiesRecentlyResolved() - .withUnavailableOccuredTime(OffsetDateTime.parse("2021-09-14T02:51:19Z")) - .withResolvedTime(OffsetDateTime.parse("2021-06-25T18:07:24Z")) - .withUnavailableSummary("oqfbowskanyk"); - model = BinaryData.fromObject(model).toObject(AvailabilityStatusPropertiesRecentlyResolved.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-14T02:51:19Z"), model.unavailableOccuredTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-25T18:07:24Z"), model.resolvedTime()); - Assertions.assertEquals("oqfbowskanyk", model.unavailableSummary()); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/AvailabilityStatusPropertiesTests.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/AvailabilityStatusPropertiesTests.java deleted file mode 100644 index 3ef9e01c5708..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/AvailabilityStatusPropertiesTests.java +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.resourcehealth.models.AvailabilityStateValues; -import com.azure.resourcemanager.resourcehealth.models.AvailabilityStatusProperties; -import com.azure.resourcemanager.resourcehealth.models.AvailabilityStatusPropertiesRecentlyResolved; -import com.azure.resourcemanager.resourcehealth.models.ReasonChronicityTypes; -import com.azure.resourcemanager.resourcehealth.models.RecommendedAction; -import com.azure.resourcemanager.resourcehealth.models.ServiceImpactingEvent; -import com.azure.resourcemanager.resourcehealth.models.ServiceImpactingEventIncidentProperties; -import com.azure.resourcemanager.resourcehealth.models.ServiceImpactingEventStatus; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AvailabilityStatusPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AvailabilityStatusProperties model = BinaryData.fromString( - "{\"availabilityState\":\"Unavailable\",\"title\":\"orcjxvsnby\",\"summary\":\"abnmocpcyshu\",\"detailedStatus\":\"afbljjgpbtoqcjmk\",\"reasonType\":\"a\",\"context\":\"qidtqajzyu\",\"category\":\"kudjkrlkhb\",\"articleId\":\"fepgzgq\",\"rootCauseAttributionTime\":\"2021-03-12T18:43:43Z\",\"healthEventType\":\"ocxscpaierhhbcs\",\"healthEventCause\":\"ummajtjaod\",\"healthEventCategory\":\"bnbdxkqpxokajion\",\"healthEventId\":\"mexgstxgcp\",\"resolutionETA\":\"2021-04-23T14:47:55Z\",\"occuredTime\":\"2020-12-20T13:07:36Z\",\"reasonChronicity\":\"Persistent\",\"reportedTime\":\"2021-03-19T19:19:25Z\",\"recentlyResolved\":{\"unavailableOccuredTime\":\"2021-03-11T04:53:43Z\",\"resolvedTime\":\"2021-09-11T20:00:02Z\",\"unavailableSummary\":\"lovmclwhijcoe\"},\"recommendedActions\":[{\"action\":\"zaqsqsycbkbfk\",\"actionUrl\":\"kdkexxp\",\"_ActionUrl.Comment\":\"fmxa\",\"actionUrlText\":\"fjpgddtocjjxhvp\"},{\"action\":\"uexhdzx\",\"actionUrl\":\"qeojnxqbzvddntw\",\"_ActionUrl.Comment\":\"eic\",\"actionUrlText\":\"w\"},{\"action\":\"zao\",\"actionUrl\":\"uhrhcffcyddgl\",\"_ActionUrl.Comment\":\"t\",\"actionUrlText\":\"qkwpyeicxmqc\"},{\"action\":\"q\",\"actionUrl\":\"khixuigdtopbo\",\"_ActionUrl.Comment\":\"og\",\"actionUrlText\":\"e\"}],\"serviceImpactingEvents\":[{\"eventStartTime\":\"2021-01-02T08:53:50Z\",\"eventStatusLastModifiedTime\":\"2021-01-27T21:23:24Z\",\"correlationId\":\"z\",\"status\":{\"value\":\"vtpgvdfgiotkf\"},\"incidentProperties\":{\"title\":\"qxlngx\",\"service\":\"fgugnxkrxdqmid\",\"region\":\"hzrvqd\",\"incidentType\":\"bhj\"}}]}") - .toObject(AvailabilityStatusProperties.class); - Assertions.assertEquals(AvailabilityStateValues.UNAVAILABLE, model.availabilityState()); - Assertions.assertEquals("orcjxvsnby", model.title()); - Assertions.assertEquals("abnmocpcyshu", model.summary()); - Assertions.assertEquals("afbljjgpbtoqcjmk", model.detailedStatus()); - Assertions.assertEquals("a", model.reasonType()); - Assertions.assertEquals("qidtqajzyu", model.context()); - Assertions.assertEquals("kudjkrlkhb", model.category()); - Assertions.assertEquals("fepgzgq", model.articleId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-12T18:43:43Z"), model.rootCauseAttributionTime()); - Assertions.assertEquals("ocxscpaierhhbcs", model.healthEventType()); - Assertions.assertEquals("ummajtjaod", model.healthEventCause()); - Assertions.assertEquals("bnbdxkqpxokajion", model.healthEventCategory()); - Assertions.assertEquals("mexgstxgcp", model.healthEventId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-23T14:47:55Z"), model.resolutionEta()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-20T13:07:36Z"), model.occuredTime()); - Assertions.assertEquals(ReasonChronicityTypes.PERSISTENT, model.reasonChronicity()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-19T19:19:25Z"), model.reportedTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-11T04:53:43Z"), - model.recentlyResolved().unavailableOccuredTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-11T20:00:02Z"), model.recentlyResolved().resolvedTime()); - Assertions.assertEquals("lovmclwhijcoe", model.recentlyResolved().unavailableSummary()); - Assertions.assertEquals("zaqsqsycbkbfk", model.recommendedActions().get(0).action()); - Assertions.assertEquals("kdkexxp", model.recommendedActions().get(0).actionUrl()); - Assertions.assertEquals("fjpgddtocjjxhvp", model.recommendedActions().get(0).actionUrlText()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-02T08:53:50Z"), - model.serviceImpactingEvents().get(0).eventStartTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-27T21:23:24Z"), - model.serviceImpactingEvents().get(0).eventStatusLastModifiedTime()); - Assertions.assertEquals("z", model.serviceImpactingEvents().get(0).correlationId()); - Assertions.assertEquals("vtpgvdfgiotkf", model.serviceImpactingEvents().get(0).status().value()); - Assertions.assertEquals("qxlngx", model.serviceImpactingEvents().get(0).incidentProperties().title()); - Assertions.assertEquals("fgugnxkrxdqmid", model.serviceImpactingEvents().get(0).incidentProperties().service()); - Assertions.assertEquals("hzrvqd", model.serviceImpactingEvents().get(0).incidentProperties().region()); - Assertions.assertEquals("bhj", model.serviceImpactingEvents().get(0).incidentProperties().incidentType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AvailabilityStatusProperties model - = new AvailabilityStatusProperties().withAvailabilityState(AvailabilityStateValues.UNAVAILABLE) - .withTitle("orcjxvsnby") - .withSummary("abnmocpcyshu") - .withDetailedStatus("afbljjgpbtoqcjmk") - .withReasonType("a") - .withContext("qidtqajzyu") - .withCategory("kudjkrlkhb") - .withArticleId("fepgzgq") - .withRootCauseAttributionTime(OffsetDateTime.parse("2021-03-12T18:43:43Z")) - .withHealthEventType("ocxscpaierhhbcs") - .withHealthEventCause("ummajtjaod") - .withHealthEventCategory("bnbdxkqpxokajion") - .withHealthEventId("mexgstxgcp") - .withResolutionEta(OffsetDateTime.parse("2021-04-23T14:47:55Z")) - .withOccuredTime(OffsetDateTime.parse("2020-12-20T13:07:36Z")) - .withReasonChronicity(ReasonChronicityTypes.PERSISTENT) - .withReportedTime(OffsetDateTime.parse("2021-03-19T19:19:25Z")) - .withRecentlyResolved(new AvailabilityStatusPropertiesRecentlyResolved() - .withUnavailableOccuredTime(OffsetDateTime.parse("2021-03-11T04:53:43Z")) - .withResolvedTime(OffsetDateTime.parse("2021-09-11T20:00:02Z")) - .withUnavailableSummary("lovmclwhijcoe")) - .withRecommendedActions(Arrays.asList(new RecommendedAction() - .withAction("zaqsqsycbkbfk") - .withActionUrl("kdkexxp") - .withActionUrlText("fjpgddtocjjxhvp"), - new RecommendedAction().withAction("uexhdzx") - .withActionUrl("qeojnxqbzvddntw") - .withActionUrlText("w"), - new RecommendedAction().withAction("zao") - .withActionUrl("uhrhcffcyddgl") - .withActionUrlText("qkwpyeicxmqc"), - new RecommendedAction().withAction("q").withActionUrl("khixuigdtopbo").withActionUrlText("e"))) - .withServiceImpactingEvents(Arrays - .asList(new ServiceImpactingEvent().withEventStartTime(OffsetDateTime.parse("2021-01-02T08:53:50Z")) - .withEventStatusLastModifiedTime(OffsetDateTime.parse("2021-01-27T21:23:24Z")) - .withCorrelationId("z") - .withStatus(new ServiceImpactingEventStatus().withValue("vtpgvdfgiotkf")) - .withIncidentProperties(new ServiceImpactingEventIncidentProperties().withTitle("qxlngx") - .withService("fgugnxkrxdqmid") - .withRegion("hzrvqd") - .withIncidentType("bhj")))); - model = BinaryData.fromObject(model).toObject(AvailabilityStatusProperties.class); - Assertions.assertEquals(AvailabilityStateValues.UNAVAILABLE, model.availabilityState()); - Assertions.assertEquals("orcjxvsnby", model.title()); - Assertions.assertEquals("abnmocpcyshu", model.summary()); - Assertions.assertEquals("afbljjgpbtoqcjmk", model.detailedStatus()); - Assertions.assertEquals("a", model.reasonType()); - Assertions.assertEquals("qidtqajzyu", model.context()); - Assertions.assertEquals("kudjkrlkhb", model.category()); - Assertions.assertEquals("fepgzgq", model.articleId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-12T18:43:43Z"), model.rootCauseAttributionTime()); - Assertions.assertEquals("ocxscpaierhhbcs", model.healthEventType()); - Assertions.assertEquals("ummajtjaod", model.healthEventCause()); - Assertions.assertEquals("bnbdxkqpxokajion", model.healthEventCategory()); - Assertions.assertEquals("mexgstxgcp", model.healthEventId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-23T14:47:55Z"), model.resolutionEta()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-20T13:07:36Z"), model.occuredTime()); - Assertions.assertEquals(ReasonChronicityTypes.PERSISTENT, model.reasonChronicity()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-19T19:19:25Z"), model.reportedTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-11T04:53:43Z"), - model.recentlyResolved().unavailableOccuredTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-11T20:00:02Z"), model.recentlyResolved().resolvedTime()); - Assertions.assertEquals("lovmclwhijcoe", model.recentlyResolved().unavailableSummary()); - Assertions.assertEquals("zaqsqsycbkbfk", model.recommendedActions().get(0).action()); - Assertions.assertEquals("kdkexxp", model.recommendedActions().get(0).actionUrl()); - Assertions.assertEquals("fjpgddtocjjxhvp", model.recommendedActions().get(0).actionUrlText()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-02T08:53:50Z"), - model.serviceImpactingEvents().get(0).eventStartTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-27T21:23:24Z"), - model.serviceImpactingEvents().get(0).eventStatusLastModifiedTime()); - Assertions.assertEquals("z", model.serviceImpactingEvents().get(0).correlationId()); - Assertions.assertEquals("vtpgvdfgiotkf", model.serviceImpactingEvents().get(0).status().value()); - Assertions.assertEquals("qxlngx", model.serviceImpactingEvents().get(0).incidentProperties().title()); - Assertions.assertEquals("fgugnxkrxdqmid", model.serviceImpactingEvents().get(0).incidentProperties().service()); - Assertions.assertEquals("hzrvqd", model.serviceImpactingEvents().get(0).incidentProperties().region()); - Assertions.assertEquals("bhj", model.serviceImpactingEvents().get(0).incidentProperties().incidentType()); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/AvailabilityStatusesGetByResourceWithResponseMockTests.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/AvailabilityStatusesGetByResourceWithResponseMockTests.java deleted file mode 100644 index 37aa567e1ec3..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/AvailabilityStatusesGetByResourceWithResponseMockTests.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.resourcehealth.ResourceHealthManager; -import com.azure.resourcemanager.resourcehealth.models.AvailabilityStateValues; -import com.azure.resourcemanager.resourcehealth.models.AvailabilityStatus; -import com.azure.resourcemanager.resourcehealth.models.ReasonChronicityTypes; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AvailabilityStatusesGetByResourceWithResponseMockTests { - @Test - public void testGetByResourceWithResponse() throws Exception { - String responseStr - = "{\"id\":\"rtawcoezb\",\"name\":\"ubskhudygoookkq\",\"type\":\"jb\",\"location\":\"eorfm\",\"properties\":{\"availabilityState\":\"Degraded\",\"title\":\"qzfavyv\",\"summary\":\"qybaryeua\",\"detailedStatus\":\"kq\",\"reasonType\":\"qgzsles\",\"context\":\"bhernntiew\",\"category\":\"cv\",\"articleId\":\"uwrbehwagoh\",\"rootCauseAttributionTime\":\"2021-11-19T12:22:46Z\",\"healthEventType\":\"kmr\",\"healthEventCause\":\"mvvhmxtdrjfuta\",\"healthEventCategory\":\"ebjvewzcjzn\",\"healthEventId\":\"cpmguaadraufact\",\"resolutionETA\":\"2021-01-01T13:50:02Z\",\"occuredTime\":\"2021-03-01T13:31:29Z\",\"reasonChronicity\":\"Persistent\",\"reportedTime\":\"2021-02-27T13:49:15Z\",\"recentlyResolved\":{\"unavailableOccuredTime\":\"2021-03-14T01:25:46Z\",\"resolvedTime\":\"2021-02-20T11:59:59Z\",\"unavailableSummary\":\"s\"},\"recommendedActions\":[{\"action\":\"kulfg\",\"actionUrl\":\"qubkw\",\"_ActionUrl.Comment\":\"enr\",\"actionUrlText\":\"utujba\"},{\"action\":\"juohminyflnorw\",\"actionUrl\":\"uvwpklvxwmyg\",\"_ActionUrl.Comment\":\"pgpqchiszepnnb\",\"actionUrlText\":\"rxgibbd\"},{\"action\":\"confozauors\",\"actionUrl\":\"okwbqplh\",\"_ActionUrl.Comment\":\"nuuepzlrp\",\"actionUrlText\":\"zsoldwey\"},{\"action\":\"dunvmnnrwrbiorkt\",\"actionUrl\":\"ywjhhgdnhx\",\"_ActionUrl.Comment\":\"ivfomiloxgg\",\"actionUrlText\":\"fi\"}],\"serviceImpactingEvents\":[{\"eventStartTime\":\"2021-01-10T04:07:58Z\",\"eventStatusLastModifiedTime\":\"2021-02-15T07:57:44Z\",\"correlationId\":\"ofjchvcyyysf\",\"status\":{\"value\":\"tcubiipuipwoqonm\"},\"incidentProperties\":{\"title\":\"ekni\",\"service\":\"hqvcimpevfgmblr\",\"region\":\"lbywdxsm\",\"incidentType\":\"cwrwfs\"}},{\"eventStartTime\":\"2021-11-21T10:18:25Z\",\"eventStatusLastModifiedTime\":\"2021-01-04T01:05:07Z\",\"correlationId\":\"szqujizdvoq\",\"status\":{\"value\":\"byowbblgyavutp\"},\"incidentProperties\":{\"title\":\"oxoismsksbpim\",\"service\":\"oljxkcgx\",\"region\":\"xsffgcviz\",\"incidentType\":\"dwl\"}},{\"eventStartTime\":\"2021-04-04T23:05:36Z\",\"eventStatusLastModifiedTime\":\"2021-03-22T22:39:30Z\",\"correlationId\":\"pfgfbkjub\",\"status\":{\"value\":\"gkfmins\"},\"incidentProperties\":{\"title\":\"zfttsttktlahb\",\"service\":\"ctxtgzukxi\",\"region\":\"m\",\"incidentType\":\"gqqqxh\"}}]}}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ResourceHealthManager manager = ResourceHealthManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AvailabilityStatus response = manager.availabilityStatuses() - .getByResourceWithResponse("kdl", "wqfbumlkxtrqjfsm", "mbtxhwgf", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("rtawcoezb", response.id()); - Assertions.assertEquals("ubskhudygoookkq", response.name()); - Assertions.assertEquals("jb", response.type()); - Assertions.assertEquals("eorfm", response.location()); - Assertions.assertEquals(AvailabilityStateValues.DEGRADED, response.properties().availabilityState()); - Assertions.assertEquals("qzfavyv", response.properties().title()); - Assertions.assertEquals("qybaryeua", response.properties().summary()); - Assertions.assertEquals("kq", response.properties().detailedStatus()); - Assertions.assertEquals("qgzsles", response.properties().reasonType()); - Assertions.assertEquals("bhernntiew", response.properties().context()); - Assertions.assertEquals("cv", response.properties().category()); - Assertions.assertEquals("uwrbehwagoh", response.properties().articleId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-19T12:22:46Z"), - response.properties().rootCauseAttributionTime()); - Assertions.assertEquals("kmr", response.properties().healthEventType()); - Assertions.assertEquals("mvvhmxtdrjfuta", response.properties().healthEventCause()); - Assertions.assertEquals("ebjvewzcjzn", response.properties().healthEventCategory()); - Assertions.assertEquals("cpmguaadraufact", response.properties().healthEventId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-01T13:50:02Z"), response.properties().resolutionEta()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-01T13:31:29Z"), response.properties().occuredTime()); - Assertions.assertEquals(ReasonChronicityTypes.PERSISTENT, response.properties().reasonChronicity()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-27T13:49:15Z"), response.properties().reportedTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-14T01:25:46Z"), - response.properties().recentlyResolved().unavailableOccuredTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-20T11:59:59Z"), - response.properties().recentlyResolved().resolvedTime()); - Assertions.assertEquals("s", response.properties().recentlyResolved().unavailableSummary()); - Assertions.assertEquals("kulfg", response.properties().recommendedActions().get(0).action()); - Assertions.assertEquals("qubkw", response.properties().recommendedActions().get(0).actionUrl()); - Assertions.assertEquals("utujba", response.properties().recommendedActions().get(0).actionUrlText()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-10T04:07:58Z"), - response.properties().serviceImpactingEvents().get(0).eventStartTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-15T07:57:44Z"), - response.properties().serviceImpactingEvents().get(0).eventStatusLastModifiedTime()); - Assertions.assertEquals("ofjchvcyyysf", response.properties().serviceImpactingEvents().get(0).correlationId()); - Assertions.assertEquals("tcubiipuipwoqonm", - response.properties().serviceImpactingEvents().get(0).status().value()); - Assertions.assertEquals("ekni", - response.properties().serviceImpactingEvents().get(0).incidentProperties().title()); - Assertions.assertEquals("hqvcimpevfgmblr", - response.properties().serviceImpactingEvents().get(0).incidentProperties().service()); - Assertions.assertEquals("lbywdxsm", - response.properties().serviceImpactingEvents().get(0).incidentProperties().region()); - Assertions.assertEquals("cwrwfs", - response.properties().serviceImpactingEvents().get(0).incidentProperties().incidentType()); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/AvailabilityStatusesListByResourceGroupMockTests.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/AvailabilityStatusesListByResourceGroupMockTests.java deleted file mode 100644 index 97d55d53511c..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/AvailabilityStatusesListByResourceGroupMockTests.java +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.resourcehealth.ResourceHealthManager; -import com.azure.resourcemanager.resourcehealth.models.AvailabilityStateValues; -import com.azure.resourcemanager.resourcehealth.models.AvailabilityStatus; -import com.azure.resourcemanager.resourcehealth.models.ReasonChronicityTypes; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AvailabilityStatusesListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - String responseStr - = "{\"value\":[{\"id\":\"gufhyaomtbg\",\"name\":\"avgrvkffovjz\",\"type\":\"jbibg\",\"location\":\"fxumv\",\"properties\":{\"availabilityState\":\"Unavailable\",\"title\":\"ovwxnbkfezzxsc\",\"summary\":\"wzdgirujbzbo\",\"detailedStatus\":\"zzbtdcqvpniyujvi\",\"reasonType\":\"wdsh\",\"context\":\"snrbgyefrymsgao\",\"category\":\"mwn\",\"articleId\":\"tmr\",\"rootCauseAttributionTime\":\"2021-11-17T23:30:45Z\",\"healthEventType\":\"ctymoxoftp\",\"healthEventCause\":\"iwyczuh\",\"healthEventCategory\":\"cpqjlihhyu\",\"healthEventId\":\"skasdvlmfwdgzxu\",\"resolutionETA\":\"2021-09-15T01:19:16Z\",\"occuredTime\":\"2021-10-16T02:48:21Z\",\"reasonChronicity\":\"Persistent\",\"reportedTime\":\"2021-10-14T22:40:57Z\",\"recentlyResolved\":{\"unavailableOccuredTime\":\"2021-11-11T05:22:52Z\",\"resolvedTime\":\"2021-11-06T01:04:21Z\",\"unavailableSummary\":\"urisjnhnytxifqj\"},\"recommendedActions\":[{\"action\":\"rhublwpcesutrg\",\"actionUrl\":\"pauutpw\",\"_ActionUrl.Comment\":\"hihejqgwzpnfqn\",\"actionUrlText\":\"ypsxjvfoim\"},{\"action\":\"slirciz\",\"actionUrl\":\"vydfceacvlhvygdy\",\"_ActionUrl.Comment\":\"umrtwnawjsl\",\"actionUrlText\":\"wkojgcyztsfmzn\"}],\"serviceImpactingEvents\":[{\"eventStartTime\":\"2021-10-05T12:18:52Z\",\"eventStatusLastModifiedTime\":\"2021-01-05T04:29:27Z\",\"correlationId\":\"qnrnrpxehuwryk\",\"status\":{\"value\":\"ifmviklbydvk\"},\"incidentProperties\":{\"title\":\"jdz\",\"service\":\"cvdsrhnj\",\"region\":\"olvtnovqfzge\",\"incidentType\":\"dftuljltduce\"}},{\"eventStartTime\":\"2021-10-12T05:01:48Z\",\"eventStatusLastModifiedTime\":\"2021-08-03T19:11:02Z\",\"correlationId\":\"u\",\"status\":{\"value\":\"jw\"},\"incidentProperties\":{\"title\":\"qioknssxmojm\",\"service\":\"p\",\"region\":\"prvkwcfzqljyxgtc\",\"incidentType\":\"eydbsd\"}},{\"eventStartTime\":\"2021-07-18T11:40:45Z\",\"eventStatusLastModifiedTime\":\"2021-10-15T01:25:58Z\",\"correlationId\":\"aehvbbxuri\",\"status\":{\"value\":\"fnhtbaxkgxyw\"},\"incidentProperties\":{\"title\":\"pyklyhpluodpvru\",\"service\":\"lgzi\",\"region\":\"hostgktstvdxecl\",\"incidentType\":\"dqbcvhzlhplod\"}}]}}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ResourceHealthManager manager = ResourceHealthManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.availabilityStatuses() - .listByResourceGroup("ejnt", "sewgioilqukr", "dxtqmieoxo", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("gufhyaomtbg", response.iterator().next().id()); - Assertions.assertEquals("avgrvkffovjz", response.iterator().next().name()); - Assertions.assertEquals("jbibg", response.iterator().next().type()); - Assertions.assertEquals("fxumv", response.iterator().next().location()); - Assertions.assertEquals(AvailabilityStateValues.UNAVAILABLE, - response.iterator().next().properties().availabilityState()); - Assertions.assertEquals("ovwxnbkfezzxsc", response.iterator().next().properties().title()); - Assertions.assertEquals("wzdgirujbzbo", response.iterator().next().properties().summary()); - Assertions.assertEquals("zzbtdcqvpniyujvi", response.iterator().next().properties().detailedStatus()); - Assertions.assertEquals("wdsh", response.iterator().next().properties().reasonType()); - Assertions.assertEquals("snrbgyefrymsgao", response.iterator().next().properties().context()); - Assertions.assertEquals("mwn", response.iterator().next().properties().category()); - Assertions.assertEquals("tmr", response.iterator().next().properties().articleId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-17T23:30:45Z"), - response.iterator().next().properties().rootCauseAttributionTime()); - Assertions.assertEquals("ctymoxoftp", response.iterator().next().properties().healthEventType()); - Assertions.assertEquals("iwyczuh", response.iterator().next().properties().healthEventCause()); - Assertions.assertEquals("cpqjlihhyu", response.iterator().next().properties().healthEventCategory()); - Assertions.assertEquals("skasdvlmfwdgzxu", response.iterator().next().properties().healthEventId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-15T01:19:16Z"), - response.iterator().next().properties().resolutionEta()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-16T02:48:21Z"), - response.iterator().next().properties().occuredTime()); - Assertions.assertEquals(ReasonChronicityTypes.PERSISTENT, - response.iterator().next().properties().reasonChronicity()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-14T22:40:57Z"), - response.iterator().next().properties().reportedTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-11T05:22:52Z"), - response.iterator().next().properties().recentlyResolved().unavailableOccuredTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-06T01:04:21Z"), - response.iterator().next().properties().recentlyResolved().resolvedTime()); - Assertions.assertEquals("urisjnhnytxifqj", - response.iterator().next().properties().recentlyResolved().unavailableSummary()); - Assertions.assertEquals("rhublwpcesutrg", - response.iterator().next().properties().recommendedActions().get(0).action()); - Assertions.assertEquals("pauutpw", - response.iterator().next().properties().recommendedActions().get(0).actionUrl()); - Assertions.assertEquals("ypsxjvfoim", - response.iterator().next().properties().recommendedActions().get(0).actionUrlText()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-05T12:18:52Z"), - response.iterator().next().properties().serviceImpactingEvents().get(0).eventStartTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-05T04:29:27Z"), - response.iterator().next().properties().serviceImpactingEvents().get(0).eventStatusLastModifiedTime()); - Assertions.assertEquals("qnrnrpxehuwryk", - response.iterator().next().properties().serviceImpactingEvents().get(0).correlationId()); - Assertions.assertEquals("ifmviklbydvk", - response.iterator().next().properties().serviceImpactingEvents().get(0).status().value()); - Assertions.assertEquals("jdz", - response.iterator().next().properties().serviceImpactingEvents().get(0).incidentProperties().title()); - Assertions.assertEquals("cvdsrhnj", - response.iterator().next().properties().serviceImpactingEvents().get(0).incidentProperties().service()); - Assertions.assertEquals("olvtnovqfzge", - response.iterator().next().properties().serviceImpactingEvents().get(0).incidentProperties().region()); - Assertions.assertEquals("dftuljltduce", - response.iterator() - .next() - .properties() - .serviceImpactingEvents() - .get(0) - .incidentProperties() - .incidentType()); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/AvailabilityStatusesListBySubscriptionIdMockTests.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/AvailabilityStatusesListBySubscriptionIdMockTests.java deleted file mode 100644 index e6baa9b8c595..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/AvailabilityStatusesListBySubscriptionIdMockTests.java +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.resourcehealth.ResourceHealthManager; -import com.azure.resourcemanager.resourcehealth.models.AvailabilityStateValues; -import com.azure.resourcemanager.resourcehealth.models.AvailabilityStatus; -import com.azure.resourcemanager.resourcehealth.models.ReasonChronicityTypes; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AvailabilityStatusesListBySubscriptionIdMockTests { - @Test - public void testListBySubscriptionId() throws Exception { - String responseStr - = "{\"value\":[{\"id\":\"qp\",\"name\":\"ostronz\",\"type\":\"hgfipnsxkmcw\",\"location\":\"krrjrea\",\"properties\":{\"availabilityState\":\"Unknown\",\"title\":\"umh\",\"summary\":\"lik\",\"detailedStatus\":\"wslolbqp\",\"reasonType\":\"zlmvfelfktgp\",\"context\":\"rpw\",\"category\":\"eznoig\",\"articleId\":\"njwmwkpnbsazejj\",\"rootCauseAttributionTime\":\"2021-11-14T03:36:06Z\",\"healthEventType\":\"gfhsxttaugzxn\",\"healthEventCause\":\"azpxdtnkdmkqjjl\",\"healthEventCategory\":\"envrkpyouaibrebq\",\"healthEventId\":\"ysjkixqtnqttez\",\"resolutionETA\":\"2021-04-09T04:33:40Z\",\"occuredTime\":\"2021-01-15T10:22:53Z\",\"reasonChronicity\":\"Persistent\",\"reportedTime\":\"2021-04-04T17:22:28Z\",\"recentlyResolved\":{\"unavailableOccuredTime\":\"2021-03-20T06:33:49Z\",\"resolvedTime\":\"2021-08-03T03:37:12Z\",\"unavailableSummary\":\"edltmmjihyeozp\"},\"recommendedActions\":[{\"action\":\"uyqncygupkvipmd\",\"actionUrl\":\"wx\",\"_ActionUrl.Comment\":\"pevzhfst\",\"actionUrlText\":\"xhojuj\"}],\"serviceImpactingEvents\":[{\"eventStartTime\":\"2021-06-17T22:54:10Z\",\"eventStatusLastModifiedTime\":\"2021-06-25T06:41:34Z\",\"correlationId\":\"vhixbjxy\",\"status\":{\"value\":\"yl\"},\"incidentProperties\":{\"title\":\"o\",\"service\":\"ttpkiwkkbnujrywv\",\"region\":\"lbfpncurd\",\"incidentType\":\"wiithtywub\"}},{\"eventStartTime\":\"2021-05-27T18:04:18Z\",\"eventStatusLastModifiedTime\":\"2021-08-12T00:10:56Z\",\"correlationId\":\"qknfd\",\"status\":{\"value\":\"jchrdgoihxumw\"},\"incidentProperties\":{\"title\":\"ndz\",\"service\":\"uu\",\"region\":\"dlwggytsbwtovv\",\"incidentType\":\"seinqfiuf\"}},{\"eventStartTime\":\"2021-09-27T18:06:02Z\",\"eventStatusLastModifiedTime\":\"2021-03-09T23:26:19Z\",\"correlationId\":\"rgnepttwqmsniffc\",\"status\":{\"value\":\"nrojlpijnkr\"},\"incidentProperties\":{\"title\":\"ddhcratizzr\",\"service\":\"asxifto\",\"region\":\"yzhftwesgogczh\",\"incidentType\":\"nxkrlgnyhmossxkk\"}},{\"eventStartTime\":\"2021-10-30T19:25:09Z\",\"eventStatusLastModifiedTime\":\"2021-06-21T18:07:23Z\",\"correlationId\":\"hxjbdhqxvc\",\"status\":{\"value\":\"rpdsof\"},\"incidentProperties\":{\"title\":\"rnsvbuswd\",\"service\":\"yybyc\",\"region\":\"nvjsrtkfa\",\"incidentType\":\"opqgikyzirtxdyux\"}}]}}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ResourceHealthManager manager = ResourceHealthManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.availabilityStatuses().listBySubscriptionId("bfvoowvrv", "t", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("qp", response.iterator().next().id()); - Assertions.assertEquals("ostronz", response.iterator().next().name()); - Assertions.assertEquals("hgfipnsxkmcw", response.iterator().next().type()); - Assertions.assertEquals("krrjrea", response.iterator().next().location()); - Assertions.assertEquals(AvailabilityStateValues.UNKNOWN, - response.iterator().next().properties().availabilityState()); - Assertions.assertEquals("umh", response.iterator().next().properties().title()); - Assertions.assertEquals("lik", response.iterator().next().properties().summary()); - Assertions.assertEquals("wslolbqp", response.iterator().next().properties().detailedStatus()); - Assertions.assertEquals("zlmvfelfktgp", response.iterator().next().properties().reasonType()); - Assertions.assertEquals("rpw", response.iterator().next().properties().context()); - Assertions.assertEquals("eznoig", response.iterator().next().properties().category()); - Assertions.assertEquals("njwmwkpnbsazejj", response.iterator().next().properties().articleId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-14T03:36:06Z"), - response.iterator().next().properties().rootCauseAttributionTime()); - Assertions.assertEquals("gfhsxttaugzxn", response.iterator().next().properties().healthEventType()); - Assertions.assertEquals("azpxdtnkdmkqjjl", response.iterator().next().properties().healthEventCause()); - Assertions.assertEquals("envrkpyouaibrebq", response.iterator().next().properties().healthEventCategory()); - Assertions.assertEquals("ysjkixqtnqttez", response.iterator().next().properties().healthEventId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-09T04:33:40Z"), - response.iterator().next().properties().resolutionEta()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-15T10:22:53Z"), - response.iterator().next().properties().occuredTime()); - Assertions.assertEquals(ReasonChronicityTypes.PERSISTENT, - response.iterator().next().properties().reasonChronicity()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-04T17:22:28Z"), - response.iterator().next().properties().reportedTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-20T06:33:49Z"), - response.iterator().next().properties().recentlyResolved().unavailableOccuredTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-03T03:37:12Z"), - response.iterator().next().properties().recentlyResolved().resolvedTime()); - Assertions.assertEquals("edltmmjihyeozp", - response.iterator().next().properties().recentlyResolved().unavailableSummary()); - Assertions.assertEquals("uyqncygupkvipmd", - response.iterator().next().properties().recommendedActions().get(0).action()); - Assertions.assertEquals("wx", response.iterator().next().properties().recommendedActions().get(0).actionUrl()); - Assertions.assertEquals("xhojuj", - response.iterator().next().properties().recommendedActions().get(0).actionUrlText()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-17T22:54:10Z"), - response.iterator().next().properties().serviceImpactingEvents().get(0).eventStartTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-25T06:41:34Z"), - response.iterator().next().properties().serviceImpactingEvents().get(0).eventStatusLastModifiedTime()); - Assertions.assertEquals("vhixbjxy", - response.iterator().next().properties().serviceImpactingEvents().get(0).correlationId()); - Assertions.assertEquals("yl", - response.iterator().next().properties().serviceImpactingEvents().get(0).status().value()); - Assertions.assertEquals("o", - response.iterator().next().properties().serviceImpactingEvents().get(0).incidentProperties().title()); - Assertions.assertEquals("ttpkiwkkbnujrywv", - response.iterator().next().properties().serviceImpactingEvents().get(0).incidentProperties().service()); - Assertions.assertEquals("lbfpncurd", - response.iterator().next().properties().serviceImpactingEvents().get(0).incidentProperties().region()); - Assertions.assertEquals("wiithtywub", - response.iterator() - .next() - .properties() - .serviceImpactingEvents() - .get(0) - .incidentProperties() - .incidentType()); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/AvailabilityStatusesListMockTests.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/AvailabilityStatusesListMockTests.java deleted file mode 100644 index 31a69f2c0561..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/AvailabilityStatusesListMockTests.java +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.resourcehealth.ResourceHealthManager; -import com.azure.resourcemanager.resourcehealth.models.AvailabilityStateValues; -import com.azure.resourcemanager.resourcehealth.models.AvailabilityStatus; -import com.azure.resourcemanager.resourcehealth.models.ReasonChronicityTypes; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AvailabilityStatusesListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"id\":\"jlkatnwxy\",\"name\":\"pidkqqfkuvscxkdm\",\"type\":\"govibrxkpmloazu\",\"location\":\"ocbgoorbteoyb\",\"properties\":{\"availabilityState\":\"Degraded\",\"title\":\"kvvjgslordilmyww\",\"summary\":\"gkxnyedabg\",\"detailedStatus\":\"udtjuewbc\",\"reasonType\":\"xuuwhcj\",\"context\":\"ccybvp\",\"category\":\"akkud\",\"articleId\":\"xgwjplmagstcyoh\",\"rootCauseAttributionTime\":\"2021-07-05T16:33:29Z\",\"healthEventType\":\"rkdbdgiogsjkmnwq\",\"healthEventCause\":\"obaiyhddviaceg\",\"healthEventCategory\":\"m\",\"healthEventId\":\"fpmvmemfnczd\",\"resolutionETA\":\"2021-06-14T22:03:09Z\",\"occuredTime\":\"2021-05-11T22:31:41Z\",\"reasonChronicity\":\"Transient\",\"reportedTime\":\"2021-10-05T15:52:55Z\",\"recentlyResolved\":{\"unavailableOccuredTime\":\"2021-06-23T09:29:02Z\",\"resolvedTime\":\"2021-11-09T04:24:31Z\",\"unavailableSummary\":\"bzevwrd\"},\"recommendedActions\":[{\"action\":\"kuvsjcswsm\",\"actionUrl\":\"tuluq\",\"_ActionUrl.Comment\":\"fcvlerch\",\"actionUrlText\":\"bm\"},{\"action\":\"jbabwidf\",\"actionUrl\":\"sspuunnoxyhkx\",\"_ActionUrl.Comment\":\"ddrihpf\",\"actionUrlText\":\"qcaaewdaomdjvl\"},{\"action\":\"x\",\"actionUrl\":\"zb\",\"_ActionUrl.Comment\":\"sgeivsiy\",\"actionUrlText\":\"kdncj\"},{\"action\":\"onbzoggculapzwy\",\"actionUrl\":\"gogtqxepnylbf\",\"_ActionUrl.Comment\":\"jlyjtlvofq\",\"actionUrlText\":\"vfcibyfmowux\"}],\"serviceImpactingEvents\":[{\"eventStartTime\":\"2021-08-28T09:36:55Z\",\"eventStatusLastModifiedTime\":\"2021-02-25T18:54:33Z\",\"correlationId\":\"fzwiivwzjbhyz\",\"status\":{\"value\":\"rkambt\"},\"incidentProperties\":{\"title\":\"gvmnvuqeq\",\"service\":\"dspastjbkkdmfl\",\"region\":\"stmjlxrri\",\"incidentType\":\"zapeewchpx\"}}]}}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ResourceHealthManager manager = ResourceHealthManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.availabilityStatuses() - .list("n", "rxcpjuisavo", "qdzfvazivjlfrqtt", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("jlkatnwxy", response.iterator().next().id()); - Assertions.assertEquals("pidkqqfkuvscxkdm", response.iterator().next().name()); - Assertions.assertEquals("govibrxkpmloazu", response.iterator().next().type()); - Assertions.assertEquals("ocbgoorbteoyb", response.iterator().next().location()); - Assertions.assertEquals(AvailabilityStateValues.DEGRADED, - response.iterator().next().properties().availabilityState()); - Assertions.assertEquals("kvvjgslordilmyww", response.iterator().next().properties().title()); - Assertions.assertEquals("gkxnyedabg", response.iterator().next().properties().summary()); - Assertions.assertEquals("udtjuewbc", response.iterator().next().properties().detailedStatus()); - Assertions.assertEquals("xuuwhcj", response.iterator().next().properties().reasonType()); - Assertions.assertEquals("ccybvp", response.iterator().next().properties().context()); - Assertions.assertEquals("akkud", response.iterator().next().properties().category()); - Assertions.assertEquals("xgwjplmagstcyoh", response.iterator().next().properties().articleId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-05T16:33:29Z"), - response.iterator().next().properties().rootCauseAttributionTime()); - Assertions.assertEquals("rkdbdgiogsjkmnwq", response.iterator().next().properties().healthEventType()); - Assertions.assertEquals("obaiyhddviaceg", response.iterator().next().properties().healthEventCause()); - Assertions.assertEquals("m", response.iterator().next().properties().healthEventCategory()); - Assertions.assertEquals("fpmvmemfnczd", response.iterator().next().properties().healthEventId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-14T22:03:09Z"), - response.iterator().next().properties().resolutionEta()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-11T22:31:41Z"), - response.iterator().next().properties().occuredTime()); - Assertions.assertEquals(ReasonChronicityTypes.TRANSIENT, - response.iterator().next().properties().reasonChronicity()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-05T15:52:55Z"), - response.iterator().next().properties().reportedTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-23T09:29:02Z"), - response.iterator().next().properties().recentlyResolved().unavailableOccuredTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-09T04:24:31Z"), - response.iterator().next().properties().recentlyResolved().resolvedTime()); - Assertions.assertEquals("bzevwrd", - response.iterator().next().properties().recentlyResolved().unavailableSummary()); - Assertions.assertEquals("kuvsjcswsm", - response.iterator().next().properties().recommendedActions().get(0).action()); - Assertions.assertEquals("tuluq", - response.iterator().next().properties().recommendedActions().get(0).actionUrl()); - Assertions.assertEquals("bm", - response.iterator().next().properties().recommendedActions().get(0).actionUrlText()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-28T09:36:55Z"), - response.iterator().next().properties().serviceImpactingEvents().get(0).eventStartTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-25T18:54:33Z"), - response.iterator().next().properties().serviceImpactingEvents().get(0).eventStatusLastModifiedTime()); - Assertions.assertEquals("fzwiivwzjbhyz", - response.iterator().next().properties().serviceImpactingEvents().get(0).correlationId()); - Assertions.assertEquals("rkambt", - response.iterator().next().properties().serviceImpactingEvents().get(0).status().value()); - Assertions.assertEquals("gvmnvuqeq", - response.iterator().next().properties().serviceImpactingEvents().get(0).incidentProperties().title()); - Assertions.assertEquals("dspastjbkkdmfl", - response.iterator().next().properties().serviceImpactingEvents().get(0).incidentProperties().service()); - Assertions.assertEquals("stmjlxrri", - response.iterator().next().properties().serviceImpactingEvents().get(0).incidentProperties().region()); - Assertions.assertEquals("zapeewchpx", - response.iterator() - .next() - .properties() - .serviceImpactingEvents() - .get(0) - .incidentProperties() - .incidentType()); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/ChildAvailabilityStatusesGetByResourceWithResponseMockTests.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/ChildAvailabilityStatusesGetByResourceWithResponseMockTests.java deleted file mode 100644 index 47c1f4602c88..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/ChildAvailabilityStatusesGetByResourceWithResponseMockTests.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.resourcehealth.ResourceHealthManager; -import com.azure.resourcemanager.resourcehealth.models.AvailabilityStateValues; -import com.azure.resourcemanager.resourcehealth.models.AvailabilityStatus; -import com.azure.resourcemanager.resourcehealth.models.ReasonChronicityTypes; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ChildAvailabilityStatusesGetByResourceWithResponseMockTests { - @Test - public void testGetByResourceWithResponse() throws Exception { - String responseStr - = "{\"id\":\"fujg\",\"name\":\"gaao\",\"type\":\"ttaqutdew\",\"location\":\"xswvru\",\"properties\":{\"availabilityState\":\"Degraded\",\"title\":\"gehkfkimrtixokff\",\"summary\":\"inljqepqwhixmo\",\"detailedStatus\":\"tshi\",\"reasonType\":\"gvelfc\",\"context\":\"uccbirdsvuw\",\"category\":\"b\",\"articleId\":\"gstmninwjizciln\",\"rootCauseAttributionTime\":\"2021-03-04T09:32:03Z\",\"healthEventType\":\"h\",\"healthEventCause\":\"jtbxqmuluxlx\",\"healthEventCategory\":\"vnersbycucrw\",\"healthEventId\":\"mikzeb\",\"resolutionETA\":\"2021-10-04T09:07:46Z\",\"occuredTime\":\"2021-08-14T09:18:40Z\",\"reasonChronicity\":\"Persistent\",\"reportedTime\":\"2021-07-12T06:31:29Z\",\"recentlyResolved\":{\"unavailableOccuredTime\":\"2021-09-02T04:51:34Z\",\"resolvedTime\":\"2021-02-04T13:53:52Z\",\"unavailableSummary\":\"kzruswh\"},\"recommendedActions\":[{\"action\":\"znvfbycjsxjww\",\"actionUrl\":\"z\",\"_ActionUrl.Comment\":\"mwmxqhndvnoamld\",\"actionUrlText\":\"haohdjhhflzokxc\"},{\"action\":\"pelnjetag\",\"actionUrl\":\"sxoa\",\"_ActionUrl.Comment\":\"tgzpnpb\",\"actionUrlText\":\"vefloccsrmozihmi\"},{\"action\":\"awtxxpk\",\"actionUrl\":\"cxcjxgry\",\"_ActionUrl.Comment\":\"mpcycilrmcaykgg\",\"actionUrlText\":\"xu\"},{\"action\":\"rksxwpndfc\",\"actionUrl\":\"nznthjtw\",\"_ActionUrl.Comment\":\"aosrxuz\",\"actionUrlText\":\"amktcqiosmgbzah\"}],\"serviceImpactingEvents\":[{\"eventStartTime\":\"2021-03-27T13:24:01Z\",\"eventStatusLastModifiedTime\":\"2021-10-01T04:20:56Z\",\"correlationId\":\"ltlaprltzkatbhj\",\"status\":{\"value\":\"nbsoqeqalarv\"},\"incidentProperties\":{\"title\":\"un\",\"service\":\"gfebwlnb\",\"region\":\"yreeudz\",\"incidentType\":\"vbpdqmjxlyyzglgo\"}},{\"eventStartTime\":\"2021-04-10T20:18:26Z\",\"eventStatusLastModifiedTime\":\"2020-12-22T17:43:39Z\",\"correlationId\":\"jyuojqtobaxkjeyt\",\"status\":{\"value\":\"bfjkw\"},\"incidentProperties\":{\"title\":\"nkqbhsyrq\",\"service\":\"jqhden\",\"region\":\"ulkpakd\",\"incidentType\":\"fmjnnawtqa\"}}]}}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ResourceHealthManager manager = ResourceHealthManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AvailabilityStatus response = manager.childAvailabilityStatuses() - .getByResourceWithResponse("zjkjexfdeqv", "psylkkshkbffmbmx", "jrgywwpgjxsn", - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("fujg", response.id()); - Assertions.assertEquals("gaao", response.name()); - Assertions.assertEquals("ttaqutdew", response.type()); - Assertions.assertEquals("xswvru", response.location()); - Assertions.assertEquals(AvailabilityStateValues.DEGRADED, response.properties().availabilityState()); - Assertions.assertEquals("gehkfkimrtixokff", response.properties().title()); - Assertions.assertEquals("inljqepqwhixmo", response.properties().summary()); - Assertions.assertEquals("tshi", response.properties().detailedStatus()); - Assertions.assertEquals("gvelfc", response.properties().reasonType()); - Assertions.assertEquals("uccbirdsvuw", response.properties().context()); - Assertions.assertEquals("b", response.properties().category()); - Assertions.assertEquals("gstmninwjizciln", response.properties().articleId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-04T09:32:03Z"), - response.properties().rootCauseAttributionTime()); - Assertions.assertEquals("h", response.properties().healthEventType()); - Assertions.assertEquals("jtbxqmuluxlx", response.properties().healthEventCause()); - Assertions.assertEquals("vnersbycucrw", response.properties().healthEventCategory()); - Assertions.assertEquals("mikzeb", response.properties().healthEventId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-04T09:07:46Z"), response.properties().resolutionEta()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-14T09:18:40Z"), response.properties().occuredTime()); - Assertions.assertEquals(ReasonChronicityTypes.PERSISTENT, response.properties().reasonChronicity()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-12T06:31:29Z"), response.properties().reportedTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-02T04:51:34Z"), - response.properties().recentlyResolved().unavailableOccuredTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-04T13:53:52Z"), - response.properties().recentlyResolved().resolvedTime()); - Assertions.assertEquals("kzruswh", response.properties().recentlyResolved().unavailableSummary()); - Assertions.assertEquals("znvfbycjsxjww", response.properties().recommendedActions().get(0).action()); - Assertions.assertEquals("z", response.properties().recommendedActions().get(0).actionUrl()); - Assertions.assertEquals("haohdjhhflzokxc", response.properties().recommendedActions().get(0).actionUrlText()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-27T13:24:01Z"), - response.properties().serviceImpactingEvents().get(0).eventStartTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-01T04:20:56Z"), - response.properties().serviceImpactingEvents().get(0).eventStatusLastModifiedTime()); - Assertions.assertEquals("ltlaprltzkatbhj", - response.properties().serviceImpactingEvents().get(0).correlationId()); - Assertions.assertEquals("nbsoqeqalarv", response.properties().serviceImpactingEvents().get(0).status().value()); - Assertions.assertEquals("un", - response.properties().serviceImpactingEvents().get(0).incidentProperties().title()); - Assertions.assertEquals("gfebwlnb", - response.properties().serviceImpactingEvents().get(0).incidentProperties().service()); - Assertions.assertEquals("yreeudz", - response.properties().serviceImpactingEvents().get(0).incidentProperties().region()); - Assertions.assertEquals("vbpdqmjxlyyzglgo", - response.properties().serviceImpactingEvents().get(0).incidentProperties().incidentType()); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/ChildAvailabilityStatusesListMockTests.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/ChildAvailabilityStatusesListMockTests.java deleted file mode 100644 index 771ad2ae6be6..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/ChildAvailabilityStatusesListMockTests.java +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.resourcehealth.ResourceHealthManager; -import com.azure.resourcemanager.resourcehealth.models.AvailabilityStateValues; -import com.azure.resourcemanager.resourcehealth.models.AvailabilityStatus; -import com.azure.resourcemanager.resourcehealth.models.ReasonChronicityTypes; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ChildAvailabilityStatusesListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"id\":\"wfl\",\"name\":\"mpizru\",\"type\":\"pqxpx\",\"location\":\"fcngjsa\",\"properties\":{\"availabilityState\":\"Unknown\",\"title\":\"tmkzjvkviirhgfgr\",\"summary\":\"dpgra\",\"detailedStatus\":\"vzbglbyvi\",\"reasonType\":\"ctbrxkjzwrgxffm\",\"context\":\"kwfbkgo\",\"category\":\"wopdbydpiz\",\"articleId\":\"clnapxbiygnugjkn\",\"rootCauseAttributionTime\":\"2021-02-25T12:06:10Z\",\"healthEventType\":\"cttuxuu\",\"healthEventCause\":\"lflqoiqu\",\"healthEventCategory\":\"ehmrn\",\"healthEventId\":\"vsujztczytqjtwh\",\"resolutionETA\":\"2021-08-12T09:47:08Z\",\"occuredTime\":\"2021-10-31T16:43:41Z\",\"reasonChronicity\":\"Transient\",\"reportedTime\":\"2021-06-26T15:30:29Z\",\"recentlyResolved\":{\"unavailableOccuredTime\":\"2021-05-26T04:45:22Z\",\"resolvedTime\":\"2021-03-23T16:05:03Z\",\"unavailableSummary\":\"mr\"},\"recommendedActions\":[{\"action\":\"uifamowaziynknlq\",\"actionUrl\":\"dvpiwh\",\"_ActionUrl.Comment\":\"szdtmaajquh\",\"actionUrlText\":\"ylr\"}],\"serviceImpactingEvents\":[{\"eventStartTime\":\"2021-10-02T10:25:29Z\",\"eventStatusLastModifiedTime\":\"2021-01-13T02:27:50Z\",\"correlationId\":\"mzyospspshck\",\"status\":{\"value\":\"jpmspbpssdfppy\"},\"incidentProperties\":{\"title\":\"ieyujtvc\",\"service\":\"cnyxrxmunjd\",\"region\":\"glnkvxlxpagl\",\"incidentType\":\"vbgkcvkhpzv\"}}]}}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ResourceHealthManager manager = ResourceHealthManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.childAvailabilityStatuses().list("pxuckpggq", "wey", "rdhlis", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("wfl", response.iterator().next().id()); - Assertions.assertEquals("mpizru", response.iterator().next().name()); - Assertions.assertEquals("pqxpx", response.iterator().next().type()); - Assertions.assertEquals("fcngjsa", response.iterator().next().location()); - Assertions.assertEquals(AvailabilityStateValues.UNKNOWN, - response.iterator().next().properties().availabilityState()); - Assertions.assertEquals("tmkzjvkviirhgfgr", response.iterator().next().properties().title()); - Assertions.assertEquals("dpgra", response.iterator().next().properties().summary()); - Assertions.assertEquals("vzbglbyvi", response.iterator().next().properties().detailedStatus()); - Assertions.assertEquals("ctbrxkjzwrgxffm", response.iterator().next().properties().reasonType()); - Assertions.assertEquals("kwfbkgo", response.iterator().next().properties().context()); - Assertions.assertEquals("wopdbydpiz", response.iterator().next().properties().category()); - Assertions.assertEquals("clnapxbiygnugjkn", response.iterator().next().properties().articleId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-25T12:06:10Z"), - response.iterator().next().properties().rootCauseAttributionTime()); - Assertions.assertEquals("cttuxuu", response.iterator().next().properties().healthEventType()); - Assertions.assertEquals("lflqoiqu", response.iterator().next().properties().healthEventCause()); - Assertions.assertEquals("ehmrn", response.iterator().next().properties().healthEventCategory()); - Assertions.assertEquals("vsujztczytqjtwh", response.iterator().next().properties().healthEventId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-12T09:47:08Z"), - response.iterator().next().properties().resolutionEta()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-31T16:43:41Z"), - response.iterator().next().properties().occuredTime()); - Assertions.assertEquals(ReasonChronicityTypes.TRANSIENT, - response.iterator().next().properties().reasonChronicity()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-26T15:30:29Z"), - response.iterator().next().properties().reportedTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-26T04:45:22Z"), - response.iterator().next().properties().recentlyResolved().unavailableOccuredTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-23T16:05:03Z"), - response.iterator().next().properties().recentlyResolved().resolvedTime()); - Assertions.assertEquals("mr", response.iterator().next().properties().recentlyResolved().unavailableSummary()); - Assertions.assertEquals("uifamowaziynknlq", - response.iterator().next().properties().recommendedActions().get(0).action()); - Assertions.assertEquals("dvpiwh", - response.iterator().next().properties().recommendedActions().get(0).actionUrl()); - Assertions.assertEquals("ylr", - response.iterator().next().properties().recommendedActions().get(0).actionUrlText()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-02T10:25:29Z"), - response.iterator().next().properties().serviceImpactingEvents().get(0).eventStartTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-13T02:27:50Z"), - response.iterator().next().properties().serviceImpactingEvents().get(0).eventStatusLastModifiedTime()); - Assertions.assertEquals("mzyospspshck", - response.iterator().next().properties().serviceImpactingEvents().get(0).correlationId()); - Assertions.assertEquals("jpmspbpssdfppy", - response.iterator().next().properties().serviceImpactingEvents().get(0).status().value()); - Assertions.assertEquals("ieyujtvc", - response.iterator().next().properties().serviceImpactingEvents().get(0).incidentProperties().title()); - Assertions.assertEquals("cnyxrxmunjd", - response.iterator().next().properties().serviceImpactingEvents().get(0).incidentProperties().service()); - Assertions.assertEquals("glnkvxlxpagl", - response.iterator().next().properties().serviceImpactingEvents().get(0).incidentProperties().region()); - Assertions.assertEquals("vbgkcvkhpzv", - response.iterator() - .next() - .properties() - .serviceImpactingEvents() - .get(0) - .incidentProperties() - .incidentType()); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/ChildResourcesListMockTests.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/ChildResourcesListMockTests.java deleted file mode 100644 index a87ff63d878a..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/ChildResourcesListMockTests.java +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.resourcehealth.ResourceHealthManager; -import com.azure.resourcemanager.resourcehealth.models.AvailabilityStateValues; -import com.azure.resourcemanager.resourcehealth.models.AvailabilityStatus; -import com.azure.resourcemanager.resourcehealth.models.ReasonChronicityTypes; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ChildResourcesListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"id\":\"nidibgqjxg\",\"name\":\"r\",\"type\":\"ov\",\"location\":\"pikqmh\",\"properties\":{\"availabilityState\":\"Unknown\",\"title\":\"rmzvupo\",\"summary\":\"zdfuydzvkfvxcnqm\",\"detailedStatus\":\"psw\",\"reasonType\":\"mvkhlggd\",\"context\":\"em\",\"category\":\"kzsz\",\"articleId\":\"iwtglxxhljfpg\",\"rootCauseAttributionTime\":\"2021-04-02T00:38:08Z\",\"healthEventType\":\"mnzhrgmqg\",\"healthEventCause\":\"x\",\"healthEventCategory\":\"qcbfrmbodths\",\"healthEventId\":\"gvriibakclac\",\"resolutionETA\":\"2021-05-02T09:19:09Z\",\"occuredTime\":\"2021-07-14T07:01:39Z\",\"reasonChronicity\":\"Transient\",\"reportedTime\":\"2021-07-14T22:56:45Z\",\"recentlyResolved\":{\"unavailableOccuredTime\":\"2021-07-27T05:54:41Z\",\"resolvedTime\":\"2021-03-08T03:09:28Z\",\"unavailableSummary\":\"gmwohqfzizvu\"},\"recommendedActions\":[{\"action\":\"jsvthnwpzteko\",\"actionUrl\":\"ribi\",\"_ActionUrl.Comment\":\"tgplucfota\",\"actionUrlText\":\"c\"}],\"serviceImpactingEvents\":[{\"eventStartTime\":\"2021-05-10T19:12:24Z\",\"eventStatusLastModifiedTime\":\"2021-05-21T03:40:41Z\",\"correlationId\":\"gswvxwlmzqwm\",\"status\":{\"value\":\"njmxmcuqudtcvcl\"},\"incidentProperties\":{\"title\":\"pdkvg\",\"service\":\"buiyji\",\"region\":\"zphdugneiknp\",\"incidentType\":\"xgjiuqh\"}},{\"eventStartTime\":\"2021-03-20T03:04:21Z\",\"eventStatusLastModifiedTime\":\"2021-09-20T08:31:06Z\",\"correlationId\":\"pqwjedm\",\"status\":{\"value\":\"xxgewpk\"},\"incidentProperties\":{\"title\":\"ylkmqp\",\"service\":\"yhlfb\",\"region\":\"wgcloxoebqinji\",\"incidentType\":\"wjfuj\"}},{\"eventStartTime\":\"2021-02-05T10:32:17Z\",\"eventStatusLastModifiedTime\":\"2021-05-17T03:09:39Z\",\"correlationId\":\"ahhpzpofoiyjwpf\",\"status\":{\"value\":\"mkkho\"},\"incidentProperties\":{\"title\":\"ndviauogphuartvt\",\"service\":\"kyefchnmnahmnxhk\",\"region\":\"qirwrweoox\",\"incidentType\":\"i\"}},{\"eventStartTime\":\"2021-05-19T03:14:53Z\",\"eventStatusLastModifiedTime\":\"2021-06-11T14:56:28Z\",\"correlationId\":\"newmozqvb\",\"status\":{\"value\":\"ma\"},\"incidentProperties\":{\"title\":\"ycxhxzgaztta\",\"service\":\"idvmfqhppubo\",\"region\":\"epdfgkmtdherng\",\"incidentType\":\"c\"}}]}}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ResourceHealthManager manager = ResourceHealthManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.childResources().list("qdf", "voniypfp", "bcpzgpxtivh", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("nidibgqjxg", response.iterator().next().id()); - Assertions.assertEquals("r", response.iterator().next().name()); - Assertions.assertEquals("ov", response.iterator().next().type()); - Assertions.assertEquals("pikqmh", response.iterator().next().location()); - Assertions.assertEquals(AvailabilityStateValues.UNKNOWN, - response.iterator().next().properties().availabilityState()); - Assertions.assertEquals("rmzvupo", response.iterator().next().properties().title()); - Assertions.assertEquals("zdfuydzvkfvxcnqm", response.iterator().next().properties().summary()); - Assertions.assertEquals("psw", response.iterator().next().properties().detailedStatus()); - Assertions.assertEquals("mvkhlggd", response.iterator().next().properties().reasonType()); - Assertions.assertEquals("em", response.iterator().next().properties().context()); - Assertions.assertEquals("kzsz", response.iterator().next().properties().category()); - Assertions.assertEquals("iwtglxxhljfpg", response.iterator().next().properties().articleId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-02T00:38:08Z"), - response.iterator().next().properties().rootCauseAttributionTime()); - Assertions.assertEquals("mnzhrgmqg", response.iterator().next().properties().healthEventType()); - Assertions.assertEquals("x", response.iterator().next().properties().healthEventCause()); - Assertions.assertEquals("qcbfrmbodths", response.iterator().next().properties().healthEventCategory()); - Assertions.assertEquals("gvriibakclac", response.iterator().next().properties().healthEventId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-02T09:19:09Z"), - response.iterator().next().properties().resolutionEta()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-14T07:01:39Z"), - response.iterator().next().properties().occuredTime()); - Assertions.assertEquals(ReasonChronicityTypes.TRANSIENT, - response.iterator().next().properties().reasonChronicity()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-14T22:56:45Z"), - response.iterator().next().properties().reportedTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-27T05:54:41Z"), - response.iterator().next().properties().recentlyResolved().unavailableOccuredTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-08T03:09:28Z"), - response.iterator().next().properties().recentlyResolved().resolvedTime()); - Assertions.assertEquals("gmwohqfzizvu", - response.iterator().next().properties().recentlyResolved().unavailableSummary()); - Assertions.assertEquals("jsvthnwpzteko", - response.iterator().next().properties().recommendedActions().get(0).action()); - Assertions.assertEquals("ribi", - response.iterator().next().properties().recommendedActions().get(0).actionUrl()); - Assertions.assertEquals("c", - response.iterator().next().properties().recommendedActions().get(0).actionUrlText()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-10T19:12:24Z"), - response.iterator().next().properties().serviceImpactingEvents().get(0).eventStartTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-21T03:40:41Z"), - response.iterator().next().properties().serviceImpactingEvents().get(0).eventStatusLastModifiedTime()); - Assertions.assertEquals("gswvxwlmzqwm", - response.iterator().next().properties().serviceImpactingEvents().get(0).correlationId()); - Assertions.assertEquals("njmxmcuqudtcvcl", - response.iterator().next().properties().serviceImpactingEvents().get(0).status().value()); - Assertions.assertEquals("pdkvg", - response.iterator().next().properties().serviceImpactingEvents().get(0).incidentProperties().title()); - Assertions.assertEquals("buiyji", - response.iterator().next().properties().serviceImpactingEvents().get(0).incidentProperties().service()); - Assertions.assertEquals("zphdugneiknp", - response.iterator().next().properties().serviceImpactingEvents().get(0).incidentProperties().region()); - Assertions.assertEquals("xgjiuqh", - response.iterator() - .next() - .properties() - .serviceImpactingEvents() - .get(0) - .incidentProperties() - .incidentType()); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/EmergingIssueImpactTests.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/EmergingIssueImpactTests.java deleted file mode 100644 index b73855446f09..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/EmergingIssueImpactTests.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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.resourcehealth.models.EmergingIssueImpact; -import com.azure.resourcemanager.resourcehealth.models.ImpactedRegion; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class EmergingIssueImpactTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EmergingIssueImpact model = BinaryData.fromString( - "{\"id\":\"yrqufegxuvwz\",\"name\":\"nhlmctlpdng\",\"regions\":[{\"id\":\"bmhrixkwmyijejv\",\"name\":\"rh\"},{\"id\":\"nai\",\"name\":\"xccbdreaxhcex\"}]}") - .toObject(EmergingIssueImpact.class); - Assertions.assertEquals("yrqufegxuvwz", model.id()); - Assertions.assertEquals("nhlmctlpdng", model.name()); - Assertions.assertEquals("bmhrixkwmyijejv", model.regions().get(0).id()); - Assertions.assertEquals("rh", model.regions().get(0).name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EmergingIssueImpact model = new EmergingIssueImpact().withId("yrqufegxuvwz") - .withName("nhlmctlpdng") - .withRegions(Arrays.asList(new ImpactedRegion().withId("bmhrixkwmyijejv").withName("rh"), - new ImpactedRegion().withId("nai").withName("xccbdreaxhcex"))); - model = BinaryData.fromObject(model).toObject(EmergingIssueImpact.class); - Assertions.assertEquals("yrqufegxuvwz", model.id()); - Assertions.assertEquals("nhlmctlpdng", model.name()); - Assertions.assertEquals("bmhrixkwmyijejv", model.regions().get(0).id()); - Assertions.assertEquals("rh", model.regions().get(0).name()); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/EmergingIssueListResultTests.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/EmergingIssueListResultTests.java deleted file mode 100644 index c17db784d8fe..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/EmergingIssueListResultTests.java +++ /dev/null @@ -1,239 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.resourcehealth.fluent.models.EmergingIssuesGetResultInner; -import com.azure.resourcemanager.resourcehealth.models.EmergingIssueImpact; -import com.azure.resourcemanager.resourcehealth.models.EmergingIssueListResult; -import com.azure.resourcemanager.resourcehealth.models.SeverityValues; -import com.azure.resourcemanager.resourcehealth.models.StageValues; -import com.azure.resourcemanager.resourcehealth.models.StatusActiveEvent; -import com.azure.resourcemanager.resourcehealth.models.StatusBanner; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class EmergingIssueListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EmergingIssueListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"refreshTimestamp\":\"2021-07-13T20:34:59Z\",\"statusBanners\":[{\"title\":\"an\",\"message\":\"jos\",\"cloud\":\"youlp\",\"lastModifiedTime\":\"2021-09-04T05:53:47Z\"},{\"title\":\"ag\",\"message\":\"vimjwos\",\"cloud\":\"xitc\",\"lastModifiedTime\":\"2021-01-06T17:55:44Z\"},{\"title\":\"k\",\"message\":\"umiekkezzi\",\"cloud\":\"ly\",\"lastModifiedTime\":\"2021-07-20T01:18:29Z\"}],\"statusActiveEvents\":[{\"title\":\"gge\",\"description\":\"unygaeqid\",\"trackingId\":\"fatpxllrxcyjmoa\",\"startTime\":\"2021-02-02T22:23:44Z\",\"cloud\":\"arm\",\"severity\":\"Warning\",\"stage\":\"Resolve\",\"published\":false,\"lastModifiedTime\":\"2021-02-01T02:42:06Z\",\"impacts\":[{},{}]},{\"title\":\"yxxrwlycoduh\",\"description\":\"xkgymareqnajxqu\",\"trackingId\":\"hky\",\"startTime\":\"2020-12-25T16:19:20Z\",\"cloud\":\"ddg\",\"severity\":\"Error\",\"stage\":\"Archived\",\"published\":false,\"lastModifiedTime\":\"2021-05-03T03:51:25Z\",\"impacts\":[{}]},{\"title\":\"rmnjijpx\",\"description\":\"q\",\"trackingId\":\"dfnbyxbaaabjyv\",\"startTime\":\"2021-10-17T00:26:42Z\",\"cloud\":\"imrzrtuzqog\",\"severity\":\"Error\",\"stage\":\"Archived\",\"published\":false,\"lastModifiedTime\":\"2021-12-03T20:54:07Z\",\"impacts\":[{}]},{\"title\":\"mewzsyyc\",\"description\":\"zsoibjudpfrxtr\",\"trackingId\":\"zvaytdwkqbr\",\"startTime\":\"2021-11-25T23:16:06Z\",\"cloud\":\"axhexiilivp\",\"severity\":\"Information\",\"stage\":\"Resolve\",\"published\":true,\"lastModifiedTime\":\"2021-05-27T12:16:15Z\",\"impacts\":[{},{},{}]}]},\"id\":\"oruzfgsquyfxrxx\",\"name\":\"eptra\",\"type\":\"xje\"},{\"properties\":{\"refreshTimestamp\":\"2021-11-14T21:34:49Z\",\"statusBanners\":[{\"title\":\"uqlcvydy\",\"message\":\"tdooaoj\",\"cloud\":\"iodkooebwnujhem\",\"lastModifiedTime\":\"2021-06-02T00:19:10Z\"},{\"title\":\"dkcrodt\",\"message\":\"nfwjlfltkacjvefk\",\"cloud\":\"foakgg\",\"lastModifiedTime\":\"2021-01-22T11:21:37Z\"},{\"title\":\"gaowpulpqblylsyx\",\"message\":\"jnsjervtiagxsd\",\"cloud\":\"uem\",\"lastModifiedTime\":\"2021-06-09T02:50:50Z\"},{\"title\":\"kfzbeyvpnqicvi\",\"message\":\"kjj\",\"cloud\":\"xrbuukzclew\",\"lastModifiedTime\":\"2021-08-28T04:23:49Z\"}],\"statusActiveEvents\":[{\"title\":\"aztz\",\"description\":\"fn\",\"trackingId\":\"kwyfzqwhxxbuyqax\",\"startTime\":\"2021-07-31T20:27:49Z\",\"cloud\":\"ztppriolxorjalto\",\"severity\":\"Warning\",\"stage\":\"Active\",\"published\":true,\"lastModifiedTime\":\"2021-09-14T22:32:45Z\",\"impacts\":[{},{},{}]}]},\"id\":\"dbnw\",\"name\":\"cf\",\"type\":\"ucqdpfuvglsb\"},{\"properties\":{\"refreshTimestamp\":\"2021-01-27T19:23:30Z\",\"statusBanners\":[{\"title\":\"bvtvudutncormr\",\"message\":\"qtvcofudflvkgj\",\"cloud\":\"gdknnqv\",\"lastModifiedTime\":\"2021-04-22T07:35:58Z\"}],\"statusActiveEvents\":[{\"title\":\"tor\",\"description\":\"sgsahmkycgr\",\"trackingId\":\"wjue\",\"startTime\":\"2020-12-26T00:25:40Z\",\"cloud\":\"uruv\",\"severity\":\"Warning\",\"stage\":\"Resolve\",\"published\":true,\"lastModifiedTime\":\"2020-12-25T04:12:31Z\",\"impacts\":[{}]},{\"title\":\"mqoefkifrvtpuqu\",\"description\":\"qlgkfbtn\",\"trackingId\":\"aongbj\",\"startTime\":\"2021-01-20T14:02:19Z\",\"cloud\":\"jitcjedftwwaez\",\"severity\":\"Information\",\"stage\":\"Archived\",\"published\":false,\"lastModifiedTime\":\"2021-04-24T14:19:49Z\",\"impacts\":[{},{},{},{}]},{\"title\":\"uicybxarzgszuf\",\"description\":\"ciqopidoa\",\"trackingId\":\"iodhkhazxkhnz\",\"startTime\":\"2021-02-10T22:24:58Z\",\"cloud\":\"wntoegokdwbwh\",\"severity\":\"Information\",\"stage\":\"Resolve\",\"published\":false,\"lastModifiedTime\":\"2020-12-29T02:15:33Z\",\"impacts\":[{},{},{}]},{\"title\":\"vbtqgsfraoyzk\",\"description\":\"wtl\",\"trackingId\":\"guxawqaldsyuuxi\",\"startTime\":\"2021-06-17T14:42:30Z\",\"cloud\":\"fobwy\",\"severity\":\"Warning\",\"stage\":\"Active\",\"published\":false,\"lastModifiedTime\":\"2021-02-09T02:12:11Z\",\"impacts\":[{},{},{},{}]}]},\"id\":\"pagmhrskdsnf\",\"name\":\"sd\",\"type\":\"akgtdlmkkzevdlh\"},{\"properties\":{\"refreshTimestamp\":\"2021-08-20T19:20:49Z\",\"statusBanners\":[{\"title\":\"ttwvogvbbe\",\"message\":\"cngqqmoakufgmjz\",\"cloud\":\"rdgrtw\",\"lastModifiedTime\":\"2021-01-23T08:17:26Z\"},{\"title\":\"uzkopbminrfd\",\"message\":\"yuhhziu\",\"cloud\":\"fozbhdmsmlmzqhof\",\"lastModifiedTime\":\"2021-05-05T04:42:21Z\"}],\"statusActiveEvents\":[{\"title\":\"u\",\"description\":\"hxicslfaoqz\",\"trackingId\":\"yylhalnswhccsp\",\"startTime\":\"2021-06-09T09:48:38Z\",\"cloud\":\"vwitqscyw\",\"severity\":\"Warning\",\"stage\":\"Archived\",\"published\":true,\"lastModifiedTime\":\"2021-10-17T17:30:07Z\",\"impacts\":[{},{},{}]}]},\"id\":\"emh\",\"name\":\"i\",\"type\":\"sbrgz\"}],\"nextLink\":\"msweypqwdxggicc\"}") - .toObject(EmergingIssueListResult.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-13T20:34:59Z"), model.value().get(0).refreshTimestamp()); - Assertions.assertEquals("an", model.value().get(0).statusBanners().get(0).title()); - Assertions.assertEquals("jos", model.value().get(0).statusBanners().get(0).message()); - Assertions.assertEquals("youlp", model.value().get(0).statusBanners().get(0).cloud()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-04T05:53:47Z"), - model.value().get(0).statusBanners().get(0).lastModifiedTime()); - Assertions.assertEquals("gge", model.value().get(0).statusActiveEvents().get(0).title()); - Assertions.assertEquals("unygaeqid", model.value().get(0).statusActiveEvents().get(0).description()); - Assertions.assertEquals("fatpxllrxcyjmoa", model.value().get(0).statusActiveEvents().get(0).trackingId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-02T22:23:44Z"), - model.value().get(0).statusActiveEvents().get(0).startTime()); - Assertions.assertEquals("arm", model.value().get(0).statusActiveEvents().get(0).cloud()); - Assertions.assertEquals(SeverityValues.WARNING, model.value().get(0).statusActiveEvents().get(0).severity()); - Assertions.assertEquals(StageValues.RESOLVE, model.value().get(0).statusActiveEvents().get(0).stage()); - Assertions.assertEquals(false, model.value().get(0).statusActiveEvents().get(0).published()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-01T02:42:06Z"), - model.value().get(0).statusActiveEvents().get(0).lastModifiedTime()); - Assertions.assertEquals("msweypqwdxggicc", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EmergingIssueListResult model - = new EmergingIssueListResult() - .withValue(Arrays.asList( - new EmergingIssuesGetResultInner() - .withRefreshTimestamp(OffsetDateTime.parse("2021-07-13T20:34:59Z")) - .withStatusBanners(Arrays.asList( - new StatusBanner().withTitle("an") - .withMessage("jos") - .withCloud("youlp") - .withLastModifiedTime(OffsetDateTime.parse("2021-09-04T05:53:47Z")), - new StatusBanner().withTitle("ag") - .withMessage("vimjwos") - .withCloud("xitc") - .withLastModifiedTime(OffsetDateTime.parse("2021-01-06T17:55:44Z")), - new StatusBanner().withTitle("k") - .withMessage("umiekkezzi") - .withCloud("ly") - .withLastModifiedTime(OffsetDateTime.parse("2021-07-20T01:18:29Z")))) - .withStatusActiveEvents(Arrays.asList( - new StatusActiveEvent().withTitle("gge") - .withDescription("unygaeqid") - .withTrackingId("fatpxllrxcyjmoa") - .withStartTime(OffsetDateTime.parse("2021-02-02T22:23:44Z")) - .withCloud("arm") - .withSeverity(SeverityValues.WARNING) - .withStage(StageValues.RESOLVE) - .withPublished(false) - .withLastModifiedTime(OffsetDateTime.parse("2021-02-01T02:42:06Z")) - .withImpacts(Arrays.asList(new EmergingIssueImpact(), new EmergingIssueImpact())), - new StatusActiveEvent().withTitle("yxxrwlycoduh") - .withDescription("xkgymareqnajxqu") - .withTrackingId("hky") - .withStartTime(OffsetDateTime.parse("2020-12-25T16:19:20Z")) - .withCloud("ddg") - .withSeverity(SeverityValues.ERROR) - .withStage(StageValues.ARCHIVED) - .withPublished(false) - .withLastModifiedTime(OffsetDateTime.parse("2021-05-03T03:51:25Z")) - .withImpacts(Arrays.asList(new EmergingIssueImpact())), - new StatusActiveEvent().withTitle("rmnjijpx") - .withDescription("q") - .withTrackingId("dfnbyxbaaabjyv") - .withStartTime(OffsetDateTime.parse("2021-10-17T00:26:42Z")) - .withCloud("imrzrtuzqog") - .withSeverity(SeverityValues.ERROR) - .withStage(StageValues.ARCHIVED) - .withPublished(false) - .withLastModifiedTime(OffsetDateTime.parse("2021-12-03T20:54:07Z")) - .withImpacts(Arrays.asList(new EmergingIssueImpact())), - new StatusActiveEvent().withTitle("mewzsyyc") - .withDescription("zsoibjudpfrxtr") - .withTrackingId("zvaytdwkqbr") - .withStartTime(OffsetDateTime.parse("2021-11-25T23:16:06Z")) - .withCloud("axhexiilivp") - .withSeverity(SeverityValues.INFORMATION) - .withStage(StageValues.RESOLVE) - .withPublished(true) - .withLastModifiedTime(OffsetDateTime.parse("2021-05-27T12:16:15Z")) - .withImpacts(Arrays.asList(new EmergingIssueImpact(), new EmergingIssueImpact(), - new EmergingIssueImpact())))), - new EmergingIssuesGetResultInner() - .withRefreshTimestamp(OffsetDateTime.parse("2021-11-14T21:34:49Z")) - .withStatusBanners( - Arrays.asList( - new StatusBanner() - .withTitle("uqlcvydy") - .withMessage("tdooaoj") - .withCloud("iodkooebwnujhem") - .withLastModifiedTime(OffsetDateTime.parse("2021-06-02T00:19:10Z")), - new StatusBanner().withTitle("dkcrodt") - .withMessage("nfwjlfltkacjvefk") - .withCloud("foakgg") - .withLastModifiedTime(OffsetDateTime.parse("2021-01-22T11:21:37Z")), - new StatusBanner().withTitle("gaowpulpqblylsyx") - .withMessage("jnsjervtiagxsd") - .withCloud("uem") - .withLastModifiedTime(OffsetDateTime.parse("2021-06-09T02:50:50Z")), - new StatusBanner().withTitle("kfzbeyvpnqicvi") - .withMessage("kjj") - .withCloud("xrbuukzclew") - .withLastModifiedTime(OffsetDateTime.parse("2021-08-28T04:23:49Z")))) - .withStatusActiveEvents( - Arrays - .asList( - new StatusActiveEvent().withTitle("aztz") - .withDescription("fn") - .withTrackingId("kwyfzqwhxxbuyqax") - .withStartTime(OffsetDateTime.parse("2021-07-31T20:27:49Z")) - .withCloud("ztppriolxorjalto") - .withSeverity(SeverityValues.WARNING) - .withStage(StageValues.ACTIVE) - .withPublished(true) - .withLastModifiedTime(OffsetDateTime.parse("2021-09-14T22:32:45Z")) - .withImpacts( - Arrays - .asList(new EmergingIssueImpact(), new EmergingIssueImpact(), - new EmergingIssueImpact())))), - new EmergingIssuesGetResultInner() - .withRefreshTimestamp(OffsetDateTime.parse("2021-01-27T19:23:30Z")) - .withStatusBanners(Arrays.asList(new StatusBanner().withTitle("bvtvudutncormr") - .withMessage("qtvcofudflvkgj") - .withCloud("gdknnqv") - .withLastModifiedTime(OffsetDateTime.parse("2021-04-22T07:35:58Z")))) - .withStatusActiveEvents(Arrays.asList( - new StatusActiveEvent().withTitle("tor") - .withDescription("sgsahmkycgr") - .withTrackingId("wjue") - .withStartTime(OffsetDateTime.parse("2020-12-26T00:25:40Z")) - .withCloud("uruv") - .withSeverity(SeverityValues.WARNING) - .withStage(StageValues.RESOLVE) - .withPublished(true) - .withLastModifiedTime(OffsetDateTime.parse("2020-12-25T04:12:31Z")) - .withImpacts(Arrays.asList(new EmergingIssueImpact())), - new StatusActiveEvent().withTitle("mqoefkifrvtpuqu") - .withDescription("qlgkfbtn") - .withTrackingId("aongbj") - .withStartTime(OffsetDateTime.parse("2021-01-20T14:02:19Z")) - .withCloud("jitcjedftwwaez") - .withSeverity(SeverityValues.INFORMATION) - .withStage(StageValues.ARCHIVED) - .withPublished(false) - .withLastModifiedTime(OffsetDateTime.parse("2021-04-24T14:19:49Z")) - .withImpacts(Arrays.asList(new EmergingIssueImpact(), new EmergingIssueImpact(), - new EmergingIssueImpact(), new EmergingIssueImpact())), - new StatusActiveEvent() - .withTitle("uicybxarzgszuf") - .withDescription("ciqopidoa") - .withTrackingId("iodhkhazxkhnz") - .withStartTime(OffsetDateTime.parse("2021-02-10T22:24:58Z")) - .withCloud("wntoegokdwbwh") - .withSeverity(SeverityValues.INFORMATION) - .withStage(StageValues.RESOLVE) - .withPublished(false) - .withLastModifiedTime(OffsetDateTime.parse("2020-12-29T02:15:33Z")) - .withImpacts( - Arrays.asList(new EmergingIssueImpact(), new EmergingIssueImpact(), - new EmergingIssueImpact())), - new StatusActiveEvent().withTitle("vbtqgsfraoyzk") - .withDescription("wtl") - .withTrackingId("guxawqaldsyuuxi") - .withStartTime(OffsetDateTime.parse("2021-06-17T14:42:30Z")) - .withCloud("fobwy") - .withSeverity(SeverityValues.WARNING) - .withStage(StageValues.ACTIVE) - .withPublished(false) - .withLastModifiedTime(OffsetDateTime.parse("2021-02-09T02:12:11Z")) - .withImpacts(Arrays.asList(new EmergingIssueImpact(), new EmergingIssueImpact(), - new EmergingIssueImpact(), new EmergingIssueImpact())))), - new EmergingIssuesGetResultInner() - .withRefreshTimestamp(OffsetDateTime.parse("2021-08-20T19:20:49Z")) - .withStatusBanners(Arrays.asList( - new StatusBanner().withTitle("ttwvogvbbe") - .withMessage("cngqqmoakufgmjz") - .withCloud("rdgrtw") - .withLastModifiedTime(OffsetDateTime.parse("2021-01-23T08:17:26Z")), - new StatusBanner().withTitle("uzkopbminrfd") - .withMessage("yuhhziu") - .withCloud("fozbhdmsmlmzqhof") - .withLastModifiedTime(OffsetDateTime.parse("2021-05-05T04:42:21Z")))) - .withStatusActiveEvents(Arrays.asList(new StatusActiveEvent().withTitle("u") - .withDescription("hxicslfaoqz") - .withTrackingId("yylhalnswhccsp") - .withStartTime(OffsetDateTime.parse("2021-06-09T09:48:38Z")) - .withCloud("vwitqscyw") - .withSeverity(SeverityValues.WARNING) - .withStage(StageValues.ARCHIVED) - .withPublished(true) - .withLastModifiedTime(OffsetDateTime.parse("2021-10-17T17:30:07Z")) - .withImpacts(Arrays.asList(new EmergingIssueImpact(), new EmergingIssueImpact(), - new EmergingIssueImpact())))))) - .withNextLink("msweypqwdxggicc"); - model = BinaryData.fromObject(model).toObject(EmergingIssueListResult.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-13T20:34:59Z"), model.value().get(0).refreshTimestamp()); - Assertions.assertEquals("an", model.value().get(0).statusBanners().get(0).title()); - Assertions.assertEquals("jos", model.value().get(0).statusBanners().get(0).message()); - Assertions.assertEquals("youlp", model.value().get(0).statusBanners().get(0).cloud()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-04T05:53:47Z"), - model.value().get(0).statusBanners().get(0).lastModifiedTime()); - Assertions.assertEquals("gge", model.value().get(0).statusActiveEvents().get(0).title()); - Assertions.assertEquals("unygaeqid", model.value().get(0).statusActiveEvents().get(0).description()); - Assertions.assertEquals("fatpxllrxcyjmoa", model.value().get(0).statusActiveEvents().get(0).trackingId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-02T22:23:44Z"), - model.value().get(0).statusActiveEvents().get(0).startTime()); - Assertions.assertEquals("arm", model.value().get(0).statusActiveEvents().get(0).cloud()); - Assertions.assertEquals(SeverityValues.WARNING, model.value().get(0).statusActiveEvents().get(0).severity()); - Assertions.assertEquals(StageValues.RESOLVE, model.value().get(0).statusActiveEvents().get(0).stage()); - Assertions.assertEquals(false, model.value().get(0).statusActiveEvents().get(0).published()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-01T02:42:06Z"), - model.value().get(0).statusActiveEvents().get(0).lastModifiedTime()); - Assertions.assertEquals("msweypqwdxggicc", model.nextLink()); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/EmergingIssueTests.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/EmergingIssueTests.java deleted file mode 100644 index d0b88a8ae2aa..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/EmergingIssueTests.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.resourcehealth.fluent.models.EmergingIssue; -import com.azure.resourcemanager.resourcehealth.models.EmergingIssueImpact; -import com.azure.resourcemanager.resourcehealth.models.ImpactedRegion; -import com.azure.resourcemanager.resourcehealth.models.SeverityValues; -import com.azure.resourcemanager.resourcehealth.models.StageValues; -import com.azure.resourcemanager.resourcehealth.models.StatusActiveEvent; -import com.azure.resourcemanager.resourcehealth.models.StatusBanner; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class EmergingIssueTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EmergingIssue model = BinaryData.fromString( - "{\"refreshTimestamp\":\"2021-06-18T14:41:07Z\",\"statusBanners\":[{\"title\":\"u\",\"message\":\"bdsrez\",\"cloud\":\"rhneuyowq\",\"lastModifiedTime\":\"2021-05-06T04:21:37Z\"},{\"title\":\"t\",\"message\":\"ib\",\"cloud\":\"cgpik\",\"lastModifiedTime\":\"2021-11-09T05:31:13Z\"},{\"title\":\"ejzanlfz\",\"message\":\"av\",\"cloud\":\"bzonok\",\"lastModifiedTime\":\"2021-01-16T04:25:55Z\"}],\"statusActiveEvents\":[{\"title\":\"irgzp\",\"description\":\"lazszrn\",\"trackingId\":\"iin\",\"startTime\":\"2021-01-06T22:30:17Z\",\"cloud\":\"pj\",\"severity\":\"Error\",\"stage\":\"Archived\",\"published\":false,\"lastModifiedTime\":\"2021-07-25T09:51:01Z\",\"impacts\":[{\"id\":\"dhszfjv\",\"name\":\"gofel\",\"regions\":[{},{},{}]}]}]}") - .toObject(EmergingIssue.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-18T14:41:07Z"), model.refreshTimestamp()); - Assertions.assertEquals("u", model.statusBanners().get(0).title()); - Assertions.assertEquals("bdsrez", model.statusBanners().get(0).message()); - Assertions.assertEquals("rhneuyowq", model.statusBanners().get(0).cloud()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-06T04:21:37Z"), - model.statusBanners().get(0).lastModifiedTime()); - Assertions.assertEquals("irgzp", model.statusActiveEvents().get(0).title()); - Assertions.assertEquals("lazszrn", model.statusActiveEvents().get(0).description()); - Assertions.assertEquals("iin", model.statusActiveEvents().get(0).trackingId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-06T22:30:17Z"), - model.statusActiveEvents().get(0).startTime()); - Assertions.assertEquals("pj", model.statusActiveEvents().get(0).cloud()); - Assertions.assertEquals(SeverityValues.ERROR, model.statusActiveEvents().get(0).severity()); - Assertions.assertEquals(StageValues.ARCHIVED, model.statusActiveEvents().get(0).stage()); - Assertions.assertEquals(false, model.statusActiveEvents().get(0).published()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-25T09:51:01Z"), - model.statusActiveEvents().get(0).lastModifiedTime()); - Assertions.assertEquals("dhszfjv", model.statusActiveEvents().get(0).impacts().get(0).id()); - Assertions.assertEquals("gofel", model.statusActiveEvents().get(0).impacts().get(0).name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EmergingIssue model = new EmergingIssue().withRefreshTimestamp(OffsetDateTime.parse("2021-06-18T14:41:07Z")) - .withStatusBanners(Arrays.asList( - new StatusBanner().withTitle("u") - .withMessage("bdsrez") - .withCloud("rhneuyowq") - .withLastModifiedTime(OffsetDateTime.parse("2021-05-06T04:21:37Z")), - new StatusBanner().withTitle("t") - .withMessage("ib") - .withCloud("cgpik") - .withLastModifiedTime(OffsetDateTime.parse("2021-11-09T05:31:13Z")), - new StatusBanner().withTitle("ejzanlfz") - .withMessage("av") - .withCloud("bzonok") - .withLastModifiedTime(OffsetDateTime.parse("2021-01-16T04:25:55Z")))) - .withStatusActiveEvents(Arrays.asList(new StatusActiveEvent().withTitle("irgzp") - .withDescription("lazszrn") - .withTrackingId("iin") - .withStartTime(OffsetDateTime.parse("2021-01-06T22:30:17Z")) - .withCloud("pj") - .withSeverity(SeverityValues.ERROR) - .withStage(StageValues.ARCHIVED) - .withPublished(false) - .withLastModifiedTime(OffsetDateTime.parse("2021-07-25T09:51:01Z")) - .withImpacts(Arrays.asList(new EmergingIssueImpact().withId("dhszfjv") - .withName("gofel") - .withRegions(Arrays.asList(new ImpactedRegion(), new ImpactedRegion(), new ImpactedRegion())))))); - model = BinaryData.fromObject(model).toObject(EmergingIssue.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-18T14:41:07Z"), model.refreshTimestamp()); - Assertions.assertEquals("u", model.statusBanners().get(0).title()); - Assertions.assertEquals("bdsrez", model.statusBanners().get(0).message()); - Assertions.assertEquals("rhneuyowq", model.statusBanners().get(0).cloud()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-06T04:21:37Z"), - model.statusBanners().get(0).lastModifiedTime()); - Assertions.assertEquals("irgzp", model.statusActiveEvents().get(0).title()); - Assertions.assertEquals("lazszrn", model.statusActiveEvents().get(0).description()); - Assertions.assertEquals("iin", model.statusActiveEvents().get(0).trackingId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-06T22:30:17Z"), - model.statusActiveEvents().get(0).startTime()); - Assertions.assertEquals("pj", model.statusActiveEvents().get(0).cloud()); - Assertions.assertEquals(SeverityValues.ERROR, model.statusActiveEvents().get(0).severity()); - Assertions.assertEquals(StageValues.ARCHIVED, model.statusActiveEvents().get(0).stage()); - Assertions.assertEquals(false, model.statusActiveEvents().get(0).published()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-25T09:51:01Z"), - model.statusActiveEvents().get(0).lastModifiedTime()); - Assertions.assertEquals("dhszfjv", model.statusActiveEvents().get(0).impacts().get(0).id()); - Assertions.assertEquals("gofel", model.statusActiveEvents().get(0).impacts().get(0).name()); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/EmergingIssuesGetResultInnerTests.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/EmergingIssuesGetResultInnerTests.java deleted file mode 100644 index 9669a791430b..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/EmergingIssuesGetResultInnerTests.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.resourcehealth.fluent.models.EmergingIssuesGetResultInner; -import com.azure.resourcemanager.resourcehealth.models.EmergingIssueImpact; -import com.azure.resourcemanager.resourcehealth.models.ImpactedRegion; -import com.azure.resourcemanager.resourcehealth.models.SeverityValues; -import com.azure.resourcemanager.resourcehealth.models.StageValues; -import com.azure.resourcemanager.resourcehealth.models.StatusActiveEvent; -import com.azure.resourcemanager.resourcehealth.models.StatusBanner; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class EmergingIssuesGetResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EmergingIssuesGetResultInner model = BinaryData.fromString( - "{\"properties\":{\"refreshTimestamp\":\"2021-07-21T16:23:57Z\",\"statusBanners\":[{\"title\":\"xmkttl\",\"message\":\"vlz\",\"cloud\":\"emhzrncsdtc\",\"lastModifiedTime\":\"2021-03-10T02:09:12Z\"},{\"title\":\"ypbsfgytguslfead\",\"message\":\"gq\",\"cloud\":\"yhejhzisxgfp\",\"lastModifiedTime\":\"2021-10-29T03:21:25Z\"},{\"title\":\"p\",\"message\":\"ksrpqv\",\"cloud\":\"zraehtwd\",\"lastModifiedTime\":\"2021-10-09T15:06:55Z\"}],\"statusActiveEvents\":[{\"title\":\"iby\",\"description\":\"dl\",\"trackingId\":\"shfwpracstwity\",\"startTime\":\"2021-10-09T17:15:47Z\",\"cloud\":\"xccedcpnmdyodn\",\"severity\":\"Warning\",\"stage\":\"Resolve\",\"published\":true,\"lastModifiedTime\":\"2021-10-06T13:51:27Z\",\"impacts\":[{\"id\":\"iugcxnavvwxq\",\"name\":\"y\",\"regions\":[{},{},{},{}]},{\"id\":\"owx\",\"name\":\"mdjrkvfgbvfvp\",\"regions\":[{},{}]},{\"id\":\"acizsjqlhkrr\",\"name\":\"deibqip\",\"regions\":[{},{},{},{}]}]},{\"title\":\"vxndz\",\"description\":\"krefajpjo\",\"trackingId\":\"kqnyh\",\"startTime\":\"2021-03-14T06:12:53Z\",\"cloud\":\"tjivfxzsjabib\",\"severity\":\"Information\",\"stage\":\"Active\",\"published\":true,\"lastModifiedTime\":\"2021-09-03T03:34:02Z\",\"impacts\":[{\"id\":\"kvpbjxbkzbz\",\"name\":\"vncjabudurgk\",\"regions\":[{},{},{}]},{\"id\":\"kzhjj\",\"name\":\"ffhmouwqlgzr\",\"regions\":[{},{}]},{\"id\":\"yebizikayuh\",\"name\":\"bjbsybb\",\"regions\":[{}]}]}]},\"id\":\"t\",\"name\":\"dgmfpgvmpipasl\",\"type\":\"haq\"}") - .toObject(EmergingIssuesGetResultInner.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-21T16:23:57Z"), model.refreshTimestamp()); - Assertions.assertEquals("xmkttl", model.statusBanners().get(0).title()); - Assertions.assertEquals("vlz", model.statusBanners().get(0).message()); - Assertions.assertEquals("emhzrncsdtc", model.statusBanners().get(0).cloud()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-10T02:09:12Z"), - model.statusBanners().get(0).lastModifiedTime()); - Assertions.assertEquals("iby", model.statusActiveEvents().get(0).title()); - Assertions.assertEquals("dl", model.statusActiveEvents().get(0).description()); - Assertions.assertEquals("shfwpracstwity", model.statusActiveEvents().get(0).trackingId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-09T17:15:47Z"), - model.statusActiveEvents().get(0).startTime()); - Assertions.assertEquals("xccedcpnmdyodn", model.statusActiveEvents().get(0).cloud()); - Assertions.assertEquals(SeverityValues.WARNING, model.statusActiveEvents().get(0).severity()); - Assertions.assertEquals(StageValues.RESOLVE, model.statusActiveEvents().get(0).stage()); - Assertions.assertEquals(true, model.statusActiveEvents().get(0).published()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-06T13:51:27Z"), - model.statusActiveEvents().get(0).lastModifiedTime()); - Assertions.assertEquals("iugcxnavvwxq", model.statusActiveEvents().get(0).impacts().get(0).id()); - Assertions.assertEquals("y", model.statusActiveEvents().get(0).impacts().get(0).name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EmergingIssuesGetResultInner model - = new EmergingIssuesGetResultInner().withRefreshTimestamp(OffsetDateTime.parse("2021-07-21T16:23:57Z")) - .withStatusBanners(Arrays.asList( - new StatusBanner().withTitle("xmkttl") - .withMessage("vlz") - .withCloud("emhzrncsdtc") - .withLastModifiedTime(OffsetDateTime.parse("2021-03-10T02:09:12Z")), - new StatusBanner().withTitle("ypbsfgytguslfead") - .withMessage("gq") - .withCloud("yhejhzisxgfp") - .withLastModifiedTime(OffsetDateTime.parse("2021-10-29T03:21:25Z")), - new StatusBanner().withTitle("p") - .withMessage("ksrpqv") - .withCloud("zraehtwd") - .withLastModifiedTime(OffsetDateTime.parse("2021-10-09T15:06:55Z")))) - .withStatusActiveEvents( - Arrays - .asList( - new StatusActiveEvent().withTitle("iby") - .withDescription("dl") - .withTrackingId("shfwpracstwity") - .withStartTime(OffsetDateTime.parse("2021-10-09T17:15:47Z")) - .withCloud("xccedcpnmdyodn") - .withSeverity(SeverityValues.WARNING) - .withStage(StageValues.RESOLVE) - .withPublished(true) - .withLastModifiedTime(OffsetDateTime.parse("2021-10-06T13:51:27Z")) - .withImpacts(Arrays.asList( - new EmergingIssueImpact().withId("iugcxnavvwxq") - .withName("y") - .withRegions(Arrays.asList(new ImpactedRegion(), new ImpactedRegion(), - new ImpactedRegion(), new ImpactedRegion())), - new EmergingIssueImpact().withId("owx") - .withName("mdjrkvfgbvfvp") - .withRegions(Arrays.asList(new ImpactedRegion(), new ImpactedRegion())), - new EmergingIssueImpact().withId("acizsjqlhkrr") - .withName("deibqip") - .withRegions(Arrays.asList(new ImpactedRegion(), new ImpactedRegion(), - new ImpactedRegion(), new ImpactedRegion())))), - new StatusActiveEvent().withTitle("vxndz") - .withDescription("krefajpjo") - .withTrackingId("kqnyh") - .withStartTime(OffsetDateTime.parse("2021-03-14T06:12:53Z")) - .withCloud("tjivfxzsjabib") - .withSeverity(SeverityValues.INFORMATION) - .withStage(StageValues.ACTIVE) - .withPublished(true) - .withLastModifiedTime(OffsetDateTime.parse("2021-09-03T03:34:02Z")) - .withImpacts(Arrays.asList( - new EmergingIssueImpact().withId("kvpbjxbkzbz") - .withName("vncjabudurgk") - .withRegions(Arrays.asList(new ImpactedRegion(), new ImpactedRegion(), - new ImpactedRegion())), - new EmergingIssueImpact().withId("kzhjj") - .withName("ffhmouwqlgzr") - .withRegions(Arrays.asList(new ImpactedRegion(), new ImpactedRegion())), - new EmergingIssueImpact().withId("yebizikayuh") - .withName("bjbsybb") - .withRegions(Arrays.asList(new ImpactedRegion())))))); - model = BinaryData.fromObject(model).toObject(EmergingIssuesGetResultInner.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-21T16:23:57Z"), model.refreshTimestamp()); - Assertions.assertEquals("xmkttl", model.statusBanners().get(0).title()); - Assertions.assertEquals("vlz", model.statusBanners().get(0).message()); - Assertions.assertEquals("emhzrncsdtc", model.statusBanners().get(0).cloud()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-10T02:09:12Z"), - model.statusBanners().get(0).lastModifiedTime()); - Assertions.assertEquals("iby", model.statusActiveEvents().get(0).title()); - Assertions.assertEquals("dl", model.statusActiveEvents().get(0).description()); - Assertions.assertEquals("shfwpracstwity", model.statusActiveEvents().get(0).trackingId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-09T17:15:47Z"), - model.statusActiveEvents().get(0).startTime()); - Assertions.assertEquals("xccedcpnmdyodn", model.statusActiveEvents().get(0).cloud()); - Assertions.assertEquals(SeverityValues.WARNING, model.statusActiveEvents().get(0).severity()); - Assertions.assertEquals(StageValues.RESOLVE, model.statusActiveEvents().get(0).stage()); - Assertions.assertEquals(true, model.statusActiveEvents().get(0).published()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-06T13:51:27Z"), - model.statusActiveEvents().get(0).lastModifiedTime()); - Assertions.assertEquals("iugcxnavvwxq", model.statusActiveEvents().get(0).impacts().get(0).id()); - Assertions.assertEquals("y", model.statusActiveEvents().get(0).impacts().get(0).name()); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/EmergingIssuesGetWithResponseMockTests.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/EmergingIssuesGetWithResponseMockTests.java deleted file mode 100644 index 7c9c55a7357b..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/EmergingIssuesGetWithResponseMockTests.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.resourcehealth.ResourceHealthManager; -import com.azure.resourcemanager.resourcehealth.models.EmergingIssuesGetResult; -import com.azure.resourcemanager.resourcehealth.models.IssueNameParameter; -import com.azure.resourcemanager.resourcehealth.models.SeverityValues; -import com.azure.resourcemanager.resourcehealth.models.StageValues; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class EmergingIssuesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"refreshTimestamp\":\"2021-03-02T08:23:47Z\",\"statusBanners\":[{\"title\":\"tu\",\"message\":\"igebxncnwfepb\",\"cloud\":\"gfmx\",\"lastModifiedTime\":\"2021-04-20T03:41:42Z\"},{\"title\":\"bjb\",\"message\":\"lfgtdysnaquflqbc\",\"cloud\":\"hamzjrwdkqze\",\"lastModifiedTime\":\"2021-01-23T02:59:42Z\"},{\"title\":\"eziunjxdfzant\",\"message\":\"cegyamlbnseqacj\",\"cloud\":\"pilguooqjag\",\"lastModifiedTime\":\"2021-03-27T08:14:43Z\"},{\"title\":\"gueiookjbsahrtdt\",\"message\":\"elqacslmot\",\"cloud\":\"bnfxofvc\",\"lastModifiedTime\":\"2021-06-12T15:09:08Z\"}],\"statusActiveEvents\":[{\"title\":\"azftxejwabmdujtm\",\"description\":\"op\",\"trackingId\":\"c\",\"startTime\":\"2021-02-26T19:05:59Z\",\"cloud\":\"buhhlkyqlt\",\"severity\":\"Information\",\"stage\":\"Resolve\",\"published\":true,\"lastModifiedTime\":\"2020-12-26T17:33:42Z\",\"impacts\":[{},{},{},{}]},{\"title\":\"jk\",\"description\":\"ysidfvclgl\",\"trackingId\":\"fuijtkbus\",\"startTime\":\"2021-02-11T13:08:58Z\",\"cloud\":\"fikayiansharujtj\",\"severity\":\"Information\",\"stage\":\"Active\",\"published\":false,\"lastModifiedTime\":\"2021-08-06T22:44:52Z\",\"impacts\":[{},{}]},{\"title\":\"kpqhjpenuygbq\",\"description\":\"qekewvnqvcd\",\"trackingId\":\"uaucmf\",\"startTime\":\"2021-12-08T13:34:35Z\",\"cloud\":\"laxpunj\",\"severity\":\"Information\",\"stage\":\"Archived\",\"published\":false,\"lastModifiedTime\":\"2021-03-20T12:18Z\",\"impacts\":[{}]},{\"title\":\"xmfcsserxhtv\",\"description\":\"xhlw\",\"trackingId\":\"sjgqrsxyp\",\"startTime\":\"2021-02-02T03:22:38Z\",\"cloud\":\"y\",\"severity\":\"Error\",\"stage\":\"Active\",\"published\":true,\"lastModifiedTime\":\"2021-06-21T14:23:10Z\",\"impacts\":[{}]}]},\"id\":\"elyetndnbf\",\"name\":\"yggagflnlgmt\",\"type\":\"wahzjmucftbyr\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ResourceHealthManager manager = ResourceHealthManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - EmergingIssuesGetResult response = manager.emergingIssues() - .getWithResponse(IssueNameParameter.DEFAULT, com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(OffsetDateTime.parse("2021-03-02T08:23:47Z"), response.refreshTimestamp()); - Assertions.assertEquals("tu", response.statusBanners().get(0).title()); - Assertions.assertEquals("igebxncnwfepb", response.statusBanners().get(0).message()); - Assertions.assertEquals("gfmx", response.statusBanners().get(0).cloud()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-20T03:41:42Z"), - response.statusBanners().get(0).lastModifiedTime()); - Assertions.assertEquals("azftxejwabmdujtm", response.statusActiveEvents().get(0).title()); - Assertions.assertEquals("op", response.statusActiveEvents().get(0).description()); - Assertions.assertEquals("c", response.statusActiveEvents().get(0).trackingId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-26T19:05:59Z"), - response.statusActiveEvents().get(0).startTime()); - Assertions.assertEquals("buhhlkyqlt", response.statusActiveEvents().get(0).cloud()); - Assertions.assertEquals(SeverityValues.INFORMATION, response.statusActiveEvents().get(0).severity()); - Assertions.assertEquals(StageValues.RESOLVE, response.statusActiveEvents().get(0).stage()); - Assertions.assertEquals(true, response.statusActiveEvents().get(0).published()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-26T17:33:42Z"), - response.statusActiveEvents().get(0).lastModifiedTime()); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/EmergingIssuesListMockTests.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/EmergingIssuesListMockTests.java deleted file mode 100644 index 49d67d01b2cb..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/EmergingIssuesListMockTests.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.resourcehealth.ResourceHealthManager; -import com.azure.resourcemanager.resourcehealth.models.EmergingIssuesGetResult; -import com.azure.resourcemanager.resourcehealth.models.SeverityValues; -import com.azure.resourcemanager.resourcehealth.models.StageValues; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class EmergingIssuesListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"refreshTimestamp\":\"2021-03-03T01:39:50Z\",\"statusBanners\":[{\"title\":\"tobkauxofshfph\",\"message\":\"nulaiywzejywhsl\",\"cloud\":\"ojpllndnpdwrpqaf\",\"lastModifiedTime\":\"2021-05-07T14:23:25Z\"},{\"title\":\"snnfhyetefyp\",\"message\":\"octfjgtixrjvzuyt\",\"cloud\":\"mlmuowol\",\"lastModifiedTime\":\"2021-10-18T09:49:12Z\"}],\"statusActiveEvents\":[{\"title\":\"p\",\"description\":\"nszonwpngaj\",\"trackingId\":\"nixjawrtmjfjmy\",\"startTime\":\"2021-04-05T08:29:20Z\",\"cloud\":\"zhcoxovnekhe\",\"severity\":\"Error\",\"stage\":\"Resolve\",\"published\":false,\"lastModifiedTime\":\"2021-06-11T07:28:09Z\",\"impacts\":[{},{},{},{}]},{\"title\":\"xrdcqtj\",\"description\":\"dt\",\"trackingId\":\"epu\",\"startTime\":\"2021-12-03T10:50:59Z\",\"cloud\":\"jtcvuwkasizies\",\"severity\":\"Warning\",\"stage\":\"Active\",\"published\":false,\"lastModifiedTime\":\"2021-02-18T13:25:08Z\",\"impacts\":[{},{}]}]},\"id\":\"xeygtuhxuic\",\"name\":\"uewmrswnjlxuzrhw\",\"type\":\"usxjbaqehg\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ResourceHealthManager manager = ResourceHealthManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.emergingIssues().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals(OffsetDateTime.parse("2021-03-03T01:39:50Z"), - response.iterator().next().refreshTimestamp()); - Assertions.assertEquals("tobkauxofshfph", response.iterator().next().statusBanners().get(0).title()); - Assertions.assertEquals("nulaiywzejywhsl", response.iterator().next().statusBanners().get(0).message()); - Assertions.assertEquals("ojpllndnpdwrpqaf", response.iterator().next().statusBanners().get(0).cloud()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-07T14:23:25Z"), - response.iterator().next().statusBanners().get(0).lastModifiedTime()); - Assertions.assertEquals("p", response.iterator().next().statusActiveEvents().get(0).title()); - Assertions.assertEquals("nszonwpngaj", response.iterator().next().statusActiveEvents().get(0).description()); - Assertions.assertEquals("nixjawrtmjfjmy", response.iterator().next().statusActiveEvents().get(0).trackingId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-05T08:29:20Z"), - response.iterator().next().statusActiveEvents().get(0).startTime()); - Assertions.assertEquals("zhcoxovnekhe", response.iterator().next().statusActiveEvents().get(0).cloud()); - Assertions.assertEquals(SeverityValues.ERROR, - response.iterator().next().statusActiveEvents().get(0).severity()); - Assertions.assertEquals(StageValues.RESOLVE, response.iterator().next().statusActiveEvents().get(0).stage()); - Assertions.assertEquals(false, response.iterator().next().statusActiveEvents().get(0).published()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-11T07:28:09Z"), - response.iterator().next().statusActiveEvents().get(0).lastModifiedTime()); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/EventPropertiesAdditionalInformationTests.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/EventPropertiesAdditionalInformationTests.java deleted file mode 100644 index 47c4a40998c3..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/EventPropertiesAdditionalInformationTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.resourcehealth.models.EventPropertiesAdditionalInformation; -import org.junit.jupiter.api.Assertions; - -public final class EventPropertiesAdditionalInformationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EventPropertiesAdditionalInformation model - = BinaryData.fromString("{\"message\":\"abfatkl\"}").toObject(EventPropertiesAdditionalInformation.class); - Assertions.assertEquals("abfatkl", model.message()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EventPropertiesAdditionalInformation model = new EventPropertiesAdditionalInformation().withMessage("abfatkl"); - model = BinaryData.fromObject(model).toObject(EventPropertiesAdditionalInformation.class); - Assertions.assertEquals("abfatkl", model.message()); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/EventPropertiesArticleTests.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/EventPropertiesArticleTests.java deleted file mode 100644 index 371a4000f874..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/EventPropertiesArticleTests.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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.resourcehealth.models.EventPropertiesArticle; -import org.junit.jupiter.api.Assertions; - -public final class EventPropertiesArticleTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EventPropertiesArticle model = BinaryData - .fromString( - "{\"articleContent\":\"gvraeaen\",\"articleId\":\"nzar\",\"parameters\":\"datalquuijfqkacewii\"}") - .toObject(EventPropertiesArticle.class); - Assertions.assertEquals("gvraeaen", model.articleContent()); - Assertions.assertEquals("nzar", model.articleId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EventPropertiesArticle model = new EventPropertiesArticle().withArticleContent("gvraeaen") - .withArticleId("nzar") - .withParameters("datalquuijfqkacewii"); - model = BinaryData.fromObject(model).toObject(EventPropertiesArticle.class); - Assertions.assertEquals("gvraeaen", model.articleContent()); - Assertions.assertEquals("nzar", model.articleId()); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/EventPropertiesRecommendedActionsItemTests.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/EventPropertiesRecommendedActionsItemTests.java deleted file mode 100644 index 9de285a5d3d8..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/EventPropertiesRecommendedActionsItemTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.resourcehealth.models.EventPropertiesRecommendedActionsItem; -import org.junit.jupiter.api.Assertions; - -public final class EventPropertiesRecommendedActionsItemTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EventPropertiesRecommendedActionsItem model - = BinaryData.fromString("{\"groupId\":597105024,\"actionText\":\"qreyfkzi\"}") - .toObject(EventPropertiesRecommendedActionsItem.class); - Assertions.assertEquals(597105024, model.groupId()); - Assertions.assertEquals("qreyfkzi", model.actionText()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EventPropertiesRecommendedActionsItem model - = new EventPropertiesRecommendedActionsItem().withGroupId(597105024).withActionText("qreyfkzi"); - model = BinaryData.fromObject(model).toObject(EventPropertiesRecommendedActionsItem.class); - Assertions.assertEquals(597105024, model.groupId()); - Assertions.assertEquals("qreyfkzi", model.actionText()); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/ImpactTests.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/ImpactTests.java deleted file mode 100644 index e44fe54b96fc..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/ImpactTests.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.resourcehealth.models.EventStatusValues; -import com.azure.resourcemanager.resourcehealth.models.Impact; -import com.azure.resourcemanager.resourcehealth.models.ImpactedServiceRegion; -import com.azure.resourcemanager.resourcehealth.models.Update; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ImpactTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Impact model = BinaryData.fromString( - "{\"impactedService\":\"mslyzrpzbchckqqz\",\"impactedRegions\":[{\"impactedRegion\":\"iysui\",\"status\":\"Resolved\",\"impactedSubscriptions\":[\"edyatrwyhqmibzyh\"],\"impactedTenants\":[\"smypyynpc\",\"pumnz\",\"mwzn\"],\"lastUpdateTime\":\"2021-06-04T15:48:38Z\",\"updates\":[{\"summary\":\"sorgj\",\"updateDateTime\":\"2021-10-23T19:23:01Z\"}]}]}") - .toObject(Impact.class); - Assertions.assertEquals("mslyzrpzbchckqqz", model.impactedService()); - Assertions.assertEquals("iysui", model.impactedRegions().get(0).impactedRegion()); - Assertions.assertEquals(EventStatusValues.RESOLVED, model.impactedRegions().get(0).status()); - Assertions.assertEquals("edyatrwyhqmibzyh", model.impactedRegions().get(0).impactedSubscriptions().get(0)); - Assertions.assertEquals("smypyynpc", model.impactedRegions().get(0).impactedTenants().get(0)); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-04T15:48:38Z"), - model.impactedRegions().get(0).lastUpdateTime()); - Assertions.assertEquals("sorgj", model.impactedRegions().get(0).updates().get(0).summary()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-23T19:23:01Z"), - model.impactedRegions().get(0).updates().get(0).updateDateTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Impact model = new Impact().withImpactedService("mslyzrpzbchckqqz") - .withImpactedRegions(Arrays.asList(new ImpactedServiceRegion().withImpactedRegion("iysui") - .withStatus(EventStatusValues.RESOLVED) - .withImpactedSubscriptions(Arrays.asList("edyatrwyhqmibzyh")) - .withImpactedTenants(Arrays.asList("smypyynpc", "pumnz", "mwzn")) - .withLastUpdateTime(OffsetDateTime.parse("2021-06-04T15:48:38Z")) - .withUpdates(Arrays.asList(new Update().withSummary("sorgj") - .withUpdateDateTime(OffsetDateTime.parse("2021-10-23T19:23:01Z")))))); - model = BinaryData.fromObject(model).toObject(Impact.class); - Assertions.assertEquals("mslyzrpzbchckqqz", model.impactedService()); - Assertions.assertEquals("iysui", model.impactedRegions().get(0).impactedRegion()); - Assertions.assertEquals(EventStatusValues.RESOLVED, model.impactedRegions().get(0).status()); - Assertions.assertEquals("edyatrwyhqmibzyh", model.impactedRegions().get(0).impactedSubscriptions().get(0)); - Assertions.assertEquals("smypyynpc", model.impactedRegions().get(0).impactedTenants().get(0)); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-04T15:48:38Z"), - model.impactedRegions().get(0).lastUpdateTime()); - Assertions.assertEquals("sorgj", model.impactedRegions().get(0).updates().get(0).summary()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-23T19:23:01Z"), - model.impactedRegions().get(0).updates().get(0).updateDateTime()); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/ImpactedRegionTests.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/ImpactedRegionTests.java deleted file mode 100644 index 9e18cd64accd..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/ImpactedRegionTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.resourcehealth.models.ImpactedRegion; -import org.junit.jupiter.api.Assertions; - -public final class ImpactedRegionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImpactedRegion model - = BinaryData.fromString("{\"id\":\"rvqahqkghtpwi\",\"name\":\"hyjsvfycx\"}").toObject(ImpactedRegion.class); - Assertions.assertEquals("rvqahqkghtpwi", model.id()); - Assertions.assertEquals("hyjsvfycx", model.name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImpactedRegion model = new ImpactedRegion().withId("rvqahqkghtpwi").withName("hyjsvfycx"); - model = BinaryData.fromObject(model).toObject(ImpactedRegion.class); - Assertions.assertEquals("rvqahqkghtpwi", model.id()); - Assertions.assertEquals("hyjsvfycx", model.name()); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/ImpactedServiceRegionTests.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/ImpactedServiceRegionTests.java deleted file mode 100644 index 1d3d2eec2f7d..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/ImpactedServiceRegionTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.resourcehealth.models.EventStatusValues; -import com.azure.resourcemanager.resourcehealth.models.ImpactedServiceRegion; -import com.azure.resourcemanager.resourcehealth.models.Update; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ImpactedServiceRegionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImpactedServiceRegion model = BinaryData.fromString( - "{\"impactedRegion\":\"dtlwwrlkd\",\"status\":\"Resolved\",\"impactedSubscriptions\":[\"ok\",\"tllxdyhgsyocogj\",\"tdtbnnhadooc\"],\"impactedTenants\":[\"cikhnv\",\"amqgxqquezikyw\",\"gxk\",\"lla\"],\"lastUpdateTime\":\"2021-05-13T13:09:28Z\",\"updates\":[{\"summary\":\"ipicc\",\"updateDateTime\":\"2021-07-16T14:13:55Z\"},{\"summary\":\"ivgvvcna\",\"updateDateTime\":\"2021-09-08T02:15:33Z\"},{\"summary\":\"rnxxmueed\",\"updateDateTime\":\"2021-02-18T21:20:21Z\"},{\"summary\":\"v\",\"updateDateTime\":\"2021-12-09T17:48:53Z\"}]}") - .toObject(ImpactedServiceRegion.class); - Assertions.assertEquals("dtlwwrlkd", model.impactedRegion()); - Assertions.assertEquals(EventStatusValues.RESOLVED, model.status()); - Assertions.assertEquals("ok", model.impactedSubscriptions().get(0)); - Assertions.assertEquals("cikhnv", model.impactedTenants().get(0)); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-13T13:09:28Z"), model.lastUpdateTime()); - Assertions.assertEquals("ipicc", model.updates().get(0).summary()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-16T14:13:55Z"), model.updates().get(0).updateDateTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImpactedServiceRegion model = new ImpactedServiceRegion().withImpactedRegion("dtlwwrlkd") - .withStatus(EventStatusValues.RESOLVED) - .withImpactedSubscriptions(Arrays.asList("ok", "tllxdyhgsyocogj", "tdtbnnhadooc")) - .withImpactedTenants(Arrays.asList("cikhnv", "amqgxqquezikyw", "gxk", "lla")) - .withLastUpdateTime(OffsetDateTime.parse("2021-05-13T13:09:28Z")) - .withUpdates(Arrays.asList( - new Update().withSummary("ipicc").withUpdateDateTime(OffsetDateTime.parse("2021-07-16T14:13:55Z")), - new Update().withSummary("ivgvvcna").withUpdateDateTime(OffsetDateTime.parse("2021-09-08T02:15:33Z")), - new Update().withSummary("rnxxmueed").withUpdateDateTime(OffsetDateTime.parse("2021-02-18T21:20:21Z")), - new Update().withSummary("v").withUpdateDateTime(OffsetDateTime.parse("2021-12-09T17:48:53Z")))); - model = BinaryData.fromObject(model).toObject(ImpactedServiceRegion.class); - Assertions.assertEquals("dtlwwrlkd", model.impactedRegion()); - Assertions.assertEquals(EventStatusValues.RESOLVED, model.status()); - Assertions.assertEquals("ok", model.impactedSubscriptions().get(0)); - Assertions.assertEquals("cikhnv", model.impactedTenants().get(0)); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-13T13:09:28Z"), model.lastUpdateTime()); - Assertions.assertEquals("ipicc", model.updates().get(0).summary()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-16T14:13:55Z"), model.updates().get(0).updateDateTime()); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/LinkDisplayTextTests.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/LinkDisplayTextTests.java deleted file mode 100644 index bf66c32773dd..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/LinkDisplayTextTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.resourcehealth.models.LinkDisplayText; -import org.junit.jupiter.api.Assertions; - -public final class LinkDisplayTextTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LinkDisplayText model - = BinaryData.fromString("{\"value\":\"ihleos\",\"localizedValue\":\"w\"}").toObject(LinkDisplayText.class); - Assertions.assertEquals("ihleos", model.value()); - Assertions.assertEquals("w", model.localizedValue()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LinkDisplayText model = new LinkDisplayText().withValue("ihleos").withLocalizedValue("w"); - model = BinaryData.fromObject(model).toObject(LinkDisplayText.class); - Assertions.assertEquals("ihleos", model.value()); - Assertions.assertEquals("w", model.localizedValue()); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/LinkTests.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/LinkTests.java deleted file mode 100644 index d55889632c38..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/LinkTests.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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.resourcehealth.models.Link; -import com.azure.resourcemanager.resourcehealth.models.LinkDisplayText; -import com.azure.resourcemanager.resourcehealth.models.LinkTypeValues; -import org.junit.jupiter.api.Assertions; - -public final class LinkTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Link model = BinaryData.fromString( - "{\"type\":\"Button\",\"displayText\":{\"value\":\"ji\",\"localizedValue\":\"wifto\"},\"extensionName\":\"kvpuvksgplsaknyn\",\"bladeName\":\"ynl\",\"parameters\":\"datahuopxodlqiynto\"}") - .toObject(Link.class); - Assertions.assertEquals(LinkTypeValues.BUTTON, model.type()); - Assertions.assertEquals("ji", model.displayText().value()); - Assertions.assertEquals("wifto", model.displayText().localizedValue()); - Assertions.assertEquals("kvpuvksgplsaknyn", model.extensionName()); - Assertions.assertEquals("ynl", model.bladeName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Link model = new Link().withType(LinkTypeValues.BUTTON) - .withDisplayText(new LinkDisplayText().withValue("ji").withLocalizedValue("wifto")) - .withExtensionName("kvpuvksgplsaknyn") - .withBladeName("ynl") - .withParameters("datahuopxodlqiynto"); - model = BinaryData.fromObject(model).toObject(Link.class); - Assertions.assertEquals(LinkTypeValues.BUTTON, model.type()); - Assertions.assertEquals("ji", model.displayText().value()); - Assertions.assertEquals("wifto", model.displayText().localizedValue()); - Assertions.assertEquals("kvpuvksgplsaknyn", model.extensionName()); - Assertions.assertEquals("ynl", model.bladeName()); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/MetadataEntityInnerTests.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/MetadataEntityInnerTests.java deleted file mode 100644 index fec0a6028e0d..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/MetadataEntityInnerTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.resourcehealth.fluent.models.MetadataEntityInner; -import com.azure.resourcemanager.resourcehealth.models.MetadataSupportedValueDetail; -import com.azure.resourcemanager.resourcehealth.models.Scenario; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class MetadataEntityInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MetadataEntityInner model = BinaryData.fromString( - "{\"properties\":{\"displayName\":\"rbu\",\"dependsOn\":[\"vpnazzm\",\"jrunmpxtt\",\"bh\",\"bnlankxmyskpb\"],\"applicableScenarios\":[\"Alerts\",\"Alerts\",\"Alerts\",\"Alerts\"],\"supportedValues\":[{\"id\":\"ny\",\"displayName\":\"rsyn\",\"resourceTypes\":[\"dybyxczfclhaa\",\"dbabp\",\"lwrq\"]}]},\"id\":\"ktsthsucocmny\",\"name\":\"azt\",\"type\":\"bt\"}") - .toObject(MetadataEntityInner.class); - Assertions.assertEquals("rbu", model.displayName()); - Assertions.assertEquals("vpnazzm", model.dependsOn().get(0)); - Assertions.assertEquals(Scenario.ALERTS, model.applicableScenarios().get(0)); - Assertions.assertEquals("ny", model.supportedValues().get(0).id()); - Assertions.assertEquals("rsyn", model.supportedValues().get(0).displayName()); - Assertions.assertEquals("dybyxczfclhaa", model.supportedValues().get(0).resourceTypes().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MetadataEntityInner model = new MetadataEntityInner().withDisplayName("rbu") - .withDependsOn(Arrays.asList("vpnazzm", "jrunmpxtt", "bh", "bnlankxmyskpb")) - .withApplicableScenarios(Arrays.asList(Scenario.ALERTS, Scenario.ALERTS, Scenario.ALERTS, Scenario.ALERTS)) - .withSupportedValues(Arrays.asList(new MetadataSupportedValueDetail().withId("ny") - .withDisplayName("rsyn") - .withResourceTypes(Arrays.asList("dybyxczfclhaa", "dbabp", "lwrq")))); - model = BinaryData.fromObject(model).toObject(MetadataEntityInner.class); - Assertions.assertEquals("rbu", model.displayName()); - Assertions.assertEquals("vpnazzm", model.dependsOn().get(0)); - Assertions.assertEquals(Scenario.ALERTS, model.applicableScenarios().get(0)); - Assertions.assertEquals("ny", model.supportedValues().get(0).id()); - Assertions.assertEquals("rsyn", model.supportedValues().get(0).displayName()); - Assertions.assertEquals("dybyxczfclhaa", model.supportedValues().get(0).resourceTypes().get(0)); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/MetadataEntityListResultTests.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/MetadataEntityListResultTests.java deleted file mode 100644 index 51d146733799..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/MetadataEntityListResultTests.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.resourcehealth.fluent.models.MetadataEntityInner; -import com.azure.resourcemanager.resourcehealth.models.MetadataEntityListResult; -import com.azure.resourcemanager.resourcehealth.models.MetadataSupportedValueDetail; -import com.azure.resourcemanager.resourcehealth.models.Scenario; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class MetadataEntityListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MetadataEntityListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"displayName\":\"nqecanoaeup\",\"dependsOn\":[\"hltrpmopjmcmatuo\",\"thfuiuaodsfcpkvx\",\"dpuozmyz\",\"dagfuaxbezyiuok\"],\"applicableScenarios\":[\"Alerts\",\"Alerts\",\"Alerts\",\"Alerts\"],\"supportedValues\":[{\"id\":\"wqsmbsur\",\"displayName\":\"imoryocfsfksym\",\"resourceTypes\":[\"stkiiuxhqyud\"]},{\"id\":\"rrqnbpoczvyifqrv\",\"displayName\":\"vjsllrmvvdfw\",\"resourceTypes\":[\"pnpulexxbczwtru\",\"iqzbq\",\"vsovmyokac\",\"pkwlhz\"]},{\"id\":\"bpxjmfl\",\"displayName\":\"vnchrkcci\",\"resourceTypes\":[\"juqk\",\"rsa\",\"iwkuofos\"]}]},\"id\":\"hsauuimjmvxied\",\"name\":\"ugidyjrr\",\"type\":\"byao\"},{\"properties\":{\"displayName\":\"xc\",\"dependsOn\":[\"pclhocohslk\"],\"applicableScenarios\":[\"Alerts\",\"Alerts\"],\"supportedValues\":[{\"id\":\"buhfmvfaxkffeiit\",\"displayName\":\"vmezy\",\"resourceTypes\":[\"xmzsbbzogg\",\"grxwbu\",\"vjxxjnsp\",\"dptkoenkouk\"]},{\"id\":\"udwtiukbl\",\"displayName\":\"gkpocipazyxoe\",\"resourceTypes\":[\"g\"]}]},\"id\":\"piu\",\"name\":\"gygev\",\"type\":\"zntypmrb\"},{\"properties\":{\"displayName\":\"c\",\"dependsOn\":[\"j\",\"dpydn\",\"yhxdeoejzicwi\",\"sjttgzfbish\"],\"applicableScenarios\":[\"Alerts\"],\"supportedValues\":[{\"id\":\"eyeam\",\"displayName\":\"hagalpbuxwgipwh\",\"resourceTypes\":[\"wkgshwa\"]},{\"id\":\"ixzbinjeputtmryw\",\"displayName\":\"zoqftiyqzrnkcqvy\",\"resourceTypes\":[\"hzls\",\"cohoq\",\"nwvlryavwhheunmm\"]},{\"id\":\"gyxzk\",\"displayName\":\"ocukoklyax\",\"resourceTypes\":[\"nuqszfkbey\"]}]},\"id\":\"wrmjmwvvjektc\",\"name\":\"senhwlrs\",\"type\":\"frzpwvlqdqgb\"},{\"properties\":{\"displayName\":\"lihkaetcktvfc\",\"dependsOn\":[\"snkymuctq\",\"jf\",\"ebrjcxe\"],\"applicableScenarios\":[\"Alerts\",\"Alerts\",\"Alerts\",\"Alerts\"],\"supportedValues\":[{\"id\":\"vjrbirphxepcyvah\",\"displayName\":\"ljkyqxjvuuj\",\"resourceTypes\":[\"dokgjl\",\"yoxgvcltbgsnc\"]},{\"id\":\"kjeszz\",\"displayName\":\"ijhtxf\",\"resourceTypes\":[\"bfs\"]},{\"id\":\"nehmpvecx\",\"displayName\":\"debfqkkrbmpukgri\",\"resourceTypes\":[\"zlfbxzpuzycispnq\",\"ahmgkbrp\",\"y\"]}]},\"id\":\"ibnuqqkpik\",\"name\":\"drgvtqagn\",\"type\":\"uynhijg\"}],\"nextLink\":\"ebf\"}") - .toObject(MetadataEntityListResult.class); - Assertions.assertEquals("nqecanoaeup", model.value().get(0).displayName()); - Assertions.assertEquals("hltrpmopjmcmatuo", model.value().get(0).dependsOn().get(0)); - Assertions.assertEquals(Scenario.ALERTS, model.value().get(0).applicableScenarios().get(0)); - Assertions.assertEquals("wqsmbsur", model.value().get(0).supportedValues().get(0).id()); - Assertions.assertEquals("imoryocfsfksym", model.value().get(0).supportedValues().get(0).displayName()); - Assertions.assertEquals("stkiiuxhqyud", model.value().get(0).supportedValues().get(0).resourceTypes().get(0)); - Assertions.assertEquals("ebf", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MetadataEntityListResult model = new MetadataEntityListResult() - .withValue(Arrays.asList( - new MetadataEntityInner().withDisplayName("nqecanoaeup") - .withDependsOn(Arrays.asList("hltrpmopjmcmatuo", "thfuiuaodsfcpkvx", "dpuozmyz", "dagfuaxbezyiuok")) - .withApplicableScenarios( - Arrays.asList(Scenario.ALERTS, Scenario.ALERTS, Scenario.ALERTS, Scenario.ALERTS)) - .withSupportedValues(Arrays.asList( - new MetadataSupportedValueDetail().withId("wqsmbsur") - .withDisplayName("imoryocfsfksym") - .withResourceTypes(Arrays.asList("stkiiuxhqyud")), - new MetadataSupportedValueDetail().withId("rrqnbpoczvyifqrv") - .withDisplayName("vjsllrmvvdfw") - .withResourceTypes(Arrays.asList("pnpulexxbczwtru", "iqzbq", "vsovmyokac", "pkwlhz")), - new MetadataSupportedValueDetail().withId("bpxjmfl") - .withDisplayName("vnchrkcci") - .withResourceTypes(Arrays.asList("juqk", "rsa", "iwkuofos")))), - new MetadataEntityInner().withDisplayName("xc") - .withDependsOn(Arrays.asList("pclhocohslk")) - .withApplicableScenarios(Arrays.asList(Scenario.ALERTS, Scenario.ALERTS)) - .withSupportedValues(Arrays.asList( - new MetadataSupportedValueDetail().withId("buhfmvfaxkffeiit") - .withDisplayName("vmezy") - .withResourceTypes(Arrays.asList("xmzsbbzogg", "grxwbu", "vjxxjnsp", "dptkoenkouk")), - new MetadataSupportedValueDetail().withId("udwtiukbl") - .withDisplayName("gkpocipazyxoe") - .withResourceTypes(Arrays.asList("g")))), - new MetadataEntityInner().withDisplayName("c") - .withDependsOn(Arrays.asList("j", "dpydn", "yhxdeoejzicwi", "sjttgzfbish")) - .withApplicableScenarios(Arrays.asList(Scenario.ALERTS)) - .withSupportedValues(Arrays.asList( - new MetadataSupportedValueDetail().withId("eyeam") - .withDisplayName("hagalpbuxwgipwh") - .withResourceTypes(Arrays.asList("wkgshwa")), - new MetadataSupportedValueDetail().withId("ixzbinjeputtmryw") - .withDisplayName("zoqftiyqzrnkcqvy") - .withResourceTypes(Arrays.asList("hzls", "cohoq", "nwvlryavwhheunmm")), - new MetadataSupportedValueDetail().withId("gyxzk") - .withDisplayName("ocukoklyax") - .withResourceTypes(Arrays.asList("nuqszfkbey")))), - new MetadataEntityInner().withDisplayName("lihkaetcktvfc") - .withDependsOn(Arrays.asList("snkymuctq", "jf", "ebrjcxe")) - .withApplicableScenarios( - Arrays.asList(Scenario.ALERTS, Scenario.ALERTS, Scenario.ALERTS, Scenario.ALERTS)) - .withSupportedValues(Arrays.asList( - new MetadataSupportedValueDetail().withId("vjrbirphxepcyvah") - .withDisplayName("ljkyqxjvuuj") - .withResourceTypes(Arrays.asList("dokgjl", "yoxgvcltbgsnc")), - new MetadataSupportedValueDetail().withId("kjeszz") - .withDisplayName("ijhtxf") - .withResourceTypes(Arrays.asList("bfs")), - new MetadataSupportedValueDetail().withId("nehmpvecx") - .withDisplayName("debfqkkrbmpukgri") - .withResourceTypes(Arrays.asList("zlfbxzpuzycispnq", "ahmgkbrp", "y")))))) - .withNextLink("ebf"); - model = BinaryData.fromObject(model).toObject(MetadataEntityListResult.class); - Assertions.assertEquals("nqecanoaeup", model.value().get(0).displayName()); - Assertions.assertEquals("hltrpmopjmcmatuo", model.value().get(0).dependsOn().get(0)); - Assertions.assertEquals(Scenario.ALERTS, model.value().get(0).applicableScenarios().get(0)); - Assertions.assertEquals("wqsmbsur", model.value().get(0).supportedValues().get(0).id()); - Assertions.assertEquals("imoryocfsfksym", model.value().get(0).supportedValues().get(0).displayName()); - Assertions.assertEquals("stkiiuxhqyud", model.value().get(0).supportedValues().get(0).resourceTypes().get(0)); - Assertions.assertEquals("ebf", model.nextLink()); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/MetadataEntityPropertiesTests.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/MetadataEntityPropertiesTests.java deleted file mode 100644 index 50b306ac6d37..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/MetadataEntityPropertiesTests.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.resourcehealth.fluent.models.MetadataEntityProperties; -import com.azure.resourcemanager.resourcehealth.models.MetadataSupportedValueDetail; -import com.azure.resourcemanager.resourcehealth.models.Scenario; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class MetadataEntityPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MetadataEntityProperties model = BinaryData.fromString( - "{\"displayName\":\"rq\",\"dependsOn\":[\"dckzywbiexz\",\"eyueaxibxujwb\",\"qwalmuzyoxaepd\",\"zjancuxr\"],\"applicableScenarios\":[\"Alerts\",\"Alerts\",\"Alerts\"],\"supportedValues\":[{\"id\":\"iwdjswztsdbpgn\",\"displayName\":\"txhp\",\"resourceTypes\":[\"zpfzabglc\",\"hxw\"]},{\"id\":\"tyq\",\"displayName\":\"lbbovplw\",\"resourceTypes\":[\"vgyuguos\",\"mkfssxqukkfplgm\",\"sxnkjzkdeslpvlo\"]}]}") - .toObject(MetadataEntityProperties.class); - Assertions.assertEquals("rq", model.displayName()); - Assertions.assertEquals("dckzywbiexz", model.dependsOn().get(0)); - Assertions.assertEquals(Scenario.ALERTS, model.applicableScenarios().get(0)); - Assertions.assertEquals("iwdjswztsdbpgn", model.supportedValues().get(0).id()); - Assertions.assertEquals("txhp", model.supportedValues().get(0).displayName()); - Assertions.assertEquals("zpfzabglc", model.supportedValues().get(0).resourceTypes().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MetadataEntityProperties model = new MetadataEntityProperties().withDisplayName("rq") - .withDependsOn(Arrays.asList("dckzywbiexz", "eyueaxibxujwb", "qwalmuzyoxaepd", "zjancuxr")) - .withApplicableScenarios(Arrays.asList(Scenario.ALERTS, Scenario.ALERTS, Scenario.ALERTS)) - .withSupportedValues(Arrays.asList( - new MetadataSupportedValueDetail().withId("iwdjswztsdbpgn") - .withDisplayName("txhp") - .withResourceTypes(Arrays.asList("zpfzabglc", "hxw")), - new MetadataSupportedValueDetail().withId("tyq") - .withDisplayName("lbbovplw") - .withResourceTypes(Arrays.asList("vgyuguos", "mkfssxqukkfplgm", "sxnkjzkdeslpvlo")))); - model = BinaryData.fromObject(model).toObject(MetadataEntityProperties.class); - Assertions.assertEquals("rq", model.displayName()); - Assertions.assertEquals("dckzywbiexz", model.dependsOn().get(0)); - Assertions.assertEquals(Scenario.ALERTS, model.applicableScenarios().get(0)); - Assertions.assertEquals("iwdjswztsdbpgn", model.supportedValues().get(0).id()); - Assertions.assertEquals("txhp", model.supportedValues().get(0).displayName()); - Assertions.assertEquals("zpfzabglc", model.supportedValues().get(0).resourceTypes().get(0)); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/MetadataSupportedValueDetailTests.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/MetadataSupportedValueDetailTests.java deleted file mode 100644 index bf3014bffe67..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/MetadataSupportedValueDetailTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.resourcehealth.models.MetadataSupportedValueDetail; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class MetadataSupportedValueDetailTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MetadataSupportedValueDetail model = BinaryData.fromString( - "{\"id\":\"i\",\"displayName\":\"ghxpkdw\",\"resourceTypes\":[\"iuebbaumny\",\"upedeojnabckhs\",\"txp\",\"ie\"]}") - .toObject(MetadataSupportedValueDetail.class); - Assertions.assertEquals("i", model.id()); - Assertions.assertEquals("ghxpkdw", model.displayName()); - Assertions.assertEquals("iuebbaumny", model.resourceTypes().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MetadataSupportedValueDetail model = new MetadataSupportedValueDetail().withId("i") - .withDisplayName("ghxpkdw") - .withResourceTypes(Arrays.asList("iuebbaumny", "upedeojnabckhs", "txp", "ie")); - model = BinaryData.fromObject(model).toObject(MetadataSupportedValueDetail.class); - Assertions.assertEquals("i", model.id()); - Assertions.assertEquals("ghxpkdw", model.displayName()); - Assertions.assertEquals("iuebbaumny", model.resourceTypes().get(0)); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/MetadatasGetEntityWithResponseMockTests.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/MetadatasGetEntityWithResponseMockTests.java deleted file mode 100644 index daac58b792e8..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/MetadatasGetEntityWithResponseMockTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.resourcehealth.ResourceHealthManager; -import com.azure.resourcemanager.resourcehealth.models.MetadataEntity; -import com.azure.resourcemanager.resourcehealth.models.Scenario; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class MetadatasGetEntityWithResponseMockTests { - @Test - public void testGetEntityWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"displayName\":\"huzqgn\",\"dependsOn\":[\"kynscliqhzv\",\"xnkomtkubo\",\"ppnvdxz\"],\"applicableScenarios\":[\"Alerts\",\"Alerts\",\"Alerts\"],\"supportedValues\":[{\"id\":\"evqagtl\",\"displayName\":\"hlfkqojpy\",\"resourceTypes\":[\"trdcnifmzzs\"]}]},\"id\":\"m\",\"name\":\"rnysux\",\"type\":\"prafwgckhoc\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ResourceHealthManager manager = ResourceHealthManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - MetadataEntity response - = manager.metadatas().getEntityWithResponse("ekrsgs", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals("huzqgn", response.displayName()); - Assertions.assertEquals("kynscliqhzv", response.dependsOn().get(0)); - Assertions.assertEquals(Scenario.ALERTS, response.applicableScenarios().get(0)); - Assertions.assertEquals("evqagtl", response.supportedValues().get(0).id()); - Assertions.assertEquals("hlfkqojpy", response.supportedValues().get(0).displayName()); - Assertions.assertEquals("trdcnifmzzs", response.supportedValues().get(0).resourceTypes().get(0)); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/MetadatasListMockTests.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/MetadatasListMockTests.java deleted file mode 100644 index eaf4b59b3da9..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/MetadatasListMockTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.resourcehealth.ResourceHealthManager; -import com.azure.resourcemanager.resourcehealth.models.MetadataEntity; -import com.azure.resourcemanager.resourcehealth.models.Scenario; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class MetadatasListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"displayName\":\"ciayzriykhya\",\"dependsOn\":[\"jlb\",\"xqvkjlmxhomdyn\",\"dwdigumb\"],\"applicableScenarios\":[\"Alerts\",\"Alerts\",\"Alerts\",\"Alerts\"],\"supportedValues\":[{\"id\":\"a\",\"displayName\":\"sdzhezww\",\"resourceTypes\":[\"qyuvvfonkp\",\"hqyikvy\"]}]},\"id\":\"uyav\",\"name\":\"uwmncs\",\"type\":\"tijfybvp\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ResourceHealthManager manager = ResourceHealthManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.metadatas().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ciayzriykhya", response.iterator().next().displayName()); - Assertions.assertEquals("jlb", response.iterator().next().dependsOn().get(0)); - Assertions.assertEquals(Scenario.ALERTS, response.iterator().next().applicableScenarios().get(0)); - Assertions.assertEquals("a", response.iterator().next().supportedValues().get(0).id()); - Assertions.assertEquals("sdzhezww", response.iterator().next().supportedValues().get(0).displayName()); - Assertions.assertEquals("qyuvvfonkp", - response.iterator().next().supportedValues().get(0).resourceTypes().get(0)); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/OperationDisplayTests.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/OperationDisplayTests.java deleted file mode 100644 index 5924eb980d42..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/OperationDisplayTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.resourcehealth.models.OperationDisplay; -import org.junit.jupiter.api.Assertions; - -public final class OperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDisplay model = BinaryData.fromString( - "{\"provider\":\"leyyvx\",\"resource\":\"jpkcattpng\",\"operation\":\"rcczsqpjhvmd\",\"description\":\"v\"}") - .toObject(OperationDisplay.class); - Assertions.assertEquals("leyyvx", model.provider()); - Assertions.assertEquals("jpkcattpng", model.resource()); - Assertions.assertEquals("rcczsqpjhvmd", model.operation()); - Assertions.assertEquals("v", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay().withProvider("leyyvx") - .withResource("jpkcattpng") - .withOperation("rcczsqpjhvmd") - .withDescription("v"); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - Assertions.assertEquals("leyyvx", model.provider()); - Assertions.assertEquals("jpkcattpng", model.resource()); - Assertions.assertEquals("rcczsqpjhvmd", model.operation()); - Assertions.assertEquals("v", model.description()); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/OperationListResultInnerTests.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/OperationListResultInnerTests.java deleted file mode 100644 index 5f157232a44a..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/OperationListResultInnerTests.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.resourcehealth.fluent.models.OperationListResultInner; -import com.azure.resourcemanager.resourcehealth.models.Operation; -import com.azure.resourcemanager.resourcehealth.models.OperationDisplay; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class OperationListResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationListResultInner model = BinaryData.fromString( - "{\"value\":[{\"name\":\"wtgrhpdjpj\",\"display\":{\"provider\":\"sxazjpq\",\"resource\":\"gual\",\"operation\":\"xxhejjzzvd\",\"description\":\"gwdslfhotwm\"}},{\"name\":\"npwlbjnpg\",\"display\":{\"provider\":\"tadehxnltyfsopp\",\"resource\":\"uesnzwdejbavo\",\"operation\":\"zdmohctbqvu\",\"description\":\"xdn\"}},{\"name\":\"vo\",\"display\":{\"provider\":\"jjugwdkcglhslaz\",\"resource\":\"yggdtjixh\",\"operation\":\"uofqwe\",\"description\":\"hmenevfyexfwhybc\"}}]}") - .toObject(OperationListResultInner.class); - Assertions.assertEquals("wtgrhpdjpj", model.value().get(0).name()); - Assertions.assertEquals("sxazjpq", model.value().get(0).display().provider()); - Assertions.assertEquals("gual", model.value().get(0).display().resource()); - Assertions.assertEquals("xxhejjzzvd", model.value().get(0).display().operation()); - Assertions.assertEquals("gwdslfhotwm", model.value().get(0).display().description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResultInner model = new OperationListResultInner().withValue(Arrays.asList( - new Operation().withName("wtgrhpdjpj") - .withDisplay(new OperationDisplay().withProvider("sxazjpq") - .withResource("gual") - .withOperation("xxhejjzzvd") - .withDescription("gwdslfhotwm")), - new Operation().withName("npwlbjnpg") - .withDisplay(new OperationDisplay().withProvider("tadehxnltyfsopp") - .withResource("uesnzwdejbavo") - .withOperation("zdmohctbqvu") - .withDescription("xdn")), - new Operation().withName("vo") - .withDisplay(new OperationDisplay().withProvider("jjugwdkcglhslaz") - .withResource("yggdtjixh") - .withOperation("uofqwe") - .withDescription("hmenevfyexfwhybc")))); - model = BinaryData.fromObject(model).toObject(OperationListResultInner.class); - Assertions.assertEquals("wtgrhpdjpj", model.value().get(0).name()); - Assertions.assertEquals("sxazjpq", model.value().get(0).display().provider()); - Assertions.assertEquals("gual", model.value().get(0).display().resource()); - Assertions.assertEquals("xxhejjzzvd", model.value().get(0).display().operation()); - Assertions.assertEquals("gwdslfhotwm", model.value().get(0).display().description()); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/OperationTests.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/OperationTests.java deleted file mode 100644 index e8a3c30f6030..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/OperationTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.resourcehealth.models.Operation; -import com.azure.resourcemanager.resourcehealth.models.OperationDisplay; -import org.junit.jupiter.api.Assertions; - -public final class OperationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Operation model = BinaryData.fromString( - "{\"name\":\"vyvdcs\",\"display\":{\"provider\":\"nnaamdectehfiqsc\",\"resource\":\"ypvhezrkg\",\"operation\":\"c\",\"description\":\"efovgmk\"}}") - .toObject(Operation.class); - Assertions.assertEquals("vyvdcs", model.name()); - Assertions.assertEquals("nnaamdectehfiqsc", model.display().provider()); - Assertions.assertEquals("ypvhezrkg", model.display().resource()); - Assertions.assertEquals("c", model.display().operation()); - Assertions.assertEquals("efovgmk", model.display().description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Operation model = new Operation().withName("vyvdcs") - .withDisplay(new OperationDisplay().withProvider("nnaamdectehfiqsc") - .withResource("ypvhezrkg") - .withOperation("c") - .withDescription("efovgmk")); - model = BinaryData.fromObject(model).toObject(Operation.class); - Assertions.assertEquals("vyvdcs", model.name()); - Assertions.assertEquals("nnaamdectehfiqsc", model.display().provider()); - Assertions.assertEquals("ypvhezrkg", model.display().resource()); - Assertions.assertEquals("c", model.display().operation()); - Assertions.assertEquals("efovgmk", model.display().description()); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/OperationsListWithResponseMockTests.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/OperationsListWithResponseMockTests.java deleted file mode 100644 index f739bafa481b..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/OperationsListWithResponseMockTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.resourcehealth.ResourceHealthManager; -import com.azure.resourcemanager.resourcehealth.models.OperationListResult; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class OperationsListWithResponseMockTests { - @Test - public void testListWithResponse() throws Exception { - String responseStr - = "{\"value\":[{\"name\":\"wk\",\"display\":{\"provider\":\"ycslevufuztcktyh\",\"resource\":\"qedcgzulwm\",\"operation\":\"qzz\",\"description\":\"jvpglydzgk\"}},{\"name\":\"qeevt\",\"display\":{\"provider\":\"r\",\"resource\":\"t\",\"operation\":\"ytp\",\"description\":\"mov\"}},{\"name\":\"fvaawzqa\",\"display\":{\"provider\":\"gzuriglaecxndt\",\"resource\":\"okpvzm\",\"operation\":\"t\",\"description\":\"dgxobfircl\"}}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ResourceHealthManager manager = ResourceHealthManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - OperationListResult response - = manager.operations().listWithResponse(com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals("wk", response.value().get(0).name()); - Assertions.assertEquals("ycslevufuztcktyh", response.value().get(0).display().provider()); - Assertions.assertEquals("qedcgzulwm", response.value().get(0).display().resource()); - Assertions.assertEquals("qzz", response.value().get(0).display().operation()); - Assertions.assertEquals("jvpglydzgk", response.value().get(0).display().description()); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/RecommendedActionTests.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/RecommendedActionTests.java deleted file mode 100644 index 1a98fdc5bcf0..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/RecommendedActionTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.resourcehealth.models.RecommendedAction; -import org.junit.jupiter.api.Assertions; - -public final class RecommendedActionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RecommendedAction model = BinaryData.fromString( - "{\"action\":\"lcuiywgqywgndr\",\"actionUrl\":\"nhzgpphrcgyn\",\"_ActionUrl.Comment\":\"cpecfvmmcoofs\",\"actionUrlText\":\"zevgb\"}") - .toObject(RecommendedAction.class); - Assertions.assertEquals("lcuiywgqywgndr", model.action()); - Assertions.assertEquals("nhzgpphrcgyn", model.actionUrl()); - Assertions.assertEquals("zevgb", model.actionUrlText()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RecommendedAction model = new RecommendedAction().withAction("lcuiywgqywgndr") - .withActionUrl("nhzgpphrcgyn") - .withActionUrlText("zevgb"); - model = BinaryData.fromObject(model).toObject(RecommendedAction.class); - Assertions.assertEquals("lcuiywgqywgndr", model.action()); - Assertions.assertEquals("nhzgpphrcgyn", model.actionUrl()); - Assertions.assertEquals("zevgb", model.actionUrlText()); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/ServiceImpactingEventIncidentPropertiesTests.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/ServiceImpactingEventIncidentPropertiesTests.java deleted file mode 100644 index 0635e23956a8..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/ServiceImpactingEventIncidentPropertiesTests.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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.resourcehealth.models.ServiceImpactingEventIncidentProperties; -import org.junit.jupiter.api.Assertions; - -public final class ServiceImpactingEventIncidentPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServiceImpactingEventIncidentProperties model = BinaryData - .fromString( - "{\"title\":\"chcbonqvpkvlrxnj\",\"service\":\"seiphe\",\"region\":\"lokeyy\",\"incidentType\":\"nj\"}") - .toObject(ServiceImpactingEventIncidentProperties.class); - Assertions.assertEquals("chcbonqvpkvlrxnj", model.title()); - Assertions.assertEquals("seiphe", model.service()); - Assertions.assertEquals("lokeyy", model.region()); - Assertions.assertEquals("nj", model.incidentType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServiceImpactingEventIncidentProperties model - = new ServiceImpactingEventIncidentProperties().withTitle("chcbonqvpkvlrxnj") - .withService("seiphe") - .withRegion("lokeyy") - .withIncidentType("nj"); - model = BinaryData.fromObject(model).toObject(ServiceImpactingEventIncidentProperties.class); - Assertions.assertEquals("chcbonqvpkvlrxnj", model.title()); - Assertions.assertEquals("seiphe", model.service()); - Assertions.assertEquals("lokeyy", model.region()); - Assertions.assertEquals("nj", model.incidentType()); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/ServiceImpactingEventStatusTests.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/ServiceImpactingEventStatusTests.java deleted file mode 100644 index 2f038b834b74..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/ServiceImpactingEventStatusTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.resourcehealth.models.ServiceImpactingEventStatus; -import org.junit.jupiter.api.Assertions; - -public final class ServiceImpactingEventStatusTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServiceImpactingEventStatus model - = BinaryData.fromString("{\"value\":\"mngnzscxaqw\"}").toObject(ServiceImpactingEventStatus.class); - Assertions.assertEquals("mngnzscxaqw", model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServiceImpactingEventStatus model = new ServiceImpactingEventStatus().withValue("mngnzscxaqw"); - model = BinaryData.fromObject(model).toObject(ServiceImpactingEventStatus.class); - Assertions.assertEquals("mngnzscxaqw", model.value()); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/ServiceImpactingEventTests.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/ServiceImpactingEventTests.java deleted file mode 100644 index c1d176a94a8a..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/ServiceImpactingEventTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.resourcehealth.models.ServiceImpactingEvent; -import com.azure.resourcemanager.resourcehealth.models.ServiceImpactingEventIncidentProperties; -import com.azure.resourcemanager.resourcehealth.models.ServiceImpactingEventStatus; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class ServiceImpactingEventTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServiceImpactingEvent model = BinaryData.fromString( - "{\"eventStartTime\":\"2021-06-17T08:19:14Z\",\"eventStatusLastModifiedTime\":\"2021-03-26T22:43:42Z\",\"correlationId\":\"c\",\"status\":{\"value\":\"ivkwlzuvccfwnfnb\"},\"incidentProperties\":{\"title\":\"ionle\",\"service\":\"etqgtzxdpnq\",\"region\":\"qwxrjfeallnw\",\"incidentType\":\"bisnja\"}}") - .toObject(ServiceImpactingEvent.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-17T08:19:14Z"), model.eventStartTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-26T22:43:42Z"), model.eventStatusLastModifiedTime()); - Assertions.assertEquals("c", model.correlationId()); - Assertions.assertEquals("ivkwlzuvccfwnfnb", model.status().value()); - Assertions.assertEquals("ionle", model.incidentProperties().title()); - Assertions.assertEquals("etqgtzxdpnq", model.incidentProperties().service()); - Assertions.assertEquals("qwxrjfeallnw", model.incidentProperties().region()); - Assertions.assertEquals("bisnja", model.incidentProperties().incidentType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServiceImpactingEvent model - = new ServiceImpactingEvent().withEventStartTime(OffsetDateTime.parse("2021-06-17T08:19:14Z")) - .withEventStatusLastModifiedTime(OffsetDateTime.parse("2021-03-26T22:43:42Z")) - .withCorrelationId("c") - .withStatus(new ServiceImpactingEventStatus().withValue("ivkwlzuvccfwnfnb")) - .withIncidentProperties(new ServiceImpactingEventIncidentProperties().withTitle("ionle") - .withService("etqgtzxdpnq") - .withRegion("qwxrjfeallnw") - .withIncidentType("bisnja")); - model = BinaryData.fromObject(model).toObject(ServiceImpactingEvent.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-17T08:19:14Z"), model.eventStartTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-26T22:43:42Z"), model.eventStatusLastModifiedTime()); - Assertions.assertEquals("c", model.correlationId()); - Assertions.assertEquals("ivkwlzuvccfwnfnb", model.status().value()); - Assertions.assertEquals("ionle", model.incidentProperties().title()); - Assertions.assertEquals("etqgtzxdpnq", model.incidentProperties().service()); - Assertions.assertEquals("qwxrjfeallnw", model.incidentProperties().region()); - Assertions.assertEquals("bisnja", model.incidentProperties().incidentType()); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/StatusActiveEventTests.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/StatusActiveEventTests.java deleted file mode 100644 index 41111d25f714..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/StatusActiveEventTests.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.resourcehealth.models.EmergingIssueImpact; -import com.azure.resourcemanager.resourcehealth.models.ImpactedRegion; -import com.azure.resourcemanager.resourcehealth.models.SeverityValues; -import com.azure.resourcemanager.resourcehealth.models.StageValues; -import com.azure.resourcemanager.resourcehealth.models.StatusActiveEvent; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class StatusActiveEventTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StatusActiveEvent model = BinaryData.fromString( - "{\"title\":\"ahhxvrh\",\"description\":\"kwpjgwwspughftqs\",\"trackingId\":\"qxujxukndxd\",\"startTime\":\"2021-02-07T08:06:06Z\",\"cloud\":\"guufzd\",\"severity\":\"Information\",\"stage\":\"Active\",\"published\":true,\"lastModifiedTime\":\"2021-02-25T10:39:49Z\",\"impacts\":[{\"id\":\"tzingamvpph\",\"name\":\"zqzudph\",\"regions\":[{\"id\":\"dkfw\",\"name\":\"wcvtbvkayhmtnvyq\"}]},{\"id\":\"tkzwpcnpwzc\",\"name\":\"esgvvsccyaj\",\"regions\":[{\"id\":\"hwyg\",\"name\":\"vdnkfxusem\"},{\"id\":\"zrmuhapfcqdps\",\"name\":\"qvpsvuoymg\"}]},{\"id\":\"elvezrypq\",\"name\":\"feo\",\"regions\":[{\"id\":\"wkyhkobopgxe\",\"name\":\"owepbqpcrfkb\"},{\"id\":\"csnjvcdwxlpqekft\",\"name\":\"htjsying\"}]},{\"id\":\"qatmtdhtmdvy\",\"name\":\"ikdgszywkbir\",\"regions\":[{\"id\":\"hlhkjoqrvqqaatj\",\"name\":\"rv\"},{\"id\":\"upmfiibfg\",\"name\":\"ioolvrwxkvtkkgll\"},{\"id\":\"jygvjayvbl\",\"name\":\"vkzuhbxvvyhgso\"}]}]}") - .toObject(StatusActiveEvent.class); - Assertions.assertEquals("ahhxvrh", model.title()); - Assertions.assertEquals("kwpjgwwspughftqs", model.description()); - Assertions.assertEquals("qxujxukndxd", model.trackingId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-07T08:06:06Z"), model.startTime()); - Assertions.assertEquals("guufzd", model.cloud()); - Assertions.assertEquals(SeverityValues.INFORMATION, model.severity()); - Assertions.assertEquals(StageValues.ACTIVE, model.stage()); - Assertions.assertEquals(true, model.published()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-25T10:39:49Z"), model.lastModifiedTime()); - Assertions.assertEquals("tzingamvpph", model.impacts().get(0).id()); - Assertions.assertEquals("zqzudph", model.impacts().get(0).name()); - Assertions.assertEquals("dkfw", model.impacts().get(0).regions().get(0).id()); - Assertions.assertEquals("wcvtbvkayhmtnvyq", model.impacts().get(0).regions().get(0).name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StatusActiveEvent model = new StatusActiveEvent().withTitle("ahhxvrh") - .withDescription("kwpjgwwspughftqs") - .withTrackingId("qxujxukndxd") - .withStartTime(OffsetDateTime.parse("2021-02-07T08:06:06Z")) - .withCloud("guufzd") - .withSeverity(SeverityValues.INFORMATION) - .withStage(StageValues.ACTIVE) - .withPublished(true) - .withLastModifiedTime(OffsetDateTime.parse("2021-02-25T10:39:49Z")) - .withImpacts(Arrays.asList( - new EmergingIssueImpact().withId("tzingamvpph") - .withName("zqzudph") - .withRegions(Arrays.asList(new ImpactedRegion().withId("dkfw").withName("wcvtbvkayhmtnvyq"))), - new EmergingIssueImpact().withId("tkzwpcnpwzc") - .withName("esgvvsccyaj") - .withRegions(Arrays.asList(new ImpactedRegion().withId("hwyg").withName("vdnkfxusem"), - new ImpactedRegion().withId("zrmuhapfcqdps").withName("qvpsvuoymg"))), - new EmergingIssueImpact().withId("elvezrypq") - .withName("feo") - .withRegions(Arrays.asList(new ImpactedRegion().withId("wkyhkobopgxe").withName("owepbqpcrfkb"), - new ImpactedRegion().withId("csnjvcdwxlpqekft").withName("htjsying"))), - new EmergingIssueImpact().withId("qatmtdhtmdvy") - .withName("ikdgszywkbir") - .withRegions(Arrays.asList(new ImpactedRegion().withId("hlhkjoqrvqqaatj").withName("rv"), - new ImpactedRegion().withId("upmfiibfg").withName("ioolvrwxkvtkkgll"), - new ImpactedRegion().withId("jygvjayvbl").withName("vkzuhbxvvyhgso"))))); - model = BinaryData.fromObject(model).toObject(StatusActiveEvent.class); - Assertions.assertEquals("ahhxvrh", model.title()); - Assertions.assertEquals("kwpjgwwspughftqs", model.description()); - Assertions.assertEquals("qxujxukndxd", model.trackingId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-07T08:06:06Z"), model.startTime()); - Assertions.assertEquals("guufzd", model.cloud()); - Assertions.assertEquals(SeverityValues.INFORMATION, model.severity()); - Assertions.assertEquals(StageValues.ACTIVE, model.stage()); - Assertions.assertEquals(true, model.published()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-25T10:39:49Z"), model.lastModifiedTime()); - Assertions.assertEquals("tzingamvpph", model.impacts().get(0).id()); - Assertions.assertEquals("zqzudph", model.impacts().get(0).name()); - Assertions.assertEquals("dkfw", model.impacts().get(0).regions().get(0).id()); - Assertions.assertEquals("wcvtbvkayhmtnvyq", model.impacts().get(0).regions().get(0).name()); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/StatusBannerTests.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/StatusBannerTests.java deleted file mode 100644 index a7ceae26cc33..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/StatusBannerTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.resourcehealth.models.StatusBanner; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class StatusBannerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StatusBanner model = BinaryData.fromString( - "{\"title\":\"qmqhldvriii\",\"message\":\"nalghfkvtvsexso\",\"cloud\":\"el\",\"lastModifiedTime\":\"2021-11-06T19:32:24Z\"}") - .toObject(StatusBanner.class); - Assertions.assertEquals("qmqhldvriii", model.title()); - Assertions.assertEquals("nalghfkvtvsexso", model.message()); - Assertions.assertEquals("el", model.cloud()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-06T19:32:24Z"), model.lastModifiedTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StatusBanner model = new StatusBanner().withTitle("qmqhldvriii") - .withMessage("nalghfkvtvsexso") - .withCloud("el") - .withLastModifiedTime(OffsetDateTime.parse("2021-11-06T19:32:24Z")); - model = BinaryData.fromObject(model).toObject(StatusBanner.class); - Assertions.assertEquals("qmqhldvriii", model.title()); - Assertions.assertEquals("nalghfkvtvsexso", model.message()); - Assertions.assertEquals("el", model.cloud()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-06T19:32:24Z"), model.lastModifiedTime()); - } -} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/UpdateTests.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/UpdateTests.java deleted file mode 100644 index f968baef0855..000000000000 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/UpdateTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resourcehealth.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.resourcehealth.models.Update; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class UpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Update model = BinaryData.fromString("{\"summary\":\"qqtch\",\"updateDateTime\":\"2021-06-10T11:36:20Z\"}") - .toObject(Update.class); - Assertions.assertEquals("qqtch", model.summary()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-10T11:36:20Z"), model.updateDateTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Update model - = new Update().withSummary("qqtch").withUpdateDateTime(OffsetDateTime.parse("2021-06-10T11:36:20Z")); - model = BinaryData.fromObject(model).toObject(Update.class); - Assertions.assertEquals("qqtch", model.summary()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-10T11:36:20Z"), model.updateDateTime()); - } -}