diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index af1e214791527..69e6bebd72202 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -315,7 +315,7 @@ com.azure.resourcemanager:azure-resourcemanager-changeanalysis;1.1.1;1.2.0-beta. com.azure.resourcemanager:azure-resourcemanager-resourcegraph;1.1.0;1.2.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-delegatednetwork;1.0.0-beta.3;1.0.0-beta.4 com.azure.resourcemanager:azure-resourcemanager-synapse;1.0.0;1.1.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager-resourcehealth;1.0.0;1.1.0-beta.4 +com.azure.resourcemanager:azure-resourcemanager-resourcehealth;1.0.0;1.1.0 com.azure.resourcemanager:azure-resourcemanager-databricks;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-databoxedge;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-frontdoor;1.1.0;1.2.0-beta.1 diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/CHANGELOG.md b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/CHANGELOG.md index 862d2c155e458..508257d0d0707 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/CHANGELOG.md +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/CHANGELOG.md @@ -1,14 +1,228 @@ # Release History -## 1.1.0-beta.4 (Unreleased) +## 1.1.0 (2026-10-27) -### Features Added +- Azure Resource Manager ResourceHealth client library for Java. This package contains Microsoft Azure SDK for ResourceHealth Management SDK. The Resource Health Client. Package api-version 2026-07-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Breaking Changes -### Bugs Fixed +#### `models.AvailabilityStatusListResult` was removed + +#### `models.ServiceImpactingEventStatus` was modified + +* `ServiceImpactingEventStatus()` was changed to private access +* `validate()` was removed +* `withValue(java.lang.String)` was removed + +#### `models.RecommendedAction` was modified + +* `RecommendedAction()` was changed to private access +* `validate()` was removed +* `withActionUrlText(java.lang.String)` was removed +* `withActionUrl(java.lang.String)` was removed +* `withAction(java.lang.String)` was removed + +#### `models.AvailabilityStatusProperties` was modified + +* `AvailabilityStatusProperties()` was changed to private access +* `withHealthEventCause(java.lang.String)` was removed +* `withOccuredTime(java.time.OffsetDateTime)` was removed +* `withRecommendedActions(java.util.List)` was removed +* `withHealthEventType(java.lang.String)` was removed +* `withServiceImpactingEvents(java.util.List)` was removed +* `validate()` was removed +* `withRootCauseAttributionTime(java.time.OffsetDateTime)` was removed +* `withHealthEventId(java.lang.String)` was removed +* `withTitle(java.lang.String)` was removed +* `withReasonType(java.lang.String)` was removed +* `withAvailabilityState(models.AvailabilityStateValues)` was removed +* `withRecentlyResolved(models.AvailabilityStatusPropertiesRecentlyResolved)` was removed +* `withResolutionEta(java.time.OffsetDateTime)` was removed +* `withHealthEventCategory(java.lang.String)` was removed +* `withSummary(java.lang.String)` was removed +* `withDetailedStatus(java.lang.String)` was removed +* `withReasonChronicity(models.ReasonChronicityTypes)` was removed +* `withReportedTime(java.time.OffsetDateTime)` was removed + +#### `models.OperationDisplay` was modified + +* `OperationDisplay()` was changed to private access +* `withDescription(java.lang.String)` was removed +* `withProvider(java.lang.String)` was removed +* `withOperation(java.lang.String)` was removed +* `validate()` was removed +* `withResource(java.lang.String)` was removed + +#### `models.ServiceImpactingEvent` was modified + +* `ServiceImpactingEvent()` was changed to private access +* `validate()` was removed +* `withIncidentProperties(models.ServiceImpactingEventIncidentProperties)` was removed +* `withCorrelationId(java.lang.String)` was removed +* `withEventStartTime(java.time.OffsetDateTime)` was removed +* `withEventStatusLastModifiedTime(java.time.OffsetDateTime)` was removed +* `withStatus(models.ServiceImpactingEventStatus)` was removed + +#### `models.ServiceImpactingEventIncidentProperties` was modified + +* `ServiceImpactingEventIncidentProperties()` was changed to private access +* `withIncidentType(java.lang.String)` was removed +* `validate()` was removed +* `withTitle(java.lang.String)` was removed +* `withRegion(java.lang.String)` was removed +* `withService(java.lang.String)` was removed + +#### `models.Operation` was modified + +* `Operation()` was changed to private access +* `withDisplay(models.OperationDisplay)` was removed +* `validate()` was removed +* `withName(java.lang.String)` was removed + +#### `models.AvailabilityStatusPropertiesRecentlyResolved` was modified + +* `AvailabilityStatusPropertiesRecentlyResolved()` was changed to private access +* `withResolvedTime(java.time.OffsetDateTime)` was removed +* `withUnavailableSummary(java.lang.String)` was removed +* `validate()` was removed +* `withUnavailableOccuredTime(java.time.OffsetDateTime)` was removed + +### Features Added + +* `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.ApiOperationLink` 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.EventSubTypeValues` was added + +* `models.EventPropertiesRecommendedActions` was added + +* `models.StatusActiveEvent` was added + +* `models.LinkTypeValues` was added + +* `models.EventImpactedResource` was added + +* `models.LevelValues` 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 + +* `toJson(com.azure.json.JsonWriter)` was added +* `actionUrlComment()` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `ResourceHealthManager` was modified + +* `emergingIssues()` was added +* `metadatas()` was added +* `childResources()` was added +* `impactedResources()` was added +* `childAvailabilityStatuses()` was added +* `eventsOperations()` was added +* `eventOperations()` was added +* `securityAdvisoryImpactedResources()` was added + +#### `models.AvailabilityStatusProperties` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `category()` was added +* `context()` was added +* `articleId()` was added + +#### `models.OperationDisplay` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ServiceImpactingEvent` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ServiceImpactingEventIncidentProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.Operation` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.AvailabilityStatusPropertiesRecentlyResolved` was modified -### Other Changes +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` 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 bbef5482494d0..5115947e40a73 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 api-version 2026-07-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 @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-resourcehealth - 1.1.0-beta.4 + 1.1.0 ``` [//]: # ({x-version-update-end}) @@ -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 1432eb3f78a94..cce9526a3a1b9 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/SAMPLE.md +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/SAMPLE.md @@ -24,6 +24,7 @@ ## EventOperation +- [FetchBilllingCommunicationDetailsBySubscriptionIdAndTrackingId](#eventoperation_fetchbilllingcommunicationdetailsbysubscriptionidandtrackingid) - [FetchDetailsBySubscriptionIdAndTrackingId](#eventoperation_fetchdetailsbysubscriptionidandtrackingid) - [FetchDetailsByTenantIdAndTrackingId](#eventoperation_fetchdetailsbytenantidandtrackingid) - [GetBySubscriptionIdAndTrackingId](#eventoperation_getbysubscriptionidandtrackingid) @@ -63,9 +64,7 @@ */ public final class AvailabilityStatusesGetByResourceSamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * AvailabilityStatus_GetByResource.json + * x-ms-original-file: 2026-07-01/AvailabilityStatus_GetByResource.json */ /** * Sample code: GetCurrentHealthByResource. @@ -88,9 +87,7 @@ public final class AvailabilityStatusesGetByResourceSamples { */ public final class AvailabilityStatusesListSamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * AvailabilityStatuses_List.json + * x-ms-original-file: 2026-07-01/AvailabilityStatuses_List.json */ /** * Sample code: GetHealthHistoryByResource. @@ -112,9 +109,7 @@ public final class AvailabilityStatusesListSamples { */ public final class AvailabilityStatusesListByResourceGroupSamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * AvailabilityStatuses_ListByResourceGroup.json + * x-ms-original-file: 2026-07-01/AvailabilityStatuses_ListByResourceGroup.json */ /** * Sample code: ListByResourceGroup. @@ -136,9 +131,7 @@ public final class AvailabilityStatusesListByResourceGroupSamples { */ public final class AvailabilityStatusesListBySubscriptionIdSamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * AvailabilityStatuses_ListBySubscriptionId.json + * x-ms-original-file: 2026-07-01/AvailabilityStatuses_ListBySubscriptionId.json */ /** * Sample code: ListHealthBySubscriptionId. @@ -161,9 +154,7 @@ public final class AvailabilityStatusesListBySubscriptionIdSamples { */ public final class ChildAvailabilityStatusesGetByResourceSamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * ChildAvailabilityStatus_GetByResource.json + * x-ms-original-file: 2026-07-01/ChildAvailabilityStatus_GetByResource.json */ /** * Sample code: GetChildCurrentHealthByResource. @@ -188,9 +179,7 @@ public final class ChildAvailabilityStatusesGetByResourceSamples { */ public final class ChildAvailabilityStatusesListSamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * ChildAvailabilityStatuses_List.json + * x-ms-original-file: 2026-07-01/ChildAvailabilityStatuses_List.json */ /** * Sample code: GetChildHealthHistoryByResource. @@ -215,9 +204,7 @@ public final class ChildAvailabilityStatusesListSamples { */ public final class ChildResourcesListSamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * ChildResources_List.json + * x-ms-original-file: 2026-07-01/ChildResources_List.json */ /** * Sample code: GetCurrentChildHealthByResource. @@ -226,7 +213,10 @@ public final class ChildResourcesListSamples { */ public static void getCurrentChildHealthByResource(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { - manager.childResources().list("resourceUri", null, null, com.azure.core.util.Context.NONE); + manager.childResources() + .list( + "subscriptions/227b734f-e14f-4de6-b7fc-3190c21e69f6/resourceGroups/JUHACKETRHCTEST/providers/Microsoft.Compute/virtualMachineScaleSets/rhctest", + null, null, com.azure.core.util.Context.NONE); } } ``` @@ -241,9 +231,7 @@ import com.azure.resourcemanager.resourcehealth.models.IssueNameParameter; */ public final class EmergingIssuesGetSamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * EmergingIssues_Get.json + * x-ms-original-file: 2026-07-01/EmergingIssues_Get.json */ /** * Sample code: GetEmergingIssues. @@ -264,9 +252,7 @@ public final class EmergingIssuesGetSamples { */ public final class EmergingIssuesListSamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * EmergingIssues_List.json + * x-ms-original-file: 2026-07-01/EmergingIssues_List.json */ /** * Sample code: GetEmergingIssues. @@ -279,6 +265,30 @@ public final class EmergingIssuesListSamples { } ``` +### EventOperation_FetchBilllingCommunicationDetailsBySubscriptionIdAndTrackingId + +```java +/** + * Samples for EventOperation FetchBilllingCommunicationDetailsBySubscriptionIdAndTrackingId. + */ +public final class EventOperationFetchBilllingCommunicationDetailsBySubscriptionIdAndTrackingIdSamples { + /* + * x-ms-original-file: 2026-07-01/Event_fetchBillingCommunicationDetailsBySubscriptionIdAndTrackingId.json + */ + /** + * Sample code: BillingEventDetailsBySubscriptionIdAndTrackingId. + * + * @param manager Entry point to ResourceHealthManager. + */ + public static void billingEventDetailsBySubscriptionIdAndTrackingId( + com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { + manager.eventOperations() + .fetchBilllingCommunicationDetailsBySubscriptionIdAndTrackingIdWithResponse("eventTrackingId", + com.azure.core.util.Context.NONE); + } +} +``` + ### EventOperation_FetchDetailsBySubscriptionIdAndTrackingId ```java @@ -287,9 +297,7 @@ public final class EmergingIssuesListSamples { */ public final class EventOperationFetchDetailsBySubscriptionIdAndTrackingIdSamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * Event_fetchDetailsBySubscriptionIdAndTrackingId.json + * x-ms-original-file: 2026-07-01/Event_fetchDetailsBySubscriptionIdAndTrackingId.json */ /** * Sample code: EventDetailsBySubscriptionIdAndTrackingId. @@ -312,9 +320,7 @@ public final class EventOperationFetchDetailsBySubscriptionIdAndTrackingIdSample */ public final class EventOperationFetchDetailsByTenantIdAndTrackingIdSamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * Event_fetchDetailsByTenantIdAndTrackingId.json + * x-ms-original-file: 2026-07-01/Event_fetchDetailsByTenantIdAndTrackingId.json */ /** * Sample code: EventDetailsByTenantIdAndTrackingId. @@ -337,20 +343,18 @@ public final class EventOperationFetchDetailsByTenantIdAndTrackingIdSamples { */ public final class EventOperationGetBySubscriptionIdAndTrackingIdSamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * Event_GetBySubscriptionIdAndTrackingId.json + * x-ms-original-file: 2026-07-01/Event_GetBySubscriptionIdAndTrackingId.json */ /** - * Sample code: SecurityAdvisoriesEventBySubscriptionIdAndTrackingId. + * Sample code: GetRetirementEventBySubscriptionIdAndTrackingId. * * @param manager Entry point to ResourceHealthManager. */ - public static void securityAdvisoriesEventBySubscriptionIdAndTrackingId( + public static void getRetirementEventBySubscriptionIdAndTrackingId( 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); } } ``` @@ -363,9 +367,7 @@ public final class EventOperationGetBySubscriptionIdAndTrackingIdSamples { */ public final class EventOperationGetByTenantIdAndTrackingIdSamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * Event_GetByTenantIdAndTrackingId.json + * x-ms-original-file: 2026-07-01/Event_GetByTenantIdAndTrackingId.json */ /** * Sample code: EventByTenantIdAndTrackingId. @@ -389,9 +391,7 @@ public final class EventOperationGetByTenantIdAndTrackingIdSamples { */ public final class EventsOperationListSamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * Events_ListBySubscriptionId.json + * x-ms-original-file: 2026-07-01/Events_ListBySubscriptionId.json */ /** * Sample code: ListEventsBySubscriptionId. @@ -401,7 +401,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); } } @@ -415,9 +415,7 @@ public final class EventsOperationListSamples { */ public final class EventsOperationListBySingleResourceSamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * Events_ListBySingleResource.json + * x-ms-original-file: 2026-07-01/Events_ListBySingleResource.json */ /** * Sample code: ListEventsBySingleResource. @@ -442,9 +440,7 @@ public final class EventsOperationListBySingleResourceSamples { */ public final class EventsOperationListByTenantIdSamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * Events_ListByTenantId.json + * x-ms-original-file: 2026-07-01/Events_ListByTenantId.json */ /** * Sample code: ListEventsByTenantId. @@ -467,9 +463,7 @@ public final class EventsOperationListByTenantIdSamples { */ public final class ImpactedResourcesGetSamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * ImpactedResources_Get.json + * x-ms-original-file: 2026-07-01/ImpactedResources_Get.json */ /** * Sample code: ImpactedResourcesGet. @@ -490,9 +484,7 @@ public final class ImpactedResourcesGetSamples { */ public final class ImpactedResourcesGetByTenantIdSamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * ImpactedResources_GetByTenantId.json + * x-ms-original-file: 2026-07-01/ImpactedResources_GetByTenantId.json */ /** * Sample code: ImpactedResourcesGet. @@ -514,9 +506,7 @@ public final class ImpactedResourcesGetByTenantIdSamples { */ public final class ImpactedResourcesListBySubscriptionIdAndEventIdSamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * ImpactedResources_ListBySubscriptionId_ListByEventId.json + * x-ms-original-file: 2026-07-01/ImpactedResources_ListBySubscriptionId_ListByEventId.json */ /** * Sample code: ListImpactedResourcesBySubscriptionId. @@ -539,9 +529,7 @@ public final class ImpactedResourcesListBySubscriptionIdAndEventIdSamples { */ public final class ImpactedResourcesListByTenantIdAndEventIdSamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * ImpactedResources_ListByTenantId_ListByEventId.json + * x-ms-original-file: 2026-07-01/ImpactedResources_ListByTenantId_ListByEventId.json */ /** * Sample code: ListEventsByTenantId. @@ -563,9 +551,7 @@ public final class ImpactedResourcesListByTenantIdAndEventIdSamples { */ public final class MetadataGetEntitySamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * Metadata_GetEntity.json + * x-ms-original-file: 2026-07-01/Metadata_GetEntity.json */ /** * Sample code: GetMetadata. @@ -586,9 +572,7 @@ public final class MetadataGetEntitySamples { */ public final class MetadataListSamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * Metadata_List.json + * x-ms-original-file: 2026-07-01/Metadata_List.json */ /** * Sample code: GetMetadata. @@ -609,9 +593,7 @@ public final class MetadataListSamples { */ public final class OperationsListSamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * Operations_List.json + * x-ms-original-file: 2026-07-01/Operations_List.json */ /** * Sample code: GetOperationsList. @@ -632,9 +614,7 @@ public final class OperationsListSamples { */ public final class SecurityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdSamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * SecurityAdvisoryImpactedResources_ListBySubscriptionId_ListByEventId.json + * x-ms-original-file: 2026-07-01/SecurityAdvisoryImpactedResources_ListBySubscriptionId_ListByEventId.json */ /** * Sample code: ListSecurityAdvisoryImpactedResourcesBySubscriptionId. @@ -657,9 +637,7 @@ public final class SecurityAdvisoryImpactedResourcesListBySubscriptionIdAndEvent */ public final class SecurityAdvisoryImpactedResourcesListByTenantIdAndEventIdSamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * SecurityAdvisoryImpactedResources_ListByTenantId_ListByEventId.json + * x-ms-original-file: 2026-07-01/SecurityAdvisoryImpactedResources_ListByTenantId_ListByEventId.json */ /** * Sample code: ListSecurityAdvisoryImpactedResourcesByTenantId. diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/pom.xml b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/pom.xml index 4f741d2e0eeef..32c4065d0a568 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/pom.xml +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/pom.xml @@ -1,9 +1,9 @@ - + 4.0.0 com.azure @@ -14,11 +14,11 @@ com.azure.resourcemanager azure-resourcemanager-resourcehealth - 1.1.0-beta.4 + 1.1.0 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 api-version 2026-07-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 9f8bc6e49d273..864426b7cfef9 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth; @@ -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; @@ -57,26 +59,26 @@ * The Resource Health Client. */ public final class ResourceHealthManager { - private AvailabilityStatuses availabilityStatuses; - private Operations operations; - private Metadatas metadatas; + private AvailabilityStatuses availabilityStatuses; - private ImpactedResources impactedResources; + private ChildAvailabilityStatuses childAvailabilityStatuses; - private SecurityAdvisoryImpactedResources securityAdvisoryImpactedResources; + private ImpactedResources impactedResources; - private EventsOperations eventsOperations; + private Metadatas metadatas; private EventOperations eventOperations; - private ChildAvailabilityStatuses childAvailabilityStatuses; + private EventsOperations eventsOperations; - private ChildResources childResources; + private SecurityAdvisoryImpactedResources securityAdvisoryImpactedResources; private EmergingIssues emergingIssues; + private ChildResources childResources; + private final MicrosoftResourceHealth clientObject; private ResourceHealthManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -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")) @@ -287,18 +294,6 @@ public ResourceHealthManager authenticate(TokenCredential credential, AzureProfi } } - /** - * Gets the resource collection API of AvailabilityStatuses. - * - * @return Resource collection API of AvailabilityStatuses. - */ - public AvailabilityStatuses availabilityStatuses() { - if (this.availabilityStatuses == null) { - this.availabilityStatuses = new AvailabilityStatusesImpl(clientObject.getAvailabilityStatuses(), this); - } - return availabilityStatuses; - } - /** * Gets the resource collection API of Operations. * @@ -312,52 +307,52 @@ public Operations operations() { } /** - * Gets the resource collection API of Metadatas. + * Gets the resource collection API of AvailabilityStatuses. * - * @return Resource collection API of Metadatas. + * @return Resource collection API of AvailabilityStatuses. */ - public Metadatas metadatas() { - if (this.metadatas == null) { - this.metadatas = new MetadatasImpl(clientObject.getMetadatas(), this); + public AvailabilityStatuses availabilityStatuses() { + if (this.availabilityStatuses == null) { + this.availabilityStatuses = new AvailabilityStatusesImpl(clientObject.getAvailabilityStatuses(), this); } - return metadatas; + return availabilityStatuses; } /** - * Gets the resource collection API of ImpactedResources. + * Gets the resource collection API of ChildAvailabilityStatuses. * - * @return Resource collection API of ImpactedResources. + * @return Resource collection API of ChildAvailabilityStatuses. */ - public ImpactedResources impactedResources() { - if (this.impactedResources == null) { - this.impactedResources = new ImpactedResourcesImpl(clientObject.getImpactedResources(), this); + public ChildAvailabilityStatuses childAvailabilityStatuses() { + if (this.childAvailabilityStatuses == null) { + this.childAvailabilityStatuses + = new ChildAvailabilityStatusesImpl(clientObject.getChildAvailabilityStatuses(), this); } - return impactedResources; + return childAvailabilityStatuses; } /** - * Gets the resource collection API of SecurityAdvisoryImpactedResources. + * Gets the resource collection API of ImpactedResources. * - * @return Resource collection API of SecurityAdvisoryImpactedResources. + * @return Resource collection API of ImpactedResources. */ - public SecurityAdvisoryImpactedResources securityAdvisoryImpactedResources() { - if (this.securityAdvisoryImpactedResources == null) { - this.securityAdvisoryImpactedResources - = new SecurityAdvisoryImpactedResourcesImpl(clientObject.getSecurityAdvisoryImpactedResources(), this); + public ImpactedResources impactedResources() { + if (this.impactedResources == null) { + this.impactedResources = new ImpactedResourcesImpl(clientObject.getImpactedResources(), this); } - return securityAdvisoryImpactedResources; + return impactedResources; } /** - * Gets the resource collection API of EventsOperations. + * Gets the resource collection API of Metadatas. * - * @return Resource collection API of EventsOperations. + * @return Resource collection API of Metadatas. */ - public EventsOperations eventsOperations() { - if (this.eventsOperations == null) { - this.eventsOperations = new EventsOperationsImpl(clientObject.getEventsOperations(), this); + public Metadatas metadatas() { + if (this.metadatas == null) { + this.metadatas = new MetadatasImpl(clientObject.getMetadatas(), this); } - return eventsOperations; + return metadatas; } /** @@ -373,28 +368,28 @@ public EventOperations eventOperations() { } /** - * Gets the resource collection API of ChildAvailabilityStatuses. + * Gets the resource collection API of EventsOperations. * - * @return Resource collection API of ChildAvailabilityStatuses. + * @return Resource collection API of EventsOperations. */ - public ChildAvailabilityStatuses childAvailabilityStatuses() { - if (this.childAvailabilityStatuses == null) { - this.childAvailabilityStatuses - = new ChildAvailabilityStatusesImpl(clientObject.getChildAvailabilityStatuses(), this); + public EventsOperations eventsOperations() { + if (this.eventsOperations == null) { + this.eventsOperations = new EventsOperationsImpl(clientObject.getEventsOperations(), this); } - return childAvailabilityStatuses; + return eventsOperations; } /** - * Gets the resource collection API of ChildResources. + * Gets the resource collection API of SecurityAdvisoryImpactedResources. * - * @return Resource collection API of ChildResources. + * @return Resource collection API of SecurityAdvisoryImpactedResources. */ - public ChildResources childResources() { - if (this.childResources == null) { - this.childResources = new ChildResourcesImpl(clientObject.getChildResources(), this); + public SecurityAdvisoryImpactedResources securityAdvisoryImpactedResources() { + if (this.securityAdvisoryImpactedResources == null) { + this.securityAdvisoryImpactedResources + = new SecurityAdvisoryImpactedResourcesImpl(clientObject.getSecurityAdvisoryImpactedResources(), this); } - return childResources; + return securityAdvisoryImpactedResources; } /** @@ -409,6 +404,18 @@ public EmergingIssues emergingIssues() { return emergingIssues; } + /** + * Gets the resource collection API of ChildResources. + * + * @return Resource collection API of ChildResources. + */ + public ChildResources childResources() { + if (this.childResources == null) { + this.childResources = new ChildResourcesImpl(clientObject.getChildResources(), this); + } + return childResources; + } + /** * Gets wrapped service client MicrosoftResourceHealth providing direct access to the underlying auto-generated API * implementation, based on Azure REST API. diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/AvailabilityStatusesClient.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/AvailabilityStatusesClient.java index 2296423a529b3..a5fc070c214d8 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/AvailabilityStatusesClient.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/AvailabilityStatusesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.fluent; @@ -16,46 +16,47 @@ */ public interface AvailabilityStatusesClient { /** - * Lists the current availability status for all the resources in the subscription. + * Gets current availability status for a single resource. * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param filter The filter to apply on the operation. For more information please see + * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List availabilityStatus operation response as paginated response with {@link PagedIterable}. + * @return current availability status for a single resource along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBySubscriptionId(); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceWithResponse(String resourceUri, String filter, String expand, + Context context); /** - * Lists the current availability status for all the resources in the subscription. + * Gets current availability status for a single resource. * - * @param filter The filter to apply on the operation. For more information please see - * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. - * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. - * @param context The context to associate with this operation. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List availabilityStatus operation response as paginated response with {@link PagedIterable}. + * @return current availability status for a single resource. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBySubscriptionId(String filter, String expand, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + AvailabilityStatusInner getByResource(String resourceUri); /** - * Lists the current availability status for all the resources in the resource group. + * Lists the current availability status for all the resources in the subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the List availabilityStatus operation response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); + PagedIterable listBySubscriptionId(); /** - * Lists the current availability status for all the resources in the resource group. + * Lists the current availability status for all the resources in the subscription. * - * @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. @@ -66,70 +67,52 @@ public interface AvailabilityStatusesClient { * @return the List availabilityStatus operation response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, String filter, String expand, - Context context); + PagedIterable listBySubscriptionId(String filter, String expand, Context context); /** - * Gets current availability status for a single resource. + * Lists all historical availability transitions and impacting events for a single resource. * - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. - * Currently the API support not nested and one nesting level resource types : - * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} - * and - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}. - * @param filter The filter to apply on the operation. For more information please see - * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. - * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. - * @param context The context to associate with this operation. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return current availability status for a single resource along with {@link Response}. + * @return the List availabilityStatus operation response as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceWithResponse(String resourceUri, String filter, String expand, - Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceUri); /** - * Gets current availability status for a single resource. + * Lists all historical availability transitions and impacting events for a single resource. * - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. - * Currently the API support not nested and one nesting level resource types : - * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} - * and - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param filter The filter to apply on the operation. For more information please see + * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return current availability status for a single resource. + * @return the List availabilityStatus operation response as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - AvailabilityStatusInner getByResource(String resourceUri); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceUri, String filter, String expand, Context context); /** - * Lists all historical availability transitions and impacting events for a single resource. + * Lists the current availability status for all the resources in the resource group. * - * @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 resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the List availabilityStatus operation response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceUri); + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Lists all historical availability transitions and impacting events for a single resource. + * Lists the current availability status for all the resources in the resource group. * - * @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 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. @@ -140,5 +123,6 @@ Response getByResourceWithResponse(String resourceUri, * @return the List availabilityStatus operation response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceUri, String filter, String expand, Context context); + PagedIterable listByResourceGroup(String resourceGroupName, String filter, String expand, + Context context); } diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/ChildAvailabilityStatusesClient.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/ChildAvailabilityStatusesClient.java index 5d5b83db04512..1ab816916937e 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/ChildAvailabilityStatusesClient.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/ChildAvailabilityStatusesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.fluent; @@ -18,9 +18,7 @@ public interface ChildAvailabilityStatusesClient { /** * 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 resourceUri undefined. * @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. @@ -37,9 +35,7 @@ Response getByResourceWithResponse(String resourceUri, /** * Gets current availability status for a single resource. * - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. - * Currently the API only support one nesting level resource types : - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}. + * @param resourceUri undefined. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -52,9 +48,7 @@ Response getByResourceWithResponse(String resourceUri, * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response * to get the next page of availability status. * - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. - * Currently the API only support one nesting level resource types : - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}. + * @param resourceUri undefined. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -67,9 +61,7 @@ Response getByResourceWithResponse(String resourceUri, * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response * to get the next page of availability status. * - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. - * Currently the API only support one nesting level resource types : - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}. + * @param resourceUri undefined. * @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. diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/ChildResourcesClient.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/ChildResourcesClient.java index 2d265fda7ecdb..9d69584fce9bd 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/ChildResourcesClient.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/ChildResourcesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.fluent; @@ -18,9 +18,7 @@ public interface ChildResourcesClient { * Lists the all the children and its current health status for a parent resource. Use the nextLink property in the * response to get the next page of children current health. * - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. - * Currently the API only support not nested parent resource type: - * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -33,9 +31,7 @@ public interface ChildResourcesClient { * Lists the all the children and its current health status for a parent resource. Use the nextLink property in the * response to get the next page of children current health. * - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. - * Currently the API only support not nested parent resource type: - * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param filter The filter to apply on the operation. For more information please see * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/EmergingIssuesClient.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/EmergingIssuesClient.java index 5cb2104f8abc1..0aab1aa3a6882 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/EmergingIssuesClient.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/EmergingIssuesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.fluent; @@ -17,49 +17,49 @@ */ public interface EmergingIssuesClient { /** - * Lists Azure services' emerging issues. + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of emerging issues as paginated response with {@link PagedIterable}. + * @return azure services' emerging issues along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(IssueNameParameter issueName, Context context); /** - * Lists Azure services' emerging issues. + * Gets Azure services' emerging issues. * - * @param context The context to associate with this operation. + * @param issueName The name of the emerging issue. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of emerging issues as paginated response with {@link PagedIterable}. + * @return azure services' emerging issues. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + EmergingIssuesGetResultInner get(IssueNameParameter issueName); /** - * Gets Azure services' emerging issues. + * Lists 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure services' emerging issues along with {@link Response}. + * @return the list of emerging issues as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(IssueNameParameter issueName, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); /** - * Gets Azure services' emerging issues. + * Lists 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure services' emerging issues. + * @return the list of emerging issues as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - EmergingIssuesGetResultInner get(IssueNameParameter issueName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); } 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 2702bc16ac1a2..b82c97decaf04 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.fluent; @@ -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. @@ -71,14 +73,42 @@ Response getBySubscriptionIdAndTrackingIdWithResponse(String eventTr @ServiceMethod(returns = ReturnType.SINGLE) EventInner fetchDetailsBySubscriptionIdAndTrackingId(String eventTrackingId); + /** + * Service health event details specific in the subscription by event tracking id. This can be used to fetch + * sensitive properties for Billing event type. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service health event along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response fetchBilllingCommunicationDetailsBySubscriptionIdAndTrackingIdWithResponse( + String eventTrackingId, Context context); + + /** + * Service health event details specific in the subscription by event tracking id. This can be used to fetch + * sensitive properties for Billing event type. + * + * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service health event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EventInner fetchBilllingCommunicationDetailsBySubscriptionIdAndTrackingId(String eventTrackingId); + /** * 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 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 +133,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 +148,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 9021334376307..d8c7d75b114e6 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.fluent; @@ -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. @@ -69,11 +69,7 @@ public interface EventsOperationsClient { /** * Lists current service health events for given 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 resourceUri The fully qualified Azure Resource manager identifier of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -85,11 +81,7 @@ public interface EventsOperationsClient { /** * Lists current service health events for given 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 resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param filter The filter to apply on the operation. For more information please see * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. * @param context The context to associate with this operation. diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/ImpactedResourcesClient.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/ImpactedResourcesClient.java index 0518320a24e6a..e92d7b2ca1ab9 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/ImpactedResourcesClient.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/ImpactedResourcesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.fluent; @@ -16,7 +16,35 @@ */ public interface ImpactedResourcesClient { /** - * Lists impacted resources in the subscription by an event. + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specific impacted resource in the tenant by an event along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByTenantIdWithResponse(String eventTrackingId, String impactedResourceName, + Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specific impacted resource in the tenant by an event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EventImpactedResourceInner getByTenantId(String eventTrackingId, String impactedResourceName); + + /** + * Lists impacted resources in the tenant by an event. * * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -25,10 +53,10 @@ public interface ImpactedResourcesClient { * @return the List of eventImpactedResources operation response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBySubscriptionIdAndEventId(String eventTrackingId); + PagedIterable listByTenantIdAndEventId(String eventTrackingId); /** - * Lists impacted resources in the subscription by an event. + * 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 @@ -40,7 +68,7 @@ public interface ImpactedResourcesClient { * @return the List of eventImpactedResources operation response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBySubscriptionIdAndEventId(String eventTrackingId, String filter, + PagedIterable listByTenantIdAndEventId(String eventTrackingId, String filter, Context context); /** @@ -72,7 +100,7 @@ Response getWithResponse(String eventTrackingId, Str EventImpactedResourceInner get(String eventTrackingId, String impactedResourceName); /** - * Lists impacted resources in the tenant by an event. + * Lists impacted resources in the subscription by an event. * * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -81,10 +109,10 @@ Response getWithResponse(String eventTrackingId, Str * @return the List of eventImpactedResources operation response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByTenantIdAndEventId(String eventTrackingId); + PagedIterable listBySubscriptionIdAndEventId(String eventTrackingId); /** - * Lists impacted resources in the tenant by an event. + * 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 @@ -96,34 +124,6 @@ Response getWithResponse(String eventTrackingId, Str * @return the List of eventImpactedResources operation response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByTenantIdAndEventId(String eventTrackingId, String filter, - Context context); - - /** - * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specific impacted resource in the tenant by an event along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByTenantIdWithResponse(String eventTrackingId, String impactedResourceName, + PagedIterable listBySubscriptionIdAndEventId(String eventTrackingId, String filter, Context context); - - /** - * 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specific impacted resource in the tenant by an event. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - EventImpactedResourceInner getByTenantId(String eventTrackingId, String impactedResourceName); } diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/MetadatasClient.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/MetadatasClient.java index 9ce3a76b620ee..247d15e8405c0 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/MetadatasClient.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/MetadatasClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.fluent; @@ -18,47 +18,47 @@ public interface MetadatasClient { /** * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of metadata entities as paginated response with {@link PagedIterable}. + * @return the list of metadata entities along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getEntityWithResponse(String name, Context context); /** * Gets the list of metadata entities. * - * @param context The context to associate with this operation. + * @param name Name of metadata entity. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of metadata entities as paginated response with {@link PagedIterable}. + * @return the list of metadata entities. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + MetadataEntityInner getEntity(String name); /** * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of metadata entities along with {@link Response}. + * @return the list of metadata entities as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getEntityWithResponse(String name, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); /** * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of metadata entities. + * @return the list of metadata entities as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - MetadataEntityInner getEntity(String name); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); } diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/MicrosoftResourceHealth.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/MicrosoftResourceHealth.java index 70e023f511d7d..7de86c8e43db6 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/MicrosoftResourceHealth.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/MicrosoftResourceHealth.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.fluent; @@ -12,26 +12,26 @@ */ public interface MicrosoftResourceHealth { /** - * Gets The ID of the target subscription. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ String getEndpoint(); /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ String getApiVersion(); + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + /** * Gets The HTTP pipeline to send requests through. * @@ -46,13 +46,6 @@ public interface MicrosoftResourceHealth { */ Duration getDefaultPollInterval(); - /** - * Gets the AvailabilityStatusesClient object to access its operations. - * - * @return the AvailabilityStatusesClient object. - */ - AvailabilityStatusesClient getAvailabilityStatuses(); - /** * Gets the OperationsClient object to access its operations. * @@ -61,32 +54,32 @@ public interface MicrosoftResourceHealth { OperationsClient getOperations(); /** - * Gets the MetadatasClient object to access its operations. + * Gets the AvailabilityStatusesClient object to access its operations. * - * @return the MetadatasClient object. + * @return the AvailabilityStatusesClient object. */ - MetadatasClient getMetadatas(); + AvailabilityStatusesClient getAvailabilityStatuses(); /** - * Gets the ImpactedResourcesClient object to access its operations. + * Gets the ChildAvailabilityStatusesClient object to access its operations. * - * @return the ImpactedResourcesClient object. + * @return the ChildAvailabilityStatusesClient object. */ - ImpactedResourcesClient getImpactedResources(); + ChildAvailabilityStatusesClient getChildAvailabilityStatuses(); /** - * Gets the SecurityAdvisoryImpactedResourcesClient object to access its operations. + * Gets the ImpactedResourcesClient object to access its operations. * - * @return the SecurityAdvisoryImpactedResourcesClient object. + * @return the ImpactedResourcesClient object. */ - SecurityAdvisoryImpactedResourcesClient getSecurityAdvisoryImpactedResources(); + ImpactedResourcesClient getImpactedResources(); /** - * Gets the EventsOperationsClient object to access its operations. + * Gets the MetadatasClient object to access its operations. * - * @return the EventsOperationsClient object. + * @return the MetadatasClient object. */ - EventsOperationsClient getEventsOperations(); + MetadatasClient getMetadatas(); /** * Gets the EventOperationsClient object to access its operations. @@ -96,18 +89,18 @@ public interface MicrosoftResourceHealth { EventOperationsClient getEventOperations(); /** - * Gets the ChildAvailabilityStatusesClient object to access its operations. + * Gets the EventsOperationsClient object to access its operations. * - * @return the ChildAvailabilityStatusesClient object. + * @return the EventsOperationsClient object. */ - ChildAvailabilityStatusesClient getChildAvailabilityStatuses(); + EventsOperationsClient getEventsOperations(); /** - * Gets the ChildResourcesClient object to access its operations. + * Gets the SecurityAdvisoryImpactedResourcesClient object to access its operations. * - * @return the ChildResourcesClient object. + * @return the SecurityAdvisoryImpactedResourcesClient object. */ - ChildResourcesClient getChildResources(); + SecurityAdvisoryImpactedResourcesClient getSecurityAdvisoryImpactedResources(); /** * Gets the EmergingIssuesClient object to access its operations. @@ -115,4 +108,11 @@ public interface MicrosoftResourceHealth { * @return the EmergingIssuesClient object. */ EmergingIssuesClient getEmergingIssues(); + + /** + * Gets the ChildResourcesClient object to access its operations. + * + * @return the ChildResourcesClient object. + */ + ChildResourcesClient getChildResources(); } diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/OperationsClient.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/OperationsClient.java index a001f93be7b21..b644cf3289d7f 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/OperationsClient.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/OperationsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.fluent; diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/SecurityAdvisoryImpactedResourcesClient.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/SecurityAdvisoryImpactedResourcesClient.java index 5aae2ddd3f511..59c32cf44b33f 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/SecurityAdvisoryImpactedResourcesClient.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/SecurityAdvisoryImpactedResourcesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.fluent; diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/AvailabilityStatusInner.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/AvailabilityStatusInner.java index 30163b79d879c..dc8811245e524 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/AvailabilityStatusInner.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/AvailabilityStatusInner.java @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.resourcemanager.resourcehealth.models.AvailabilityStatusProperties; @@ -15,97 +15,46 @@ /** * availabilityStatus of a resource. */ -@Fluent -public final class AvailabilityStatusInner implements JsonSerializable { +@Immutable +public final class AvailabilityStatusInner extends ProxyResource { /* - * Azure Resource Manager Identity for the availabilityStatuses resource. + * Properties of availability state. */ - private String id; + private AvailabilityStatusProperties properties; /* - * current. + * Azure Resource Manager geo location of the resource. */ - private String name; + private String location; /* - * Microsoft.ResourceHealth/AvailabilityStatuses. + * Azure Resource Manager Identity for the availabilityStatuses resource. */ - private String type; + private String id; /* - * Azure Resource Manager geo location of the resource. + * The name property. */ - private String location; + private String name; /* - * Properties of availability state. + * Microsoft.ResourceHealth/AvailabilityStatuses. */ - private AvailabilityStatusProperties properties; + private String type; /** * Creates an instance of AvailabilityStatusInner class. */ - public AvailabilityStatusInner() { - } - - /** - * Get the id property: Azure Resource Manager Identity for the availabilityStatuses resource. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Azure Resource Manager Identity for the availabilityStatuses resource. - * - * @param id the id value to set. - * @return the AvailabilityStatusInner object itself. - */ - public AvailabilityStatusInner withId(String id) { - this.id = id; - return this; - } - - /** - * Get the name property: current. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: current. - * - * @param name the name value to set. - * @return the AvailabilityStatusInner object itself. - */ - public AvailabilityStatusInner withName(String name) { - this.name = name; - return this; + private AvailabilityStatusInner() { } /** - * Get the type property: Microsoft.ResourceHealth/AvailabilityStatuses. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: Microsoft.ResourceHealth/AvailabilityStatuses. + * Get the properties property: Properties of availability state. * - * @param type the type value to set. - * @return the AvailabilityStatusInner object itself. + * @return the properties value. */ - public AvailabilityStatusInner withType(String type) { - this.type = type; - return this; + public AvailabilityStatusProperties properties() { + return this.properties; } /** @@ -118,45 +67,30 @@ public String location() { } /** - * Set the location property: Azure Resource Manager geo location of the resource. - * - * @param location the location value to set. - * @return the AvailabilityStatusInner object itself. - */ - public AvailabilityStatusInner withLocation(String location) { - this.location = location; - return this; - } - - /** - * Get the properties property: Properties of availability state. + * Get the id property: Azure Resource Manager Identity for the availabilityStatuses resource. * - * @return the properties value. + * @return the id value. */ - public AvailabilityStatusProperties properties() { - return this.properties; + public String id() { + return this.id; } /** - * Set the properties property: Properties of availability state. + * Get the name property: The name property. * - * @param properties the properties value to set. - * @return the AvailabilityStatusInner object itself. + * @return the name value. */ - public AvailabilityStatusInner withProperties(AvailabilityStatusProperties properties) { - this.properties = properties; - return this; + public String name() { + return this.name; } /** - * Validates the instance. + * Get the type property: Microsoft.ResourceHealth/AvailabilityStatuses. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the type value. */ - public void validate() { - if (properties() != null) { - properties().validate(); - } + public String type() { + return this.type; } /** @@ -165,11 +99,11 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeStringField("location", this.location); jsonWriter.writeStringField("id", this.id); jsonWriter.writeStringField("name", this.name); jsonWriter.writeStringField("type", this.type); - jsonWriter.writeStringField("location", this.location); - jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -188,16 +122,16 @@ public static AvailabilityStatusInner fromJson(JsonReader jsonReader) throws IOE String fieldName = reader.getFieldName(); reader.nextToken(); - if ("id".equals(fieldName)) { + if ("properties".equals(fieldName)) { + deserializedAvailabilityStatusInner.properties = AvailabilityStatusProperties.fromJson(reader); + } else if ("location".equals(fieldName)) { + deserializedAvailabilityStatusInner.location = reader.getString(); + } else if ("id".equals(fieldName)) { deserializedAvailabilityStatusInner.id = reader.getString(); } else if ("name".equals(fieldName)) { deserializedAvailabilityStatusInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedAvailabilityStatusInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedAvailabilityStatusInner.location = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedAvailabilityStatusInner.properties = AvailabilityStatusProperties.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EmergingIssue.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EmergingIssue.java index d6262c5acb5f6..9122562ca8ae0 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EmergingIssue.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EmergingIssue.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -20,7 +20,7 @@ /** * On-going emerging issue from azure status. */ -@Fluent +@Immutable public final class EmergingIssue implements JsonSerializable { /* * Timestamp for when last time refreshed for ongoing emerging issue. @@ -40,7 +40,7 @@ public final class EmergingIssue implements JsonSerializable { /** * Creates an instance of EmergingIssue class. */ - public EmergingIssue() { + private EmergingIssue() { } /** @@ -52,17 +52,6 @@ public OffsetDateTime refreshTimestamp() { return this.refreshTimestamp; } - /** - * Set the refreshTimestamp property: Timestamp for when last time refreshed for ongoing emerging issue. - * - * @param refreshTimestamp the refreshTimestamp value to set. - * @return the EmergingIssue object itself. - */ - public EmergingIssue withRefreshTimestamp(OffsetDateTime refreshTimestamp) { - this.refreshTimestamp = refreshTimestamp; - return this; - } - /** * Get the statusBanners property: The list of emerging issues of banner type. * @@ -72,17 +61,6 @@ public List statusBanners() { return this.statusBanners; } - /** - * Set the statusBanners property: The list of emerging issues of banner type. - * - * @param statusBanners the statusBanners value to set. - * @return the EmergingIssue object itself. - */ - public EmergingIssue withStatusBanners(List statusBanners) { - this.statusBanners = statusBanners; - return this; - } - /** * Get the statusActiveEvents property: The list of emerging issues of active event type. * @@ -92,31 +70,6 @@ public List statusActiveEvents() { return this.statusActiveEvents; } - /** - * Set the statusActiveEvents property: The list of emerging issues of active event type. - * - * @param statusActiveEvents the statusActiveEvents value to set. - * @return the EmergingIssue object itself. - */ - public EmergingIssue withStatusActiveEvents(List statusActiveEvents) { - this.statusActiveEvents = statusActiveEvents; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (statusBanners() != null) { - statusBanners().forEach(e -> e.validate()); - } - if (statusActiveEvents() != null) { - statusActiveEvents().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EmergingIssuesGetResultInner.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EmergingIssuesGetResultInner.java index 5d8db4ddd8961..e89914ad2973c 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EmergingIssuesGetResultInner.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EmergingIssuesGetResultInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; @@ -19,7 +19,7 @@ /** * The Get EmergingIssues operation response. */ -@Fluent +@Immutable public final class EmergingIssuesGetResultInner extends ProxyResource { /* * The emerging issue entity properties. @@ -49,7 +49,7 @@ public final class EmergingIssuesGetResultInner extends ProxyResource { /** * Creates an instance of EmergingIssuesGetResultInner class. */ - public EmergingIssuesGetResultInner() { + private EmergingIssuesGetResultInner() { } /** @@ -109,20 +109,6 @@ public OffsetDateTime refreshTimestamp() { return this.innerProperties() == null ? null : this.innerProperties().refreshTimestamp(); } - /** - * Set the refreshTimestamp property: Timestamp for when last time refreshed for ongoing emerging issue. - * - * @param refreshTimestamp the refreshTimestamp value to set. - * @return the EmergingIssuesGetResultInner object itself. - */ - public EmergingIssuesGetResultInner withRefreshTimestamp(OffsetDateTime refreshTimestamp) { - if (this.innerProperties() == null) { - this.innerProperties = new EmergingIssue(); - } - this.innerProperties().withRefreshTimestamp(refreshTimestamp); - return this; - } - /** * Get the statusBanners property: The list of emerging issues of banner type. * @@ -132,20 +118,6 @@ public List statusBanners() { return this.innerProperties() == null ? null : this.innerProperties().statusBanners(); } - /** - * Set the statusBanners property: The list of emerging issues of banner type. - * - * @param statusBanners the statusBanners value to set. - * @return the EmergingIssuesGetResultInner object itself. - */ - public EmergingIssuesGetResultInner withStatusBanners(List statusBanners) { - if (this.innerProperties() == null) { - this.innerProperties = new EmergingIssue(); - } - this.innerProperties().withStatusBanners(statusBanners); - return this; - } - /** * Get the statusActiveEvents property: The list of emerging issues of active event type. * @@ -155,31 +127,6 @@ public List statusActiveEvents() { return this.innerProperties() == null ? null : this.innerProperties().statusActiveEvents(); } - /** - * Set the statusActiveEvents property: The list of emerging issues of active event type. - * - * @param statusActiveEvents the statusActiveEvents value to set. - * @return the EmergingIssuesGetResultInner object itself. - */ - public EmergingIssuesGetResultInner withStatusActiveEvents(List statusActiveEvents) { - if (this.innerProperties() == null) { - this.innerProperties = new EmergingIssue(); - } - this.innerProperties().withStatusActiveEvents(statusActiveEvents); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ 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 85b243165baad..c0ed5150810b5 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; @@ -17,7 +17,7 @@ /** * Impacted resource for an event. */ -@Fluent +@Immutable public final class EventImpactedResourceInner extends ProxyResource { /* * Properties of impacted resource. @@ -47,7 +47,7 @@ public final class EventImpactedResourceInner extends ProxyResource { /** * Creates an instance of EventImpactedResourceInner class. */ - public EventImpactedResourceInner() { + private EventImpactedResourceInner() { } /** @@ -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. * @@ -179,31 +134,6 @@ public List info() { return this.innerProperties() == null ? null : this.innerProperties().info(); } - /** - * Set the info property: Additional information. - * - * @param info the info value to set. - * @return the EventImpactedResourceInner object itself. - */ - public EventImpactedResourceInner withInfo(List info) { - if (this.innerProperties() == null) { - this.innerProperties = new EventImpactedResourceProperties(); - } - this.innerProperties().withInfo(info); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ 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 6c1c5910be76f..37ff43b0a965f 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * Properties of impacted resource. */ -@Fluent +@Immutable public final class EventImpactedResourceProperties implements JsonSerializable { /* * Resource type within Microsoft cloud. @@ -33,31 +33,6 @@ public final class EventImpactedResourceProperties implements JsonSerializable info() { return this.info; } - /** - * Set the info property: Additional information. - * - * @param info the info value to set. - * @return the EventImpactedResourceProperties object itself. - */ - public EventImpactedResourceProperties withInfo(List info) { - this.info = info; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (info() != null) { - info().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -204,16 +112,6 @@ public static EventImpactedResourceProperties fromJson(JsonReader jsonReader) th deserializedEventImpactedResourceProperties.targetResourceId = reader.getString(); } else if ("targetRegion".equals(fieldName)) { deserializedEventImpactedResourceProperties.targetRegion = reader.getString(); - } else if ("resourceName".equals(fieldName)) { - deserializedEventImpactedResourceProperties.resourceName = reader.getString(); - } else if ("resourceGroup".equals(fieldName)) { - deserializedEventImpactedResourceProperties.resourceGroup = reader.getString(); - } else if ("status".equals(fieldName)) { - deserializedEventImpactedResourceProperties.status = reader.getString(); - } else if ("maintenanceStartTime".equals(fieldName)) { - deserializedEventImpactedResourceProperties.maintenanceStartTime = reader.getString(); - } else if ("maintenanceEndTime".equals(fieldName)) { - deserializedEventImpactedResourceProperties.maintenanceEndTime = reader.getString(); } else if ("info".equals(fieldName)) { List 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 e26a5f1fb6c70..d04a630dbf078 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 @@ -1,15 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.resourcehealth.models.ApiOperationLink; import com.azure.resourcemanager.resourcehealth.models.EventLevelValues; import com.azure.resourcemanager.resourcehealth.models.EventPropertiesAdditionalInformation; import com.azure.resourcemanager.resourcehealth.models.EventPropertiesArticle; @@ -29,7 +30,7 @@ /** * Service health event. */ -@Fluent +@Immutable public final class EventInner extends ProxyResource { /* * Properties of event. @@ -59,7 +60,7 @@ public final class EventInner extends ProxyResource { /** * Creates an instance of EventInner class. */ - public EventInner() { + private EventInner() { } /** @@ -120,22 +121,7 @@ public EventTypeValues eventType() { } /** - * Set the eventType property: Type of event. - * - * @param eventType the eventType value to set. - * @return the EventInner object itself. - */ - public EventInner withEventType(EventTypeValues eventType) { - if (this.innerProperties() == null) { - this.innerProperties = new EventProperties(); - } - this.innerProperties().withEventType(eventType); - return this; - } - - /** - * Get the eventSubType property: Sub type of the event. Currently used to determine retirement communications for - * health advisory events. + * Get the eventSubType property: Sub-type of event. * * @return the eventSubType value. */ @@ -144,18 +130,13 @@ public EventSubTypeValues eventSubType() { } /** - * Set the eventSubType property: Sub type of the event. Currently used to determine retirement communications for - * health advisory events. + * Get the advisorRecommendations property: Operation for listing Advisor recommendations associated with this + * event's tracking ID in the response subscription. * - * @param eventSubType the eventSubType value to set. - * @return the EventInner object itself. + * @return the advisorRecommendations value. */ - public EventInner withEventSubType(EventSubTypeValues eventSubType) { - if (this.innerProperties() == null) { - this.innerProperties = new EventProperties(); - } - this.innerProperties().withEventSubType(eventSubType); - return this; + public ApiOperationLink advisorRecommendations() { + return this.innerProperties() == null ? null : this.innerProperties().advisorRecommendations(); } /** @@ -167,20 +148,6 @@ public EventSourceValues eventSource() { return this.innerProperties() == null ? null : this.innerProperties().eventSource(); } - /** - * Set the eventSource property: Source of event. - * - * @param eventSource the eventSource value to set. - * @return the EventInner object itself. - */ - public EventInner withEventSource(EventSourceValues eventSource) { - if (this.innerProperties() == null) { - this.innerProperties = new EventProperties(); - } - this.innerProperties().withEventSource(eventSource); - return this; - } - /** * Get the status property: Current status of event. * @@ -190,20 +157,6 @@ public EventStatusValues status() { return this.innerProperties() == null ? null : this.innerProperties().status(); } - /** - * Set the status property: Current status of event. - * - * @param status the status value to set. - * @return the EventInner object itself. - */ - public EventInner withStatus(EventStatusValues status) { - if (this.innerProperties() == null) { - this.innerProperties = new EventProperties(); - } - this.innerProperties().withStatus(status); - return this; - } - /** * Get the title property: Title text of event. * @@ -214,21 +167,8 @@ public String title() { } /** - * Set the title property: Title text of event. - * - * @param title the title value to set. - * @return the EventInner object itself. - */ - public EventInner withTitle(String title) { - if (this.innerProperties() == null) { - this.innerProperties = new EventProperties(); - } - this.innerProperties().withTitle(title); - return this; - } - - /** - * 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. */ @@ -236,20 +176,6 @@ public String summary() { return this.innerProperties() == null ? null : this.innerProperties().summary(); } - /** - * Set the summary property: Summary text of event. - * - * @param summary the summary value to set. - * @return the EventInner object itself. - */ - public EventInner withSummary(String summary) { - if (this.innerProperties() == null) { - this.innerProperties = new EventProperties(); - } - this.innerProperties().withSummary(summary); - return this; - } - /** * Get the headerProperty property: Header text of event. * @@ -259,20 +185,6 @@ public String headerProperty() { return this.innerProperties() == null ? null : this.innerProperties().headerProperty(); } - /** - * Set the headerProperty property: Header text of event. - * - * @param headerProperty the headerProperty value to set. - * @return the EventInner object itself. - */ - public EventInner withHeaderProperty(String headerProperty) { - if (this.innerProperties() == null) { - this.innerProperties = new EventProperties(); - } - this.innerProperties().withHeaderProperty(headerProperty); - return this; - } - /** * Get the level property: Level of insight. * @@ -282,20 +194,6 @@ public LevelValues level() { return this.innerProperties() == null ? null : this.innerProperties().level(); } - /** - * Set the level property: Level of insight. - * - * @param level the level value to set. - * @return the EventInner object itself. - */ - public EventInner withLevel(LevelValues level) { - if (this.innerProperties() == null) { - this.innerProperties = new EventProperties(); - } - this.innerProperties().withLevel(level); - return this; - } - /** * Get the eventLevel property: Level of event. * @@ -306,17 +204,14 @@ public EventLevelValues eventLevel() { } /** - * Set the eventLevel property: Level of event. + * 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. * - * @param eventLevel the eventLevel value to set. - * @return the EventInner object itself. + * @return the isEventSensitive value. */ - public EventInner withEventLevel(EventLevelValues eventLevel) { - if (this.innerProperties() == null) { - this.innerProperties = new EventProperties(); - } - this.innerProperties().withEventLevel(eventLevel); - return this; + public Boolean isEventSensitive() { + return this.innerProperties() == null ? null : this.innerProperties().isEventSensitive(); } /** @@ -328,20 +223,6 @@ public String externalIncidentId() { return this.innerProperties() == null ? null : this.innerProperties().externalIncidentId(); } - /** - * Set the externalIncidentId property: The id of the Incident. - * - * @param externalIncidentId the externalIncidentId value to set. - * @return the EventInner object itself. - */ - public EventInner withExternalIncidentId(String externalIncidentId) { - if (this.innerProperties() == null) { - this.innerProperties = new EventProperties(); - } - this.innerProperties().withExternalIncidentId(externalIncidentId); - return this; - } - /** * Get the reason property: The reason for the Incident. * @@ -351,20 +232,6 @@ public String reason() { return this.innerProperties() == null ? null : this.innerProperties().reason(); } - /** - * Set the reason property: The reason for the Incident. - * - * @param reason the reason value to set. - * @return the EventInner object itself. - */ - public EventInner withReason(String reason) { - if (this.innerProperties() == null) { - this.innerProperties = new EventProperties(); - } - this.innerProperties().withReason(reason); - return this; - } - /** * Get the article property: Article of event. * @@ -374,20 +241,6 @@ public EventPropertiesArticle article() { return this.innerProperties() == null ? null : this.innerProperties().article(); } - /** - * Set the article property: Article of event. - * - * @param article the article value to set. - * @return the EventInner object itself. - */ - public EventInner withArticle(EventPropertiesArticle article) { - if (this.innerProperties() == null) { - this.innerProperties = new EventProperties(); - } - this.innerProperties().withArticle(article); - return this; - } - /** * Get the links property: Useful links of event. * @@ -397,20 +250,6 @@ public List links() { return this.innerProperties() == null ? null : this.innerProperties().links(); } - /** - * Set the links property: Useful links of event. - * - * @param links the links value to set. - * @return the EventInner object itself. - */ - public EventInner withLinks(List links) { - if (this.innerProperties() == null) { - this.innerProperties = new EventProperties(); - } - this.innerProperties().withLinks(links); - return this; - } - /** * Get the impactStartTime property: It provides the Timestamp for when the health impacting event started. * @@ -420,20 +259,6 @@ public OffsetDateTime impactStartTime() { return this.innerProperties() == null ? null : this.innerProperties().impactStartTime(); } - /** - * Set the impactStartTime property: It provides the Timestamp for when the health impacting event started. - * - * @param impactStartTime the impactStartTime value to set. - * @return the EventInner object itself. - */ - public EventInner withImpactStartTime(OffsetDateTime impactStartTime) { - if (this.innerProperties() == null) { - this.innerProperties = new EventProperties(); - } - this.innerProperties().withImpactStartTime(impactStartTime); - return this; - } - /** * Get the impactMitigationTime property: It provides the Timestamp for when the health impacting event resolved. * @@ -443,20 +268,6 @@ public OffsetDateTime impactMitigationTime() { return this.innerProperties() == null ? null : this.innerProperties().impactMitigationTime(); } - /** - * Set the impactMitigationTime property: It provides the Timestamp for when the health impacting event resolved. - * - * @param impactMitigationTime the impactMitigationTime value to set. - * @return the EventInner object itself. - */ - public EventInner withImpactMitigationTime(OffsetDateTime impactMitigationTime) { - if (this.innerProperties() == null) { - this.innerProperties = new EventProperties(); - } - this.innerProperties().withImpactMitigationTime(impactMitigationTime); - return this; - } - /** * Get the impact property: List services impacted by the service health event. * @@ -466,20 +277,6 @@ public List impact() { return this.innerProperties() == null ? null : this.innerProperties().impact(); } - /** - * Set the impact property: List services impacted by the service health event. - * - * @param impact the impact value to set. - * @return the EventInner object itself. - */ - public EventInner withImpact(List impact) { - if (this.innerProperties() == null) { - this.innerProperties = new EventProperties(); - } - this.innerProperties().withImpact(impact); - return this; - } - /** * Get the recommendedActions property: Recommended actions of event. * @@ -489,20 +286,6 @@ public EventPropertiesRecommendedActions recommendedActions() { return this.innerProperties() == null ? null : this.innerProperties().recommendedActions(); } - /** - * Set the recommendedActions property: Recommended actions of event. - * - * @param recommendedActions the recommendedActions value to set. - * @return the EventInner object itself. - */ - public EventInner withRecommendedActions(EventPropertiesRecommendedActions recommendedActions) { - if (this.innerProperties() == null) { - this.innerProperties = new EventProperties(); - } - this.innerProperties().withRecommendedActions(recommendedActions); - return this; - } - /** * Get the faqs property: Frequently asked questions for the service health event. * @@ -512,20 +295,6 @@ public List faqs() { return this.innerProperties() == null ? null : this.innerProperties().faqs(); } - /** - * Set the faqs property: Frequently asked questions for the service health event. - * - * @param faqs the faqs value to set. - * @return the EventInner object itself. - */ - public EventInner withFaqs(List faqs) { - if (this.innerProperties() == null) { - this.innerProperties = new EventProperties(); - } - this.innerProperties().withFaqs(faqs); - return this; - } - /** * Get the isHir property: It provides information if the event is High incident rate event or not. * @@ -535,20 +304,6 @@ public Boolean isHir() { return this.innerProperties() == null ? null : this.innerProperties().isHir(); } - /** - * Set the isHir property: It provides information if the event is High incident rate event or not. - * - * @param isHir the isHir value to set. - * @return the EventInner object itself. - */ - public EventInner withIsHir(Boolean isHir) { - if (this.innerProperties() == null) { - this.innerProperties = new EventProperties(); - } - this.innerProperties().withIsHir(isHir); - return this; - } - /** * Get the enableMicrosoftSupport property: Tells if we want to enable or disable Microsoft Support for this event. * @@ -558,23 +313,9 @@ public Boolean enableMicrosoftSupport() { return this.innerProperties() == null ? null : this.innerProperties().enableMicrosoftSupport(); } - /** - * Set the enableMicrosoftSupport property: Tells if we want to enable or disable Microsoft Support for this event. - * - * @param enableMicrosoftSupport the enableMicrosoftSupport value to set. - * @return the EventInner object itself. - */ - public EventInner withEnableMicrosoftSupport(Boolean enableMicrosoftSupport) { - if (this.innerProperties() == null) { - this.innerProperties = new EventProperties(); - } - this.innerProperties().withEnableMicrosoftSupport(enableMicrosoftSupport); - return this; - } - /** * 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. */ @@ -582,21 +323,6 @@ public String description() { return this.innerProperties() == null ? null : this.innerProperties().description(); } - /** - * Set the description property: Contains the communication message for the event, that could include summary, root - * cause and other details. - * - * @param description the description value to set. - * @return the EventInner object itself. - */ - public EventInner withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new EventProperties(); - } - this.innerProperties().withDescription(description); - return this; - } - /** * Get the platformInitiated property: Is true if the event is platform initiated. * @@ -606,20 +332,6 @@ public Boolean platformInitiated() { return this.innerProperties() == null ? null : this.innerProperties().platformInitiated(); } - /** - * Set the platformInitiated property: Is true if the event is platform initiated. - * - * @param platformInitiated the platformInitiated value to set. - * @return the EventInner object itself. - */ - public EventInner withPlatformInitiated(Boolean platformInitiated) { - if (this.innerProperties() == null) { - this.innerProperties = new EventProperties(); - } - this.innerProperties().withPlatformInitiated(platformInitiated); - return this; - } - /** * Get the enableChatWithUs property: Tells if we want to enable or disable Microsoft Support for this event. * @@ -629,20 +341,6 @@ public Boolean enableChatWithUs() { return this.innerProperties() == null ? null : this.innerProperties().enableChatWithUs(); } - /** - * Set the enableChatWithUs property: Tells if we want to enable or disable Microsoft Support for this event. - * - * @param enableChatWithUs the enableChatWithUs value to set. - * @return the EventInner object itself. - */ - public EventInner withEnableChatWithUs(Boolean enableChatWithUs) { - if (this.innerProperties() == null) { - this.innerProperties = new EventProperties(); - } - this.innerProperties().withEnableChatWithUs(enableChatWithUs); - return this; - } - /** * Get the priority property: Priority level of the event. Has value from 0 to 23. 0 is the highest priority. * Service issue events have higher priority followed by planned maintenance and health advisory. Critical events @@ -655,23 +353,6 @@ public Integer priority() { return this.innerProperties() == null ? null : this.innerProperties().priority(); } - /** - * Set the priority property: Priority level of the event. Has value from 0 to 23. 0 is the highest priority. - * Service issue events have higher priority followed by planned maintenance and health advisory. Critical events - * have higher priority followed by error, warning and informational. Furthermore, active events have higher - * priority than resolved. - * - * @param priority the priority value to set. - * @return the EventInner object itself. - */ - public EventInner withPriority(Integer priority) { - if (this.innerProperties() == null) { - this.innerProperties = new EventProperties(); - } - this.innerProperties().withPriority(priority); - return this; - } - /** * Get the lastUpdateTime property: It provides the Timestamp for when the health impacting event was last updated. * @@ -681,20 +362,6 @@ public OffsetDateTime lastUpdateTime() { return this.innerProperties() == null ? null : this.innerProperties().lastUpdateTime(); } - /** - * Set the lastUpdateTime property: It provides the Timestamp for when the health impacting event was last updated. - * - * @param lastUpdateTime the lastUpdateTime value to set. - * @return the EventInner object itself. - */ - public EventInner withLastUpdateTime(OffsetDateTime lastUpdateTime) { - if (this.innerProperties() == null) { - this.innerProperties = new EventProperties(); - } - this.innerProperties().withLastUpdateTime(lastUpdateTime); - return this; - } - /** * Get the hirStage property: Stage for HIR Document. * @@ -704,20 +371,6 @@ public String hirStage() { return this.innerProperties() == null ? null : this.innerProperties().hirStage(); } - /** - * Set the hirStage property: Stage for HIR Document. - * - * @param hirStage the hirStage value to set. - * @return the EventInner object itself. - */ - public EventInner withHirStage(String hirStage) { - if (this.innerProperties() == null) { - this.innerProperties = new EventProperties(); - } - this.innerProperties().withHirStage(hirStage); - return this; - } - /** * Get the additionalInformation property: Additional information. * @@ -727,20 +380,6 @@ public EventPropertiesAdditionalInformation additionalInformation() { return this.innerProperties() == null ? null : this.innerProperties().additionalInformation(); } - /** - * Set the additionalInformation property: Additional information. - * - * @param additionalInformation the additionalInformation value to set. - * @return the EventInner object itself. - */ - public EventInner withAdditionalInformation(EventPropertiesAdditionalInformation additionalInformation) { - if (this.innerProperties() == null) { - this.innerProperties = new EventProperties(); - } - this.innerProperties().withAdditionalInformation(additionalInformation); - return this; - } - /** * Get the duration property: duration in seconds. * @@ -750,20 +389,6 @@ public Integer duration() { return this.innerProperties() == null ? null : this.innerProperties().duration(); } - /** - * Set the duration property: duration in seconds. - * - * @param duration the duration value to set. - * @return the EventInner object itself. - */ - public EventInner withDuration(Integer duration) { - if (this.innerProperties() == null) { - this.innerProperties = new EventProperties(); - } - this.innerProperties().withDuration(duration); - return this; - } - /** * Get the impactType property: The type of the impact. * @@ -774,99 +399,58 @@ public String impactType() { } /** - * Set the impactType property: The type of the impact. - * - * @param impactType the impactType value to set. - * @return the EventInner object itself. - */ - public EventInner withImpactType(String impactType) { - if (this.innerProperties() == null) { - this.innerProperties = new EventProperties(); - } - this.innerProperties().withImpactType(impactType); - return this; - } - - /** - * 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. + * 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 maintenanceType value. + * @return the eventTags value. */ - public String maintenanceType() { - return this.innerProperties() == null ? null : this.innerProperties().maintenanceType(); + public List eventTags() { + return this.innerProperties() == null ? null : this.innerProperties().eventTags(); } /** - * Set the maintenanceType property: The type of planned maintenance event. + * Get the newRate property: Billing rate change information - new rate. * - * @param maintenanceType the maintenanceType value to set. - * @return the EventInner object itself. + * @return the newRate value. */ - public EventInner withMaintenanceType(String maintenanceType) { - if (this.innerProperties() == null) { - this.innerProperties = new EventProperties(); - } - this.innerProperties().withMaintenanceType(maintenanceType); - return this; + public Double newRate() { + return this.innerProperties() == null ? null : this.innerProperties().newRate(); } /** - * Get the argQuery property: Azure Resource Graph query to fetch the affected resources from their existing Azure - * Resource Graph locations. + * Get the oldRate property: Billing rate change information - old rate. * - * @return the argQuery value. + * @return the oldRate value. */ - public String argQuery() { - return this.innerProperties() == null ? null : this.innerProperties().argQuery(); + public Double oldRate() { + return this.innerProperties() == null ? null : this.innerProperties().oldRate(); } /** - * Set the argQuery property: Azure Resource Graph query to fetch the affected resources from their existing Azure - * Resource Graph locations. + * Get the currencyType property: Billing currency type information. Example: USD, CAD. * - * @param argQuery the argQuery value to set. - * @return the EventInner object itself. + * @return the currencyType value. */ - public EventInner withArgQuery(String argQuery) { - if (this.innerProperties() == null) { - this.innerProperties = new EventProperties(); - } - this.innerProperties().withArgQuery(argQuery); - return this; + public String currencyType() { + return this.innerProperties() == null ? null : this.innerProperties().currencyType(); } /** - * Validates the instance. + * Get the billingId property: Billing identifier information. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the billingId value. */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } + public String billingId() { + return this.innerProperties() == null ? null : this.innerProperties().billingId(); } /** 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 c4959ce3e569c..7e5a167ff0043 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 @@ -1,15 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.resourcehealth.models.ApiOperationLink; import com.azure.resourcemanager.resourcehealth.models.EventLevelValues; import com.azure.resourcemanager.resourcehealth.models.EventPropertiesAdditionalInformation; import com.azure.resourcemanager.resourcehealth.models.EventPropertiesArticle; @@ -30,7 +31,7 @@ /** * Properties of event. */ -@Fluent +@Immutable public final class EventProperties implements JsonSerializable { /* * Type of event. @@ -38,10 +39,16 @@ public final class EventProperties implements JsonSerializable private EventTypeValues eventType; /* - * Sub type of the event. Currently used to determine retirement communications for health advisory events + * Sub-type of event. */ private EventSubTypeValues eventSubType; + /* + * Operation for listing Advisor recommendations associated with this event's tracking ID in the response + * subscription. + */ + private ApiOperationLink advisorRecommendations; + /* * Source of event. */ @@ -58,7 +65,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 +84,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 +147,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,24 +195,44 @@ 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 List eventTags; + + /* + * Billing rate change information - new rate + */ + private Double newRate; + + /* + * Billing rate change information - old rate */ - private String maintenanceId; + private Double oldRate; /* - * The type of planned maintenance event. + * Billing currency type information. Example: USD, CAD */ - private String maintenanceType; + private String currencyType; /* - * Azure Resource Graph query to fetch the affected resources from their existing Azure Resource Graph locations. + * Billing identifier information. */ - private String argQuery; + private String billingId; /** * Creates an instance of EventProperties class. */ - public EventProperties() { + private EventProperties() { } /** @@ -210,19 +245,7 @@ public EventTypeValues eventType() { } /** - * Set the eventType property: Type of event. - * - * @param eventType the eventType value to set. - * @return the EventProperties object itself. - */ - public EventProperties withEventType(EventTypeValues eventType) { - this.eventType = eventType; - return this; - } - - /** - * Get the eventSubType property: Sub type of the event. Currently used to determine retirement communications for - * health advisory events. + * Get the eventSubType property: Sub-type of event. * * @return the eventSubType value. */ @@ -231,15 +254,13 @@ public EventSubTypeValues eventSubType() { } /** - * Set the eventSubType property: Sub type of the event. Currently used to determine retirement communications for - * health advisory events. + * Get the advisorRecommendations property: Operation for listing Advisor recommendations associated with this + * event's tracking ID in the response subscription. * - * @param eventSubType the eventSubType value to set. - * @return the EventProperties object itself. + * @return the advisorRecommendations value. */ - public EventProperties withEventSubType(EventSubTypeValues eventSubType) { - this.eventSubType = eventSubType; - return this; + public ApiOperationLink advisorRecommendations() { + return this.advisorRecommendations; } /** @@ -251,17 +272,6 @@ public EventSourceValues eventSource() { return this.eventSource; } - /** - * Set the eventSource property: Source of event. - * - * @param eventSource the eventSource value to set. - * @return the EventProperties object itself. - */ - public EventProperties withEventSource(EventSourceValues eventSource) { - this.eventSource = eventSource; - return this; - } - /** * Get the status property: Current status of event. * @@ -271,17 +281,6 @@ public EventStatusValues status() { return this.status; } - /** - * Set the status property: Current status of event. - * - * @param status the status value to set. - * @return the EventProperties object itself. - */ - public EventProperties withStatus(EventStatusValues status) { - this.status = status; - return this; - } - /** * Get the title property: Title text of event. * @@ -292,18 +291,8 @@ public String title() { } /** - * Set the title property: Title text of event. - * - * @param title the title value to set. - * @return the EventProperties object itself. - */ - public EventProperties withTitle(String title) { - this.title = title; - return this; - } - - /** - * 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. */ @@ -311,17 +300,6 @@ public String summary() { return this.summary; } - /** - * Set the summary property: Summary text of event. - * - * @param summary the summary value to set. - * @return the EventProperties object itself. - */ - public EventProperties withSummary(String summary) { - this.summary = summary; - return this; - } - /** * Get the headerProperty property: Header text of event. * @@ -331,17 +309,6 @@ public String headerProperty() { return this.headerProperty; } - /** - * Set the headerProperty property: Header text of event. - * - * @param headerProperty the headerProperty value to set. - * @return the EventProperties object itself. - */ - public EventProperties withHeaderProperty(String headerProperty) { - this.headerProperty = headerProperty; - return this; - } - /** * Get the level property: Level of insight. * @@ -351,17 +318,6 @@ public LevelValues level() { return this.level; } - /** - * Set the level property: Level of insight. - * - * @param level the level value to set. - * @return the EventProperties object itself. - */ - public EventProperties withLevel(LevelValues level) { - this.level = level; - return this; - } - /** * Get the eventLevel property: Level of event. * @@ -372,14 +328,14 @@ public EventLevelValues eventLevel() { } /** - * Set the eventLevel property: Level of event. + * 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. * - * @param eventLevel the eventLevel value to set. - * @return the EventProperties object itself. + * @return the isEventSensitive value. */ - public EventProperties withEventLevel(EventLevelValues eventLevel) { - this.eventLevel = eventLevel; - return this; + public Boolean isEventSensitive() { + return this.isEventSensitive; } /** @@ -391,17 +347,6 @@ public String externalIncidentId() { return this.externalIncidentId; } - /** - * Set the externalIncidentId property: The id of the Incident. - * - * @param externalIncidentId the externalIncidentId value to set. - * @return the EventProperties object itself. - */ - public EventProperties withExternalIncidentId(String externalIncidentId) { - this.externalIncidentId = externalIncidentId; - return this; - } - /** * Get the reason property: The reason for the Incident. * @@ -411,17 +356,6 @@ public String reason() { return this.reason; } - /** - * Set the reason property: The reason for the Incident. - * - * @param reason the reason value to set. - * @return the EventProperties object itself. - */ - public EventProperties withReason(String reason) { - this.reason = reason; - return this; - } - /** * Get the article property: Article of event. * @@ -431,17 +365,6 @@ public EventPropertiesArticle article() { return this.article; } - /** - * Set the article property: Article of event. - * - * @param article the article value to set. - * @return the EventProperties object itself. - */ - public EventProperties withArticle(EventPropertiesArticle article) { - this.article = article; - return this; - } - /** * Get the links property: Useful links of event. * @@ -451,17 +374,6 @@ public List links() { return this.links; } - /** - * Set the links property: Useful links of event. - * - * @param links the links value to set. - * @return the EventProperties object itself. - */ - public EventProperties withLinks(List links) { - this.links = links; - return this; - } - /** * Get the impactStartTime property: It provides the Timestamp for when the health impacting event started. * @@ -471,17 +383,6 @@ public OffsetDateTime impactStartTime() { return this.impactStartTime; } - /** - * Set the impactStartTime property: It provides the Timestamp for when the health impacting event started. - * - * @param impactStartTime the impactStartTime value to set. - * @return the EventProperties object itself. - */ - public EventProperties withImpactStartTime(OffsetDateTime impactStartTime) { - this.impactStartTime = impactStartTime; - return this; - } - /** * Get the impactMitigationTime property: It provides the Timestamp for when the health impacting event resolved. * @@ -491,17 +392,6 @@ public OffsetDateTime impactMitigationTime() { return this.impactMitigationTime; } - /** - * Set the impactMitigationTime property: It provides the Timestamp for when the health impacting event resolved. - * - * @param impactMitigationTime the impactMitigationTime value to set. - * @return the EventProperties object itself. - */ - public EventProperties withImpactMitigationTime(OffsetDateTime impactMitigationTime) { - this.impactMitigationTime = impactMitigationTime; - return this; - } - /** * Get the impact property: List services impacted by the service health event. * @@ -511,17 +401,6 @@ public List impact() { return this.impact; } - /** - * Set the impact property: List services impacted by the service health event. - * - * @param impact the impact value to set. - * @return the EventProperties object itself. - */ - public EventProperties withImpact(List impact) { - this.impact = impact; - return this; - } - /** * Get the recommendedActions property: Recommended actions of event. * @@ -531,17 +410,6 @@ public EventPropertiesRecommendedActions recommendedActions() { return this.recommendedActions; } - /** - * Set the recommendedActions property: Recommended actions of event. - * - * @param recommendedActions the recommendedActions value to set. - * @return the EventProperties object itself. - */ - public EventProperties withRecommendedActions(EventPropertiesRecommendedActions recommendedActions) { - this.recommendedActions = recommendedActions; - return this; - } - /** * Get the faqs property: Frequently asked questions for the service health event. * @@ -551,17 +419,6 @@ public List faqs() { return this.faqs; } - /** - * Set the faqs property: Frequently asked questions for the service health event. - * - * @param faqs the faqs value to set. - * @return the EventProperties object itself. - */ - public EventProperties withFaqs(List faqs) { - this.faqs = faqs; - return this; - } - /** * Get the isHir property: It provides information if the event is High incident rate event or not. * @@ -571,17 +428,6 @@ public Boolean isHir() { return this.isHir; } - /** - * Set the isHir property: It provides information if the event is High incident rate event or not. - * - * @param isHir the isHir value to set. - * @return the EventProperties object itself. - */ - public EventProperties withIsHir(Boolean isHir) { - this.isHir = isHir; - return this; - } - /** * Get the enableMicrosoftSupport property: Tells if we want to enable or disable Microsoft Support for this event. * @@ -591,20 +437,9 @@ public Boolean enableMicrosoftSupport() { return this.enableMicrosoftSupport; } - /** - * Set the enableMicrosoftSupport property: Tells if we want to enable or disable Microsoft Support for this event. - * - * @param enableMicrosoftSupport the enableMicrosoftSupport value to set. - * @return the EventProperties object itself. - */ - public EventProperties withEnableMicrosoftSupport(Boolean enableMicrosoftSupport) { - this.enableMicrosoftSupport = enableMicrosoftSupport; - return this; - } - /** * 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. */ @@ -612,18 +447,6 @@ public String description() { return this.description; } - /** - * Set the description property: Contains the communication message for the event, that could include summary, root - * cause and other details. - * - * @param description the description value to set. - * @return the EventProperties object itself. - */ - public EventProperties withDescription(String description) { - this.description = description; - return this; - } - /** * Get the platformInitiated property: Is true if the event is platform initiated. * @@ -633,17 +456,6 @@ public Boolean platformInitiated() { return this.platformInitiated; } - /** - * Set the platformInitiated property: Is true if the event is platform initiated. - * - * @param platformInitiated the platformInitiated value to set. - * @return the EventProperties object itself. - */ - public EventProperties withPlatformInitiated(Boolean platformInitiated) { - this.platformInitiated = platformInitiated; - return this; - } - /** * Get the enableChatWithUs property: Tells if we want to enable or disable Microsoft Support for this event. * @@ -653,17 +465,6 @@ public Boolean enableChatWithUs() { return this.enableChatWithUs; } - /** - * Set the enableChatWithUs property: Tells if we want to enable or disable Microsoft Support for this event. - * - * @param enableChatWithUs the enableChatWithUs value to set. - * @return the EventProperties object itself. - */ - public EventProperties withEnableChatWithUs(Boolean enableChatWithUs) { - this.enableChatWithUs = enableChatWithUs; - return this; - } - /** * Get the priority property: Priority level of the event. Has value from 0 to 23. 0 is the highest priority. * Service issue events have higher priority followed by planned maintenance and health advisory. Critical events @@ -676,20 +477,6 @@ public Integer priority() { return this.priority; } - /** - * Set the priority property: Priority level of the event. Has value from 0 to 23. 0 is the highest priority. - * Service issue events have higher priority followed by planned maintenance and health advisory. Critical events - * have higher priority followed by error, warning and informational. Furthermore, active events have higher - * priority than resolved. - * - * @param priority the priority value to set. - * @return the EventProperties object itself. - */ - public EventProperties withPriority(Integer priority) { - this.priority = priority; - return this; - } - /** * Get the lastUpdateTime property: It provides the Timestamp for when the health impacting event was last updated. * @@ -699,17 +486,6 @@ public OffsetDateTime lastUpdateTime() { return this.lastUpdateTime; } - /** - * Set the lastUpdateTime property: It provides the Timestamp for when the health impacting event was last updated. - * - * @param lastUpdateTime the lastUpdateTime value to set. - * @return the EventProperties object itself. - */ - public EventProperties withLastUpdateTime(OffsetDateTime lastUpdateTime) { - this.lastUpdateTime = lastUpdateTime; - return this; - } - /** * Get the hirStage property: Stage for HIR Document. * @@ -719,17 +495,6 @@ public String hirStage() { return this.hirStage; } - /** - * Set the hirStage property: Stage for HIR Document. - * - * @param hirStage the hirStage value to set. - * @return the EventProperties object itself. - */ - public EventProperties withHirStage(String hirStage) { - this.hirStage = hirStage; - return this; - } - /** * Get the additionalInformation property: Additional information. * @@ -739,17 +504,6 @@ public EventPropertiesAdditionalInformation additionalInformation() { return this.additionalInformation; } - /** - * Set the additionalInformation property: Additional information. - * - * @param additionalInformation the additionalInformation value to set. - * @return the EventProperties object itself. - */ - public EventProperties withAdditionalInformation(EventPropertiesAdditionalInformation additionalInformation) { - this.additionalInformation = additionalInformation; - return this; - } - /** * Get the duration property: duration in seconds. * @@ -759,17 +513,6 @@ public Integer duration() { return this.duration; } - /** - * Set the duration property: duration in seconds. - * - * @param duration the duration value to set. - * @return the EventProperties object itself. - */ - public EventProperties withDuration(Integer duration) { - this.duration = duration; - return this; - } - /** * Get the impactType property: The type of the impact. * @@ -780,102 +523,58 @@ public String impactType() { } /** - * Set the impactType property: The type of the impact. - * - * @param impactType the impactType value to set. - * @return the EventProperties object itself. - */ - public EventProperties withImpactType(String impactType) { - this.impactType = impactType; - return this; - } - - /** - * 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. + * 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 maintenanceType value. + * @return the eventTags value. */ - public String maintenanceType() { - return this.maintenanceType; + public List eventTags() { + return this.eventTags; } /** - * Set the maintenanceType property: The type of planned maintenance event. + * Get the newRate property: Billing rate change information - new rate. * - * @param maintenanceType the maintenanceType value to set. - * @return the EventProperties object itself. + * @return the newRate value. */ - public EventProperties withMaintenanceType(String maintenanceType) { - this.maintenanceType = maintenanceType; - return this; + public Double newRate() { + return this.newRate; } /** - * Get the argQuery property: Azure Resource Graph query to fetch the affected resources from their existing Azure - * Resource Graph locations. + * Get the oldRate property: Billing rate change information - old rate. * - * @return the argQuery value. + * @return the oldRate value. */ - public String argQuery() { - return this.argQuery; + public Double oldRate() { + return this.oldRate; } /** - * Set the argQuery property: Azure Resource Graph query to fetch the affected resources from their existing Azure - * Resource Graph locations. + * Get the currencyType property: Billing currency type information. Example: USD, CAD. * - * @param argQuery the argQuery value to set. - * @return the EventProperties object itself. + * @return the currencyType value. */ - public EventProperties withArgQuery(String argQuery) { - this.argQuery = argQuery; - return this; + public String currencyType() { + return this.currencyType; } /** - * Validates the instance. + * Get the billingId property: Billing identifier information. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the billingId value. */ - public void validate() { - if (article() != null) { - article().validate(); - } - if (links() != null) { - links().forEach(e -> e.validate()); - } - if (impact() != null) { - impact().forEach(e -> e.validate()); - } - if (recommendedActions() != null) { - recommendedActions().validate(); - } - if (faqs() != null) { - faqs().forEach(e -> e.validate()); - } - if (additionalInformation() != null) { - additionalInformation().validate(); - } + public String billingId() { + return this.billingId; } /** @@ -893,6 +592,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 +618,11 @@ 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)); + jsonWriter.writeNumberField("newRate", this.newRate); + jsonWriter.writeNumberField("oldRate", this.oldRate); + jsonWriter.writeStringField("currencyType", this.currencyType); + jsonWriter.writeStringField("billingId", this.billingId); return jsonWriter.writeEndObject(); } @@ -943,6 +645,8 @@ public static EventProperties fromJson(JsonReader jsonReader) throws IOException deserializedEventProperties.eventType = EventTypeValues.fromString(reader.getString()); } else if ("eventSubType".equals(fieldName)) { deserializedEventProperties.eventSubType = EventSubTypeValues.fromString(reader.getString()); + } else if ("advisorRecommendations".equals(fieldName)) { + deserializedEventProperties.advisorRecommendations = ApiOperationLink.fromJson(reader); } else if ("eventSource".equals(fieldName)) { deserializedEventProperties.eventSource = EventSourceValues.fromString(reader.getString()); } else if ("status".equals(fieldName)) { @@ -957,6 +661,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 +710,17 @@ 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 if ("newRate".equals(fieldName)) { + deserializedEventProperties.newRate = reader.getNullable(JsonReader::getDouble); + } else if ("oldRate".equals(fieldName)) { + deserializedEventProperties.oldRate = reader.getNullable(JsonReader::getDouble); + } else if ("currencyType".equals(fieldName)) { + deserializedEventProperties.currencyType = reader.getString(); + } else if ("billingId".equals(fieldName)) { + deserializedEventProperties.billingId = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/MetadataEntityInner.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/MetadataEntityInner.java index 7538b51c21f2f..21ea23dc9acc9 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/MetadataEntityInner.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/MetadataEntityInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; @@ -18,7 +18,7 @@ /** * The metadata entity contract. */ -@Fluent +@Immutable public final class MetadataEntityInner extends ProxyResource { /* * The metadata entity properties. @@ -48,7 +48,7 @@ public final class MetadataEntityInner extends ProxyResource { /** * Creates an instance of MetadataEntityInner class. */ - public MetadataEntityInner() { + private MetadataEntityInner() { } /** @@ -108,20 +108,6 @@ public String displayName() { return this.innerProperties() == null ? null : this.innerProperties().displayName(); } - /** - * Set the displayName property: The display name. - * - * @param displayName the displayName value to set. - * @return the MetadataEntityInner object itself. - */ - public MetadataEntityInner withDisplayName(String displayName) { - if (this.innerProperties() == null) { - this.innerProperties = new MetadataEntityProperties(); - } - this.innerProperties().withDisplayName(displayName); - return this; - } - /** * Get the dependsOn property: The list of keys on which this entity depends on. * @@ -131,20 +117,6 @@ public List dependsOn() { return this.innerProperties() == null ? null : this.innerProperties().dependsOn(); } - /** - * Set the dependsOn property: The list of keys on which this entity depends on. - * - * @param dependsOn the dependsOn value to set. - * @return the MetadataEntityInner object itself. - */ - public MetadataEntityInner withDependsOn(List dependsOn) { - if (this.innerProperties() == null) { - this.innerProperties = new MetadataEntityProperties(); - } - this.innerProperties().withDependsOn(dependsOn); - return this; - } - /** * Get the applicableScenarios property: The list of scenarios applicable to this metadata entity. * @@ -154,20 +126,6 @@ public List applicableScenarios() { return this.innerProperties() == null ? null : this.innerProperties().applicableScenarios(); } - /** - * Set the applicableScenarios property: The list of scenarios applicable to this metadata entity. - * - * @param applicableScenarios the applicableScenarios value to set. - * @return the MetadataEntityInner object itself. - */ - public MetadataEntityInner withApplicableScenarios(List applicableScenarios) { - if (this.innerProperties() == null) { - this.innerProperties = new MetadataEntityProperties(); - } - this.innerProperties().withApplicableScenarios(applicableScenarios); - return this; - } - /** * Get the supportedValues property: The list of supported values. * @@ -177,31 +135,6 @@ public List supportedValues() { return this.innerProperties() == null ? null : this.innerProperties().supportedValues(); } - /** - * Set the supportedValues property: The list of supported values. - * - * @param supportedValues the supportedValues value to set. - * @return the MetadataEntityInner object itself. - */ - public MetadataEntityInner withSupportedValues(List supportedValues) { - if (this.innerProperties() == null) { - this.innerProperties = new MetadataEntityProperties(); - } - this.innerProperties().withSupportedValues(supportedValues); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/MetadataEntityProperties.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/MetadataEntityProperties.java index 8d04587daa89f..31ef12a63344b 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/MetadataEntityProperties.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/MetadataEntityProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,7 +17,7 @@ /** * The metadata entity properties. */ -@Fluent +@Immutable public final class MetadataEntityProperties implements JsonSerializable { /* * The display name. @@ -42,7 +42,7 @@ public final class MetadataEntityProperties implements JsonSerializable dependsOn() { return this.dependsOn; } - /** - * Set the dependsOn property: The list of keys on which this entity depends on. - * - * @param dependsOn the dependsOn value to set. - * @return the MetadataEntityProperties object itself. - */ - public MetadataEntityProperties withDependsOn(List dependsOn) { - this.dependsOn = dependsOn; - return this; - } - /** * Get the applicableScenarios property: The list of scenarios applicable to this metadata entity. * @@ -94,17 +72,6 @@ public List applicableScenarios() { return this.applicableScenarios; } - /** - * Set the applicableScenarios property: The list of scenarios applicable to this metadata entity. - * - * @param applicableScenarios the applicableScenarios value to set. - * @return the MetadataEntityProperties object itself. - */ - public MetadataEntityProperties withApplicableScenarios(List applicableScenarios) { - this.applicableScenarios = applicableScenarios; - return this; - } - /** * Get the supportedValues property: The list of supported values. * @@ -114,28 +81,6 @@ public List supportedValues() { return this.supportedValues; } - /** - * Set the supportedValues property: The list of supported values. - * - * @param supportedValues the supportedValues value to set. - * @return the MetadataEntityProperties object itself. - */ - public MetadataEntityProperties withSupportedValues(List supportedValues) { - this.supportedValues = supportedValues; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (supportedValues() != null) { - supportedValues().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/OperationListResultInner.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/OperationListResultInner.java index 3bef343a283fe..af76d57d4c040 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/OperationListResultInner.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/OperationListResultInner.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.fluent.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,7 +16,7 @@ /** * Lists the operations response. */ -@Fluent +@Immutable public final class OperationListResultInner implements JsonSerializable { /* * List of operations available in the Microsoft.ResourceHealth resource provider. @@ -27,7 +26,7 @@ public final class OperationListResultInner implements JsonSerializable value() { return this.value; } - /** - * Set the value property: List of operations available in the Microsoft.ResourceHealth resource provider. - * - * @param value the value value to set. - * @return the OperationListResultInner object itself. - */ - public OperationListResultInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property value in model OperationListResultInner")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(OperationListResultInner.class); - /** * {@inheritDoc} */ diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/package-info.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/package-info.java index 9adcf72241095..7551f7faa8ccb 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/package-info.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the inner data models for MicrosoftResourceHealth. + * Package containing the inner data models for ResourceHealth. * The Resource Health Client. */ package com.azure.resourcemanager.resourcehealth.fluent.models; diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/package-info.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/package-info.java index f2dc44c975c98..c4a106b384477 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/package-info.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the service clients for MicrosoftResourceHealth. + * Package containing the service clients for ResourceHealth. * The Resource Health Client. */ package com.azure.resourcemanager.resourcehealth.fluent; diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/AvailabilityStatusImpl.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/AvailabilityStatusImpl.java index dd0a22300453e..0b83367933882 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/AvailabilityStatusImpl.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/AvailabilityStatusImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.implementation; @@ -19,6 +19,14 @@ public final class AvailabilityStatusImpl implements AvailabilityStatus { this.serviceManager = serviceManager; } + public AvailabilityStatusProperties properties() { + return this.innerModel().properties(); + } + + public String location() { + return this.innerModel().location(); + } + public String id() { return this.innerModel().id(); } @@ -31,14 +39,6 @@ public String type() { return this.innerModel().type(); } - public String location() { - return this.innerModel().location(); - } - - public AvailabilityStatusProperties properties() { - return this.innerModel().properties(); - } - public AvailabilityStatusInner innerModel() { return this.innerObject; } 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 bc92739a91490..6aa82b753c892 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.resourcehealth.fluent.AvailabilityStatusesClient; import com.azure.resourcemanager.resourcehealth.fluent.models.AvailabilityStatusInner; -import com.azure.resourcemanager.resourcehealth.models.AvailabilityStatusListResult; +import com.azure.resourcemanager.resourcehealth.implementation.models.AvailabilityStatusListResult; import reactor.core.publisher.Mono; /** @@ -59,44 +59,79 @@ public final class AvailabilityStatusesClientImpl implements AvailabilityStatuse * The interface defining all the services for MicrosoftResourceHealthAvailabilityStatuses to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "MicrosoftResourceHea") + @Host("{endpoint}") + @ServiceInterface(name = "MicrosoftResourceHealthAvailabilityStatuses") public interface AvailabilityStatusesService { + @Headers({ "Content-Type: application/json" }) + @Get("/{resourceUri}/providers/Microsoft.ResourceHealth/availabilityStatuses/current") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResource(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, @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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, @QueryParam("$filter") String filter, + @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) - Mono> listBySubscriptionId(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("$expand") String expand, + Mono> listBySubscriptionId(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @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") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/availabilityStatuses") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + Response listBySubscriptionIdSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @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") + @Get("/{resourceUri}/providers/Microsoft.ResourceHealth/availabilityStatuses") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResource(@HostParam("$host") String endpoint, - @PathParam(value = "resourceUri", encoded = true) String resourceUri, - @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, @QueryParam("$filter") String filter, @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/{resourceUri}/providers/Microsoft.ResourceHealth/availabilityStatuses") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam(value = "resourceUri", encoded = true) String resourceUri, - @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, @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) + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -104,15 +139,15 @@ Mono> list(@HostParam("$host") String end @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionIdNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + Response listBySubscriptionIdNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -120,45 +155,78 @@ Mono> listByResourceGroupNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") 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("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") 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("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Lists the current availability status for all the resources in the subscription. + * Gets current availability status for a single resource. * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param filter The filter to apply on the operation. For more information please see * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List availabilityStatus operation response along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return current availability status for a single resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionIdSinglePageAsync(String filter, + private Mono> getByResourceWithResponseAsync(String resourceUri, String filter, String expand) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listBySubscriptionId(this.client.getEndpoint(), this.client.getApiVersion(), - filter, this.client.getSubscriptionId(), expand, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.getByResource(this.client.getEndpoint(), this.client.getApiVersion(), + resourceUri, filter, expand, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists the current availability status for all the resources in the subscription. + * Gets current availability status for a single resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return current availability status for a single resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceAsync(String resourceUri) { + final String filter = null; + final String expand = null; + return getByResourceWithResponseAsync(resourceUri, filter, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets current availability status for a single resource. * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param filter The filter to apply on the operation. For more information please see * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. @@ -166,27 +234,54 @@ private Mono> listBySubscriptionIdSingleP * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return current availability status for a single resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceWithResponse(String resourceUri, String filter, String expand, + Context context) { + final String accept = "application/json"; + return service.getByResourceSync(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, filter, + expand, accept, context); + } + + /** + * Gets current availability status for a single resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return current availability status for a single resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AvailabilityStatusInner getByResource(String resourceUri) { + final String filter = null; + final String expand = null; + return getByResourceWithResponse(resourceUri, filter, expand, Context.NONE).getValue(); + } + + /** + * Lists the current availability status for all the resources in the subscription. + * + * @param filter The filter to apply on the operation. For more information please see + * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the List availabilityStatus operation response along with {@link PagedResponse} on successful completion * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionIdSinglePageAsync(String filter, - String expand, 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.")); - } + String expand) { 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)); + return FluxUtil + .withContext(context -> service.listBySubscriptionId(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), filter, expand, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -221,6 +316,26 @@ 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) { + final String accept = "application/json"; + Response res = service.listBySubscriptionIdSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), filter, 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 +346,16 @@ 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)); + final String accept = "application/json"; + Response res = service.listBySubscriptionIdSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), filter, expand, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -251,7 +369,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,13 +387,14 @@ 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)); } /** - * Lists the current availability status for all the resources in the resource group. + * Lists all historical availability transitions and impacting events for a single resource. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param filter The filter to apply on the operation. For more information please see * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. @@ -285,72 +405,21 @@ public PagedIterable listBySubscriptionId(String filter * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - String filter, String expand) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } + private Mono> listSinglePageAsync(String resourceUri, String filter, + String expand) { final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), filter, expand, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + filter, expand, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists the current availability status for all the resources in the resource group. - * - * @param resourceGroupName The name of the resource group. 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. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List availabilityStatus operation response along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - String filter, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), filter, expand, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Lists the current availability status for all the resources in the resource group. + * Lists all historical availability transitions and impacting events for a single resource. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param filter The filter to apply on the operation. For more information please see * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. @@ -360,126 +429,53 @@ private Mono> listByResourceGroupSinglePa * @return the List availabilityStatus operation response as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter, - String expand) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, expand), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Lists the current availability status for all the resources in the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List availabilityStatus operation response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - final String filter = null; - final String expand = null; - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, expand), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + private PagedFlux listAsync(String resourceUri, String filter, String expand) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceUri, filter, expand), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Lists the current availability status for all the resources in the resource group. + * Lists all historical availability transitions and impacting events for a single resource. * - * @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. - * @param context The context to associate with this operation. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the List availabilityStatus operation response as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter, - String expand, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, expand, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the current availability status for all the resources in the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List availabilityStatus operation response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { + private PagedFlux listAsync(String resourceUri) { final String filter = null; final String expand = null; - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, expand)); - } - - /** - * Lists the current availability status for all the resources in the resource group. - * - * @param resourceGroupName The name of the resource group. 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. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List availabilityStatus operation response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, String filter, - String expand, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, expand, context)); + return new PagedFlux<>(() -> listSinglePageAsync(resourceUri, filter, expand), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Gets current availability status for a single resource. + * Lists all historical availability transitions and impacting events for a single resource. * - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. - * Currently the API support not nested and one nesting level resource types : - * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} - * and - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param filter The filter to apply on the operation. For more information please see * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return current availability status for a single resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return the List availabilityStatus operation response along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceWithResponseAsync(String resourceUri, String filter, - String expand) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); - } + private PagedResponse listSinglePage(String resourceUri, String filter, String expand) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getByResource(this.client.getEndpoint(), resourceUri, - this.client.getApiVersion(), filter, expand, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), resourceUri, filter, expand, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Gets current availability status for a single resource. + * Lists all historical availability transitions and impacting events for a single resource. * - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. - * Currently the API support not nested and one nesting level resource types : - * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} - * and - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param filter The filter to apply on the operation. For more information please see * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. @@ -487,54 +483,39 @@ private Mono> getByResourceWithResponseAsync(S * @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}. + * @return the List availabilityStatus operation response along with {@link PagedResponse}. */ @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.")); - } + private PagedResponse listSinglePage(String resourceUri, String filter, String expand, + Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getByResource(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), filter, - expand, accept, context); + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), resourceUri, filter, expand, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Gets current availability status for a single resource. + * Lists all historical availability transitions and impacting events for a single resource. * - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. - * Currently the API support not nested and one nesting level resource types : - * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} - * and - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return current availability status for a single resource on successful completion of {@link Mono}. + * @return the List availabilityStatus operation response as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceAsync(String resourceUri) { + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceUri) { final String filter = null; final String expand = null; - return getByResourceWithResponseAsync(resourceUri, filter, expand) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + return new PagedIterable<>(() -> listSinglePage(resourceUri, filter, expand), + nextLink -> listNextSinglePage(nextLink)); } /** - * Gets current availability status for a single resource. + * Lists all historical availability transitions and impacting events for a single resource. * - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. - * Currently the API support not nested and one nesting level resource types : - * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} - * and - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param filter The filter to apply on the operation. For more information please see * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. @@ -542,42 +523,19 @@ private Mono getByResourceAsync(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 current availability status for a single resource along with {@link Response}. + * @return the List availabilityStatus operation response as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceWithResponse(String resourceUri, String filter, String expand, + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceUri, String filter, String expand, Context context) { - return getByResourceWithResponseAsync(resourceUri, filter, expand, context).block(); - } - - /** - * Gets current availability status for a single resource. - * - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. - * Currently the API support not nested and one nesting level resource types : - * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} - * and - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return current availability status for a single resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AvailabilityStatusInner getByResource(String resourceUri) { - final String filter = null; - final String expand = null; - return getByResourceWithResponse(resourceUri, filter, expand, Context.NONE).getValue(); + return new PagedIterable<>(() -> listSinglePage(resourceUri, filter, expand, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** - * Lists all historical availability transitions and impacting events for a single resource. + * Lists the current availability status for all the resources in the resource group. * - * @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 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. @@ -588,111 +546,80 @@ public AvailabilityStatusInner getByResource(String resourceUri) { * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceUri, String filter, - String expand) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); - } + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + String filter, String expand) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), - filter, expand, accept, context)) + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filter, expand, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists all historical availability transitions and impacting events for a single resource. + * Lists the current availability status for all the resources in the resource group. * - * @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 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. - * @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 listByResourceGroupAsync(String resourceGroupName, String filter, + String expand) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, expand), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** - * Lists all historical availability transitions and impacting events for a single resource. + * Lists the current availability status for all the resources in the resource group. * - * @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 resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the List availabilityStatus operation response as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceUri, String filter, String expand) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceUri, filter, expand), - nextLink -> listNextSinglePageAsync(nextLink)); + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + final String filter = null; + final String expand = null; + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, expand), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** - * Lists all historical availability transitions and impacting events for a single resource. + * Lists the current availability status for all the resources in the resource group. * - * @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 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 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 listByResourceGroupSinglePage(String resourceGroupName, + String filter, String expand) { + final String accept = "application/json"; + Response res + = service.listByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filter, expand, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Lists all historical availability transitions and impacting events for a single resource. + * Lists the current availability status for all the resources in the resource group. * - * @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 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. @@ -700,43 +627,40 @@ 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, - Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceUri, filter, expand, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, + String filter, String expand, Context context) { + final String accept = "application/json"; + Response res + = service.listByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filter, expand, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Lists all historical availability transitions and impacting events for a single resource. + * Lists the current availability status for all the resources in the resource group. * - * @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 resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the List availabilityStatus operation response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceUri) { + public PagedIterable listByResourceGroup(String resourceGroupName) { final String filter = null; final String expand = null; - return new PagedIterable<>(listAsync(resourceUri, filter, expand)); + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, filter, expand), + nextLink -> listByResourceGroupNextSinglePage(nextLink)); } /** - * Lists all historical availability transitions and impacting events for a single resource. + * Lists the current availability status for all the resources in the resource group. * - * @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 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. @@ -747,9 +671,10 @@ public PagedIterable list(String resourceUri) { * @return the List availabilityStatus operation response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceUri, String filter, String expand, - Context context) { - return new PagedIterable<>(listAsync(resourceUri, filter, expand, context)); + public PagedIterable listByResourceGroup(String resourceGroupName, String filter, + String expand, Context context) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, filter, expand, context), + nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); } /** @@ -764,13 +689,6 @@ public PagedIterable list(String resourceUri, String fi */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionIdNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext( @@ -780,6 +698,24 @@ 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) { + 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 +724,16 @@ 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.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listBySubscriptionIdNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + 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); } /** @@ -819,23 +747,32 @@ private Mono> listBySubscriptionIdNextSin * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private Mono> listNextSinglePageAsync(String nextLink) { final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The 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) { + 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. * @@ -844,24 +781,15 @@ 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) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { 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.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -875,21 +803,34 @@ private Mono> listByResourceGroupNextSing * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The 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) { + 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. * @@ -898,22 +839,14 @@ 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) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { 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.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/AvailabilityStatusesImpl.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/AvailabilityStatusesImpl.java index ae55a91f58976..5f62942a850ba 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/AvailabilityStatusesImpl.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/AvailabilityStatusesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.implementation; @@ -27,39 +27,12 @@ public AvailabilityStatusesImpl(AvailabilityStatusesClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable listBySubscriptionId() { - PagedIterable inner = this.serviceClient().listBySubscriptionId(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AvailabilityStatusImpl(inner1, this.manager())); - } - - public PagedIterable listBySubscriptionId(String filter, String expand, Context context) { - PagedIterable inner - = this.serviceClient().listBySubscriptionId(filter, expand, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AvailabilityStatusImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AvailabilityStatusImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, String filter, String expand, - Context context) { - PagedIterable inner - = this.serviceClient().listByResourceGroup(resourceGroupName, filter, expand, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AvailabilityStatusImpl(inner1, this.manager())); - } - public Response getByResourceWithResponse(String resourceUri, String filter, String expand, Context context) { Response inner = this.serviceClient().getByResourceWithResponse(resourceUri, filter, expand, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AvailabilityStatusImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AvailabilityStatusImpl(inner.getValue(), this.manager())); } public AvailabilityStatus getByResource(String resourceUri) { @@ -71,6 +44,17 @@ public AvailabilityStatus getByResource(String resourceUri) { } } + public PagedIterable listBySubscriptionId() { + PagedIterable inner = this.serviceClient().listBySubscriptionId(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AvailabilityStatusImpl(inner1, this.manager())); + } + + public PagedIterable listBySubscriptionId(String filter, String expand, Context context) { + PagedIterable inner + = this.serviceClient().listBySubscriptionId(filter, expand, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AvailabilityStatusImpl(inner1, this.manager())); + } + public PagedIterable list(String resourceUri) { PagedIterable inner = this.serviceClient().list(resourceUri); return ResourceManagerUtils.mapPage(inner, inner1 -> new AvailabilityStatusImpl(inner1, this.manager())); @@ -81,6 +65,18 @@ public PagedIterable list(String resourceUri, String filter, return ResourceManagerUtils.mapPage(inner, inner1 -> new AvailabilityStatusImpl(inner1, this.manager())); } + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AvailabilityStatusImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, String filter, String expand, + Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, filter, expand, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AvailabilityStatusImpl(inner1, this.manager())); + } + private AvailabilityStatusesClient serviceClient() { return this.innerClient; } 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 08998a98a13d0..c1cdc45a904ee 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.resourcehealth.fluent.ChildAvailabilityStatusesClient; import com.azure.resourcemanager.resourcehealth.fluent.models.AvailabilityStatusInner; -import com.azure.resourcemanager.resourcehealth.models.AvailabilityStatusListResult; +import com.azure.resourcemanager.resourcehealth.implementation.models.AvailabilityStatusListResult; import reactor.core.publisher.Mono; /** @@ -59,25 +59,43 @@ public final class ChildAvailabilityStatusesClientImpl implements ChildAvailabil * The interface defining all the services for MicrosoftResourceHealthChildAvailabilityStatuses to be used by the * proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "MicrosoftResourceHea") + @Host("{endpoint}") + @ServiceInterface(name = "MicrosoftResourceHealthChildAvailabilityStatuses") public interface ChildAvailabilityStatusesService { @Headers({ "Content-Type: application/json" }) @Get("/{resourceUri}/providers/Microsoft.ResourceHealth/childAvailabilityStatuses/current") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResource(@HostParam("$host") String endpoint, - @PathParam(value = "resourceUri", encoded = true) String resourceUri, - @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, + Mono> getByResource(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, @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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, @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) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, @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) - Mono> list(@HostParam("$host") String endpoint, - @PathParam(value = "resourceUri", encoded = true) String resourceUri, - @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, @QueryParam("$filter") String filter, @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -85,16 +103,22 @@ Mono> list(@HostParam("$host") String end @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") 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("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Gets current availability status for a single resource. * - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. - * Currently the API only support one nesting level resource types : - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}. + * @param resourceUri undefined. * @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. @@ -107,58 +131,17 @@ Mono> listNext( @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceWithResponseAsync(String resourceUri, String filter, String expand) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getByResource(this.client.getEndpoint(), resourceUri, - this.client.getApiVersion(), filter, expand, accept, context)) + .withContext(context -> service.getByResource(this.client.getEndpoint(), this.client.getApiVersion(), + resourceUri, filter, expand, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets current availability status for a single resource. * - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. - * Currently the API 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. - * - * @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 resourceUri undefined. * @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. @@ -175,9 +158,7 @@ private Mono getByResourceAsync(String resourceUri) { /** * Gets current availability status for a single resource. * - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. - * Currently the API only support one nesting level resource types : - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}. + * @param resourceUri undefined. * @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. @@ -190,15 +171,15 @@ 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(); + final String accept = "application/json"; + return service.getByResourceSync(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, filter, + expand, accept, context); } /** * Gets current availability status for a single resource. * - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. - * Currently the API only support one nesting level resource types : - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}. + * @param resourceUri undefined. * @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. @@ -215,9 +196,7 @@ public AvailabilityStatusInner getByResource(String resourceUri) { * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response * to get the next page of availability status. * - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. - * Currently the API only support one nesting level resource types : - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}. + * @param resourceUri undefined. * @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. @@ -230,16 +209,9 @@ public AvailabilityStatusInner getByResource(String resourceUri) { @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String resourceUri, String filter, String expand) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, filter, expand, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) @@ -250,54 +222,35 @@ private Mono> listSinglePageAsync(String * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response * to get the next page of availability status. * - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. - * Currently the API only support one nesting level resource types : - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}. + * @param resourceUri undefined. * @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)); } /** * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response * to get the next page of availability status. * - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. - * Currently the API 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 resourceUri undefined. * @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)); } @@ -306,29 +259,29 @@ private PagedFlux listAsync(String resourceUri, String * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response * to get the next page of availability status. * - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. - * Currently the API only support one nesting level resource types : - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}. + * @param resourceUri undefined. + * @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) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), resourceUri, filter, expand, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response * to get the next page of availability status. * - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. - * Currently the API only support one nesting level resource types : - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}. + * @param resourceUri undefined. * @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. @@ -336,22 +289,23 @@ 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)); + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), resourceUri, filter, expand, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response * to get the next page of availability status. * - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. - * Currently the API only support one nesting level resource types : - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}. + * @param resourceUri undefined. * @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. @@ -361,16 +315,15 @@ 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)); } /** * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response * to get the next page of availability status. * - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. - * Currently the API only support one nesting level resource types : - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}. + * @param resourceUri undefined. * @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. @@ -383,7 +336,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)); } /** @@ -398,13 +352,6 @@ public PagedIterable list(String resourceUri, String fi */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), @@ -412,6 +359,24 @@ 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) { + 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 +385,14 @@ 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) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { 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); } } diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/ChildAvailabilityStatusesImpl.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/ChildAvailabilityStatusesImpl.java index 2ea2450a6562f..1801eb64c30c9 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/ChildAvailabilityStatusesImpl.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/ChildAvailabilityStatusesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.implementation; @@ -31,12 +31,8 @@ public Response getByResourceWithResponse(String resourceUri Context context) { Response inner = this.serviceClient().getByResourceWithResponse(resourceUri, filter, expand, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AvailabilityStatusImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AvailabilityStatusImpl(inner.getValue(), this.manager())); } public AvailabilityStatus getByResource(String resourceUri) { 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 e6b1c96047364..43c2d16e587d2 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.resourcehealth.fluent.ChildResourcesClient; import com.azure.resourcemanager.resourcehealth.fluent.models.AvailabilityStatusInner; -import com.azure.resourcemanager.resourcehealth.models.AvailabilityStatusListResult; +import com.azure.resourcemanager.resourcehealth.implementation.models.AvailabilityStatusListResult; import reactor.core.publisher.Mono; /** @@ -59,16 +59,25 @@ public final class ChildResourcesClientImpl implements ChildResourcesClient { * The interface defining all the services for MicrosoftResourceHealthChildResources to be used by the proxy service * to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "MicrosoftResourceHea") + @Host("{endpoint}") + @ServiceInterface(name = "MicrosoftResourceHealthChildResources") public interface ChildResourcesService { @Headers({ "Content-Type: application/json" }) @Get("/{resourceUri}/providers/Microsoft.ResourceHealth/childResources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam(value = "resourceUri", encoded = true) String resourceUri, - @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, @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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, @QueryParam("$filter") String filter, @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -76,7 +85,15 @@ Mono> list(@HostParam("$host") String end @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") 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("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } @@ -84,9 +101,7 @@ Mono> listNext( * Lists the all the children and its current health status for a parent resource. Use the nextLink property in the * response to get the next page of children current health. * - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. - * Currently the API only support not nested parent resource type: - * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param filter The filter to apply on the operation. For more information please see * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. @@ -99,16 +114,9 @@ Mono> listNext( @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String resourceUri, String filter, String expand) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, filter, expand, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) @@ -119,54 +127,35 @@ private Mono> listSinglePageAsync(String * Lists the all the children and its current health status for a parent resource. Use the nextLink property in the * response to get the next page of children current health. * - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. - * Currently the API only support not nested parent resource type: - * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param filter The filter to apply on the operation. For more information please see * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. * @param 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)); } /** * Lists the all the children and its current health status for a parent resource. Use the nextLink property in the * response to get the next page of children current health. * - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. - * Currently the API only support not nested parent resource type: - * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}. - * @param filter The filter to apply on the operation. For more information please see - * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. - * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @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)); } @@ -175,29 +164,29 @@ private PagedFlux listAsync(String resourceUri, String * Lists the all the children and its current health status for a parent resource. Use the nextLink property in the * response to get the next page of children current health. * - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. - * Currently the API only support not nested parent resource type: - * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param filter The filter to apply on the operation. For more information please see + * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. + * @param 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) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), resourceUri, filter, expand, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** * Lists the all the children and its current health status for a parent resource. Use the nextLink property in the * response to get the next page of children current health. * - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. - * Currently the API only support not nested parent resource type: - * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param filter The filter to apply on the operation. For more information please see * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. @@ -205,22 +194,23 @@ 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)); + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), resourceUri, filter, expand, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** * Lists the all the children and its current health status for a parent resource. Use the nextLink property in the * response to get the next page of children current health. * - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. - * Currently the API only support not nested parent resource type: - * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @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. @@ -230,16 +220,15 @@ 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)); } /** * Lists the all the children and its current health status for a parent resource. Use the nextLink property in the * response to get the next page of children current health. * - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. - * Currently the API only support not nested parent resource type: - * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param filter The filter to apply on the operation. For more information please see * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. @@ -252,7 +241,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)); } /** @@ -267,13 +257,6 @@ public PagedIterable list(String resourceUri, String fi */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), @@ -281,6 +264,24 @@ 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) { + 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 +290,14 @@ 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) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { 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); } } diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/ChildResourcesImpl.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/ChildResourcesImpl.java index fa157dabbb3e7..afdcea7a78172 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/ChildResourcesImpl.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/ChildResourcesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.implementation; 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 5c0566f5bf142..c7f5dcb5b47e2 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.resourcehealth.fluent.EmergingIssuesClient; import com.azure.resourcemanager.resourcehealth.fluent.models.EmergingIssuesGetResultInner; -import com.azure.resourcemanager.resourcehealth.models.EmergingIssueListResult; +import com.azure.resourcemanager.resourcehealth.implementation.models.EmergingIssueListResult; import com.azure.resourcemanager.resourcehealth.models.IssueNameParameter; import reactor.core.publisher.Mono; @@ -60,101 +60,113 @@ public final class EmergingIssuesClientImpl implements EmergingIssuesClient { * The interface defining all the services for MicrosoftResourceHealthEmergingIssues to be used by the proxy service * to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "MicrosoftResourceHea") + @Host("{endpoint}") + @ServiceInterface(name = "MicrosoftResourceHealthEmergingIssues") public interface EmergingIssuesService { @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.ResourceHealth/emergingIssues") + @Get("/providers/Microsoft.ResourceHealth/emergingIssues/{issueName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("issueName") IssueNameParameter issueName, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.ResourceHealth/emergingIssues/{issueName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("issueName") IssueNameParameter issueName, @QueryParam("api-version") String apiVersion, + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("issueName") IssueNameParameter issueName, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.ResourceHealth/emergingIssues") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") 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("endpoint") String endpoint, + @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); + @HostParam("endpoint") 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("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Lists Azure services' emerging issues. + * Gets Azure services' emerging issues. * + * @param issueName The name of the emerging issue. + * @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 azure services' emerging issues along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private Mono> getWithResponseAsync(IssueNameParameter issueName) { final String accept = "application/json"; - return FluxUtil - .withContext( - context -> 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)) + return FluxUtil.withContext( + context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), issueName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists Azure services' emerging issues. + * Gets Azure services' emerging issues. * - * @param context The context to associate with this operation. + * @param issueName The name of the emerging issue. * @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 azure services' emerging issues on successful completion of {@link Mono}. */ @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)); + private Mono getAsync(IssueNameParameter issueName) { + return getWithResponseAsync(issueName).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Lists Azure services' emerging issues. + * 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 the list of emerging issues as paginated response with {@link PagedFlux}. + * @return azure services' emerging issues along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(IssueNameParameter issueName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), issueName, accept, context); } /** - * Lists Azure services' emerging issues. + * Gets Azure services' emerging issues. * - * @param context The context to associate with this operation. + * @param issueName The name of the emerging issue. * @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 azure services' emerging issues. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public EmergingIssuesGetResultInner get(IssueNameParameter issueName) { + return getWithResponse(issueName, Context.NONE).getValue(); } /** @@ -162,117 +174,107 @@ private PagedFlux listAsync(Context context) { * * @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 PagedIterable}. + * @return the list of emerging issues along with {@link PagedResponse} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> 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)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * 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 as paginated response with {@link PagedIterable}. + * @return the list of emerging issues as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Gets Azure services' emerging issues. + * Lists Azure services' emerging issues. * - * @param issueName The name of the emerging issue. - * @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}. + * @return the list of emerging issues along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(IssueNameParameter issueName) { - 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.")); - } + private PagedResponse listSinglePage() { final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.get(this.client.getEndpoint(), issueName, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + 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); } /** - * Gets Azure services' emerging issues. + * Lists 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}. + * @return the list of emerging issues along with {@link PagedResponse}. */ @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.")); - } + private PagedResponse listSinglePage(Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), issueName, this.client.getApiVersion(), accept, context); + 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); } /** - * Gets Azure services' emerging issues. + * Lists Azure services' emerging issues. * - * @param issueName The name of the emerging issue. - * @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 on successful completion of {@link Mono}. + * @return the list of emerging issues as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(IssueNameParameter issueName) { - return getWithResponseAsync(issueName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); } /** - * Gets Azure services' emerging issues. + * Lists 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}. + * @return the list of emerging issues as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(IssueNameParameter issueName, Context context) { - return getWithResponseAsync(issueName, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); } /** - * Gets Azure services' emerging issues. + * Get the next page of items. * - * @param issueName The name of the emerging issue. + * @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 azure services' emerging issues. + * @return the list of emerging issues along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public EmergingIssuesGetResultInner get(IssueNameParameter issueName) { - return getWithResponse(issueName, Context.NONE).getValue(); + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -282,22 +284,15 @@ public EmergingIssuesGetResultInner get(IssueNameParameter issueName) { * @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) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + 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); } /** @@ -308,22 +303,14 @@ 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) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { 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); } } diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EmergingIssuesGetResultImpl.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EmergingIssuesGetResultImpl.java index a2f00c0d2eb12..e1be32d7a6dc0 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EmergingIssuesGetResultImpl.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EmergingIssuesGetResultImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.implementation; diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EmergingIssuesImpl.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EmergingIssuesImpl.java index 3b4267ea58e3a..90c3ba978a6c8 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EmergingIssuesImpl.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EmergingIssuesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.implementation; @@ -28,24 +28,10 @@ public EmergingIssuesImpl(EmergingIssuesClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new EmergingIssuesGetResultImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new EmergingIssuesGetResultImpl(inner1, this.manager())); - } - public Response getWithResponse(IssueNameParameter issueName, Context context) { Response inner = this.serviceClient().getWithResponse(issueName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new EmergingIssuesGetResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EmergingIssuesGetResultImpl(inner.getValue(), this.manager())); } public EmergingIssuesGetResult get(IssueNameParameter issueName) { @@ -57,6 +43,16 @@ public EmergingIssuesGetResult get(IssueNameParameter issueName) { } } + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EmergingIssuesGetResultImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EmergingIssuesGetResultImpl(inner1, this.manager())); + } + private EmergingIssuesClient serviceClient() { return this.innerClient; } 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 6320d53e5ab21..627ad3c167806 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.implementation; @@ -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 94ccd1b69e596..08822a4658cdb 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 @@ -1,11 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.implementation; import com.azure.core.management.SystemData; import com.azure.resourcemanager.resourcehealth.fluent.models.EventInner; +import com.azure.resourcemanager.resourcehealth.models.ApiOperationLink; import com.azure.resourcemanager.resourcehealth.models.Event; import com.azure.resourcemanager.resourcehealth.models.EventLevelValues; import com.azure.resourcemanager.resourcehealth.models.EventPropertiesAdditionalInformation; @@ -57,6 +58,10 @@ public EventSubTypeValues eventSubType() { return this.innerModel().eventSubType(); } + public ApiOperationLink advisorRecommendations() { + return this.innerModel().advisorRecommendations(); + } + public EventSourceValues eventSource() { return this.innerModel().eventSource(); } @@ -85,6 +90,10 @@ public EventLevelValues eventLevel() { return this.innerModel().eventLevel(); } + public Boolean isEventSensitive() { + return this.innerModel().isEventSensitive(); + } + public String externalIncidentId() { return this.innerModel().externalIncidentId(); } @@ -180,16 +189,29 @@ public String impactType() { return this.innerModel().impactType(); } - public String maintenanceId() { - return this.innerModel().maintenanceId(); + public List eventTags() { + List inner = this.innerModel().eventTags(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Double newRate() { + return this.innerModel().newRate(); + } + + public Double oldRate() { + return this.innerModel().oldRate(); } - public String maintenanceType() { - return this.innerModel().maintenanceType(); + public String currencyType() { + return this.innerModel().currencyType(); } - public String argQuery() { - return this.innerModel().argQuery(); + public String billingId() { + return this.innerModel().billingId(); } 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 d03670d4f7b11..eee4cf7384cb2 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.implementation; @@ -55,16 +55,33 @@ public final class EventOperationsClientImpl implements EventOperationsClient { * The interface defining all the services for MicrosoftResourceHealthEventOperations to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "MicrosoftResourceHea") + @Host("{endpoint}") + @ServiceInterface(name = "MicrosoftResourceHealthEventOperations") public interface EventOperationsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/events/{eventTrackingId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getBySubscriptionIdAndTrackingId(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, - @QueryParam("queryStartTime") String queryStartTime, @PathParam("subscriptionId") String subscriptionId, + Mono> getBySubscriptionIdAndTrackingId(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("eventTrackingId") String eventTrackingId, @QueryParam("$filter") String filter, + @QueryParam("queryStartTime") String queryStartTime, @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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("eventTrackingId") String eventTrackingId, @QueryParam("$filter") String filter, + @QueryParam("queryStartTime") String queryStartTime, @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) + Mono> fetchDetailsBySubscriptionIdAndTrackingId(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("eventTrackingId") String eventTrackingId, @HeaderParam("Accept") String accept, Context context); @@ -72,25 +89,60 @@ Mono> getBySubscriptionIdAndTrackingId(@HostParam("$host") @Post("/subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/events/{eventTrackingId}/fetchEventDetails") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> fetchDetailsBySubscriptionIdAndTrackingId(@HostParam("$host") String endpoint, + Response fetchDetailsBySubscriptionIdAndTrackingIdSync(@HostParam("endpoint") 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" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/events/{eventTrackingId}/fetchBillingCommunicationDetails") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> fetchBilllingCommunicationDetailsBySubscriptionIdAndTrackingId( + @HostParam("endpoint") 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" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/events/{eventTrackingId}/fetchBillingCommunicationDetails") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response fetchBilllingCommunicationDetailsBySubscriptionIdAndTrackingIdSync( + @HostParam("endpoint") 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 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByTenantIdAndTrackingId(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, - @QueryParam("queryStartTime") String queryStartTime, @PathParam("eventTrackingId") String eventTrackingId, + Mono> getByTenantIdAndTrackingId(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("eventTrackingId") String eventTrackingId, + @QueryParam("$filter") String filter, @QueryParam("queryStartTime") String queryStartTime, + @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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("eventTrackingId") String eventTrackingId, + @QueryParam("$filter") String filter, @QueryParam("queryStartTime") String queryStartTime, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/providers/Microsoft.ResourceHealth/events/{eventTrackingId}/fetchEventDetails") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> fetchDetailsByTenantIdAndTrackingId(@HostParam("endpoint") 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) - Mono> fetchDetailsByTenantIdAndTrackingId(@HostParam("$host") String endpoint, + Response fetchDetailsByTenantIdAndTrackingIdSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("eventTrackingId") String eventTrackingId, @HeaderParam("Accept") String accept, Context context); } @@ -101,8 +153,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. @@ -111,61 +163,14 @@ Mono> fetchDetailsByTenantIdAndTrackingId(@HostParam("$host @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getBySubscriptionIdAndTrackingIdWithResponseAsync(String eventTrackingId, String filter, String queryStartTime) { - 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"; return FluxUtil .withContext(context -> service.getBySubscriptionIdAndTrackingId(this.client.getEndpoint(), - this.client.getApiVersion(), filter, queryStartTime, this.client.getSubscriptionId(), eventTrackingId, + this.client.getApiVersion(), this.client.getSubscriptionId(), eventTrackingId, filter, queryStartTime, accept, context)) .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 +194,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 +205,9 @@ 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(); + final String accept = "application/json"; + return service.getBySubscriptionIdAndTrackingIdSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), eventTrackingId, filter, queryStartTime, accept, context); } /** @@ -223,7 +229,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. @@ -234,18 +241,6 @@ public EventInner getBySubscriptionIdAndTrackingId(String eventTrackingId) { @ServiceMethod(returns = ReturnType.SINGLE) private Mono> fetchDetailsBySubscriptionIdAndTrackingIdWithResponseAsync(String eventTrackingId) { - 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"; return FluxUtil .withContext(context -> service.fetchDetailsBySubscriptionIdAndTrackingId(this.client.getEndpoint(), @@ -255,39 +250,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 +267,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 +280,15 @@ private Mono fetchDetailsBySubscriptionIdAndTrackingIdAsync(String e @ServiceMethod(returns = ReturnType.SINGLE) public Response fetchDetailsBySubscriptionIdAndTrackingIdWithResponse(String eventTrackingId, Context context) { - return fetchDetailsBySubscriptionIdAndTrackingIdWithResponseAsync(eventTrackingId, context).block(); + 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. @@ -334,45 +302,86 @@ public EventInner fetchDetailsBySubscriptionIdAndTrackingId(String eventTracking } /** - * Service health event in the tenant by event tracking id. + * Service health event details specific in the subscription by event tracking id. This can be used to fetch + * sensitive properties for Billing event type. * * @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. * @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) { - 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.")); - } + private Mono> + fetchBilllingCommunicationDetailsBySubscriptionIdAndTrackingIdWithResponseAsync(String eventTrackingId) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getByTenantIdAndTrackingId(this.client.getEndpoint(), - this.client.getApiVersion(), filter, queryStartTime, eventTrackingId, accept, context)) + .withContext(context -> service.fetchBilllingCommunicationDetailsBySubscriptionIdAndTrackingId( + this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + eventTrackingId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Service health event details specific in the subscription by event tracking id. This can be used to fetch + * sensitive properties for Billing event type. + * + * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. + * @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono + fetchBilllingCommunicationDetailsBySubscriptionIdAndTrackingIdAsync(String eventTrackingId) { + return fetchBilllingCommunicationDetailsBySubscriptionIdAndTrackingIdWithResponseAsync(eventTrackingId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Service health event details specific in the subscription by event tracking id. This can be used to fetch + * sensitive properties for Billing event type. + * + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response fetchBilllingCommunicationDetailsBySubscriptionIdAndTrackingIdWithResponse( + String eventTrackingId, Context context) { + final String accept = "application/json"; + return service.fetchBilllingCommunicationDetailsBySubscriptionIdAndTrackingIdSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), eventTrackingId, accept, context); + } + + /** + * Service health event details specific in the subscription by event tracking id. This can be used to fetch + * sensitive properties for Billing event type. + * + * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EventInner fetchBilllingCommunicationDetailsBySubscriptionIdAndTrackingId(String eventTrackingId) { + return fetchBilllingCommunicationDetailsBySubscriptionIdAndTrackingIdWithResponse(eventTrackingId, Context.NONE) + .getValue(); + } + /** * 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. + * @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. @@ -380,19 +389,12 @@ private Mono> getByTenantIdAndTrackingIdWithResponseAsync(S */ @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.")); - } + String filter, String queryStartTime) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getByTenantIdAndTrackingId(this.client.getEndpoint(), this.client.getApiVersion(), filter, - queryStartTime, eventTrackingId, accept, context); + return FluxUtil + .withContext(context -> service.getByTenantIdAndTrackingId(this.client.getEndpoint(), + this.client.getApiVersion(), eventTrackingId, filter, queryStartTime, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -418,8 +420,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 +431,9 @@ 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(); + final String accept = "application/json"; + return service.getByTenantIdAndTrackingIdSync(this.client.getEndpoint(), this.client.getApiVersion(), + eventTrackingId, filter, queryStartTime, accept, context); } /** @@ -450,7 +454,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. @@ -460,14 +465,6 @@ public EventInner getByTenantIdAndTrackingId(String eventTrackingId) { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> fetchDetailsByTenantIdAndTrackingIdWithResponseAsync(String eventTrackingId) { - 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"; return FluxUtil .withContext(context -> service.fetchDetailsByTenantIdAndTrackingId(this.client.getEndpoint(), @@ -477,35 +474,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 +491,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 +504,15 @@ private Mono fetchDetailsByTenantIdAndTrackingIdAsync(String eventTr @ServiceMethod(returns = ReturnType.SINGLE) public Response fetchDetailsByTenantIdAndTrackingIdWithResponse(String eventTrackingId, Context context) { - return fetchDetailsByTenantIdAndTrackingIdWithResponseAsync(eventTrackingId, context).block(); + 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. diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EventOperationsImpl.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EventOperationsImpl.java index c354728bcfc69..66cd9821af534 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EventOperationsImpl.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EventOperationsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.implementation; @@ -30,12 +30,8 @@ public Response getBySubscriptionIdAndTrackingIdWithResponse(String event String queryStartTime, Context context) { Response inner = this.serviceClient() .getBySubscriptionIdAndTrackingIdWithResponse(eventTrackingId, filter, queryStartTime, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new EventImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EventImpl(inner.getValue(), this.manager())); } public Event getBySubscriptionIdAndTrackingId(String eventTrackingId) { @@ -51,16 +47,30 @@ public Response fetchDetailsBySubscriptionIdAndTrackingIdWithResponse(Str Context context) { Response inner = this.serviceClient().fetchDetailsBySubscriptionIdAndTrackingIdWithResponse(eventTrackingId, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EventImpl(inner.getValue(), this.manager())); + } + + public Event fetchDetailsBySubscriptionIdAndTrackingId(String eventTrackingId) { + EventInner inner = this.serviceClient().fetchDetailsBySubscriptionIdAndTrackingId(eventTrackingId); if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new EventImpl(inner.getValue(), this.manager())); + return new EventImpl(inner, this.manager()); } else { return null; } } - public Event fetchDetailsBySubscriptionIdAndTrackingId(String eventTrackingId) { - EventInner inner = this.serviceClient().fetchDetailsBySubscriptionIdAndTrackingId(eventTrackingId); + public Response fetchBilllingCommunicationDetailsBySubscriptionIdAndTrackingIdWithResponse( + String eventTrackingId, Context context) { + Response inner = this.serviceClient() + .fetchBilllingCommunicationDetailsBySubscriptionIdAndTrackingIdWithResponse(eventTrackingId, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EventImpl(inner.getValue(), this.manager())); + } + + public Event fetchBilllingCommunicationDetailsBySubscriptionIdAndTrackingId(String eventTrackingId) { + EventInner inner + = this.serviceClient().fetchBilllingCommunicationDetailsBySubscriptionIdAndTrackingId(eventTrackingId); if (inner != null) { return new EventImpl(inner, this.manager()); } else { @@ -72,12 +82,8 @@ public Response getByTenantIdAndTrackingIdWithResponse(String eventTracki String queryStartTime, Context context) { Response inner = this.serviceClient() .getByTenantIdAndTrackingIdWithResponse(eventTrackingId, filter, queryStartTime, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new EventImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EventImpl(inner.getValue(), this.manager())); } public Event getByTenantIdAndTrackingId(String eventTrackingId) { @@ -92,12 +98,8 @@ public Event getByTenantIdAndTrackingId(String eventTrackingId) { public Response fetchDetailsByTenantIdAndTrackingIdWithResponse(String eventTrackingId, Context context) { Response inner = this.serviceClient().fetchDetailsByTenantIdAndTrackingIdWithResponse(eventTrackingId, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new EventImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EventImpl(inner.getValue(), this.manager())); } public Event fetchDetailsByTenantIdAndTrackingId(String eventTrackingId) { 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 45ff567e76742..9c92c6e71784f 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.resourcehealth.fluent.EventsOperationsClient; import com.azure.resourcemanager.resourcehealth.fluent.models.EventInner; -import com.azure.resourcemanager.resourcehealth.models.Events; +import com.azure.resourcemanager.resourcehealth.implementation.models.Events; import reactor.core.publisher.Mono; /** @@ -59,32 +59,58 @@ public final class EventsOperationsClientImpl implements EventsOperationsClient * The interface defining all the services for MicrosoftResourceHealthEventsOperations to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "MicrosoftResourceHea") + @Host("{endpoint}") + @ServiceInterface(name = "MicrosoftResourceHealthEventsOperations") public interface EventsOperationsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/events") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @QueryParam("$filter") String filter, @QueryParam("queryStartTime") String queryStartTime, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @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("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @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) - Mono> listByTenantId(@HostParam("$host") String endpoint, + Mono> listByTenantId(@HostParam("endpoint") 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") + @Get("/providers/Microsoft.ResourceHealth/events") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySingleResource(@HostParam("$host") String endpoint, - @PathParam(value = "resourceUri", encoded = true) String resourceUri, + Response listByTenantIdSync(@HostParam("endpoint") 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 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySingleResource(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, @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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -92,21 +118,42 @@ Mono> listBySingleResource(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionIdNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") 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("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByTenantIdNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") 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("endpoint") 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); + @HostParam("endpoint") 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("endpoint") 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. @@ -124,18 +171,10 @@ Mono> listBySingleResourceNext(@PathParam(value = "nextLink", e */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String filter, String queryStartTime) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), filter, - queryStartTime, this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), filter, queryStartTime, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -146,41 +185,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 +218,42 @@ 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) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), filter, queryStartTime, 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) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), filter, queryStartTime, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -237,7 +267,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 +276,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 +286,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 +295,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. @@ -273,10 +305,6 @@ public PagedIterable list(String filter, String queryStartTime, Cont */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByTenantIdSinglePageAsync(String filter, String queryStartTime) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByTenantId(this.client.getEndpoint(), this.client.getApiVersion(), @@ -291,38 +319,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 +352,42 @@ 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) { + 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) { + 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 +401,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 +410,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,17 +420,14 @@ 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)); } /** * Lists current service health events for given 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 resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param filter The filter to apply on the operation. For more information please see * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -418,17 +438,10 @@ public PagedIterable listByTenantId(String filter, String queryStart */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySingleResourceSinglePageAsync(String resourceUri, String filter) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listBySingleResource(this.client.getEndpoint(), resourceUri, - this.client.getApiVersion(), filter, accept, context)) + .withContext(context -> service.listBySingleResource(this.client.getEndpoint(), this.client.getApiVersion(), + resourceUri, filter, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -437,56 +450,32 @@ private Mono> listBySingleResourceSinglePageAsync(Stri /** * Lists current service health events for given 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 resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param filter The filter to apply on the operation. For more information please see * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. - * @param 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)); } /** * Lists current service health events for given 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 resourceUri The fully qualified Azure Resource manager identifier of the resource. * @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)); } @@ -494,53 +483,49 @@ private PagedFlux listBySingleResourceAsync(String resourceUri, Stri /** * Lists current service health events for given 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 resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param filter The filter to apply on the operation. For more information please see + * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. * @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) { + final String accept = "application/json"; + Response res = service.listBySingleResourceSync(this.client.getEndpoint(), this.client.getApiVersion(), + resourceUri, filter, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** * Lists current service health events for given 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 resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param filter The filter to apply on the operation. For more information please see * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. * @param 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 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) { + final String accept = "application/json"; + Response res = service.listBySingleResourceSync(this.client.getEndpoint(), this.client.getApiVersion(), + resourceUri, filter, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** * Lists current service health events for given 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 resourceUri The fully qualified Azure Resource manager identifier of the resource. * @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. @@ -549,17 +534,14 @@ 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)); } /** * Lists current service health events for given 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 resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param filter The filter to apply on the operation. For more information please see * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. * @param context The context to associate with this operation. @@ -570,7 +552,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)); } /** @@ -585,13 +568,6 @@ public PagedIterable listBySingleResource(String resourceUri, String */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionIdNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext( @@ -601,6 +577,24 @@ 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) { + 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 +603,15 @@ 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) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listBySubscriptionIdNextSinglePage(String nextLink, Context context) { 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); } /** @@ -640,13 +626,6 @@ private Mono> listBySubscriptionIdNextSinglePageAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByTenantIdNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByTenantIdNext(nextLink, this.client.getEndpoint(), accept, context)) @@ -655,6 +634,24 @@ 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) { + 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 +660,14 @@ 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) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listByTenantIdNextSinglePage(String nextLink, Context context) { 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); } /** @@ -694,13 +682,6 @@ private Mono> listByTenantIdNextSinglePageAsync(String */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySingleResourceNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext( @@ -710,6 +691,24 @@ 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) { + 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 +717,14 @@ 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) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listBySingleResourceNextSinglePage(String nextLink, Context context) { 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); } } diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EventsOperationsImpl.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EventsOperationsImpl.java index aa29fdb88dd04..ba6bd683a13fe 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EventsOperationsImpl.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EventsOperationsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.implementation; 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 439614cdc8722..9fdd51c078985 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.resourcehealth.fluent.ImpactedResourcesClient; import com.azure.resourcemanager.resourcehealth.fluent.models.EventImpactedResourceInner; -import com.azure.resourcemanager.resourcehealth.models.EventImpactedResourceListResult; +import com.azure.resourcemanager.resourcehealth.implementation.models.EventImpactedResourceListResult; import reactor.core.publisher.Mono; /** @@ -59,104 +59,191 @@ public final class ImpactedResourcesClientImpl implements ImpactedResourcesClien * The interface defining all the services for MicrosoftResourceHealthImpactedResources to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "MicrosoftResourceHea") + @Host("{endpoint}") + @ServiceInterface(name = "MicrosoftResourceHealthImpactedResources") public interface ImpactedResourcesService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/events/{eventTrackingId}/impactedResources") + @Get("/providers/Microsoft.ResourceHealth/events/{eventTrackingId}/impactedResources/{impactedResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionIdAndEventId( - @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("eventTrackingId") String eventTrackingId, @QueryParam("api-version") String apiVersion, + Mono> getByTenantId(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("eventTrackingId") String eventTrackingId, + @PathParam("impactedResourceName") String impactedResourceName, @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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("eventTrackingId") String eventTrackingId, + @PathParam("impactedResourceName") String impactedResourceName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.ResourceHealth/events/{eventTrackingId}/impactedResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByTenantIdAndEventId(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("eventTrackingId") String eventTrackingId, + @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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("eventTrackingId") String eventTrackingId, @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 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("eventTrackingId") String eventTrackingId, + @PathParam("impactedResourceName") String impactedResourceName, @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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("eventTrackingId") String eventTrackingId, + @PathParam("impactedResourceName") String impactedResourceName, @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) + Mono> listBySubscriptionIdAndEventId( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("eventTrackingId") String eventTrackingId, - @PathParam("impactedResourceName") String impactedResourceName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.ResourceHealth/events/{eventTrackingId}/impactedResources") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/events/{eventTrackingId}/impactedResources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByTenantIdAndEventId(@HostParam("$host") String endpoint, - @PathParam("eventTrackingId") String eventTrackingId, @QueryParam("api-version") String apiVersion, + Response listBySubscriptionIdAndEventIdSync( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("eventTrackingId") String eventTrackingId, @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.ResourceHealth/events/{eventTrackingId}/impactedResources/{impactedResourceName}") + @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByTenantId(@HostParam("$host") String endpoint, - @PathParam("eventTrackingId") String eventTrackingId, - @PathParam("impactedResourceName") String impactedResourceName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Mono> listByTenantIdAndEventIdNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") 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("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionIdAndEventIdNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByTenantIdAndEventIdNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + Response listBySubscriptionIdAndEventIdNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Lists impacted resources in the subscription by an event. + * Gets the specific impacted resource 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. + * @param impactedResourceName Name of the Impacted Resource. * @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 + * @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> - listBySubscriptionIdAndEventIdSinglePageAsync(String eventTrackingId, String filter) { - 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.")); - } + private Mono> getByTenantIdWithResponseAsync(String eventTrackingId, + String impactedResourceName) { final String accept = "application/json"; return FluxUtil - .withContext(context -> 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)) + .withContext(context -> service.getByTenantId(this.client.getEndpoint(), this.client.getApiVersion(), + eventTrackingId, impactedResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists impacted resources in the subscription by an event. + * 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. + * @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByTenantIdAsync(String eventTrackingId, String impactedResourceName) { + return getByTenantIdWithResponseAsync(eventTrackingId, impactedResourceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByTenantIdWithResponse(String eventTrackingId, + String impactedResourceName, Context context) { + final String accept = "application/json"; + return service.getByTenantIdSync(this.client.getEndpoint(), this.client.getApiVersion(), eventTrackingId, + impactedResourceName, accept, context); + } + + /** + * 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. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EventImpactedResourceInner getByTenantId(String eventTrackingId, String impactedResourceName) { + return getByTenantIdWithResponse(eventTrackingId, impactedResourceName, Context.NONE).getValue(); + } + + /** + * 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. - * @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. @@ -165,30 +252,18 @@ Mono> listByTenantIdAndEventIdNext( */ @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.")); - } + listByTenantIdAndEventIdSinglePageAsync(String eventTrackingId, String filter) { 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)); + return FluxUtil + .withContext(context -> service.listByTenantIdAndEventId(this.client.getEndpoint(), + this.client.getApiVersion(), eventTrackingId, filter, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists impacted resources in the subscription by an event. + * 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 @@ -199,14 +274,13 @@ Mono> listByTenantIdAndEventIdNext( * @return the List of eventImpactedResources operation response as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySubscriptionIdAndEventIdAsync(String eventTrackingId, - String filter) { - return new PagedFlux<>(() -> listBySubscriptionIdAndEventIdSinglePageAsync(eventTrackingId, filter), - nextLink -> listBySubscriptionIdAndEventIdNextSinglePageAsync(nextLink)); + private PagedFlux listByTenantIdAndEventIdAsync(String eventTrackingId, String filter) { + return new PagedFlux<>(() -> listByTenantIdAndEventIdSinglePageAsync(eventTrackingId, filter), + nextLink -> listByTenantIdAndEventIdNextSinglePageAsync(nextLink)); } /** - * Lists impacted resources in the subscription by an event. + * Lists impacted resources in the tenant by an event. * * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -215,14 +289,35 @@ private PagedFlux listBySubscriptionIdAndEventIdAsyn * @return the List of eventImpactedResources operation response as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySubscriptionIdAndEventIdAsync(String eventTrackingId) { + private PagedFlux listByTenantIdAndEventIdAsync(String eventTrackingId) { final String filter = null; - return new PagedFlux<>(() -> listBySubscriptionIdAndEventIdSinglePageAsync(eventTrackingId, filter), - nextLink -> listBySubscriptionIdAndEventIdNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listByTenantIdAndEventIdSinglePageAsync(eventTrackingId, filter), + nextLink -> listByTenantIdAndEventIdNextSinglePageAsync(nextLink)); } /** - * Lists impacted resources in the subscription by an event. + * 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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByTenantIdAndEventIdSinglePage(String eventTrackingId, + String filter) { + final String accept = "application/json"; + Response res = service.listByTenantIdAndEventIdSync(this.client.getEndpoint(), + this.client.getApiVersion(), eventTrackingId, filter, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * 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 @@ -231,17 +326,20 @@ 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 listByTenantIdAndEventIdSinglePage(String eventTrackingId, String filter, Context context) { - return new PagedFlux<>(() -> listBySubscriptionIdAndEventIdSinglePageAsync(eventTrackingId, filter, context), - nextLink -> listBySubscriptionIdAndEventIdNextSinglePageAsync(nextLink, context)); + final String accept = "application/json"; + Response res = service.listByTenantIdAndEventIdSync(this.client.getEndpoint(), + this.client.getApiVersion(), eventTrackingId, filter, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Lists impacted resources in the subscription by an event. + * Lists impacted resources in the tenant by an event. * * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -250,13 +348,14 @@ private PagedFlux listBySubscriptionIdAndEventIdAsyn * @return the List of eventImpactedResources operation response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBySubscriptionIdAndEventId(String eventTrackingId) { + public PagedIterable listByTenantIdAndEventId(String eventTrackingId) { final String filter = null; - return new PagedIterable<>(listBySubscriptionIdAndEventIdAsync(eventTrackingId, filter)); + return new PagedIterable<>(() -> listByTenantIdAndEventIdSinglePage(eventTrackingId, filter), + nextLink -> listByTenantIdAndEventIdNextSinglePage(nextLink)); } /** - * Lists impacted resources in the subscription by an event. + * 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 @@ -268,9 +367,10 @@ public PagedIterable listBySubscriptionIdAndEventId( * @return the List of eventImpactedResources operation response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBySubscriptionIdAndEventId(String eventTrackingId, - String filter, Context context) { - return new PagedIterable<>(listBySubscriptionIdAndEventIdAsync(eventTrackingId, filter, context)); + public PagedIterable listByTenantIdAndEventId(String eventTrackingId, String filter, + Context context) { + return new PagedIterable<>(() -> listByTenantIdAndEventIdSinglePage(eventTrackingId, filter, context), + nextLink -> listByTenantIdAndEventIdNextSinglePage(nextLink, context)); } /** @@ -287,66 +387,13 @@ public PagedIterable listBySubscriptionIdAndEventId( @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String eventTrackingId, String impactedResourceName) { - 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"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - eventTrackingId, impactedResourceName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), eventTrackingId, impactedResourceName, accept, context)) .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 +424,9 @@ 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(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + eventTrackingId, impactedResourceName, accept, context); } /** @@ -396,7 +445,7 @@ public EventImpactedResourceInner get(String eventTrackingId, String impactedRes } /** - * Lists impacted resources in the tenant by an event. + * 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 @@ -409,92 +458,74 @@ public EventImpactedResourceInner get(String eventTrackingId, String impactedRes */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> - listByTenantIdAndEventIdSinglePageAsync(String eventTrackingId, String filter) { - 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.")); - } + listBySubscriptionIdAndEventIdSinglePageAsync(String eventTrackingId, String filter) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByTenantIdAndEventId(this.client.getEndpoint(), eventTrackingId, - this.client.getApiVersion(), filter, accept, context)) + .withContext(context -> service.listBySubscriptionIdAndEventId(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), eventTrackingId, filter, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists impacted resources in the tenant by an event. + * 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. - * @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 listBySubscriptionIdAndEventIdAsync(String eventTrackingId, + String filter) { + return new PagedFlux<>(() -> listBySubscriptionIdAndEventIdSinglePageAsync(eventTrackingId, filter), + nextLink -> listBySubscriptionIdAndEventIdNextSinglePageAsync(nextLink)); } /** - * Lists impacted resources in the tenant by an event. + * 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 listByTenantIdAndEventIdAsync(String eventTrackingId, String filter) { - return new PagedFlux<>(() -> listByTenantIdAndEventIdSinglePageAsync(eventTrackingId, filter), - nextLink -> listByTenantIdAndEventIdNextSinglePageAsync(nextLink)); + private PagedFlux listBySubscriptionIdAndEventIdAsync(String eventTrackingId) { + final String filter = null; + return new PagedFlux<>(() -> listBySubscriptionIdAndEventIdSinglePageAsync(eventTrackingId, filter), + nextLink -> listBySubscriptionIdAndEventIdNextSinglePageAsync(nextLink)); } /** - * Lists impacted resources in the tenant by an event. + * 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 listByTenantIdAndEventIdAsync(String eventTrackingId) { - final String filter = null; - return new PagedFlux<>(() -> listByTenantIdAndEventIdSinglePageAsync(eventTrackingId, filter), - nextLink -> listByTenantIdAndEventIdNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionIdAndEventIdSinglePage(String eventTrackingId, + String filter) { + final String accept = "application/json"; + Response res + = service.listBySubscriptionIdAndEventIdSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), eventTrackingId, filter, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Lists impacted resources in the tenant by an event. + * 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 @@ -503,17 +534,21 @@ 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 listBySubscriptionIdAndEventIdSinglePage(String eventTrackingId, + String filter, Context context) { + final String accept = "application/json"; + Response res + = service.listBySubscriptionIdAndEventIdSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), eventTrackingId, filter, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Lists impacted resources in the tenant by an event. + * Lists impacted resources in the subscription by an event. * * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -522,13 +557,14 @@ private PagedFlux listByTenantIdAndEventIdAsync(Stri * @return the List of eventImpactedResources operation response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByTenantIdAndEventId(String eventTrackingId) { + public PagedIterable listBySubscriptionIdAndEventId(String eventTrackingId) { final String filter = null; - return new PagedIterable<>(listByTenantIdAndEventIdAsync(eventTrackingId, filter)); + return new PagedIterable<>(() -> listBySubscriptionIdAndEventIdSinglePage(eventTrackingId, filter), + nextLink -> listBySubscriptionIdAndEventIdNextSinglePage(nextLink)); } /** - * Lists impacted resources in the tenant by an event. + * 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 @@ -540,123 +576,70 @@ public PagedIterable listByTenantIdAndEventId(String * @return the List of eventImpactedResources operation response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByTenantIdAndEventId(String eventTrackingId, String filter, - Context context) { - return new PagedIterable<>(listByTenantIdAndEventIdAsync(eventTrackingId, filter, context)); + public PagedIterable listBySubscriptionIdAndEventId(String eventTrackingId, + String filter, Context context) { + return new PagedIterable<>(() -> listBySubscriptionIdAndEventIdSinglePage(eventTrackingId, filter, context), + nextLink -> listBySubscriptionIdAndEventIdNextSinglePage(nextLink, context)); } /** - * Gets the specific impacted resource in the tenant by an event. + * Get the next page of items. * - * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. - * @param impactedResourceName Name of the Impacted Resource. + * @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 specific impacted resource in the tenant by an event along with {@link Response} on successful + * @return the List of eventImpactedResources operation response along with {@link PagedResponse} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByTenantIdWithResponseAsync(String eventTrackingId, - String impactedResourceName) { - 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.")); - } + private Mono> + listByTenantIdAndEventIdNextSinglePageAsync(String nextLink) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getByTenantId(this.client.getEndpoint(), eventTrackingId, - impactedResourceName, this.client.getApiVersion(), accept, context)) + .withContext( + context -> 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)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets the specific impacted resource in the tenant by an event. + * Get the next page of items. * - * @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. + * @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 specific impacted resource in the tenant by an event along with {@link Response} on successful - * completion of {@link Mono}. + * @return the List of eventImpactedResources operation response along with {@link PagedResponse}. */ @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.")); - } + private PagedResponse listByTenantIdAndEventIdNextSinglePage(String nextLink) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getByTenantId(this.client.getEndpoint(), eventTrackingId, impactedResourceName, - this.client.getApiVersion(), accept, context); + 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); } /** - * 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. - * @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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByTenantIdAsync(String eventTrackingId, String impactedResourceName) { - return getByTenantIdWithResponseAsync(eventTrackingId, impactedResourceName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the specific impacted resource in the tenant by an event. + * Get the next page of items. * - * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. - * @param impactedResourceName Name of the Impacted Resource. + * @param nextLink The URL to get the next list of items. * @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}. + * @return the List of eventImpactedResources operation response along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByTenantIdWithResponse(String eventTrackingId, - String impactedResourceName, Context context) { - return getByTenantIdWithResponseAsync(eventTrackingId, impactedResourceName, context).block(); - } - - /** - * 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. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public EventImpactedResourceInner getByTenantId(String eventTrackingId, String impactedResourceName) { - return getByTenantIdWithResponse(eventTrackingId, impactedResourceName, Context.NONE).getValue(); + private PagedResponse listByTenantIdAndEventIdNextSinglePage(String nextLink, + Context context) { + final String accept = "application/json"; + 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); } /** @@ -672,13 +655,6 @@ public EventImpactedResourceInner getByTenantId(String eventTrackingId, String i @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionIdAndEventIdNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext( context -> service.listBySubscriptionIdAndEventIdNext(nextLink, this.client.getEndpoint(), accept, context)) @@ -687,34 +663,6 @@ 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. - * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listBySubscriptionIdAndEventIdNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listBySubscriptionIdAndEventIdNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - /** * Get the next page of items. * @@ -722,26 +670,15 @@ 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) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listBySubscriptionIdAndEventIdNextSinglePage(String nextLink) { final String accept = "application/json"; - return FluxUtil - .withContext( - context -> 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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + 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); } /** @@ -752,23 +689,15 @@ 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 listBySubscriptionIdAndEventIdNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.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.listBySubscriptionIdAndEventIdNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/ImpactedResourcesImpl.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/ImpactedResourcesImpl.java index 4dd25c77c5c10..1aa873d92462f 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/ImpactedResourcesImpl.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/ImpactedResourcesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.implementation; @@ -27,33 +27,16 @@ public ImpactedResourcesImpl(ImpactedResourcesClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable listBySubscriptionIdAndEventId(String eventTrackingId) { - PagedIterable inner - = this.serviceClient().listBySubscriptionIdAndEventId(eventTrackingId); - return ResourceManagerUtils.mapPage(inner, inner1 -> new EventImpactedResourceImpl(inner1, this.manager())); - } - - public PagedIterable listBySubscriptionIdAndEventId(String eventTrackingId, String filter, - Context context) { - PagedIterable inner - = this.serviceClient().listBySubscriptionIdAndEventId(eventTrackingId, filter, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new EventImpactedResourceImpl(inner1, this.manager())); - } - - public Response getWithResponse(String eventTrackingId, String impactedResourceName, - Context context) { + public Response getByTenantIdWithResponse(String eventTrackingId, + String impactedResourceName, Context context) { Response inner - = this.serviceClient().getWithResponse(eventTrackingId, impactedResourceName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new EventImpactedResourceImpl(inner.getValue(), this.manager())); - } else { - return null; - } + = this.serviceClient().getByTenantIdWithResponse(eventTrackingId, impactedResourceName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EventImpactedResourceImpl(inner.getValue(), this.manager())); } - public EventImpactedResource get(String eventTrackingId, String impactedResourceName) { - EventImpactedResourceInner inner = this.serviceClient().get(eventTrackingId, impactedResourceName); + public EventImpactedResource getByTenantId(String eventTrackingId, String impactedResourceName) { + EventImpactedResourceInner inner = this.serviceClient().getByTenantId(eventTrackingId, impactedResourceName); if (inner != null) { return new EventImpactedResourceImpl(inner, this.manager()); } else { @@ -74,20 +57,16 @@ public PagedIterable listByTenantIdAndEventId(String even return ResourceManagerUtils.mapPage(inner, inner1 -> new EventImpactedResourceImpl(inner1, this.manager())); } - public Response getByTenantIdWithResponse(String eventTrackingId, - String impactedResourceName, Context context) { + public Response getWithResponse(String eventTrackingId, String impactedResourceName, + Context context) { Response inner - = this.serviceClient().getByTenantIdWithResponse(eventTrackingId, impactedResourceName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new EventImpactedResourceImpl(inner.getValue(), this.manager())); - } else { - return null; - } + = this.serviceClient().getWithResponse(eventTrackingId, impactedResourceName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EventImpactedResourceImpl(inner.getValue(), this.manager())); } - public EventImpactedResource getByTenantId(String eventTrackingId, String impactedResourceName) { - EventImpactedResourceInner inner = this.serviceClient().getByTenantId(eventTrackingId, impactedResourceName); + public EventImpactedResource get(String eventTrackingId, String impactedResourceName) { + EventImpactedResourceInner inner = this.serviceClient().get(eventTrackingId, impactedResourceName); if (inner != null) { return new EventImpactedResourceImpl(inner, this.manager()); } else { @@ -95,6 +74,19 @@ public EventImpactedResource getByTenantId(String eventTrackingId, String impact } } + public PagedIterable listBySubscriptionIdAndEventId(String eventTrackingId) { + PagedIterable inner + = this.serviceClient().listBySubscriptionIdAndEventId(eventTrackingId); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EventImpactedResourceImpl(inner1, this.manager())); + } + + public PagedIterable listBySubscriptionIdAndEventId(String eventTrackingId, String filter, + Context context) { + PagedIterable inner + = this.serviceClient().listBySubscriptionIdAndEventId(eventTrackingId, filter, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EventImpactedResourceImpl(inner1, this.manager())); + } + private ImpactedResourcesClient serviceClient() { return this.innerClient; } diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/MetadataEntityImpl.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/MetadataEntityImpl.java index e0c2ba534f8bf..ec686d69c043f 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/MetadataEntityImpl.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/MetadataEntityImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.implementation; 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 20ff218c574e5..204937100bc77 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.resourcehealth.fluent.MetadatasClient; import com.azure.resourcemanager.resourcehealth.fluent.models.MetadataEntityInner; -import com.azure.resourcemanager.resourcehealth.models.MetadataEntityListResult; +import com.azure.resourcemanager.resourcehealth.implementation.models.MetadataEntityListResult; import reactor.core.publisher.Mono; /** @@ -59,102 +59,114 @@ public final class MetadatasClientImpl implements MetadatasClient { * The interface defining all the services for MicrosoftResourceHealthMetadatas to be used by the proxy service to * perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "MicrosoftResourceHea") + @Host("{endpoint}") + @ServiceInterface(name = "MicrosoftResourceHealthMetadatas") public interface MetadatasService { @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.ResourceHealth/metadata") + @Get("/providers/Microsoft.ResourceHealth/metadata/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Mono> getEntity(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.ResourceHealth/metadata/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getEntity(@HostParam("$host") String endpoint, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + Response getEntitySync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("name") String name, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.ResourceHealth/metadata") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") 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("endpoint") String endpoint, + @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, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") 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("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Gets the list of metadata entities. * + * @param name Name of metadata entity. + * @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 Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private Mono> getEntityWithResponseAsync(String name) { final String accept = "application/json"; - return FluxUtil - .withContext( - context -> 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)) + return FluxUtil.withContext( + context -> service.getEntity(this.client.getEndpoint(), this.client.getApiVersion(), name, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the list of metadata entities. * - * @param context The context to associate with this operation. + * @param name Name of metadata entity. * @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 on successful completion of {@link Mono}. */ @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)); + private Mono getEntityAsync(String name) { + return getEntityWithResponseAsync(name).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * 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 as paginated response with {@link PagedFlux}. + * @return the list of metadata entities along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEntityWithResponse(String name, Context context) { + final String accept = "application/json"; + return service.getEntitySync(this.client.getEndpoint(), this.client.getApiVersion(), name, accept, context); } /** * Gets the list of metadata entities. * - * @param context The context to associate with this operation. + * @param name Name of metadata entity. * @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. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public MetadataEntityInner getEntity(String name) { + return getEntityWithResponse(name, Context.NONE).getValue(); } /** @@ -162,116 +174,107 @@ private PagedFlux listAsync(Context context) { * * @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 PagedIterable}. + * @return the list of metadata entities along with {@link PagedResponse} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> 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)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * 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 as paginated response with {@link PagedIterable}. + * @return the list of metadata entities as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** * Gets the list of metadata entities. * - * @param name Name of metadata entity. - * @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}. + * @return the list of metadata entities along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getEntityWithResponseAsync(String name) { - 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.")); - } + private PagedResponse listSinglePage() { final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.getEntity(this.client.getEndpoint(), name, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + 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); } /** * 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}. + * @return the list of metadata entities along with {@link PagedResponse}. */ @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.")); - } + private PagedResponse listSinglePage(Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getEntity(this.client.getEndpoint(), name, this.client.getApiVersion(), accept, context); + 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); } /** * Gets the list of metadata entities. * - * @param name Name of metadata entity. - * @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 on successful completion of {@link Mono}. + * @return the list of metadata entities as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getEntityAsync(String name) { - return getEntityWithResponseAsync(name).flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); } /** * 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}. + * @return the list of metadata entities as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getEntityWithResponse(String name, Context context) { - return getEntityWithResponseAsync(name, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); } /** - * Gets the list of metadata entities. + * Get the next page of items. * - * @param name Name of metadata entity. + * @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. + * @return the list of metadata entities along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public MetadataEntityInner getEntity(String name) { - return getEntityWithResponse(name, Context.NONE).getValue(); + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -281,22 +284,15 @@ public MetadataEntityInner getEntity(String name) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list 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) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + 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); } /** @@ -307,21 +303,14 @@ 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) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { 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); } } diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/MetadatasImpl.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/MetadatasImpl.java index d3afc8d850d76..6bcaba928bba1 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/MetadatasImpl.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/MetadatasImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.implementation; @@ -27,24 +27,10 @@ public MetadatasImpl(MetadatasClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new MetadataEntityImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new MetadataEntityImpl(inner1, this.manager())); - } - public Response getEntityWithResponse(String name, Context context) { Response inner = this.serviceClient().getEntityWithResponse(name, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new MetadataEntityImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new MetadataEntityImpl(inner.getValue(), this.manager())); } public MetadataEntity getEntity(String name) { @@ -56,6 +42,16 @@ public MetadataEntity getEntity(String name) { } } + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MetadataEntityImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MetadataEntityImpl(inner1, this.manager())); + } + private MetadatasClient serviceClient() { return this.innerClient; } diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/MicrosoftResourceHealthBuilder.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/MicrosoftResourceHealthBuilder.java index b70861eac855f..6ce606d9da00c 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/MicrosoftResourceHealthBuilder.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/MicrosoftResourceHealthBuilder.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.implementation; @@ -20,34 +20,34 @@ @ServiceClientBuilder(serviceClients = { MicrosoftResourceHealthImpl.class }) public final class MicrosoftResourceHealthBuilder { /* - * The ID of the target subscription. + * Service host */ - private String subscriptionId; + private String endpoint; /** - * Sets The ID of the target subscription. + * Sets Service host. * - * @param subscriptionId the subscriptionId value. + * @param endpoint the endpoint value. * @return the MicrosoftResourceHealthBuilder. */ - public MicrosoftResourceHealthBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; + public MicrosoftResourceHealthBuilder endpoint(String endpoint) { + this.endpoint = endpoint; return this; } /* - * server parameter + * The ID of the target subscription. The value must be an UUID. */ - private String endpoint; + private String subscriptionId; /** - * Sets server parameter. + * Sets The ID of the target subscription. The value must be an UUID. * - * @param endpoint the endpoint value. + * @param subscriptionId the subscriptionId value. * @return the MicrosoftResourceHealthBuilder. */ - public MicrosoftResourceHealthBuilder endpoint(String endpoint) { - this.endpoint = endpoint; + public MicrosoftResourceHealthBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; return this; } @@ -132,7 +132,7 @@ public MicrosoftResourceHealthImpl buildClient() { ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); MicrosoftResourceHealthImpl client = new MicrosoftResourceHealthImpl(localPipeline, localSerializerAdapter, - localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); + localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); return client; } } diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/MicrosoftResourceHealthImpl.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/MicrosoftResourceHealthImpl.java index 0d6aa5c50c4ab..77fbaf2c0a31e 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.implementation; @@ -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; @@ -49,26 +52,12 @@ @ServiceClient(builder = MicrosoftResourceHealthBuilder.class) public final class MicrosoftResourceHealthImpl implements MicrosoftResourceHealth { /** - * The ID of the target subscription. - */ - private final String subscriptionId; - - /** - * Gets The ID of the target subscription. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** - * server parameter. + * Service host. */ private final String endpoint; /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -77,12 +66,12 @@ public String getEndpoint() { } /** - * Api Version. + * Version parameter. */ private final String apiVersion; /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ @@ -90,6 +79,20 @@ public String getApiVersion() { return this.apiVersion; } + /** + * The ID of the target subscription. The value must be an UUID. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + /** * The HTTP pipeline to send requests through. */ @@ -132,20 +135,6 @@ public Duration getDefaultPollInterval() { return this.defaultPollInterval; } - /** - * The AvailabilityStatusesClient object to access its operations. - */ - private final AvailabilityStatusesClient availabilityStatuses; - - /** - * Gets the AvailabilityStatusesClient object to access its operations. - * - * @return the AvailabilityStatusesClient object. - */ - public AvailabilityStatusesClient getAvailabilityStatuses() { - return this.availabilityStatuses; - } - /** * The OperationsClient object to access its operations. */ @@ -161,59 +150,59 @@ public OperationsClient getOperations() { } /** - * The MetadatasClient object to access its operations. + * The AvailabilityStatusesClient object to access its operations. */ - private final MetadatasClient metadatas; + private final AvailabilityStatusesClient availabilityStatuses; /** - * Gets the MetadatasClient object to access its operations. + * Gets the AvailabilityStatusesClient object to access its operations. * - * @return the MetadatasClient object. + * @return the AvailabilityStatusesClient object. */ - public MetadatasClient getMetadatas() { - return this.metadatas; + public AvailabilityStatusesClient getAvailabilityStatuses() { + return this.availabilityStatuses; } /** - * The ImpactedResourcesClient object to access its operations. + * The ChildAvailabilityStatusesClient object to access its operations. */ - private final ImpactedResourcesClient impactedResources; + private final ChildAvailabilityStatusesClient childAvailabilityStatuses; /** - * Gets the ImpactedResourcesClient object to access its operations. + * Gets the ChildAvailabilityStatusesClient object to access its operations. * - * @return the ImpactedResourcesClient object. + * @return the ChildAvailabilityStatusesClient object. */ - public ImpactedResourcesClient getImpactedResources() { - return this.impactedResources; + public ChildAvailabilityStatusesClient getChildAvailabilityStatuses() { + return this.childAvailabilityStatuses; } /** - * The SecurityAdvisoryImpactedResourcesClient object to access its operations. + * The ImpactedResourcesClient object to access its operations. */ - private final SecurityAdvisoryImpactedResourcesClient securityAdvisoryImpactedResources; + private final ImpactedResourcesClient impactedResources; /** - * Gets the SecurityAdvisoryImpactedResourcesClient object to access its operations. + * Gets the ImpactedResourcesClient object to access its operations. * - * @return the SecurityAdvisoryImpactedResourcesClient object. + * @return the ImpactedResourcesClient object. */ - public SecurityAdvisoryImpactedResourcesClient getSecurityAdvisoryImpactedResources() { - return this.securityAdvisoryImpactedResources; + public ImpactedResourcesClient getImpactedResources() { + return this.impactedResources; } /** - * The EventsOperationsClient object to access its operations. + * The MetadatasClient object to access its operations. */ - private final EventsOperationsClient eventsOperations; + private final MetadatasClient metadatas; /** - * Gets the EventsOperationsClient object to access its operations. + * Gets the MetadatasClient object to access its operations. * - * @return the EventsOperationsClient object. + * @return the MetadatasClient object. */ - public EventsOperationsClient getEventsOperations() { - return this.eventsOperations; + public MetadatasClient getMetadatas() { + return this.metadatas; } /** @@ -231,31 +220,31 @@ public EventOperationsClient getEventOperations() { } /** - * The ChildAvailabilityStatusesClient object to access its operations. + * The EventsOperationsClient object to access its operations. */ - private final ChildAvailabilityStatusesClient childAvailabilityStatuses; + private final EventsOperationsClient eventsOperations; /** - * Gets the ChildAvailabilityStatusesClient object to access its operations. + * Gets the EventsOperationsClient object to access its operations. * - * @return the ChildAvailabilityStatusesClient object. + * @return the EventsOperationsClient object. */ - public ChildAvailabilityStatusesClient getChildAvailabilityStatuses() { - return this.childAvailabilityStatuses; + public EventsOperationsClient getEventsOperations() { + return this.eventsOperations; } /** - * The ChildResourcesClient object to access its operations. + * The SecurityAdvisoryImpactedResourcesClient object to access its operations. */ - private final ChildResourcesClient childResources; + private final SecurityAdvisoryImpactedResourcesClient securityAdvisoryImpactedResources; /** - * Gets the ChildResourcesClient object to access its operations. + * Gets the SecurityAdvisoryImpactedResourcesClient object to access its operations. * - * @return the ChildResourcesClient object. + * @return the SecurityAdvisoryImpactedResourcesClient object. */ - public ChildResourcesClient getChildResources() { - return this.childResources; + public SecurityAdvisoryImpactedResourcesClient getSecurityAdvisoryImpactedResources() { + return this.securityAdvisoryImpactedResources; } /** @@ -272,6 +261,20 @@ public EmergingIssuesClient getEmergingIssues() { return this.emergingIssues; } + /** + * The ChildResourcesClient object to access its operations. + */ + private final ChildResourcesClient childResources; + + /** + * Gets the ChildResourcesClient object to access its operations. + * + * @return the ChildResourcesClient object. + */ + public ChildResourcesClient getChildResources() { + return this.childResources; + } + /** * Initializes an instance of MicrosoftResourceHealth client. * @@ -279,27 +282,27 @@ public EmergingIssuesClient getEmergingIssues() { * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. - * @param subscriptionId The ID of the target subscription. - * @param endpoint server parameter. + * @param endpoint Service host. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. */ MicrosoftResourceHealthImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { + Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2023-10-01-preview"; - this.availabilityStatuses = new AvailabilityStatusesClientImpl(this); + this.subscriptionId = subscriptionId; + this.apiVersion = "2026-07-01"; this.operations = new OperationsClientImpl(this); - this.metadatas = new MetadatasClientImpl(this); + this.availabilityStatuses = new AvailabilityStatusesClientImpl(this); + this.childAvailabilityStatuses = new ChildAvailabilityStatusesClientImpl(this); this.impactedResources = new ImpactedResourcesClientImpl(this); - this.securityAdvisoryImpactedResources = new SecurityAdvisoryImpactedResourcesClientImpl(this); - this.eventsOperations = new EventsOperationsClientImpl(this); + this.metadatas = new MetadatasClientImpl(this); this.eventOperations = new EventOperationsClientImpl(this); - this.childAvailabilityStatuses = new ChildAvailabilityStatusesClientImpl(this); - this.childResources = new ChildResourcesClientImpl(this); + this.eventsOperations = new EventsOperationsClientImpl(this); + this.securityAdvisoryImpactedResources = new SecurityAdvisoryImpactedResourcesClientImpl(this); this.emergingIssues = new EmergingIssuesClientImpl(this); + this.childResources = new ChildResourcesClientImpl(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. * @@ -396,7 +416,7 @@ private static final class HttpResponseImpl extends HttpResponse { super(null); this.statusCode = statusCode; this.httpHeaders = httpHeaders; - this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + this.responseBody = responseBody == null ? new byte[0] : responseBody.getBytes(StandardCharsets.UTF_8); } public int getStatusCode() { diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/OperationListResultImpl.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/OperationListResultImpl.java index 77296a907cd80..da456d9421b26 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/OperationListResultImpl.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/OperationListResultImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.implementation; 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 da16606ec29ae..3c311570452e8 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.implementation; @@ -53,14 +53,21 @@ public final class OperationsClientImpl implements OperationsClient { * The interface defining all the services for MicrosoftResourceHealthOperations to be used by the proxy service to * perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "MicrosoftResourceHea") + @Host("{endpoint}") + @ServiceInterface(name = "MicrosoftResourceHealthOperations") public interface OperationsService { @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.ResourceHealth/operations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") 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("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); } @@ -73,10 +80,6 @@ Mono> list(@HostParam("$host") String endpoin */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listWithResponseAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext( @@ -84,26 +87,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 +110,8 @@ private Mono listAsync() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response listWithResponse(Context context) { - return listWithResponseAsync(context).block(); + final String accept = "application/json"; + return service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); } /** diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/OperationsImpl.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/OperationsImpl.java index e57f271053f98..23308306ed534 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/OperationsImpl.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/OperationsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.implementation; @@ -28,12 +28,8 @@ public OperationsImpl(OperationsClient innerClient, public Response listWithResponse(Context context) { Response inner = this.serviceClient().listWithResponse(context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new OperationListResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new OperationListResultImpl(inner.getValue(), this.manager())); } public OperationListResult list() { diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/ResourceManagerUtils.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/ResourceManagerUtils.java index 1fc619fe92b1b..565010ed502d6 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/ResourceManagerUtils.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/ResourceManagerUtils.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.implementation; @@ -8,12 +8,8 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.PagedResponse; import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.util.CoreUtils; -import java.util.ArrayList; import java.util.Arrays; -import java.util.Collections; import java.util.Iterator; -import java.util.List; import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -23,57 +19,43 @@ final class ResourceManagerUtils { private ResourceManagerUtils() { } - static String getValueFromIdByName(String id, String name) { - if (id == null) { + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null || parameterName == null) { return null; } - Iterator itr = Arrays.stream(id.split("/")).iterator(); - while (itr.hasNext()) { - String part = itr.next(); - if (part != null && !part.trim().isEmpty()) { - if (part.equalsIgnoreCase(name)) { - if (itr.hasNext()) { - return itr.next(); - } else { - return null; - } - } - } - } - return null; - } - - static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { - if (id == null || pathTemplate == null) { + String[] idSegments = id.split("/", -1); + String[] pathSegments = pathTemplate.split("/", -1); + int idStart = idSegments[0].isEmpty() ? 1 : 0; + int pathStart = pathSegments[0].isEmpty() ? 1 : 0; + if (idStart == idSegments.length || pathStart == pathSegments.length) { return null; } - String parameterNameParentheses = "{" + parameterName + "}"; - List idSegmentsReverted = Arrays.asList(id.split("/")); - List pathSegments = Arrays.asList(pathTemplate.split("/")); - Collections.reverse(idSegmentsReverted); - Iterator idItrReverted = idSegmentsReverted.iterator(); - int pathIndex = pathSegments.size(); - while (idItrReverted.hasNext() && pathIndex > 0) { - String idSegment = idItrReverted.next(); - String pathSegment = pathSegments.get(--pathIndex); - if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { - if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { - if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { - List segments = new ArrayList<>(); - segments.add(idSegment); - idItrReverted.forEachRemaining(segments::add); - Collections.reverse(segments); - if (!segments.isEmpty() && segments.get(0).isEmpty()) { - segments.remove(0); - } - return String.join("/", segments); - } else { - return idSegment; - } + for (int i = idStart; i < idSegments.length; ++i) { + if (idSegments[i].isEmpty()) { + return null; + } + } + String parameterPlaceholder = "{" + parameterName + "}"; + String value = null; + int idIndex = idSegments.length - 1; + for (int pathIndex = pathSegments.length - 1; pathIndex >= pathStart; --pathIndex, --idIndex) { + String pathSegment = pathSegments[pathIndex]; + boolean isParameter = pathSegment.startsWith("{") && pathSegment.endsWith("}"); + if (pathIndex == pathStart && isParameter) { + // A leading scope can span multiple segments, or be empty for tenant resources. + if (pathSegment.equalsIgnoreCase(parameterPlaceholder)) { + value = String.join("/", Arrays.copyOfRange(idSegments, idStart, idIndex + 1)); } + idIndex = idStart; + } else if (idIndex < idStart) { + return null; + } else if (!isParameter && !pathSegment.equalsIgnoreCase(idSegments[idIndex])) { + return null; + } else if (pathSegment.equalsIgnoreCase(parameterPlaceholder)) { + value = idSegments[idIndex]; } } - return null; + return idIndex < idStart ? value : null; } static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { 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 251a0edc8d241..44d718675a8cd 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.implementation; @@ -28,7 +28,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.resourcehealth.fluent.SecurityAdvisoryImpactedResourcesClient; import com.azure.resourcemanager.resourcehealth.fluent.models.EventImpactedResourceInner; -import com.azure.resourcemanager.resourcehealth.models.EventImpactedResourceListResult; +import com.azure.resourcemanager.resourcehealth.implementation.models.EventImpactedResourceListResult; import reactor.core.publisher.Mono; /** @@ -60,24 +60,41 @@ public final class SecurityAdvisoryImpactedResourcesClientImpl implements Securi * The interface defining all the services for MicrosoftResourceHealthSecurityAdvisoryImpactedResources to be used * by the proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "MicrosoftResourceHea") + @Host("{endpoint}") + @ServiceInterface(name = "MicrosoftResourceHealthSecurityAdvisoryImpactedResources") public interface SecurityAdvisoryImpactedResourcesService { @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/events/{eventTrackingId}/listSecurityAdvisoryImpactedResources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionIdAndEventId( - @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("eventTrackingId") String eventTrackingId, @QueryParam("api-version") String apiVersion, + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("eventTrackingId") String eventTrackingId, + @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("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("eventTrackingId") String eventTrackingId, + @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) + Mono> listByTenantIdAndEventId(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("eventTrackingId") String eventTrackingId, @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) - Mono> listByTenantIdAndEventId(@HostParam("$host") String endpoint, - @PathParam("eventTrackingId") String eventTrackingId, @QueryParam("api-version") String apiVersion, + Response listByTenantIdAndEventIdSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("eventTrackingId") String eventTrackingId, @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -85,7 +102,15 @@ Mono> listByTenantIdAndEventId(@HostPa @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionIdAndEventIdNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") 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("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -93,7 +118,15 @@ Mono> listBySubscriptionIdAndEventIdNe @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByTenantIdAndEventIdNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") 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("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } @@ -112,22 +145,10 @@ Mono> listByTenantIdAndEventIdNext( @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionIdAndEventIdSinglePageAsync(String eventTrackingId, String filter) { - 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"; return FluxUtil .withContext(context -> service.listBySubscriptionIdAndEventId(this.client.getEndpoint(), - this.client.getSubscriptionId(), eventTrackingId, this.client.getApiVersion(), filter, accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), eventTrackingId, filter, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -139,51 +160,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 +192,22 @@ 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) { + final String accept = "application/json"; + Response res + = service.listBySubscriptionIdAndEventIdSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), eventTrackingId, filter, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -214,13 +220,17 @@ 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)); + final String accept = "application/json"; + Response res + = service.listBySubscriptionIdAndEventIdSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), eventTrackingId, filter, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -235,7 +245,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 +264,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)); } /** @@ -271,18 +283,10 @@ public PagedIterable listBySubscriptionIdAndEventId( @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByTenantIdAndEventIdSinglePageAsync(String eventTrackingId, String filter) { - 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"; return FluxUtil - .withContext(context -> service.listByTenantIdAndEventId(this.client.getEndpoint(), eventTrackingId, - this.client.getApiVersion(), filter, accept, context)) + .withContext(context -> service.listByTenantIdAndEventId(this.client.getEndpoint(), + this.client.getApiVersion(), eventTrackingId, filter, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -294,46 +298,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 +329,21 @@ 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) { + final String accept = "application/json"; + Response res = service.listByTenantIdAndEventIdSync(this.client.getEndpoint(), + this.client.getApiVersion(), eventTrackingId, filter, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -364,13 +356,16 @@ 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) { + final String accept = "application/json"; + Response res = service.listByTenantIdAndEventIdSync(this.client.getEndpoint(), + this.client.getApiVersion(), eventTrackingId, filter, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -385,7 +380,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 +399,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)); } /** @@ -419,13 +416,6 @@ public PagedIterable listByTenantIdAndEventId(String @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionIdAndEventIdNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext( context -> service.listBySubscriptionIdAndEventIdNext(nextLink, this.client.getEndpoint(), accept, context)) @@ -434,6 +424,24 @@ 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) { + 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 +450,16 @@ 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) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listBySubscriptionIdAndEventIdNextSinglePage(String nextLink, + Context context) { 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); } /** @@ -475,13 +475,6 @@ public PagedIterable listByTenantIdAndEventId(String @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByTenantIdAndEventIdNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext( @@ -491,6 +484,24 @@ 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) { + 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 +510,15 @@ 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.")); - } - 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.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); } } diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/SecurityAdvisoryImpactedResourcesImpl.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/SecurityAdvisoryImpactedResourcesImpl.java index 6101b85f9fdb5..512c21f26d320 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/SecurityAdvisoryImpactedResourcesImpl.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/SecurityAdvisoryImpactedResourcesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.implementation; diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatusListResult.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/models/AvailabilityStatusListResult.java similarity index 67% rename from sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatusListResult.java rename to sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/models/AvailabilityStatusListResult.java index e4b7228c8aa82..13581e77501ac 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatusListResult.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/models/AvailabilityStatusListResult.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.resourcehealth.models; +package com.azure.resourcemanager.resourcehealth.implementation.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,7 +16,7 @@ /** * The List availabilityStatus operation response. */ -@Fluent +@Immutable public final class AvailabilityStatusListResult implements JsonSerializable { /* * The list of availabilityStatuses. @@ -33,7 +32,7 @@ public final class AvailabilityStatusListResult implements JsonSerializable value() { return this.value; } - /** - * Set the value property: The list of availabilityStatuses. - * - * @param value the value value to set. - * @return the AvailabilityStatusListResult object itself. - */ - public AvailabilityStatusListResult withValue(List value) { - this.value = value; - return this; - } - /** * Get the nextLink property: The URI to fetch the next page of availabilityStatuses. Call ListNext() with this URI * to fetch the next page of availabilityStatuses. @@ -66,35 +54,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The URI to fetch the next page of availabilityStatuses. Call ListNext() with this URI - * to fetch the next page of availabilityStatuses. - * - * @param nextLink the nextLink value to set. - * @return the AvailabilityStatusListResult object itself. - */ - public AvailabilityStatusListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property value in model AvailabilityStatusListResult")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AvailabilityStatusListResult.class); - /** * {@inheritDoc} */ diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EmergingIssueListResult.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/models/EmergingIssueListResult.java similarity index 72% rename from sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EmergingIssueListResult.java rename to sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/models/EmergingIssueListResult.java index 07b49f7ecfd89..2fe1028511de5 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EmergingIssueListResult.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/models/EmergingIssueListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.resourcehealth.models; +package com.azure.resourcemanager.resourcehealth.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * The list of emerging issues. */ -@Fluent +@Immutable public final class EmergingIssueListResult implements JsonSerializable { /* * The list of emerging issues. @@ -31,7 +31,7 @@ public final class EmergingIssueListResult implements JsonSerializable value() { return this.value; } - /** - * Set the value property: The list of emerging issues. - * - * @param value the value value to set. - * @return the EmergingIssueListResult object itself. - */ - public EmergingIssueListResult withValue(List value) { - this.value = value; - return this; - } - /** * Get the nextLink property: The link used to get the next page of emerging issues. * @@ -63,28 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link used to get the next page of emerging issues. - * - * @param nextLink the nextLink value to set. - * @return the EmergingIssueListResult object itself. - */ - public EmergingIssueListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventImpactedResourceListResult.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/models/EventImpactedResourceListResult.java similarity index 68% rename from sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventImpactedResourceListResult.java rename to sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/models/EventImpactedResourceListResult.java index c41c5a6c2b51e..03c289671b195 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventImpactedResourceListResult.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/models/EventImpactedResourceListResult.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.resourcehealth.models; +package com.azure.resourcemanager.resourcehealth.implementation.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,7 +16,7 @@ /** * The List of eventImpactedResources operation response. */ -@Fluent +@Immutable public final class EventImpactedResourceListResult implements JsonSerializable { /* * The list of eventImpactedResources. @@ -33,7 +32,7 @@ public final class EventImpactedResourceListResult implements JsonSerializable value() { return this.value; } - /** - * Set the value property: The list of eventImpactedResources. - * - * @param value the value value to set. - * @return the EventImpactedResourceListResult object itself. - */ - public EventImpactedResourceListResult withValue(List value) { - this.value = value; - return this; - } - /** * Get the nextLink property: The URI to fetch the next page of events. Call ListNext() with this URI to fetch the * next page of impacted resource. @@ -66,35 +54,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The URI to fetch the next page of events. Call ListNext() with this URI to fetch the - * next page of impacted resource. - * - * @param nextLink the nextLink value to set. - * @return the EventImpactedResourceListResult object itself. - */ - public EventImpactedResourceListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property value in model EventImpactedResourceListResult")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(EventImpactedResourceListResult.class); - /** * {@inheritDoc} */ diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/Events.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/models/Events.java similarity index 60% rename from sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/Events.java rename to sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/models/Events.java index 416a1251e8128..67adb4b97fda5 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/Events.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/models/Events.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.resourcehealth.models; +package com.azure.resourcemanager.resourcehealth.implementation.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,26 +16,26 @@ /** * The List events operation response. */ -@Fluent +@Immutable public final class Events implements JsonSerializable { /* - * The list of event. + * The Event items on this page */ private List value; /* - * The URI to fetch the next page of events. Call ListNext() with this URI to fetch the next page of events. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of Events class. */ - public Events() { + private Events() { } /** - * Get the value property: The list of event. + * Get the value property: The Event items on this page. * * @return the value value. */ @@ -45,19 +44,7 @@ public List value() { } /** - * Set the value property: The list of event. - * - * @param value the value value to set. - * @return the Events object itself. - */ - public Events withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI to fetch the next page of events. Call ListNext() with this URI to fetch the - * next page of events. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -65,33 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The URI to fetch the next page of events. Call ListNext() with this URI to fetch the - * next page of events. - * - * @param nextLink the nextLink value to set. - * @return the Events object itself. - */ - public Events withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER.atError().log(new IllegalArgumentException("Missing required property value in model Events")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(Events.class); - /** * {@inheritDoc} */ diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/MetadataEntityListResult.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/models/MetadataEntityListResult.java similarity index 72% rename from sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/MetadataEntityListResult.java rename to sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/models/MetadataEntityListResult.java index 03666d25d2810..5205a02329405 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/MetadataEntityListResult.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/models/MetadataEntityListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.resourcehealth.models; +package com.azure.resourcemanager.resourcehealth.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * The list of metadata entities. */ -@Fluent +@Immutable public final class MetadataEntityListResult implements JsonSerializable { /* * The list of metadata entities. @@ -31,7 +31,7 @@ public final class MetadataEntityListResult implements JsonSerializable value() { return this.value; } - /** - * Set the value property: The list of metadata entities. - * - * @param value the value value to set. - * @return the MetadataEntityListResult object itself. - */ - public MetadataEntityListResult withValue(List value) { - this.value = value; - return this; - } - /** * Get the nextLink property: The link used to get the next page of metadata. * @@ -63,28 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link used to get the next page of metadata. - * - * @param nextLink the nextLink value to set. - * @return the MetadataEntityListResult object itself. - */ - public MetadataEntityListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/package-info.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/package-info.java index 896f10a5e54bc..e3bcb301a3f0f 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/package-info.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the implementations for MicrosoftResourceHealth. + * Package containing the implementations for ResourceHealth. * The Resource Health Client. */ package com.azure.resourcemanager.resourcehealth.implementation; diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ApiOperationLink.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ApiOperationLink.java new file mode 100644 index 0000000000000..7551c9eea11e2 --- /dev/null +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ApiOperationLink.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resourcehealth.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * An API operation associated with an event. + */ +@Immutable +public final class ApiOperationLink implements JsonSerializable { + /* + * HTTP method to use. Resource Health returns GET for Advisor recommendations. + */ + private String httpMethod; + + /* + * Opaque absolute ARM URL for the associated API operation. + */ + private String url; + + /* + * Human-readable description of the operation. Clients must not parse this value. + */ + private String description; + + /** + * Creates an instance of ApiOperationLink class. + */ + private ApiOperationLink() { + } + + /** + * Get the httpMethod property: HTTP method to use. Resource Health returns GET for Advisor recommendations. + * + * @return the httpMethod value. + */ + public String httpMethod() { + return this.httpMethod; + } + + /** + * Get the url property: Opaque absolute ARM URL for the associated API operation. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Get the description property: Human-readable description of the operation. Clients must not parse this value. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApiOperationLink from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApiOperationLink if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ApiOperationLink. + */ + public static ApiOperationLink fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApiOperationLink deserializedApiOperationLink = new ApiOperationLink(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("httpMethod".equals(fieldName)) { + deserializedApiOperationLink.httpMethod = reader.getString(); + } else if ("url".equals(fieldName)) { + deserializedApiOperationLink.url = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedApiOperationLink.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApiOperationLink; + }); + } +} diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStateValues.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStateValues.java index ed60bc1123c4f..292b3ecc6209f 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStateValues.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStateValues.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.models; @@ -12,22 +12,22 @@ */ public final class AvailabilityStateValues extends ExpandableStringEnum { /** - * Static value Available for AvailabilityStateValues. + * Available. */ public static final AvailabilityStateValues AVAILABLE = fromString("Available"); /** - * Static value Unavailable for AvailabilityStateValues. + * Unavailable. */ public static final AvailabilityStateValues UNAVAILABLE = fromString("Unavailable"); /** - * Static value Degraded for AvailabilityStateValues. + * Degraded. */ public static final AvailabilityStateValues DEGRADED = fromString("Degraded"); /** - * Static value Unknown for AvailabilityStateValues. + * Unknown. */ public static final AvailabilityStateValues UNKNOWN = fromString("Unknown"); diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatus.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatus.java index bf73f8565874c..c75b75445ea92 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatus.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatus.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.models; @@ -11,39 +11,39 @@ */ public interface AvailabilityStatus { /** - * Gets the id property: Azure Resource Manager Identity for the availabilityStatuses resource. + * Gets the properties property: Properties of availability state. * - * @return the id value. + * @return the properties value. */ - String id(); + AvailabilityStatusProperties properties(); /** - * Gets the name property: current. + * Gets the location property: Azure Resource Manager geo location of the resource. * - * @return the name value. + * @return the location value. */ - String name(); + String location(); /** - * Gets the type property: Microsoft.ResourceHealth/AvailabilityStatuses. + * Gets the id property: Azure Resource Manager Identity for the availabilityStatuses resource. * - * @return the type value. + * @return the id value. */ - String type(); + String id(); /** - * Gets the location property: Azure Resource Manager geo location of the resource. + * Gets the name property: The name property. * - * @return the location value. + * @return the name value. */ - String location(); + String name(); /** - * Gets the properties property: Properties of availability state. + * Gets the type property: Microsoft.ResourceHealth/AvailabilityStatuses. * - * @return the properties value. + * @return the type value. */ - AvailabilityStatusProperties properties(); + String type(); /** * Gets the inner com.azure.resourcemanager.resourcehealth.fluent.models.AvailabilityStatusInner object. diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatusProperties.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatusProperties.java index 425f0703a1923..f5ab4efebc681 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatusProperties.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatusProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -18,7 +18,7 @@ /** * Properties of availability state. */ -@Fluent +@Immutable public final class AvailabilityStatusProperties implements JsonSerializable { /* * Availability status of the resource. When it is null, this availabilityStatus object represents an availability @@ -133,7 +133,7 @@ public final class AvailabilityStatusProperties implements JsonSerializable recommendedActions() { return this.recommendedActions; } - /** - * Set the recommendedActions property: Lists actions the user can take based on the current availabilityState of - * the resource. - * - * @param recommendedActions the recommendedActions value to set. - * @return the AvailabilityStatusProperties object itself. - */ - public AvailabilityStatusProperties withRecommendedActions(List recommendedActions) { - this.recommendedActions = recommendedActions; - return this; - } - /** * Get the serviceImpactingEvents property: Lists the service impacting events that may be affecting the health of * the resource. @@ -549,35 +328,6 @@ public List serviceImpactingEvents() { return this.serviceImpactingEvents; } - /** - * Set the serviceImpactingEvents property: Lists the service impacting events that may be affecting the health of - * the resource. - * - * @param serviceImpactingEvents the serviceImpactingEvents value to set. - * @return the AvailabilityStatusProperties object itself. - */ - public AvailabilityStatusProperties withServiceImpactingEvents(List serviceImpactingEvents) { - this.serviceImpactingEvents = serviceImpactingEvents; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (recentlyResolved() != null) { - recentlyResolved().validate(); - } - if (recommendedActions() != null) { - recommendedActions().forEach(e -> e.validate()); - } - if (serviceImpactingEvents() != null) { - serviceImpactingEvents().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatusPropertiesRecentlyResolved.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatusPropertiesRecentlyResolved.java index 479de7bde8604..eae0a102244de 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatusPropertiesRecentlyResolved.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatusPropertiesRecentlyResolved.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -18,7 +18,7 @@ * An annotation describing a change in the availabilityState to Available from Unavailable with a reasonType of type * Unplanned. */ -@Fluent +@Immutable public final class AvailabilityStatusPropertiesRecentlyResolved implements JsonSerializable { /* @@ -39,7 +39,7 @@ public final class AvailabilityStatusPropertiesRecentlyResolved /** * Creates an instance of AvailabilityStatusPropertiesRecentlyResolved class. */ - public AvailabilityStatusPropertiesRecentlyResolved() { + private AvailabilityStatusPropertiesRecentlyResolved() { } /** @@ -51,18 +51,6 @@ public OffsetDateTime unavailableOccuredTime() { return this.unavailableOccuredTime; } - /** - * Set the unavailableOccuredTime property: Timestamp for when the availabilityState changed to Unavailable. - * - * @param unavailableOccuredTime the unavailableOccuredTime value to set. - * @return the AvailabilityStatusPropertiesRecentlyResolved object itself. - */ - public AvailabilityStatusPropertiesRecentlyResolved - withUnavailableOccuredTime(OffsetDateTime unavailableOccuredTime) { - this.unavailableOccuredTime = unavailableOccuredTime; - return this; - } - /** * Get the resolvedTime property: Timestamp when the availabilityState changes to Available. * @@ -72,17 +60,6 @@ public OffsetDateTime resolvedTime() { return this.resolvedTime; } - /** - * Set the resolvedTime property: Timestamp when the availabilityState changes to Available. - * - * @param resolvedTime the resolvedTime value to set. - * @return the AvailabilityStatusPropertiesRecentlyResolved object itself. - */ - public AvailabilityStatusPropertiesRecentlyResolved withResolvedTime(OffsetDateTime resolvedTime) { - this.resolvedTime = resolvedTime; - return this; - } - /** * Get the unavailableSummary property: Brief description of cause of the resource becoming unavailable. * @@ -92,25 +69,6 @@ public String unavailableSummary() { return this.unavailableSummary; } - /** - * Set the unavailableSummary property: Brief description of cause of the resource becoming unavailable. - * - * @param unavailableSummary the unavailableSummary value to set. - * @return the AvailabilityStatusPropertiesRecentlyResolved object itself. - */ - public AvailabilityStatusPropertiesRecentlyResolved withUnavailableSummary(String unavailableSummary) { - this.unavailableSummary = unavailableSummary; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatuses.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatuses.java index 2bf4214faaccd..f7fc0c1837cb9 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatuses.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatuses.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.models; @@ -13,43 +13,44 @@ */ public interface AvailabilityStatuses { /** - * Lists the current availability status for all the resources in the subscription. + * Gets current availability status for a single resource. * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param filter The filter to apply on the operation. For more information please see + * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List availabilityStatus operation response as paginated response with {@link PagedIterable}. + * @return current availability status for a single resource along with {@link Response}. */ - PagedIterable listBySubscriptionId(); + Response getByResourceWithResponse(String resourceUri, String filter, String expand, + Context context); /** - * Lists the current availability status for all the resources in the subscription. + * Gets current availability status for a single resource. * - * @param filter The filter to apply on the operation. For more information please see - * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. - * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. - * @param context The context to associate with this operation. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List availabilityStatus operation response as paginated response with {@link PagedIterable}. + * @return current availability status for a single resource. */ - PagedIterable listBySubscriptionId(String filter, String expand, Context context); + AvailabilityStatus getByResource(String resourceUri); /** - * Lists the current availability status for all the resources in the resource group. + * Lists the current availability status for all the resources in the subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the List availabilityStatus operation response as paginated response with {@link PagedIterable}. */ - PagedIterable listByResourceGroup(String resourceGroupName); + PagedIterable listBySubscriptionId(); /** - * Lists the current availability status for all the resources in the resource group. + * Lists the current availability status for all the resources in the subscription. * - * @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. @@ -59,67 +60,49 @@ public interface AvailabilityStatuses { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the List availabilityStatus operation response as paginated response with {@link PagedIterable}. */ - PagedIterable listByResourceGroup(String resourceGroupName, String filter, String expand, - Context context); + PagedIterable listBySubscriptionId(String filter, String expand, Context context); /** - * Gets current availability status for a single resource. + * Lists all historical availability transitions and impacting events for a single resource. * - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. - * Currently the API support not nested and one nesting level resource types : - * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} - * and - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}. - * @param filter The filter to apply on the operation. For more information please see - * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. - * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. - * @param context The context to associate with this operation. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return current availability status for a single resource along with {@link Response}. + * @return the List availabilityStatus operation response as paginated response with {@link PagedIterable}. */ - Response getByResourceWithResponse(String resourceUri, String filter, String expand, - Context context); + PagedIterable list(String resourceUri); /** - * Gets current availability status for a single resource. + * Lists all historical availability transitions and impacting events for a single resource. * - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. - * Currently the API support not nested and one nesting level resource types : - * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} - * and - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param filter The filter to apply on the operation. For more information please see + * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. + * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return current availability status for a single resource. + * @return the List availabilityStatus operation response as paginated response with {@link PagedIterable}. */ - AvailabilityStatus getByResource(String resourceUri); + PagedIterable list(String resourceUri, String filter, String expand, Context context); /** - * Lists all historical availability transitions and impacting events for a single resource. + * Lists the current availability status for all the resources in the resource group. * - * @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 resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the List availabilityStatus operation response as paginated response with {@link PagedIterable}. */ - PagedIterable list(String resourceUri); + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Lists all historical availability transitions and impacting events for a single resource. + * Lists the current availability status for all the resources in the resource group. * - * @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 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. @@ -129,5 +112,6 @@ Response getByResourceWithResponse(String resourceUri, Strin * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the List availabilityStatus operation response as paginated response with {@link PagedIterable}. */ - PagedIterable list(String resourceUri, String filter, String expand, Context context); + PagedIterable listByResourceGroup(String resourceGroupName, String filter, String expand, + Context context); } diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ChildAvailabilityStatuses.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ChildAvailabilityStatuses.java index 70529161578cd..e747ba7aacd87 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ChildAvailabilityStatuses.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ChildAvailabilityStatuses.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.models; @@ -15,9 +15,7 @@ public interface ChildAvailabilityStatuses { /** * 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 resourceUri undefined. * @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. @@ -33,9 +31,7 @@ Response getByResourceWithResponse(String resourceUri, Strin /** * 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 resourceUri undefined. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -47,9 +43,7 @@ Response getByResourceWithResponse(String resourceUri, Strin * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response * to get the next page of availability status. * - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. - * Currently the API only support one nesting level resource types : - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}. + * @param resourceUri undefined. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -61,9 +55,7 @@ Response getByResourceWithResponse(String resourceUri, Strin * Lists the historical availability statuses for a single child resource. Use the nextLink property in the response * to get the next page of availability status. * - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. - * Currently the API only support one nesting level resource types : - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}. + * @param resourceUri undefined. * @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. diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ChildResources.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ChildResources.java index 89fe205e234e2..f0d863845f03f 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ChildResources.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ChildResources.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.models; @@ -15,9 +15,7 @@ public interface ChildResources { * Lists the all the children and its current health status for a parent resource. Use the nextLink property in the * response to get the next page of children current health. * - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. - * Currently the API only support not nested parent resource type: - * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -29,9 +27,7 @@ public interface ChildResources { * Lists the all the children and its current health status for a parent resource. Use the nextLink property in the * response to get the next page of children current health. * - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type. - * Currently the API only support not nested parent resource type: - * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param filter The filter to apply on the operation. For more information please see * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response. diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EmergingIssueImpact.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EmergingIssueImpact.java index 4f95a49675ce6..4e9f1d91f741b 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EmergingIssueImpact.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EmergingIssueImpact.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * Object of the emerging issue impact on services and regions. */ -@Fluent +@Immutable public final class EmergingIssueImpact implements JsonSerializable { /* * The impacted service id. @@ -35,7 +35,7 @@ public final class EmergingIssueImpact implements JsonSerializable regions() { return this.regions; } - /** - * Set the regions property: The list of impacted regions for corresponding emerging issues. - * - * @param regions the regions value to set. - * @return the EmergingIssueImpact object itself. - */ - public EmergingIssueImpact withRegions(List regions) { - this.regions = regions; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (regions() != null) { - regions().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EmergingIssues.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EmergingIssues.java index f2618060517da..b20c31eb85eed 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EmergingIssues.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EmergingIssues.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.models; @@ -13,45 +13,45 @@ */ public interface EmergingIssues { /** - * Lists Azure services' emerging issues. + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of emerging issues as paginated response with {@link PagedIterable}. + * @return azure services' emerging issues along with {@link Response}. */ - PagedIterable list(); + Response getWithResponse(IssueNameParameter issueName, Context context); /** - * Lists Azure services' emerging issues. + * Gets Azure services' emerging issues. * - * @param context The context to associate with this operation. + * @param issueName The name of the emerging issue. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of emerging issues as paginated response with {@link PagedIterable}. + * @return azure services' emerging issues. */ - PagedIterable list(Context context); + EmergingIssuesGetResult get(IssueNameParameter issueName); /** - * Gets Azure services' emerging issues. + * Lists 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure services' emerging issues along with {@link Response}. + * @return the list of emerging issues as paginated response with {@link PagedIterable}. */ - Response getWithResponse(IssueNameParameter issueName, Context context); + PagedIterable list(); /** - * Gets Azure services' emerging issues. + * Lists 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure services' emerging issues. + * @return the list of emerging issues as paginated response with {@link PagedIterable}. */ - EmergingIssuesGetResult get(IssueNameParameter issueName); + PagedIterable list(Context context); } diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EmergingIssuesGetResult.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EmergingIssuesGetResult.java index 491e1c5687816..37c408ee7efeb 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EmergingIssuesGetResult.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EmergingIssuesGetResult.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.models; 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 392696297ece1..2e4da1392864a 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.models; @@ -49,13 +49,20 @@ public interface Event { EventTypeValues eventType(); /** - * Gets the eventSubType property: Sub type of the event. Currently used to determine retirement communications for - * health advisory events. + * Gets the eventSubType property: Sub-type of event. * * @return the eventSubType value. */ EventSubTypeValues eventSubType(); + /** + * Gets the advisorRecommendations property: Operation for listing Advisor recommendations associated with this + * event's tracking ID in the response subscription. + * + * @return the advisorRecommendations value. + */ + ApiOperationLink advisorRecommendations(); + /** * Gets the eventSource property: Source of event. * @@ -78,7 +85,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 +113,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 +201,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 +267,49 @@ public interface Event { String impactType(); /** - * Gets the maintenanceId property: Unique identifier for planned maintenance event. + * 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 eventTags value. + */ + List eventTags(); + + /** + * Gets the newRate property: Billing rate change information - new rate. + * + * @return the newRate value. + */ + Double newRate(); + + /** + * Gets the oldRate property: Billing rate change information - old rate. * - * @return the maintenanceId value. + * @return the oldRate value. */ - String maintenanceId(); + Double oldRate(); /** - * Gets the maintenanceType property: The type of planned maintenance event. + * Gets the currencyType property: Billing currency type information. Example: USD, CAD. * - * @return the maintenanceType value. + * @return the currencyType value. */ - String maintenanceType(); + String currencyType(); /** - * Gets the argQuery property: Azure Resource Graph query to fetch the affected resources from their existing Azure - * Resource Graph locations. + * Gets the billingId property: Billing identifier information. * - * @return the argQuery value. + * @return the billingId value. */ - String argQuery(); + String billingId(); /** * 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 40ec5cb51b35e..8e53179769433 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.models; @@ -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/EventLevelValues.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventLevelValues.java index a2acdc216d332..c84d8693f4757 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventLevelValues.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventLevelValues.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.models; @@ -12,22 +12,22 @@ */ public final class EventLevelValues extends ExpandableStringEnum { /** - * Static value Critical for EventLevelValues. + * Critical. */ public static final EventLevelValues CRITICAL = fromString("Critical"); /** - * Static value Error for EventLevelValues. + * Error. */ public static final EventLevelValues ERROR = fromString("Error"); /** - * Static value Warning for EventLevelValues. + * Warning. */ public static final EventLevelValues WARNING = fromString("Warning"); /** - * Static value Informational for EventLevelValues. + * Informational. */ public static final EventLevelValues INFORMATIONAL = fromString("Informational"); 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 c97860a7c5cfa..04ac1dddf64df 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.models; @@ -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. @@ -64,14 +66,40 @@ Response getBySubscriptionIdAndTrackingIdWithResponse(String eventTrackin */ Event fetchDetailsBySubscriptionIdAndTrackingId(String eventTrackingId); + /** + * Service health event details specific in the subscription by event tracking id. This can be used to fetch + * sensitive properties for Billing event type. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service health event along with {@link Response}. + */ + Response fetchBilllingCommunicationDetailsBySubscriptionIdAndTrackingIdWithResponse(String eventTrackingId, + Context context); + + /** + * Service health event details specific in the subscription by event tracking id. This can be used to fetch + * sensitive properties for Billing event type. + * + * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service health event. + */ + Event fetchBilllingCommunicationDetailsBySubscriptionIdAndTrackingId(String eventTrackingId); + /** * 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 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 +122,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 +136,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/EventPropertiesAdditionalInformation.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventPropertiesAdditionalInformation.java index c4622c988ae82..78e68cf112d05 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventPropertiesAdditionalInformation.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventPropertiesAdditionalInformation.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Additional information. */ -@Fluent +@Immutable public final class EventPropertiesAdditionalInformation implements JsonSerializable { /* @@ -25,7 +25,7 @@ public final class EventPropertiesAdditionalInformation /** * Creates an instance of EventPropertiesAdditionalInformation class. */ - public EventPropertiesAdditionalInformation() { + private EventPropertiesAdditionalInformation() { } /** @@ -37,25 +37,6 @@ public String message() { return this.message; } - /** - * Set the message property: Additional information Message. - * - * @param message the message value to set. - * @return the EventPropertiesAdditionalInformation object itself. - */ - public EventPropertiesAdditionalInformation withMessage(String message) { - this.message = message; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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 2ee4ec57d0656..e65e84b7ac583 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Article of event. */ -@Fluent +@Immutable public final class EventPropertiesArticle implements JsonSerializable { /* * Article content of event. @@ -34,7 +34,7 @@ public final class EventPropertiesArticle implements JsonSerializable { /* * Recommended action title for the service health event. @@ -35,7 +35,7 @@ public final class EventPropertiesRecommendedActions implements JsonSerializable /** * Creates an instance of EventPropertiesRecommendedActions class. */ - public EventPropertiesRecommendedActions() { + private EventPropertiesRecommendedActions() { } /** @@ -47,17 +47,6 @@ public String message() { return this.message; } - /** - * Set the message property: Recommended action title for the service health event. - * - * @param message the message value to set. - * @return the EventPropertiesRecommendedActions object itself. - */ - public EventPropertiesRecommendedActions withMessage(String message) { - this.message = message; - return this; - } - /** * Get the actions property: Recommended actions for the service health event. * @@ -67,17 +56,6 @@ public List actions() { return this.actions; } - /** - * Set the actions property: Recommended actions for the service health event. - * - * @param actions the actions value to set. - * @return the EventPropertiesRecommendedActions object itself. - */ - public EventPropertiesRecommendedActions withActions(List actions) { - this.actions = actions; - return this; - } - /** * Get the localeCode property: Recommended action locale for the service health event. * @@ -87,28 +65,6 @@ public String localeCode() { return this.localeCode; } - /** - * Set the localeCode property: Recommended action locale for the service health event. - * - * @param localeCode the localeCode value to set. - * @return the EventPropertiesRecommendedActions object itself. - */ - public EventPropertiesRecommendedActions withLocaleCode(String localeCode) { - this.localeCode = localeCode; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (actions() != null) { - actions().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventPropertiesRecommendedActionsItem.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventPropertiesRecommendedActionsItem.java index 5ca8d6b1704a8..a1fb65c5f245f 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventPropertiesRecommendedActionsItem.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventPropertiesRecommendedActionsItem.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Recommended action for the service health event. */ -@Fluent +@Immutable public final class EventPropertiesRecommendedActionsItem implements JsonSerializable { /* @@ -30,7 +30,7 @@ public final class EventPropertiesRecommendedActionsItem /** * Creates an instance of EventPropertiesRecommendedActionsItem class. */ - public EventPropertiesRecommendedActionsItem() { + private EventPropertiesRecommendedActionsItem() { } /** @@ -42,17 +42,6 @@ public Integer groupId() { return this.groupId; } - /** - * Set the groupId property: Recommended action group Id for the service health event. - * - * @param groupId the groupId value to set. - * @return the EventPropertiesRecommendedActionsItem object itself. - */ - public EventPropertiesRecommendedActionsItem withGroupId(Integer groupId) { - this.groupId = groupId; - return this; - } - /** * Get the actionText property: Recommended action text. * @@ -62,25 +51,6 @@ public String actionText() { return this.actionText; } - /** - * Set the actionText property: Recommended action text. - * - * @param actionText the actionText value to set. - * @return the EventPropertiesRecommendedActionsItem object itself. - */ - public EventPropertiesRecommendedActionsItem withActionText(String actionText) { - this.actionText = actionText; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventSourceValues.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventSourceValues.java index 137adefba19a5..7022fe0d1ff69 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventSourceValues.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventSourceValues.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.models; @@ -12,12 +12,12 @@ */ public final class EventSourceValues extends ExpandableStringEnum { /** - * Static value ResourceHealth for EventSourceValues. + * ResourceHealth. */ public static final EventSourceValues RESOURCE_HEALTH = fromString("ResourceHealth"); /** - * Static value ServiceHealth for EventSourceValues. + * ServiceHealth. */ public static final EventSourceValues SERVICE_HEALTH = fromString("ServiceHealth"); diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventStatusValues.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventStatusValues.java index e78797b218dfa..4668007568824 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventStatusValues.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventStatusValues.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.models; @@ -12,12 +12,12 @@ */ public final class EventStatusValues extends ExpandableStringEnum { /** - * Static value Active for EventStatusValues. + * Active. */ public static final EventStatusValues ACTIVE = fromString("Active"); /** - * Static value Resolved for EventStatusValues. + * Resolved. */ public static final EventStatusValues RESOLVED = fromString("Resolved"); 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 index 30fe2776f44d2..ad799b0bd61ca 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.models; @@ -8,14 +8,49 @@ import java.util.Collection; /** - * Sub type of the event. Currently used to determine retirement communications for health advisory events. + * Sub-type of event. */ public final class EventSubTypeValues extends ExpandableStringEnum { /** - * Static value Retirement for EventSubTypeValues. + * Retirement. */ public static final EventSubTypeValues RETIREMENT = fromString("Retirement"); + /** + * ForeignExchangeRateChange. + */ + public static final EventSubTypeValues FOREIGN_EXCHANGE_RATE_CHANGE = fromString("ForeignExchangeRateChange"); + + /** + * Underbilling. + */ + public static final EventSubTypeValues UNDERBILLING = fromString("Underbilling"); + + /** + * Overbilling. + */ + public static final EventSubTypeValues OVERBILLING = fromString("Overbilling"); + + /** + * PriceChanges. + */ + public static final EventSubTypeValues PRICE_CHANGES = fromString("PriceChanges"); + + /** + * TaxChanges. + */ + public static final EventSubTypeValues TAX_CHANGES = fromString("TaxChanges"); + + /** + * MeterIDChanges. + */ + public static final EventSubTypeValues METER_IDCHANGES = fromString("MeterIDChanges"); + + /** + * UnauthorizedPartyAbuse. + */ + public static final EventSubTypeValues UNAUTHORIZED_PARTY_ABUSE = fromString("UnauthorizedPartyAbuse"); + /** * Creates a new instance of EventSubTypeValues value. * diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventTypeValues.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventTypeValues.java index f01b03ae1b005..dd847b6e9920a 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventTypeValues.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/EventTypeValues.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.models; @@ -12,35 +12,40 @@ */ public final class EventTypeValues extends ExpandableStringEnum { /** - * Static value ServiceIssue for EventTypeValues. + * ServiceIssue. */ public static final EventTypeValues SERVICE_ISSUE = fromString("ServiceIssue"); /** - * Static value PlannedMaintenance for EventTypeValues. + * PlannedMaintenance. */ public static final EventTypeValues PLANNED_MAINTENANCE = fromString("PlannedMaintenance"); /** - * Static value HealthAdvisory for EventTypeValues. + * HealthAdvisory. */ public static final EventTypeValues HEALTH_ADVISORY = fromString("HealthAdvisory"); /** - * Static value RCA for EventTypeValues. + * RCA. */ public static final EventTypeValues RCA = fromString("RCA"); /** - * Static value EmergingIssues for EventTypeValues. + * EmergingIssues. */ public static final EventTypeValues EMERGING_ISSUES = fromString("EmergingIssues"); /** - * Static value SecurityAdvisory for EventTypeValues. + * SecurityAdvisory. */ public static final EventTypeValues SECURITY_ADVISORY = fromString("SecurityAdvisory"); + /** + * Billing. + */ + public static final EventTypeValues BILLING = fromString("Billing"); + /** * Creates a new instance of EventTypeValues value. * 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 4520d31061e48..fc0858bb671fa 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.models; @@ -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. @@ -62,11 +62,7 @@ public interface EventsOperations { /** * Lists current service health events for given 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 resourceUri The fully qualified Azure Resource manager identifier of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -77,11 +73,7 @@ public interface EventsOperations { /** * Lists current service health events for given 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 resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param filter The filter to apply on the operation. For more information please see * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. * @param context The context to associate with this operation. diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/Faq.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/Faq.java index 230c0e9a1c2f0..49a2d1dddb6aa 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/Faq.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/Faq.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Frequently asked question for the service health event. */ -@Fluent +@Immutable public final class Faq implements JsonSerializable { /* * FAQ question for the service health event. @@ -34,7 +34,7 @@ public final class Faq implements JsonSerializable { /** * Creates an instance of Faq class. */ - public Faq() { + private Faq() { } /** @@ -46,17 +46,6 @@ public String question() { return this.question; } - /** - * Set the question property: FAQ question for the service health event. - * - * @param question the question value to set. - * @return the Faq object itself. - */ - public Faq withQuestion(String question) { - this.question = question; - return this; - } - /** * Get the answer property: FAQ answer for the service health event. * @@ -66,17 +55,6 @@ public String answer() { return this.answer; } - /** - * Set the answer property: FAQ answer for the service health event. - * - * @param answer the answer value to set. - * @return the Faq object itself. - */ - public Faq withAnswer(String answer) { - this.answer = answer; - return this; - } - /** * Get the localeCode property: FAQ locale for the service health event. * @@ -86,25 +64,6 @@ public String localeCode() { return this.localeCode; } - /** - * Set the localeCode property: FAQ locale for the service health event. - * - * @param localeCode the localeCode value to set. - * @return the Faq object itself. - */ - public Faq withLocaleCode(String localeCode) { - this.localeCode = localeCode; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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 21557fd0ba10c..ee5642a9f368d 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,13 +15,18 @@ /** * Azure service impacted by the service health event. */ -@Fluent +@Immutable public final class Impact implements JsonSerializable { /* * Impacted service name. */ 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. */ @@ -30,7 +35,7 @@ public final class Impact implements JsonSerializable { /** * Creates an instance of Impact class. */ - public Impact() { + private Impact() { } /** @@ -43,14 +48,13 @@ public String impactedService() { } /** - * Set the impactedService property: Impacted service name. + * Get the impactedServiceGuid property: Impacted service guid. This is the permanent identifier for the impacted + * service. * - * @param impactedService the impactedService value to set. - * @return the Impact object itself. + * @return the impactedServiceGuid value. */ - public Impact withImpactedService(String impactedService) { - this.impactedService = impactedService; - return this; + public String impactedServiceGuid() { + return this.impactedServiceGuid; } /** @@ -62,28 +66,6 @@ public List impactedRegions() { return this.impactedRegions; } - /** - * Set the impactedRegions property: List regions impacted by the service health event. - * - * @param impactedRegions the impactedRegions value to set. - * @return the Impact object itself. - */ - public Impact withImpactedRegions(List impactedRegions) { - this.impactedRegions = impactedRegions; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (impactedRegions() != null) { - impactedRegions().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -91,6 +73,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 +96,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/ImpactedRegion.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ImpactedRegion.java index 432a136919a9a..e725a53a83ccc 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ImpactedRegion.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ImpactedRegion.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Object of impacted region. */ -@Fluent +@Immutable public final class ImpactedRegion implements JsonSerializable { /* * The impacted region id. @@ -29,7 +29,7 @@ public final class ImpactedRegion implements JsonSerializable { /** * Creates an instance of ImpactedRegion class. */ - public ImpactedRegion() { + private ImpactedRegion() { } /** @@ -41,17 +41,6 @@ public String id() { return this.id; } - /** - * Set the id property: The impacted region id. - * - * @param id the id value to set. - * @return the ImpactedRegion object itself. - */ - public ImpactedRegion withId(String id) { - this.id = id; - return this; - } - /** * Get the name property: The impacted region name. * @@ -61,25 +50,6 @@ public String name() { return this.name; } - /** - * Set the name property: The impacted region name. - * - * @param name the name value to set. - * @return the ImpactedRegion object itself. - */ - public ImpactedRegion withName(String name) { - this.name = name; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ImpactedResources.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ImpactedResources.java index d706393d6afc1..f5cea6f12f445 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ImpactedResources.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ImpactedResources.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.models; @@ -13,7 +13,33 @@ */ public interface ImpactedResources { /** - * Lists impacted resources in the subscription by an event. + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specific impacted resource in the tenant by an event along with {@link Response}. + */ + Response getByTenantIdWithResponse(String eventTrackingId, String impactedResourceName, + Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specific impacted resource in the tenant by an event. + */ + EventImpactedResource getByTenantId(String eventTrackingId, String impactedResourceName); + + /** + * Lists impacted resources in the tenant by an event. * * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -21,10 +47,10 @@ public interface ImpactedResources { * @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 PagedIterable}. */ - PagedIterable listBySubscriptionIdAndEventId(String eventTrackingId); + PagedIterable listByTenantIdAndEventId(String eventTrackingId); /** - * Lists impacted resources in the subscription by an event. + * 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 @@ -35,7 +61,7 @@ public interface ImpactedResources { * @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 PagedIterable}. */ - PagedIterable listBySubscriptionIdAndEventId(String eventTrackingId, String filter, + PagedIterable listByTenantIdAndEventId(String eventTrackingId, String filter, Context context); /** @@ -65,7 +91,7 @@ Response getWithResponse(String eventTrackingId, String i EventImpactedResource get(String eventTrackingId, String impactedResourceName); /** - * Lists impacted resources in the tenant by an event. + * Lists impacted resources in the subscription by an event. * * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -73,10 +99,10 @@ Response getWithResponse(String eventTrackingId, String i * @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 PagedIterable}. */ - PagedIterable listByTenantIdAndEventId(String eventTrackingId); + PagedIterable listBySubscriptionIdAndEventId(String eventTrackingId); /** - * Lists impacted resources in the tenant by an event. + * 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 @@ -87,32 +113,6 @@ Response getWithResponse(String eventTrackingId, String i * @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 PagedIterable}. */ - PagedIterable listByTenantIdAndEventId(String eventTrackingId, String filter, - Context context); - - /** - * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specific impacted resource in the tenant by an event along with {@link Response}. - */ - Response getByTenantIdWithResponse(String eventTrackingId, String impactedResourceName, + PagedIterable listBySubscriptionIdAndEventId(String eventTrackingId, String filter, Context context); - - /** - * 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specific impacted resource in the tenant by an event. - */ - EventImpactedResource getByTenantId(String eventTrackingId, String impactedResourceName); } 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 55301f93c969d..48cd5265c4258 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -18,7 +18,7 @@ /** * Azure region impacted by the service health event. */ -@Fluent +@Immutable public final class ImpactedServiceRegion implements JsonSerializable { /* * Impacted region name. @@ -46,14 +46,15 @@ public final class ImpactedServiceRegion implements JsonSerializable updates; /** * Creates an instance of ImpactedServiceRegion class. */ - public ImpactedServiceRegion() { + private ImpactedServiceRegion() { } /** @@ -65,17 +66,6 @@ public String impactedRegion() { return this.impactedRegion; } - /** - * Set the impactedRegion property: Impacted region name. - * - * @param impactedRegion the impactedRegion value to set. - * @return the ImpactedServiceRegion object itself. - */ - public ImpactedServiceRegion withImpactedRegion(String impactedRegion) { - this.impactedRegion = impactedRegion; - return this; - } - /** * Get the status property: Current status of event in the region. * @@ -85,17 +75,6 @@ public EventStatusValues status() { return this.status; } - /** - * Set the status property: Current status of event in the region. - * - * @param status the status value to set. - * @return the ImpactedServiceRegion object itself. - */ - public ImpactedServiceRegion withStatus(EventStatusValues status) { - this.status = status; - return this; - } - /** * Get the impactedSubscriptions property: List subscription impacted by the service health event. * @@ -105,17 +84,6 @@ public List impactedSubscriptions() { return this.impactedSubscriptions; } - /** - * Set the impactedSubscriptions property: List subscription impacted by the service health event. - * - * @param impactedSubscriptions the impactedSubscriptions value to set. - * @return the ImpactedServiceRegion object itself. - */ - public ImpactedServiceRegion withImpactedSubscriptions(List impactedSubscriptions) { - this.impactedSubscriptions = impactedSubscriptions; - return this; - } - /** * Get the impactedTenants property: List tenant impacted by the service health event. * @@ -125,17 +93,6 @@ public List impactedTenants() { return this.impactedTenants; } - /** - * Set the impactedTenants property: List tenant impacted by the service health event. - * - * @param impactedTenants the impactedTenants value to set. - * @return the ImpactedServiceRegion object itself. - */ - public ImpactedServiceRegion withImpactedTenants(List impactedTenants) { - this.impactedTenants = impactedTenants; - return this; - } - /** * Get the lastUpdateTime property: It provides the Timestamp for when the last update for the service health event. * @@ -146,18 +103,8 @@ public OffsetDateTime lastUpdateTime() { } /** - * Set the lastUpdateTime property: It provides the Timestamp for when the last update for the service health event. - * - * @param lastUpdateTime the lastUpdateTime value to set. - * @return the ImpactedServiceRegion object itself. - */ - public ImpactedServiceRegion withLastUpdateTime(OffsetDateTime lastUpdateTime) { - this.lastUpdateTime = lastUpdateTime; - return this; - } - - /** - * Get the updates property: List of updates for given service health event. + * 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. */ @@ -165,28 +112,6 @@ public List updates() { return this.updates; } - /** - * Set the updates property: List of updates for given service health event. - * - * @param updates the updates value to set. - * @return the ImpactedServiceRegion object itself. - */ - public ImpactedServiceRegion withUpdates(List updates) { - this.updates = updates; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (updates() != null) { - updates().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/IssueNameParameter.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/IssueNameParameter.java index 2edf06b9fca2c..9c03db1b8d1ee 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/IssueNameParameter.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/IssueNameParameter.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.models; @@ -12,7 +12,7 @@ */ public final class IssueNameParameter extends ExpandableStringEnum { /** - * Static value default for IssueNameParameter. + * default. */ public static final IssueNameParameter DEFAULT = fromString("default"); diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/KeyValueItem.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/KeyValueItem.java index 2f3462187f430..5d33023e37d69 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/KeyValueItem.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/KeyValueItem.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.models; @@ -29,7 +29,7 @@ public final class KeyValueItem implements JsonSerializable { /** * Creates an instance of KeyValueItem class. */ - public KeyValueItem() { + private KeyValueItem() { } /** @@ -50,14 +50,6 @@ public String value() { return this.value; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/LevelValues.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/LevelValues.java index 1aa0d2a1fd978..94f12c75583ce 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/LevelValues.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/LevelValues.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.models; @@ -12,12 +12,12 @@ */ public final class LevelValues extends ExpandableStringEnum { /** - * Static value Critical for LevelValues. + * Critical. */ public static final LevelValues CRITICAL = fromString("Critical"); /** - * Static value Warning for LevelValues. + * Warning. */ public static final LevelValues WARNING = fromString("Warning"); 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 fdec081240ee7..28cba56196cd0 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Useful links for service health event. */ -@Fluent +@Immutable public final class Link implements JsonSerializable { /* * Type of link. @@ -45,7 +45,7 @@ public final class Link implements JsonSerializable { /** * Creates an instance of Link class. */ - public Link() { + private Link() { } /** @@ -57,17 +57,6 @@ public LinkTypeValues type() { return this.type; } - /** - * Set the type property: Type of link. - * - * @param type the type value to set. - * @return the Link object itself. - */ - public Link withType(LinkTypeValues type) { - this.type = type; - return this; - } - /** * Get the displayText property: Display text of link. * @@ -77,17 +66,6 @@ public LinkDisplayText displayText() { return this.displayText; } - /** - * Set the displayText property: Display text of link. - * - * @param displayText the displayText value to set. - * @return the Link object itself. - */ - public Link withDisplayText(LinkDisplayText displayText) { - this.displayText = displayText; - return this; - } - /** * Get the extensionName property: It provides the name of portal extension to produce link for given service health * event. @@ -98,18 +76,6 @@ public String extensionName() { return this.extensionName; } - /** - * Set the extensionName property: It provides the name of portal extension to produce link for given service health - * event. - * - * @param extensionName the extensionName value to set. - * @return the Link object itself. - */ - public Link withExtensionName(String extensionName) { - this.extensionName = extensionName; - return this; - } - /** * Get the bladeName property: It provides the name of portal extension blade to produce link for given service * health event. @@ -120,18 +86,6 @@ public String bladeName() { return this.bladeName; } - /** - * Set the bladeName property: It provides the name of portal extension blade to produce link for given service - * health event. - * - * @param bladeName the bladeName value to set. - * @return the Link object itself. - */ - public Link withBladeName(String bladeName) { - this.bladeName = bladeName; - return this; - } - /** * Get the parameters property: It provides a map of parameter name and value for portal extension blade to produce * lik for given service health event. @@ -142,29 +96,6 @@ public Object parameters() { return this.parameters; } - /** - * Set the parameters property: It provides a map of parameter name and value for portal extension blade to produce - * lik for given service health event. - * - * @param parameters the parameters value to set. - * @return the Link object itself. - */ - public Link withParameters(Object parameters) { - this.parameters = parameters; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (displayText() != null) { - displayText().validate(); - } - } - /** * {@inheritDoc} */ @@ -175,7 +106,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/LinkDisplayText.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/LinkDisplayText.java index a912031f6e813..7b8d0ea6293a9 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/LinkDisplayText.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/LinkDisplayText.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Display text of link. */ -@Fluent +@Immutable public final class LinkDisplayText implements JsonSerializable { /* * Display text of link. @@ -29,7 +29,7 @@ public final class LinkDisplayText implements JsonSerializable /** * Creates an instance of LinkDisplayText class. */ - public LinkDisplayText() { + private LinkDisplayText() { } /** @@ -41,17 +41,6 @@ public String value() { return this.value; } - /** - * Set the value property: Display text of link. - * - * @param value the value value to set. - * @return the LinkDisplayText object itself. - */ - public LinkDisplayText withValue(String value) { - this.value = value; - return this; - } - /** * Get the localizedValue property: Localized display text of link. * @@ -61,25 +50,6 @@ public String localizedValue() { return this.localizedValue; } - /** - * Set the localizedValue property: Localized display text of link. - * - * @param localizedValue the localizedValue value to set. - * @return the LinkDisplayText object itself. - */ - public LinkDisplayText withLocalizedValue(String localizedValue) { - this.localizedValue = localizedValue; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/LinkTypeValues.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/LinkTypeValues.java index eaec9bb1efd91..ce22707d9cce3 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/LinkTypeValues.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/LinkTypeValues.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.models; @@ -12,12 +12,12 @@ */ public final class LinkTypeValues extends ExpandableStringEnum { /** - * Static value Button for LinkTypeValues. + * Button. */ public static final LinkTypeValues BUTTON = fromString("Button"); /** - * Static value Hyperlink for LinkTypeValues. + * Hyperlink. */ public static final LinkTypeValues HYPERLINK = fromString("Hyperlink"); diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/MetadataEntity.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/MetadataEntity.java index ff957aafb695e..2c5a6c365a43e 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/MetadataEntity.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/MetadataEntity.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.models; 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 1cd5d2c84f1b7..4795b7347266a 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,13 +15,23 @@ /** * The metadata supported value detail. */ -@Fluent +@Immutable public final class MetadataSupportedValueDetail implements JsonSerializable { /* - * The id. + * The id of the metadata value */ private String id; + /* + * The previous value of the id field in case 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. */ @@ -32,14 +42,19 @@ public final class MetadataSupportedValueDetail implements JsonSerializable resourceTypes; + /* + * Priority of this metadata supported value. Lower number is given higher preference. + */ + private Integer priority; + /** * Creates an instance of MetadataSupportedValueDetail class. */ - public MetadataSupportedValueDetail() { + private MetadataSupportedValueDetail() { } /** - * Get the id property: The id. + * Get the id property: The id of the metadata value. * * @return the id value. */ @@ -48,34 +63,30 @@ public String id() { } /** - * Set the id property: The id. + * Get the previousId property: The previous value of the id field in case the data has changed. * - * @param id the id value to set. - * @return the MetadataSupportedValueDetail object itself. + * @return the previousId value. */ - public MetadataSupportedValueDetail withId(String id) { - this.id = id; - return this; + public String previousId() { + return this.previousId; } /** - * Get the displayName property: The display name. + * Get the serviceGuid property: The permanent guid for the service. Used when the id is a service name. * - * @return the displayName value. + * @return the serviceGuid value. */ - public String displayName() { - return this.displayName; + public String serviceGuid() { + return this.serviceGuid; } /** - * Set the displayName property: The display name. + * Get the displayName property: The display name. * - * @param displayName the displayName value to set. - * @return the MetadataSupportedValueDetail object itself. + * @return the displayName value. */ - public MetadataSupportedValueDetail withDisplayName(String displayName) { - this.displayName = displayName; - return this; + public String displayName() { + return this.displayName; } /** @@ -88,22 +99,12 @@ public List resourceTypes() { } /** - * Set the resourceTypes property: The list of associated resource types. - * - * @param resourceTypes the resourceTypes value to set. - * @return the MetadataSupportedValueDetail object itself. - */ - public MetadataSupportedValueDetail withResourceTypes(List resourceTypes) { - this.resourceTypes = resourceTypes; - return this; - } - - /** - * Validates the instance. + * Get the priority property: Priority of this metadata supported value. Lower number is given higher preference. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the priority value. */ - public void validate() { + public Integer priority() { + return this.priority; } /** @@ -113,9 +114,12 @@ 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)); + jsonWriter.writeNumberField("priority", this.priority); return jsonWriter.writeEndObject(); } @@ -136,11 +140,17 @@ 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)) { List resourceTypes = reader.readArray(reader1 -> reader1.getString()); deserializedMetadataSupportedValueDetail.resourceTypes = resourceTypes; + } else if ("priority".equals(fieldName)) { + deserializedMetadataSupportedValueDetail.priority = reader.getNullable(JsonReader::getInt); } else { reader.skipChildren(); } diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/Metadatas.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/Metadatas.java index 9cc10d49295ce..d41e289e93d8a 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/Metadatas.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/Metadatas.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.models; @@ -15,43 +15,43 @@ public interface Metadatas { /** * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of metadata entities as paginated response with {@link PagedIterable}. + * @return the list of metadata entities along with {@link Response}. */ - PagedIterable list(); + Response getEntityWithResponse(String name, Context context); /** * Gets the list of metadata entities. * - * @param context The context to associate with this operation. + * @param name Name of metadata entity. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of metadata entities as paginated response with {@link PagedIterable}. + * @return the list of metadata entities. */ - PagedIterable list(Context context); + MetadataEntity getEntity(String name); /** * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of metadata entities along with {@link Response}. + * @return the list of metadata entities as paginated response with {@link PagedIterable}. */ - Response getEntityWithResponse(String name, Context context); + PagedIterable list(); /** * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of metadata entities. + * @return the list of metadata entities as paginated response with {@link PagedIterable}. */ - MetadataEntity getEntity(String name); + PagedIterable list(Context context); } diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/Operation.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/Operation.java index 06d77c50ff55c..e8b72b894dd84 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/Operation.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/Operation.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Operation available in the Microsoft.ResourceHealth resource provider. */ -@Fluent +@Immutable public final class Operation implements JsonSerializable { /* * Name of the operation. @@ -29,7 +29,7 @@ public final class Operation implements JsonSerializable { /** * Creates an instance of Operation class. */ - public Operation() { + private Operation() { } /** @@ -41,17 +41,6 @@ public String name() { return this.name; } - /** - * Set the name property: Name of the operation. - * - * @param name the name value to set. - * @return the Operation object itself. - */ - public Operation withName(String name) { - this.name = name; - return this; - } - /** * Get the display property: Properties of the operation. * @@ -61,28 +50,6 @@ public OperationDisplay display() { return this.display; } - /** - * Set the display property: Properties of the operation. - * - * @param display the display value to set. - * @return the Operation object itself. - */ - public Operation withDisplay(OperationDisplay display) { - this.display = display; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (display() != null) { - display().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/OperationDisplay.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/OperationDisplay.java index 95bd01d84d6b4..5f3fdeeb3087b 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/OperationDisplay.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/OperationDisplay.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Properties of the operation. */ -@Fluent +@Immutable public final class OperationDisplay implements JsonSerializable { /* * Provider name. @@ -39,7 +39,7 @@ public final class OperationDisplay implements JsonSerializable { /** - * Static value Transient for ReasonChronicityTypes. + * Transient. */ public static final ReasonChronicityTypes TRANSIENT = fromString("Transient"); /** - * Static value Persistent for ReasonChronicityTypes. + * Persistent. */ public static final ReasonChronicityTypes PERSISTENT = fromString("Persistent"); diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/RecommendedAction.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/RecommendedAction.java index 8a893efcaa97f..bb2ed19716b5f 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/RecommendedAction.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/RecommendedAction.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Lists actions the user can take based on the current availabilityState of the resource. */ -@Fluent +@Immutable public final class RecommendedAction implements JsonSerializable { /* * Recommended action. @@ -39,7 +39,7 @@ public final class RecommendedAction implements JsonSerializable { /** - * Static value Alerts for Scenario. + * Alerts. */ public static final Scenario ALERTS = fromString("Alerts"); diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/SecurityAdvisoryImpactedResources.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/SecurityAdvisoryImpactedResources.java index 0b41f3cd3e4c0..15af3cdec349d 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/SecurityAdvisoryImpactedResources.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/SecurityAdvisoryImpactedResources.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.models; diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ServiceImpactingEvent.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ServiceImpactingEvent.java index c8b032da66bfc..c47f5adbbdbc2 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ServiceImpactingEvent.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ServiceImpactingEvent.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -17,7 +17,7 @@ /** * Lists the service impacting events that may be affecting the health of the resource. */ -@Fluent +@Immutable public final class ServiceImpactingEvent implements JsonSerializable { /* * Timestamp for when the event started. @@ -47,7 +47,7 @@ public final class ServiceImpactingEvent implements JsonSerializable { /* @@ -40,7 +40,7 @@ public final class ServiceImpactingEventIncidentProperties /** * Creates an instance of ServiceImpactingEventIncidentProperties class. */ - public ServiceImpactingEventIncidentProperties() { + private ServiceImpactingEventIncidentProperties() { } /** @@ -52,17 +52,6 @@ public String title() { return this.title; } - /** - * Set the title property: Title of the incident. - * - * @param title the title value to set. - * @return the ServiceImpactingEventIncidentProperties object itself. - */ - public ServiceImpactingEventIncidentProperties withTitle(String title) { - this.title = title; - return this; - } - /** * Get the service property: Service impacted by the event. * @@ -72,17 +61,6 @@ public String service() { return this.service; } - /** - * Set the service property: Service impacted by the event. - * - * @param service the service value to set. - * @return the ServiceImpactingEventIncidentProperties object itself. - */ - public ServiceImpactingEventIncidentProperties withService(String service) { - this.service = service; - return this; - } - /** * Get the region property: Region impacted by the event. * @@ -92,17 +70,6 @@ public String region() { return this.region; } - /** - * Set the region property: Region impacted by the event. - * - * @param region the region value to set. - * @return the ServiceImpactingEventIncidentProperties object itself. - */ - public ServiceImpactingEventIncidentProperties withRegion(String region) { - this.region = region; - return this; - } - /** * Get the incidentType property: Type of Event. * @@ -112,25 +79,6 @@ public String incidentType() { return this.incidentType; } - /** - * Set the incidentType property: Type of Event. - * - * @param incidentType the incidentType value to set. - * @return the ServiceImpactingEventIncidentProperties object itself. - */ - public ServiceImpactingEventIncidentProperties withIncidentType(String incidentType) { - this.incidentType = incidentType; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ServiceImpactingEventStatus.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ServiceImpactingEventStatus.java index eadd09dbe8ab5..85b27b79bcea3 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ServiceImpactingEventStatus.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/ServiceImpactingEventStatus.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Status of the service impacting event. */ -@Fluent +@Immutable public final class ServiceImpactingEventStatus implements JsonSerializable { /* * Current status of the event @@ -24,7 +24,7 @@ public final class ServiceImpactingEventStatus implements JsonSerializable { /** - * Static value Information for SeverityValues. + * Information. */ public static final SeverityValues INFORMATION = fromString("Information"); /** - * Static value Warning for SeverityValues. + * Warning. */ public static final SeverityValues WARNING = fromString("Warning"); /** - * Static value Error for SeverityValues. + * Error. */ public static final SeverityValues ERROR = fromString("Error"); diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/StageValues.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/StageValues.java index b96e8afceba07..39e9e56ae3447 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/StageValues.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/StageValues.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.models; @@ -12,17 +12,17 @@ */ public final class StageValues extends ExpandableStringEnum { /** - * Static value Active for StageValues. + * Active. */ public static final StageValues ACTIVE = fromString("Active"); /** - * Static value Resolve for StageValues. + * Resolve. */ public static final StageValues RESOLVE = fromString("Resolve"); /** - * Static value Archived for StageValues. + * Archived. */ public static final StageValues ARCHIVED = fromString("Archived"); diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/StatusActiveEvent.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/StatusActiveEvent.java index 2f6e85647a3f2..5cc70fda3f924 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/StatusActiveEvent.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/StatusActiveEvent.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -18,7 +18,7 @@ /** * Active event type of emerging issue. */ -@Fluent +@Immutable public final class StatusActiveEvent implements JsonSerializable { /* * The active event title. @@ -73,7 +73,7 @@ public final class StatusActiveEvent implements JsonSerializable impacts() { return this.impacts; } - /** - * Set the impacts property: The list of emerging issues impacts. - * - * @param impacts the impacts value to set. - * @return the StatusActiveEvent object itself. - */ - public StatusActiveEvent withImpacts(List impacts) { - this.impacts = impacts; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (impacts() != null) { - impacts().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/StatusBanner.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/StatusBanner.java index 43023eb5daa0c..6662b9114499a 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/StatusBanner.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/StatusBanner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -17,7 +17,7 @@ /** * Banner type of emerging issue. */ -@Fluent +@Immutable public final class StatusBanner implements JsonSerializable { /* * The banner title. @@ -42,7 +42,7 @@ public final class StatusBanner implements JsonSerializable { /** * Creates an instance of StatusBanner class. */ - public StatusBanner() { + private StatusBanner() { } /** @@ -54,17 +54,6 @@ public String title() { return this.title; } - /** - * Set the title property: The banner title. - * - * @param title the title value to set. - * @return the StatusBanner object itself. - */ - public StatusBanner withTitle(String title) { - this.title = title; - return this; - } - /** * Get the message property: The details of banner. * @@ -74,17 +63,6 @@ public String message() { return this.message; } - /** - * Set the message property: The details of banner. - * - * @param message the message value to set. - * @return the StatusBanner object itself. - */ - public StatusBanner withMessage(String message) { - this.message = message; - return this; - } - /** * Get the cloud property: The cloud type of this banner. * @@ -94,17 +72,6 @@ public String cloud() { return this.cloud; } - /** - * Set the cloud property: The cloud type of this banner. - * - * @param cloud the cloud value to set. - * @return the StatusBanner object itself. - */ - public StatusBanner withCloud(String cloud) { - this.cloud = cloud; - return this; - } - /** * Get the lastModifiedTime property: The last time modified on this banner. * @@ -114,25 +81,6 @@ public OffsetDateTime lastModifiedTime() { return this.lastModifiedTime; } - /** - * Set the lastModifiedTime property: The last time modified on this banner. - * - * @param lastModifiedTime the lastModifiedTime value to set. - * @return the StatusBanner object itself. - */ - public StatusBanner withLastModifiedTime(OffsetDateTime lastModifiedTime) { - this.lastModifiedTime = lastModifiedTime; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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 bb2a8c3ee2eef..e26c3dc1924e5 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -13,11 +13,12 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; +import java.util.List; /** * Update for service health event. */ -@Fluent +@Immutable public final class Update implements JsonSerializable { /* * Summary text for the given update for the service health event. @@ -29,10 +30,26 @@ 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. */ - public Update() { + private Update() { } /** @@ -44,17 +61,6 @@ public String summary() { return this.summary; } - /** - * Set the summary property: Summary text for the given update for the service health event. - * - * @param summary the summary value to set. - * @return the Update object itself. - */ - public Update withSummary(String summary) { - this.summary = summary; - return this; - } - /** * Get the updateDateTime property: It provides the Timestamp for the given update for the service health event. * @@ -65,22 +71,23 @@ public OffsetDateTime updateDateTime() { } /** - * Set the updateDateTime property: It provides the Timestamp for the given update for the service health event. - * - * @param updateDateTime the updateDateTime value to set. - * @return the Update object itself. - */ - public Update withUpdateDateTime(OffsetDateTime updateDateTime) { - this.updateDateTime = updateDateTime; - return this; - } - - /** - * Validates the instance. + * 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. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the eventTags value. */ - public void validate() { + public List eventTags() { + return this.eventTags; } /** @@ -92,6 +99,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 +123,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/java/com/azure/resourcemanager/resourcehealth/models/package-info.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/package-info.java index 9c1cc4323af16..cc3a5af65d0c8 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/package-info.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/models/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the data models for MicrosoftResourceHealth. + * Package containing the data models for ResourceHealth. * The Resource Health Client. */ package com.azure.resourcemanager.resourcehealth.models; diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/package-info.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/package-info.java index 660421104ea24..e41332bcae482 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/package-info.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the classes for MicrosoftResourceHealth. + * Package containing the classes for ResourceHealth. * The Resource Health Client. */ package com.azure.resourcemanager.resourcehealth; diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/module-info.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/module-info.java index a83c543ac2784..81ee887b567ec 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/module-info.java +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/module-info.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. module com.azure.resourcemanager.resourcehealth { requires transitive com.azure.core.management; @@ -12,4 +12,5 @@ opens com.azure.resourcemanager.resourcehealth.fluent.models to com.azure.core; opens com.azure.resourcemanager.resourcehealth.models to com.azure.core; + opens com.azure.resourcemanager.resourcehealth.implementation.models to com.azure.core; } diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/resources/META-INF/azure-resourcemanager-resourcehealth_metadata.json b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/resources/META-INF/azure-resourcemanager-resourcehealth_metadata.json new file mode 100644 index 0000000000000..4be3e92428b0e --- /dev/null +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/resources/META-INF/azure-resourcemanager-resourcehealth_metadata.json @@ -0,0 +1 @@ +{"flavor":"azure","apiVersions":{"Microsoft.ResourceHealth":"2026-07-01"},"crossLanguagePackageId":"Microsoft.ResourceHealth","crossLanguageVersion":"98dfce16f843","crossLanguageDefinitions":{"com.azure.resourcemanager.resourcehealth.fluent.AvailabilityStatusesClient":"Microsoft.ResourceHealth.AvailabilityStatuses","com.azure.resourcemanager.resourcehealth.fluent.AvailabilityStatusesClient.getByResource":"Microsoft.ResourceHealth.AvailabilityStatuses.getByResource","com.azure.resourcemanager.resourcehealth.fluent.AvailabilityStatusesClient.getByResourceWithResponse":"Microsoft.ResourceHealth.AvailabilityStatuses.getByResource","com.azure.resourcemanager.resourcehealth.fluent.AvailabilityStatusesClient.list":"Microsoft.ResourceHealth.AvailabilityStatuses.list","com.azure.resourcemanager.resourcehealth.fluent.AvailabilityStatusesClient.listByResourceGroup":"Microsoft.ResourceHealth.AvailabilityStatuses.listByResourceGroup","com.azure.resourcemanager.resourcehealth.fluent.AvailabilityStatusesClient.listBySubscriptionId":"Microsoft.ResourceHealth.AvailabilityStatuses.listBySubscriptionId","com.azure.resourcemanager.resourcehealth.fluent.ChildAvailabilityStatusesClient":"Microsoft.ResourceHealth.ChildAvailabilityStatuses","com.azure.resourcemanager.resourcehealth.fluent.ChildAvailabilityStatusesClient.getByResource":"Microsoft.ResourceHealth.ChildAvailabilityStatuses.getByResource","com.azure.resourcemanager.resourcehealth.fluent.ChildAvailabilityStatusesClient.getByResourceWithResponse":"Microsoft.ResourceHealth.ChildAvailabilityStatuses.getByResource","com.azure.resourcemanager.resourcehealth.fluent.ChildAvailabilityStatusesClient.list":"Microsoft.ResourceHealth.ChildAvailabilityStatuses.list","com.azure.resourcemanager.resourcehealth.fluent.ChildResourcesClient":"Microsoft.ResourceHealth","com.azure.resourcemanager.resourcehealth.fluent.ChildResourcesClient.list":"Microsoft.ResourceHealth.ChildResourcesOperationGroup.list","com.azure.resourcemanager.resourcehealth.fluent.EmergingIssuesClient":"Microsoft.ResourceHealth","com.azure.resourcemanager.resourcehealth.fluent.EmergingIssuesClient.get":"Microsoft.ResourceHealth.EmergingIssuesGetResults.get","com.azure.resourcemanager.resourcehealth.fluent.EmergingIssuesClient.getWithResponse":"Microsoft.ResourceHealth.EmergingIssuesGetResults.get","com.azure.resourcemanager.resourcehealth.fluent.EmergingIssuesClient.list":"Microsoft.ResourceHealth.EmergingIssuesGetResults.list","com.azure.resourcemanager.resourcehealth.fluent.EventOperationsClient":"Microsoft.ResourceHealth","com.azure.resourcemanager.resourcehealth.fluent.EventOperationsClient.fetchBilllingCommunicationDetailsBySubscriptionIdAndTrackingId":"Microsoft.ResourceHealth.EventOperationGroup.fetchBilllingCommunicationDetailsBySubscriptionIdAndTrackingId","com.azure.resourcemanager.resourcehealth.fluent.EventOperationsClient.fetchBilllingCommunicationDetailsBySubscriptionIdAndTrackingIdWithResponse":"Microsoft.ResourceHealth.EventOperationGroup.fetchBilllingCommunicationDetailsBySubscriptionIdAndTrackingId","com.azure.resourcemanager.resourcehealth.fluent.EventOperationsClient.fetchDetailsBySubscriptionIdAndTrackingId":"Microsoft.ResourceHealth.EventOperationGroup.fetchDetailsBySubscriptionIdAndTrackingId","com.azure.resourcemanager.resourcehealth.fluent.EventOperationsClient.fetchDetailsBySubscriptionIdAndTrackingIdWithResponse":"Microsoft.ResourceHealth.EventOperationGroup.fetchDetailsBySubscriptionIdAndTrackingId","com.azure.resourcemanager.resourcehealth.fluent.EventOperationsClient.fetchDetailsByTenantIdAndTrackingId":"Microsoft.ResourceHealth.TenantEventOperationGroup.fetchDetailsByTenantIdAndTrackingId","com.azure.resourcemanager.resourcehealth.fluent.EventOperationsClient.fetchDetailsByTenantIdAndTrackingIdWithResponse":"Microsoft.ResourceHealth.TenantEventOperationGroup.fetchDetailsByTenantIdAndTrackingId","com.azure.resourcemanager.resourcehealth.fluent.EventOperationsClient.getBySubscriptionIdAndTrackingId":"Microsoft.ResourceHealth.EventOperationGroup.getBySubscriptionIdAndTrackingId","com.azure.resourcemanager.resourcehealth.fluent.EventOperationsClient.getBySubscriptionIdAndTrackingIdWithResponse":"Microsoft.ResourceHealth.EventOperationGroup.getBySubscriptionIdAndTrackingId","com.azure.resourcemanager.resourcehealth.fluent.EventOperationsClient.getByTenantIdAndTrackingId":"Microsoft.ResourceHealth.TenantEventOperationGroup.getByTenantIdAndTrackingId","com.azure.resourcemanager.resourcehealth.fluent.EventOperationsClient.getByTenantIdAndTrackingIdWithResponse":"Microsoft.ResourceHealth.TenantEventOperationGroup.getByTenantIdAndTrackingId","com.azure.resourcemanager.resourcehealth.fluent.EventsOperationsClient":"Microsoft.ResourceHealth","com.azure.resourcemanager.resourcehealth.fluent.EventsOperationsClient.list":"Microsoft.ResourceHealth.EventOperationGroup.listBySubscriptionId","com.azure.resourcemanager.resourcehealth.fluent.EventsOperationsClient.listBySingleResource":"Microsoft.ResourceHealth.EventsOperationGroup.listBySingleResource","com.azure.resourcemanager.resourcehealth.fluent.EventsOperationsClient.listByTenantId":"Microsoft.ResourceHealth.TenantEventOperationGroup.listByTenantId","com.azure.resourcemanager.resourcehealth.fluent.ImpactedResourcesClient":"Microsoft.ResourceHealth.ImpactedResources","com.azure.resourcemanager.resourcehealth.fluent.ImpactedResourcesClient.get":"Microsoft.ResourceHealth.EventImpactedResources.get","com.azure.resourcemanager.resourcehealth.fluent.ImpactedResourcesClient.getByTenantId":"Microsoft.ResourceHealth.ImpactedResources.getByTenantId","com.azure.resourcemanager.resourcehealth.fluent.ImpactedResourcesClient.getByTenantIdWithResponse":"Microsoft.ResourceHealth.ImpactedResources.getByTenantId","com.azure.resourcemanager.resourcehealth.fluent.ImpactedResourcesClient.getWithResponse":"Microsoft.ResourceHealth.EventImpactedResources.get","com.azure.resourcemanager.resourcehealth.fluent.ImpactedResourcesClient.listBySubscriptionIdAndEventId":"Microsoft.ResourceHealth.EventImpactedResources.listBySubscriptionIdAndEventId","com.azure.resourcemanager.resourcehealth.fluent.ImpactedResourcesClient.listByTenantIdAndEventId":"Microsoft.ResourceHealth.ImpactedResources.listByTenantIdAndEventId","com.azure.resourcemanager.resourcehealth.fluent.MetadatasClient":"Microsoft.ResourceHealth","com.azure.resourcemanager.resourcehealth.fluent.MetadatasClient.getEntity":"Microsoft.ResourceHealth.MetadataEntities.getEntity","com.azure.resourcemanager.resourcehealth.fluent.MetadatasClient.getEntityWithResponse":"Microsoft.ResourceHealth.MetadataEntities.getEntity","com.azure.resourcemanager.resourcehealth.fluent.MetadatasClient.list":"Microsoft.ResourceHealth.MetadataEntities.list","com.azure.resourcemanager.resourcehealth.fluent.MicrosoftResourceHealth":"Microsoft.ResourceHealth","com.azure.resourcemanager.resourcehealth.fluent.OperationsClient":"Microsoft.ResourceHealth.Operations","com.azure.resourcemanager.resourcehealth.fluent.OperationsClient.list":"Microsoft.ResourceHealth.Operations.list","com.azure.resourcemanager.resourcehealth.fluent.OperationsClient.listWithResponse":"Microsoft.ResourceHealth.Operations.list","com.azure.resourcemanager.resourcehealth.fluent.SecurityAdvisoryImpactedResourcesClient":"Microsoft.ResourceHealth","com.azure.resourcemanager.resourcehealth.fluent.SecurityAdvisoryImpactedResourcesClient.listBySubscriptionIdAndEventId":"Microsoft.ResourceHealth.EventOperationGroup.listBySubscriptionIdAndEventId","com.azure.resourcemanager.resourcehealth.fluent.SecurityAdvisoryImpactedResourcesClient.listByTenantIdAndEventId":"Microsoft.ResourceHealth.TenantEventOperationGroup.listByTenantIdAndEventId","com.azure.resourcemanager.resourcehealth.fluent.models.AvailabilityStatusInner":"Microsoft.ResourceHealth.AvailabilityStatus","com.azure.resourcemanager.resourcehealth.fluent.models.EmergingIssue":"Microsoft.ResourceHealth.EmergingIssue","com.azure.resourcemanager.resourcehealth.fluent.models.EmergingIssuesGetResultInner":"Microsoft.ResourceHealth.EmergingIssuesGetResult","com.azure.resourcemanager.resourcehealth.fluent.models.EventImpactedResourceInner":"Microsoft.ResourceHealth.EventImpactedResource","com.azure.resourcemanager.resourcehealth.fluent.models.EventImpactedResourceProperties":"Microsoft.ResourceHealth.EventImpactedResourceProperties","com.azure.resourcemanager.resourcehealth.fluent.models.EventInner":"Microsoft.ResourceHealth.Event","com.azure.resourcemanager.resourcehealth.fluent.models.EventProperties":"Microsoft.ResourceHealth.EventProperties","com.azure.resourcemanager.resourcehealth.fluent.models.MetadataEntityInner":"Microsoft.ResourceHealth.MetadataEntity","com.azure.resourcemanager.resourcehealth.fluent.models.MetadataEntityProperties":"Microsoft.ResourceHealth.MetadataEntityProperties","com.azure.resourcemanager.resourcehealth.fluent.models.OperationListResultInner":"Microsoft.ResourceHealth.operationListResult","com.azure.resourcemanager.resourcehealth.implementation.MicrosoftResourceHealthBuilder":"Microsoft.ResourceHealth","com.azure.resourcemanager.resourcehealth.implementation.models.AvailabilityStatusListResult":"Microsoft.ResourceHealth.availabilityStatusListResult","com.azure.resourcemanager.resourcehealth.implementation.models.EmergingIssueListResult":"Microsoft.ResourceHealth.emergingIssueListResult","com.azure.resourcemanager.resourcehealth.implementation.models.EventImpactedResourceListResult":"Microsoft.ResourceHealth.eventImpactedResourceListResult","com.azure.resourcemanager.resourcehealth.implementation.models.Events":"Microsoft.ResourceHealth.Events","com.azure.resourcemanager.resourcehealth.implementation.models.MetadataEntityListResult":"Microsoft.ResourceHealth.MetadataEntityListResult","com.azure.resourcemanager.resourcehealth.models.ApiOperationLink":"Microsoft.ResourceHealth.ApiOperationLink","com.azure.resourcemanager.resourcehealth.models.AvailabilityStateValues":"Microsoft.ResourceHealth.AvailabilityStateValues","com.azure.resourcemanager.resourcehealth.models.AvailabilityStatusProperties":"Microsoft.ResourceHealth.AvailabilityStatusProperties","com.azure.resourcemanager.resourcehealth.models.AvailabilityStatusPropertiesRecentlyResolved":"Microsoft.ResourceHealth.AvailabilityStatusPropertiesRecentlyResolved","com.azure.resourcemanager.resourcehealth.models.EmergingIssueImpact":"Microsoft.ResourceHealth.EmergingIssueImpact","com.azure.resourcemanager.resourcehealth.models.EventLevelValues":"Microsoft.ResourceHealth.EventLevelValues","com.azure.resourcemanager.resourcehealth.models.EventPropertiesAdditionalInformation":"Microsoft.ResourceHealth.EventPropertiesAdditionalInformation","com.azure.resourcemanager.resourcehealth.models.EventPropertiesArticle":"Microsoft.ResourceHealth.EventPropertiesArticle","com.azure.resourcemanager.resourcehealth.models.EventPropertiesRecommendedActions":"Microsoft.ResourceHealth.EventPropertiesRecommendedActions","com.azure.resourcemanager.resourcehealth.models.EventPropertiesRecommendedActionsItem":"Microsoft.ResourceHealth.EventPropertiesRecommendedActionsActionsItem","com.azure.resourcemanager.resourcehealth.models.EventSourceValues":"Microsoft.ResourceHealth.EventSourceValues","com.azure.resourcemanager.resourcehealth.models.EventStatusValues":"Microsoft.ResourceHealth.EventStatusValues","com.azure.resourcemanager.resourcehealth.models.EventSubTypeValues":"Microsoft.ResourceHealth.EventSubTypeValues","com.azure.resourcemanager.resourcehealth.models.EventTypeValues":"Microsoft.ResourceHealth.EventTypeValues","com.azure.resourcemanager.resourcehealth.models.Faq":"Microsoft.ResourceHealth.Faq","com.azure.resourcemanager.resourcehealth.models.Impact":"Microsoft.ResourceHealth.Impact","com.azure.resourcemanager.resourcehealth.models.ImpactedRegion":"Microsoft.ResourceHealth.ImpactedRegion","com.azure.resourcemanager.resourcehealth.models.ImpactedServiceRegion":"Microsoft.ResourceHealth.ImpactedServiceRegion","com.azure.resourcemanager.resourcehealth.models.IssueNameParameter":"Microsoft.ResourceHealth.IssueNameParameter","com.azure.resourcemanager.resourcehealth.models.KeyValueItem":"Microsoft.ResourceHealth.KeyValueItem","com.azure.resourcemanager.resourcehealth.models.LevelValues":"Microsoft.ResourceHealth.LevelValues","com.azure.resourcemanager.resourcehealth.models.Link":"Microsoft.ResourceHealth.Link","com.azure.resourcemanager.resourcehealth.models.LinkDisplayText":"Microsoft.ResourceHealth.LinkDisplayText","com.azure.resourcemanager.resourcehealth.models.LinkTypeValues":"Microsoft.ResourceHealth.LinkTypeValues","com.azure.resourcemanager.resourcehealth.models.MetadataSupportedValueDetail":"Microsoft.ResourceHealth.MetadataSupportedValueDetail","com.azure.resourcemanager.resourcehealth.models.Operation":"Microsoft.ResourceHealth.Operation","com.azure.resourcemanager.resourcehealth.models.OperationDisplay":"Microsoft.ResourceHealth.OperationDisplay","com.azure.resourcemanager.resourcehealth.models.ReasonChronicityTypes":"Microsoft.ResourceHealth.reasonChronicityTypes","com.azure.resourcemanager.resourcehealth.models.RecommendedAction":"Microsoft.ResourceHealth.RecommendedAction","com.azure.resourcemanager.resourcehealth.models.Scenario":"Microsoft.ResourceHealth.Scenario","com.azure.resourcemanager.resourcehealth.models.ServiceImpactingEvent":"Microsoft.ResourceHealth.ServiceImpactingEvent","com.azure.resourcemanager.resourcehealth.models.ServiceImpactingEventIncidentProperties":"Microsoft.ResourceHealth.ServiceImpactingEventIncidentProperties","com.azure.resourcemanager.resourcehealth.models.ServiceImpactingEventStatus":"Microsoft.ResourceHealth.ServiceImpactingEventStatus","com.azure.resourcemanager.resourcehealth.models.SeverityValues":"Microsoft.ResourceHealth.SeverityValues","com.azure.resourcemanager.resourcehealth.models.StageValues":"Microsoft.ResourceHealth.StageValues","com.azure.resourcemanager.resourcehealth.models.StatusActiveEvent":"Microsoft.ResourceHealth.StatusActiveEvent","com.azure.resourcemanager.resourcehealth.models.StatusBanner":"Microsoft.ResourceHealth.StatusBanner","com.azure.resourcemanager.resourcehealth.models.Update":"Microsoft.ResourceHealth.Update"},"generatedFiles":["src/main/java/com/azure/resourcemanager/resourcehealth/ResourceHealthManager.java","src/main/java/com/azure/resourcemanager/resourcehealth/fluent/AvailabilityStatusesClient.java","src/main/java/com/azure/resourcemanager/resourcehealth/fluent/ChildAvailabilityStatusesClient.java","src/main/java/com/azure/resourcemanager/resourcehealth/fluent/ChildResourcesClient.java","src/main/java/com/azure/resourcemanager/resourcehealth/fluent/EmergingIssuesClient.java","src/main/java/com/azure/resourcemanager/resourcehealth/fluent/EventOperationsClient.java","src/main/java/com/azure/resourcemanager/resourcehealth/fluent/EventsOperationsClient.java","src/main/java/com/azure/resourcemanager/resourcehealth/fluent/ImpactedResourcesClient.java","src/main/java/com/azure/resourcemanager/resourcehealth/fluent/MetadatasClient.java","src/main/java/com/azure/resourcemanager/resourcehealth/fluent/MicrosoftResourceHealth.java","src/main/java/com/azure/resourcemanager/resourcehealth/fluent/OperationsClient.java","src/main/java/com/azure/resourcemanager/resourcehealth/fluent/SecurityAdvisoryImpactedResourcesClient.java","src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/AvailabilityStatusInner.java","src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EmergingIssue.java","src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EmergingIssuesGetResultInner.java","src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EventImpactedResourceInner.java","src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EventImpactedResourceProperties.java","src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EventInner.java","src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EventProperties.java","src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/MetadataEntityInner.java","src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/MetadataEntityProperties.java","src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/OperationListResultInner.java","src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/resourcehealth/fluent/package-info.java","src/main/java/com/azure/resourcemanager/resourcehealth/implementation/AvailabilityStatusImpl.java","src/main/java/com/azure/resourcemanager/resourcehealth/implementation/AvailabilityStatusesClientImpl.java","src/main/java/com/azure/resourcemanager/resourcehealth/implementation/AvailabilityStatusesImpl.java","src/main/java/com/azure/resourcemanager/resourcehealth/implementation/ChildAvailabilityStatusesClientImpl.java","src/main/java/com/azure/resourcemanager/resourcehealth/implementation/ChildAvailabilityStatusesImpl.java","src/main/java/com/azure/resourcemanager/resourcehealth/implementation/ChildResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/resourcehealth/implementation/ChildResourcesImpl.java","src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EmergingIssuesClientImpl.java","src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EmergingIssuesGetResultImpl.java","src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EmergingIssuesImpl.java","src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EventImpactedResourceImpl.java","src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EventImpl.java","src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EventOperationsClientImpl.java","src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EventOperationsImpl.java","src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EventsOperationsClientImpl.java","src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EventsOperationsImpl.java","src/main/java/com/azure/resourcemanager/resourcehealth/implementation/ImpactedResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/resourcehealth/implementation/ImpactedResourcesImpl.java","src/main/java/com/azure/resourcemanager/resourcehealth/implementation/MetadataEntityImpl.java","src/main/java/com/azure/resourcemanager/resourcehealth/implementation/MetadatasClientImpl.java","src/main/java/com/azure/resourcemanager/resourcehealth/implementation/MetadatasImpl.java","src/main/java/com/azure/resourcemanager/resourcehealth/implementation/MicrosoftResourceHealthBuilder.java","src/main/java/com/azure/resourcemanager/resourcehealth/implementation/MicrosoftResourceHealthImpl.java","src/main/java/com/azure/resourcemanager/resourcehealth/implementation/OperationListResultImpl.java","src/main/java/com/azure/resourcemanager/resourcehealth/implementation/OperationsClientImpl.java","src/main/java/com/azure/resourcemanager/resourcehealth/implementation/OperationsImpl.java","src/main/java/com/azure/resourcemanager/resourcehealth/implementation/ResourceManagerUtils.java","src/main/java/com/azure/resourcemanager/resourcehealth/implementation/SecurityAdvisoryImpactedResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/resourcehealth/implementation/SecurityAdvisoryImpactedResourcesImpl.java","src/main/java/com/azure/resourcemanager/resourcehealth/implementation/models/AvailabilityStatusListResult.java","src/main/java/com/azure/resourcemanager/resourcehealth/implementation/models/EmergingIssueListResult.java","src/main/java/com/azure/resourcemanager/resourcehealth/implementation/models/EventImpactedResourceListResult.java","src/main/java/com/azure/resourcemanager/resourcehealth/implementation/models/Events.java","src/main/java/com/azure/resourcemanager/resourcehealth/implementation/models/MetadataEntityListResult.java","src/main/java/com/azure/resourcemanager/resourcehealth/implementation/package-info.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/ApiOperationLink.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStateValues.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatus.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatusProperties.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatusPropertiesRecentlyResolved.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/AvailabilityStatuses.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/ChildAvailabilityStatuses.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/ChildResources.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/EmergingIssueImpact.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/EmergingIssues.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/EmergingIssuesGetResult.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/Event.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/EventImpactedResource.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/EventLevelValues.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/EventOperations.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/EventPropertiesAdditionalInformation.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/EventPropertiesArticle.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/EventPropertiesRecommendedActions.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/EventPropertiesRecommendedActionsItem.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/EventSourceValues.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/EventStatusValues.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/EventSubTypeValues.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/EventTypeValues.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/EventsOperations.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/Faq.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/Impact.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/ImpactedRegion.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/ImpactedResources.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/ImpactedServiceRegion.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/IssueNameParameter.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/KeyValueItem.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/LevelValues.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/Link.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/LinkDisplayText.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/LinkTypeValues.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/MetadataEntity.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/MetadataSupportedValueDetail.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/Metadatas.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/Operation.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/OperationDisplay.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/OperationListResult.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/Operations.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/ReasonChronicityTypes.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/RecommendedAction.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/Scenario.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/SecurityAdvisoryImpactedResources.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/ServiceImpactingEvent.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/ServiceImpactingEventIncidentProperties.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/ServiceImpactingEventStatus.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/SeverityValues.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/StageValues.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/StatusActiveEvent.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/StatusBanner.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/Update.java","src/main/java/com/azure/resourcemanager/resourcehealth/models/package-info.java","src/main/java/com/azure/resourcemanager/resourcehealth/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file 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 0000000000000..defbd48204e47 --- /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 d81ada9c0ae34..57f24f2aad487 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.generated; @@ -9,9 +9,7 @@ */ public final class AvailabilityStatusesGetByResourceSamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * AvailabilityStatus_GetByResource.json + * x-ms-original-file: 2026-07-01/AvailabilityStatus_GetByResource.json */ /** * Sample code: GetCurrentHealthByResource. 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 ccb8369106a47..06ed9b345bc1a 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.generated; @@ -9,9 +9,7 @@ */ public final class AvailabilityStatusesListByResourceGroupSamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * AvailabilityStatuses_ListByResourceGroup.json + * x-ms-original-file: 2026-07-01/AvailabilityStatuses_ListByResourceGroup.json */ /** * Sample code: ListByResourceGroup. 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 503901d24f7e2..e8fdaf2a11fb3 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.generated; @@ -9,9 +9,7 @@ */ public final class AvailabilityStatusesListBySubscriptionIdSamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * AvailabilityStatuses_ListBySubscriptionId.json + * x-ms-original-file: 2026-07-01/AvailabilityStatuses_ListBySubscriptionId.json */ /** * Sample code: ListHealthBySubscriptionId. 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 42677556787e5..de8efa1186720 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.generated; @@ -9,9 +9,7 @@ */ public final class AvailabilityStatusesListSamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * AvailabilityStatuses_List.json + * x-ms-original-file: 2026-07-01/AvailabilityStatuses_List.json */ /** * Sample code: GetHealthHistoryByResource. 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 6348ec29ccbe4..84be681a6ccb6 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.generated; @@ -9,9 +9,7 @@ */ public final class ChildAvailabilityStatusesGetByResourceSamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * ChildAvailabilityStatus_GetByResource.json + * x-ms-original-file: 2026-07-01/ChildAvailabilityStatus_GetByResource.json */ /** * Sample code: GetChildCurrentHealthByResource. 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 8d61f79435f51..2a9ca879fa518 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.generated; @@ -9,9 +9,7 @@ */ public final class ChildAvailabilityStatusesListSamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * ChildAvailabilityStatuses_List.json + * x-ms-original-file: 2026-07-01/ChildAvailabilityStatuses_List.json */ /** * Sample code: GetChildHealthHistoryByResource. 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 19b018b179679..97e649609cb18 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.generated; @@ -9,9 +9,7 @@ */ public final class ChildResourcesListSamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * ChildResources_List.json + * x-ms-original-file: 2026-07-01/ChildResources_List.json */ /** * Sample code: GetCurrentChildHealthByResource. @@ -20,6 +18,9 @@ public final class ChildResourcesListSamples { */ public static void getCurrentChildHealthByResource(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { - manager.childResources().list("resourceUri", null, null, com.azure.core.util.Context.NONE); + manager.childResources() + .list( + "subscriptions/227b734f-e14f-4de6-b7fc-3190c21e69f6/resourceGroups/JUHACKETRHCTEST/providers/Microsoft.Compute/virtualMachineScaleSets/rhctest", + null, null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/EmergingIssuesGetSamples.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/EmergingIssuesGetSamples.java index 8895228e6970b..bb226729aa7b4 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.generated; @@ -11,9 +11,7 @@ */ public final class EmergingIssuesGetSamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * EmergingIssues_Get.json + * x-ms-original-file: 2026-07-01/EmergingIssues_Get.json */ /** * Sample code: GetEmergingIssues. 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 770cf1e7357b5..6fa807622fd3e 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.generated; @@ -9,9 +9,7 @@ */ public final class EmergingIssuesListSamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * EmergingIssues_List.json + * x-ms-original-file: 2026-07-01/EmergingIssues_List.json */ /** * Sample code: GetEmergingIssues. diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/EventOperationFetchBilllingCommunicationDetailsBySubscriptionIdAndTrackingIdSamples.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/EventOperationFetchBilllingCommunicationDetailsBySubscriptionIdAndTrackingIdSamples.java new file mode 100644 index 0000000000000..4e490634a7015 --- /dev/null +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/samples/java/com/azure/resourcemanager/resourcehealth/generated/EventOperationFetchBilllingCommunicationDetailsBySubscriptionIdAndTrackingIdSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resourcehealth.generated; + +/** + * Samples for EventOperation FetchBilllingCommunicationDetailsBySubscriptionIdAndTrackingId. + */ +public final class EventOperationFetchBilllingCommunicationDetailsBySubscriptionIdAndTrackingIdSamples { + /* + * x-ms-original-file: 2026-07-01/Event_fetchBillingCommunicationDetailsBySubscriptionIdAndTrackingId.json + */ + /** + * Sample code: BillingEventDetailsBySubscriptionIdAndTrackingId. + * + * @param manager Entry point to ResourceHealthManager. + */ + public static void billingEventDetailsBySubscriptionIdAndTrackingId( + com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) { + manager.eventOperations() + .fetchBilllingCommunicationDetailsBySubscriptionIdAndTrackingIdWithResponse("eventTrackingId", + com.azure.core.util.Context.NONE); + } +} 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 e66203d8e3127..6c15808366338 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.generated; @@ -9,9 +9,7 @@ */ public final class EventOperationFetchDetailsBySubscriptionIdAndTrackingIdSamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * Event_fetchDetailsBySubscriptionIdAndTrackingId.json + * x-ms-original-file: 2026-07-01/Event_fetchDetailsBySubscriptionIdAndTrackingId.json */ /** * Sample code: EventDetailsBySubscriptionIdAndTrackingId. 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 ccd7e618073be..07c54023da74d 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.generated; @@ -9,9 +9,7 @@ */ public final class EventOperationFetchDetailsByTenantIdAndTrackingIdSamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * Event_fetchDetailsByTenantIdAndTrackingId.json + * x-ms-original-file: 2026-07-01/Event_fetchDetailsByTenantIdAndTrackingId.json */ /** * Sample code: EventDetailsByTenantIdAndTrackingId. 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 cdbaed795b1b0..20a05d0174740 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.generated; @@ -9,19 +9,17 @@ */ public final class EventOperationGetBySubscriptionIdAndTrackingIdSamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * Event_GetBySubscriptionIdAndTrackingId.json + * x-ms-original-file: 2026-07-01/Event_GetBySubscriptionIdAndTrackingId.json */ /** - * Sample code: SecurityAdvisoriesEventBySubscriptionIdAndTrackingId. + * Sample code: GetRetirementEventBySubscriptionIdAndTrackingId. * * @param manager Entry point to ResourceHealthManager. */ - public static void securityAdvisoriesEventBySubscriptionIdAndTrackingId( + public static void getRetirementEventBySubscriptionIdAndTrackingId( 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 ec2eef504a392..47d23763b6de5 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.generated; @@ -9,9 +9,7 @@ */ public final class EventOperationGetByTenantIdAndTrackingIdSamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * Event_GetByTenantIdAndTrackingId.json + * x-ms-original-file: 2026-07-01/Event_GetByTenantIdAndTrackingId.json */ /** * Sample code: EventByTenantIdAndTrackingId. 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 8d508e4def458..49a72b51d3f64 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.generated; @@ -9,9 +9,7 @@ */ public final class EventsOperationListBySingleResourceSamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * Events_ListBySingleResource.json + * x-ms-original-file: 2026-07-01/Events_ListBySingleResource.json */ /** * Sample code: ListEventsBySingleResource. 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 d03e5e86e128a..f0f2bd54d20d1 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.generated; @@ -9,9 +9,7 @@ */ public final class EventsOperationListByTenantIdSamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * Events_ListByTenantId.json + * x-ms-original-file: 2026-07-01/Events_ListByTenantId.json */ /** * Sample code: ListEventsByTenantId. 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 89ed01d714637..53a3d243f2493 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.generated; @@ -9,9 +9,7 @@ */ public final class EventsOperationListSamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * Events_ListBySubscriptionId.json + * x-ms-original-file: 2026-07-01/Events_ListBySubscriptionId.json */ /** * Sample code: ListEventsBySubscriptionId. @@ -21,7 +19,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 f7c7804258a3b..04c389ab4c416 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.generated; @@ -9,9 +9,7 @@ */ public final class ImpactedResourcesGetByTenantIdSamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * ImpactedResources_GetByTenantId.json + * x-ms-original-file: 2026-07-01/ImpactedResources_GetByTenantId.json */ /** * Sample code: ImpactedResourcesGet. 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 33a639c1b4fbb..94c0fa1164d9f 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.generated; @@ -9,9 +9,7 @@ */ public final class ImpactedResourcesGetSamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * ImpactedResources_Get.json + * x-ms-original-file: 2026-07-01/ImpactedResources_Get.json */ /** * Sample code: ImpactedResourcesGet. 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 08d0dcccc2499..2cad576ffd7e5 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.generated; @@ -9,9 +9,7 @@ */ public final class ImpactedResourcesListBySubscriptionIdAndEventIdSamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * ImpactedResources_ListBySubscriptionId_ListByEventId.json + * x-ms-original-file: 2026-07-01/ImpactedResources_ListBySubscriptionId_ListByEventId.json */ /** * Sample code: ListImpactedResourcesBySubscriptionId. 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 f467573bedb34..6cd51e42a2fc4 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.generated; @@ -9,9 +9,7 @@ */ public final class ImpactedResourcesListByTenantIdAndEventIdSamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * ImpactedResources_ListByTenantId_ListByEventId.json + * x-ms-original-file: 2026-07-01/ImpactedResources_ListByTenantId_ListByEventId.json */ /** * Sample code: ListEventsByTenantId. 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 3bb0bad61d547..8cd834ff07fff 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.generated; @@ -9,9 +9,7 @@ */ public final class MetadataGetEntitySamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * Metadata_GetEntity.json + * x-ms-original-file: 2026-07-01/Metadata_GetEntity.json */ /** * Sample code: GetMetadata. 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 ee0ab260d55f6..ce2dfde678104 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.generated; @@ -9,9 +9,7 @@ */ public final class MetadataListSamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * Metadata_List.json + * x-ms-original-file: 2026-07-01/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 9b37efe054bb2..df3c0a715b3c0 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.generated; @@ -9,9 +9,7 @@ */ public final class OperationsListSamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * Operations_List.json + * x-ms-original-file: 2026-07-01/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 bc015360c6141..4ee535966d651 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.generated; @@ -9,9 +9,7 @@ */ public final class SecurityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdSamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * SecurityAdvisoryImpactedResources_ListBySubscriptionId_ListByEventId.json + * x-ms-original-file: 2026-07-01/SecurityAdvisoryImpactedResources_ListBySubscriptionId_ListByEventId.json */ /** * Sample code: ListSecurityAdvisoryImpactedResourcesBySubscriptionId. 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 0eef54939b4ac..0bede47fc6d95 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.generated; @@ -9,9 +9,7 @@ */ public final class SecurityAdvisoryImpactedResourcesListByTenantIdAndEventIdSamples { /* - * x-ms-original-file: - * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ - * SecurityAdvisoryImpactedResources_ListByTenantId_ListByEventId.json + * x-ms-original-file: 2026-07-01/SecurityAdvisoryImpactedResources_ListByTenantId_ListByEventId.json */ /** * Sample code: ListSecurityAdvisoryImpactedResourcesByTenantId. diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/ApiOperationLinkTests.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/ApiOperationLinkTests.java new file mode 100644 index 0000000000000..67cd4668562c6 --- /dev/null +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/test/java/com/azure/resourcemanager/resourcehealth/generated/ApiOperationLinkTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resourcehealth.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.resourcehealth.models.ApiOperationLink; + +public final class ApiOperationLinkTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ApiOperationLink model = BinaryData + .fromString("{\"httpMethod\":\"dlpichkoymkcdyhb\",\"url\":\"kkpwdreqnovvq\",\"description\":\"vljxywsu\"}") + .toObject(ApiOperationLink.class); + } +} 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 index a5c636fcb8fab..78d4d728ca954 100644 --- 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 @@ -1,184 +1,65 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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\"}}]}}") + "{\"properties\":{\"availabilityState\":\"Unavailable\",\"title\":\"y\",\"summary\":\"nzwuxzd\",\"detailedStatus\":\"a\",\"reasonType\":\"lhmwhfpmrqobm\",\"context\":\"kknryrtihf\",\"category\":\"ijbpzvgnwzsymgl\",\"articleId\":\"fcyzkohdbihanufh\",\"rootCauseAttributionTime\":\"2021-01-11T10:02:32Z\",\"healthEventType\":\"y\",\"healthEventCause\":\"git\",\"healthEventCategory\":\"qhabifpikxwcz\",\"healthEventId\":\"scnpqxuhivy\",\"resolutionETA\":\"2021-06-17T16:29:35Z\",\"occuredTime\":\"2021-02-26T02:52:04Z\",\"reasonChronicity\":\"Transient\",\"reportedTime\":\"2021-04-19T10:59:49Z\",\"recentlyResolved\":{\"unavailableOccuredTime\":\"2021-04-25T05:12:43Z\",\"resolvedTime\":\"2021-06-29T10:27:04Z\",\"unavailableSummary\":\"grtfwvu\"},\"recommendedActions\":[{\"action\":\"udccsnhsjc\",\"actionUrl\":\"ejhkry\",\"_ActionUrl.Comment\":\"napczwlokjy\",\"actionUrlText\":\"kkvnipjox\"},{\"action\":\"nchgej\",\"actionUrl\":\"odmailzyd\",\"_ActionUrl.Comment\":\"o\",\"actionUrlText\":\"yahux\"}],\"serviceImpactingEvents\":[{\"eventStartTime\":\"2021-12-05T01:17:56Z\",\"eventStatusLastModifiedTime\":\"2021-03-03T19:18:19Z\",\"correlationId\":\"qwixjspro\",\"status\":{\"value\":\"putegjvwmfd\"},\"incidentProperties\":{\"title\":\"cmdv\",\"service\":\"hulsuuvmkjozkrwf\",\"region\":\"iodjp\",\"incidentType\":\"w\"}},{\"eventStartTime\":\"2021-12-10T02:07:51Z\",\"eventStatusLastModifiedTime\":\"2021-06-14T18:24:45Z\",\"correlationId\":\"ryo\",\"status\":{\"value\":\"oacctaza\"},\"incidentProperties\":{\"title\":\"lahbcryff\",\"service\":\"dosyg\",\"region\":\"paojakhmsbzjh\",\"incidentType\":\"zevdphlx\"}}]},\"location\":\"lthqtrgqjbp\",\"id\":\"pfxxy\",\"name\":\"ininmay\",\"type\":\"uybbkpodep\"}") .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"), + Assertions.assertEquals("y", model.properties().title()); + Assertions.assertEquals("nzwuxzd", model.properties().summary()); + Assertions.assertEquals("a", model.properties().detailedStatus()); + Assertions.assertEquals("lhmwhfpmrqobm", model.properties().reasonType()); + Assertions.assertEquals("kknryrtihf", model.properties().context()); + Assertions.assertEquals("ijbpzvgnwzsymgl", model.properties().category()); + Assertions.assertEquals("fcyzkohdbihanufh", model.properties().articleId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-11T10:02:32Z"), 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"), + Assertions.assertEquals("y", model.properties().healthEventType()); + Assertions.assertEquals("git", model.properties().healthEventCause()); + Assertions.assertEquals("qhabifpikxwcz", model.properties().healthEventCategory()); + Assertions.assertEquals("scnpqxuhivy", model.properties().healthEventId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-17T16:29:35Z"), model.properties().resolutionEta()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-26T02:52:04Z"), model.properties().occuredTime()); + Assertions.assertEquals(ReasonChronicityTypes.TRANSIENT, model.properties().reasonChronicity()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-19T10:59:49Z"), model.properties().reportedTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-25T05:12:43Z"), model.properties().recentlyResolved().unavailableOccuredTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-07T14:56:07Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-06-29T10:27:04Z"), 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"), + Assertions.assertEquals("grtfwvu", model.properties().recentlyResolved().unavailableSummary()); + Assertions.assertEquals("udccsnhsjc", model.properties().recommendedActions().get(0).action()); + Assertions.assertEquals("ejhkry", model.properties().recommendedActions().get(0).actionUrl()); + Assertions.assertEquals("kkvnipjox", model.properties().recommendedActions().get(0).actionUrlText()); + Assertions.assertEquals(OffsetDateTime.parse("2021-12-05T01:17:56Z"), model.properties().serviceImpactingEvents().get(0).eventStartTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-23T15:38:51Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-03-03T19:18:19Z"), 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", + Assertions.assertEquals("qwixjspro", model.properties().serviceImpactingEvents().get(0).correlationId()); + Assertions.assertEquals("putegjvwmfd", model.properties().serviceImpactingEvents().get(0).status().value()); + Assertions.assertEquals("cmdv", model.properties().serviceImpactingEvents().get(0).incidentProperties().title()); - Assertions.assertEquals("fidfvzw", + Assertions.assertEquals("hulsuuvmkjozkrwf", model.properties().serviceImpactingEvents().get(0).incidentProperties().service()); - Assertions.assertEquals("uht", + Assertions.assertEquals("iodjp", 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", + Assertions.assertEquals("w", model.properties().serviceImpactingEvents().get(0).incidentProperties().incidentType()); + Assertions.assertEquals("lthqtrgqjbp", model.location()); + Assertions.assertEquals("pfxxy", model.id()); + Assertions.assertEquals("ininmay", model.name()); + Assertions.assertEquals("uybbkpodep", model.type()); } } 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 index ca86113e7705a..d26bc328769c8 100644 --- 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 @@ -1,270 +1,63 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.implementation.models.AvailabilityStatusListResult; 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\"}") + "{\"value\":[{\"properties\":{\"availabilityState\":\"Degraded\",\"title\":\"rpymzidnsez\",\"summary\":\"tbzsgfyccs\",\"detailedStatus\":\"wmdwzjeiachboo\",\"reasonType\":\"lnrosfqp\",\"context\":\"ehzzvypyqrim\",\"category\":\"npvswjdkirso\",\"articleId\":\"qxhcrmn\",\"rootCauseAttributionTime\":\"2021-05-15T08:21:17Z\",\"healthEventType\":\"ckwhds\",\"healthEventCause\":\"fiyipjxsqwpgrj\",\"healthEventCategory\":\"norcjxvsnbyxqab\",\"healthEventId\":\"ocpcy\",\"resolutionETA\":\"2021-10-15T17:46:31Z\",\"occuredTime\":\"2021-04-05T03:32:07Z\",\"reasonChronicity\":\"Transient\",\"reportedTime\":\"2021-02-03T18:35:41Z\",\"recentlyResolved\":{\"unavailableOccuredTime\":\"2021-08-04T23:38:29Z\",\"resolvedTime\":\"2021-03-18T13:17:11Z\",\"unavailableSummary\":\"oq\"},\"recommendedActions\":[{\"action\":\"ljavbqid\",\"actionUrl\":\"ajzyul\",\"_ActionUrl.Comment\":\"u\",\"actionUrlText\":\"krlkhbzhfepg\"},{\"action\":\"qex\",\"actionUrl\":\"ocxscpaierhhbcs\",\"_ActionUrl.Comment\":\"ummajtjaod\",\"actionUrlText\":\"bnbdxkqpxokajion\"}],\"serviceImpactingEvents\":[{\"eventStartTime\":\"2021-11-19T16:58:18Z\",\"eventStatusLastModifiedTime\":\"2021-04-16T13:46:56Z\",\"correlationId\":\"xgcp\",\"status\":{},\"incidentProperties\":{}},{\"eventStartTime\":\"2020-12-20T13:07:36Z\",\"eventStatusLastModifiedTime\":\"2021-08-14T01:03:38Z\",\"correlationId\":\"mvdjwzrlovmc\",\"status\":{},\"incidentProperties\":{}},{\"eventStartTime\":\"2021-03-13T08:52:38Z\",\"eventStatusLastModifiedTime\":\"2021-06-21T02:40:32Z\",\"correlationId\":\"jctbza\",\"status\":{},\"incidentProperties\":{}}]},\"location\":\"y\",\"id\":\"fjpgddtocjjxhvp\",\"name\":\"o\",\"type\":\"exhd\"},{\"properties\":{\"availabilityState\":\"Available\",\"title\":\"eojnxqbzvddn\",\"summary\":\"ndei\",\"detailedStatus\":\"twnpzaoqvuhrhcf\",\"reasonType\":\"yd\",\"context\":\"lmjthjq\",\"category\":\"pyeicxm\",\"articleId\":\"iwqvhkh\",\"rootCauseAttributionTime\":\"2021-04-08T23:48:15Z\",\"healthEventType\":\"gdtopbobjogh\",\"healthEventCause\":\"w\",\"healthEventCategory\":\"m\",\"healthEventId\":\"hrzayvvtpgvdf\",\"resolutionETA\":\"2021-06-28T04:08:22Z\",\"occuredTime\":\"2021-08-06T16:31:09Z\",\"reasonChronicity\":\"Persistent\",\"reportedTime\":\"2021-07-18T12:38:02Z\",\"recentlyResolved\":{\"unavailableOccuredTime\":\"2021-01-13T20:02:55Z\",\"resolvedTime\":\"2021-02-26T05:04:17Z\",\"unavailableSummary\":\"lefgugnxk\"},\"recommendedActions\":[{\"action\":\"mi\",\"actionUrl\":\"thz\",\"_ActionUrl.Comment\":\"qdrabhjybigehoqf\",\"actionUrlText\":\"wska\"},{\"action\":\"ktzlcuiywg\",\"actionUrl\":\"wgndrvynhzgpp\",\"_ActionUrl.Comment\":\"cgyncocpecf\",\"actionUrlText\":\"mcoo\"}],\"serviceImpactingEvents\":[{\"eventStartTime\":\"2021-11-20T02:18:33Z\",\"eventStatusLastModifiedTime\":\"2021-08-17T05:40:34Z\",\"correlationId\":\"bmqj\",\"status\":{},\"incidentProperties\":{}},{\"eventStartTime\":\"2021-05-28T08:17:24Z\",\"eventStatusLastModifiedTime\":\"2021-06-22T17:35:49Z\",\"correlationId\":\"vkwlzuvccfwnf\",\"status\":{},\"incidentProperties\":{}},{\"eventStartTime\":\"2021-04-04T07:21:26Z\",\"eventStatusLastModifiedTime\":\"2021-04-16T12:59:12Z\",\"correlationId\":\"l\",\"status\":{},\"incidentProperties\":{}},{\"eventStartTime\":\"2021-04-06T03:12:38Z\",\"eventStatusLastModifiedTime\":\"2021-11-29T00:22:10Z\",\"correlationId\":\"zxdpnqbqqw\",\"status\":{},\"incidentProperties\":{}}]},\"location\":\"eallnwsubisnj\",\"id\":\"xnj\",\"name\":\"ase\",\"type\":\"pheoflokeyy\"}],\"nextLink\":\"nj\"}") .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"), + Assertions.assertEquals("rpymzidnsez", model.value().get(0).properties().title()); + Assertions.assertEquals("tbzsgfyccs", model.value().get(0).properties().summary()); + Assertions.assertEquals("wmdwzjeiachboo", model.value().get(0).properties().detailedStatus()); + Assertions.assertEquals("lnrosfqp", model.value().get(0).properties().reasonType()); + Assertions.assertEquals("ehzzvypyqrim", model.value().get(0).properties().context()); + Assertions.assertEquals("npvswjdkirso", model.value().get(0).properties().category()); + Assertions.assertEquals("qxhcrmn", model.value().get(0).properties().articleId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-15T08:21:17Z"), 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"), + Assertions.assertEquals("ckwhds", model.value().get(0).properties().healthEventType()); + Assertions.assertEquals("fiyipjxsqwpgrj", model.value().get(0).properties().healthEventCause()); + Assertions.assertEquals("norcjxvsnbyxqab", model.value().get(0).properties().healthEventCategory()); + Assertions.assertEquals("ocpcy", model.value().get(0).properties().healthEventId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-15T17:46:31Z"), model.value().get(0).properties().resolutionEta()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-04T01:57:27Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-04-05T03:32:07Z"), 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"), + Assertions.assertEquals(OffsetDateTime.parse("2021-02-03T18:35:41Z"), model.value().get(0).properties().reportedTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-21T00:46:54Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-08-04T23:38:29Z"), model.value().get(0).properties().recentlyResolved().unavailableOccuredTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-30T15:17:55Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-03-18T13:17:11Z"), 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", + Assertions.assertEquals("oq", model.value().get(0).properties().recentlyResolved().unavailableSummary()); + Assertions.assertEquals("ljavbqid", model.value().get(0).properties().recommendedActions().get(0).action()); + Assertions.assertEquals("ajzyul", model.value().get(0).properties().recommendedActions().get(0).actionUrl()); + Assertions.assertEquals("krlkhbzhfepg", model.value().get(0).properties().recommendedActions().get(0).actionUrlText()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-07T10:33:04Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-11-19T16:58:18Z"), model.value().get(0).properties().serviceImpactingEvents().get(0).eventStartTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-22T22:11:04Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-04-16T13:46:56Z"), model.value().get(0).properties().serviceImpactingEvents().get(0).eventStatusLastModifiedTime()); - Assertions.assertEquals("mofcq", + Assertions.assertEquals("xgcp", 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()); + Assertions.assertEquals("y", model.value().get(0).location()); + Assertions.assertEquals("fjpgddtocjjxhvp", model.value().get(0).id()); + Assertions.assertEquals("o", model.value().get(0).name()); + Assertions.assertEquals("exhd", model.value().get(0).type()); + Assertions.assertEquals("nj", 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 index 9e28f2a5eddb5..409626d413474 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.generated; @@ -13,22 +13,10 @@ 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\"}") + "{\"unavailableOccuredTime\":\"2021-01-31T05:15:53Z\",\"resolvedTime\":\"2021-03-25T06:01:40Z\",\"unavailableSummary\":\"bquxigjy\"}") .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()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-31T05:15:53Z"), model.unavailableOccuredTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-25T06:01:40Z"), model.resolvedTime()); + Assertions.assertEquals("bquxigjy", 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 index 3ef9e01c57081..c46929254a379 100644 --- 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 @@ -1,142 +1,55 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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\"}}]}") + "{\"availabilityState\":\"Degraded\",\"title\":\"nuvamiheogna\",\"summary\":\"zxtheotusivyevcc\",\"detailedStatus\":\"ihnhun\",\"reasonType\":\"wjzrnfygxgisp\",\"context\":\"vtz\",\"category\":\"ufubl\",\"articleId\":\"fxqeof\",\"rootCauseAttributionTime\":\"2021-11-09T06:35:40Z\",\"healthEventType\":\"jhqjbasvmsmjqul\",\"healthEventCause\":\"sntnbybkzgcw\",\"healthEventCategory\":\"clxxwrljdo\",\"healthEventId\":\"kcqvkocrc\",\"resolutionETA\":\"2021-02-11T18:18:15Z\",\"occuredTime\":\"2021-10-12T07:17:40Z\",\"reasonChronicity\":\"Persistent\",\"reportedTime\":\"2021-08-17T00:59:03Z\",\"recentlyResolved\":{\"unavailableOccuredTime\":\"2021-08-22T09:01:35Z\",\"resolvedTime\":\"2021-05-23T21:52:10Z\",\"unavailableSummary\":\"qrglssainqpjwn\"},\"recommendedActions\":[{\"action\":\"fmppe\",\"actionUrl\":\"vmgxsab\",\"_ActionUrl.Comment\":\"qduujitcjczdz\",\"actionUrlText\":\"ndhkrw\"},{\"action\":\"appd\",\"actionUrl\":\"dkvwrwjfe\",\"_ActionUrl.Comment\":\"nhutjeltmrldhugj\",\"actionUrlText\":\"datqxhocdgeabl\"}],\"serviceImpactingEvents\":[{\"eventStartTime\":\"2021-04-11T10:07:02Z\",\"eventStatusLastModifiedTime\":\"2021-10-07T02:44:54Z\",\"correlationId\":\"dvkaozw\",\"status\":{\"value\":\"tyhxhurokft\"},\"incidentProperties\":{\"title\":\"lniwpwcukjfkgiaw\",\"service\":\"lryplwckbasyy\",\"region\":\"ddhsgcbacphe\",\"incidentType\":\"ot\"}},{\"eventStartTime\":\"2021-05-11T13:05:51Z\",\"eventStatusLastModifiedTime\":\"2021-02-05T05:14:14Z\",\"correlationId\":\"l\",\"status\":{\"value\":\"likwyqkgfgib\"},\"incidentProperties\":{\"title\":\"gakeqsr\",\"service\":\"bzqqedqytbciq\",\"region\":\"uflmm\",\"incidentType\":\"zsm\"}},{\"eventStartTime\":\"2021-04-01T03:04:17Z\",\"eventStatusLastModifiedTime\":\"2021-09-11T16:20:20Z\",\"correlationId\":\"ugpbkw\",\"status\":{\"value\":\"tduqktapspwgcuer\"},\"incidentProperties\":{\"title\":\"kdosvqw\",\"service\":\"mdgbbjfdd\",\"region\":\"bmbexppbhtqqro\",\"incidentType\":\"p\"}}]}") .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(AvailabilityStateValues.DEGRADED, model.availabilityState()); + Assertions.assertEquals("nuvamiheogna", model.title()); + Assertions.assertEquals("zxtheotusivyevcc", model.summary()); + Assertions.assertEquals("ihnhun", model.detailedStatus()); + Assertions.assertEquals("wjzrnfygxgisp", model.reasonType()); + Assertions.assertEquals("vtz", model.context()); + Assertions.assertEquals("ufubl", model.category()); + Assertions.assertEquals("fxqeof", model.articleId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-09T06:35:40Z"), model.rootCauseAttributionTime()); + Assertions.assertEquals("jhqjbasvmsmjqul", model.healthEventType()); + Assertions.assertEquals("sntnbybkzgcw", model.healthEventCause()); + Assertions.assertEquals("clxxwrljdo", model.healthEventCategory()); + Assertions.assertEquals("kcqvkocrc", model.healthEventId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-11T18:18:15Z"), model.resolutionEta()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-12T07:17:40Z"), 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"), + Assertions.assertEquals(OffsetDateTime.parse("2021-08-17T00:59:03Z"), model.reportedTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-22T09:01:35Z"), 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"), + Assertions.assertEquals(OffsetDateTime.parse("2021-05-23T21:52:10Z"), model.recentlyResolved().resolvedTime()); + Assertions.assertEquals("qrglssainqpjwn", model.recentlyResolved().unavailableSummary()); + Assertions.assertEquals("fmppe", model.recommendedActions().get(0).action()); + Assertions.assertEquals("vmgxsab", model.recommendedActions().get(0).actionUrl()); + Assertions.assertEquals("ndhkrw", model.recommendedActions().get(0).actionUrlText()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-11T10:07:02Z"), model.serviceImpactingEvents().get(0).eventStartTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-27T21:23:24Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-10-07T02:44:54Z"), 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()); + Assertions.assertEquals("dvkaozw", model.serviceImpactingEvents().get(0).correlationId()); + Assertions.assertEquals("tyhxhurokft", model.serviceImpactingEvents().get(0).status().value()); + Assertions.assertEquals("lniwpwcukjfkgiaw", model.serviceImpactingEvents().get(0).incidentProperties().title()); + Assertions.assertEquals("lryplwckbasyy", model.serviceImpactingEvents().get(0).incidentProperties().service()); + Assertions.assertEquals("ddhsgcbacphe", model.serviceImpactingEvents().get(0).incidentProperties().region()); + Assertions.assertEquals("ot", 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 index 37aa567e1ec3e..7faf6ef5701e8 100644 --- 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.resourcehealth.ResourceHealthManager; import com.azure.resourcemanager.resourcehealth.models.AvailabilityStateValues; @@ -23,63 +23,63 @@ 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\"}}]}}"; + = "{\"properties\":{\"availabilityState\":\"Available\",\"title\":\"mlkxtrqjfs\",\"summary\":\"mbtxhwgf\",\"detailedStatus\":\"rtawcoezb\",\"reasonType\":\"ubskhudygoookkq\",\"context\":\"jb\",\"category\":\"eorfm\",\"articleId\":\"iqtqzfavyvnq\",\"rootCauseAttributionTime\":\"2021-05-23T06:21:06Z\",\"healthEventType\":\"ryeu\",\"healthEventCause\":\"jkqa\",\"healthEventCategory\":\"gzslesjcbhernnti\",\"healthEventId\":\"djc\",\"resolutionETA\":\"2021-06-26T16:02:41Z\",\"occuredTime\":\"2021-02-13T08:45:08Z\",\"reasonChronicity\":\"Persistent\",\"reportedTime\":\"2021-03-14T01:37:10Z\",\"recentlyResolved\":{\"unavailableOccuredTime\":\"2021-03-14T10:10:40Z\",\"resolvedTime\":\"2021-09-18T09:21:14Z\",\"unavailableSummary\":\"uffkmrqemvvh\"},\"recommendedActions\":[{\"action\":\"rjfut\",\"actionUrl\":\"oe\",\"_ActionUrl.Comment\":\"vewzcj\",\"actionUrlText\":\"m\"},{\"action\":\"pmguaadraufac\",\"actionUrl\":\"ahzovajjziuxxp\",\"_ActionUrl.Comment\":\"neekulfg\",\"actionUrlText\":\"qubkw\"},{\"action\":\"enr\",\"actionUrl\":\"utujba\",\"_ActionUrl.Comment\":\"juohminyflnorw\",\"actionUrlText\":\"uvwpklvxwmyg\"},{\"action\":\"pgpqchiszepnnb\",\"actionUrl\":\"rxgibbd\",\"_ActionUrl.Comment\":\"confozauors\",\"actionUrlText\":\"okwbqplh\"}],\"serviceImpactingEvents\":[{\"eventStartTime\":\"2021-01-24T14:33:20Z\",\"eventStatusLastModifiedTime\":\"2021-08-29T14:02:44Z\",\"correlationId\":\"lrphwzsoldw\",\"status\":{\"value\":\"qdunvmnnrwrbior\"},\"incidentProperties\":{\"title\":\"lywjhh\",\"service\":\"nhxmsi\",\"region\":\"omi\",\"incidentType\":\"xggdufi\"}},{\"eventStartTime\":\"2021-01-17T17:19:37Z\",\"eventStatusLastModifiedTime\":\"2021-01-10T04:07:58Z\",\"correlationId\":\"zaofjchvcyy\",\"status\":{\"value\":\"gdotcubiipuipwo\"},\"incidentProperties\":{\"title\":\"macjekn\",\"service\":\"shqvcimpev\",\"region\":\"mblrrilbywd\",\"incidentType\":\"miccwrwfscjfnyn\"}},{\"eventStartTime\":\"2021-06-16T16:28:25Z\",\"eventStatusLastModifiedTime\":\"2021-11-10T04:53:36Z\",\"correlationId\":\"zdvoqytibyowbb\",\"status\":{\"value\":\"avu\"},\"incidentProperties\":{\"title\":\"hjoxo\",\"service\":\"msksbp\",\"region\":\"lqol\",\"incidentType\":\"kcgxxlxsffgcvi\"}}]},\"location\":\"zdwlvwlyoupfgfb\",\"id\":\"ahbqactxtgzuk\",\"name\":\"itmmqtgqqqxh\",\"type\":\"n\"}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); AvailabilityStatus response = manager.availabilityStatuses() - .getByResourceWithResponse("kdl", "wqfbumlkxtrqjfsm", "mbtxhwgf", com.azure.core.util.Context.NONE) + .getByResourceWithResponse("vdxec", "zedqbcvhzlhplo", "qkdlw", 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"), + Assertions.assertEquals(AvailabilityStateValues.AVAILABLE, response.properties().availabilityState()); + Assertions.assertEquals("mlkxtrqjfs", response.properties().title()); + Assertions.assertEquals("mbtxhwgf", response.properties().summary()); + Assertions.assertEquals("rtawcoezb", response.properties().detailedStatus()); + Assertions.assertEquals("ubskhudygoookkq", response.properties().reasonType()); + Assertions.assertEquals("jb", response.properties().context()); + Assertions.assertEquals("eorfm", response.properties().category()); + Assertions.assertEquals("iqtqzfavyvnq", response.properties().articleId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-23T06:21:06Z"), 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("ryeu", response.properties().healthEventType()); + Assertions.assertEquals("jkqa", response.properties().healthEventCause()); + Assertions.assertEquals("gzslesjcbhernnti", response.properties().healthEventCategory()); + Assertions.assertEquals("djc", response.properties().healthEventId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-26T16:02:41Z"), response.properties().resolutionEta()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-13T08:45:08Z"), 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"), + Assertions.assertEquals(OffsetDateTime.parse("2021-03-14T01:37:10Z"), response.properties().reportedTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-14T10:10:40Z"), response.properties().recentlyResolved().unavailableOccuredTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-20T11:59:59Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-09-18T09:21:14Z"), 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"), + Assertions.assertEquals("uffkmrqemvvh", response.properties().recentlyResolved().unavailableSummary()); + Assertions.assertEquals("rjfut", response.properties().recommendedActions().get(0).action()); + Assertions.assertEquals("oe", response.properties().recommendedActions().get(0).actionUrl()); + Assertions.assertEquals("m", response.properties().recommendedActions().get(0).actionUrlText()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-24T14:33:20Z"), response.properties().serviceImpactingEvents().get(0).eventStartTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-15T07:57:44Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-08-29T14:02:44Z"), response.properties().serviceImpactingEvents().get(0).eventStatusLastModifiedTime()); - Assertions.assertEquals("ofjchvcyyysf", response.properties().serviceImpactingEvents().get(0).correlationId()); - Assertions.assertEquals("tcubiipuipwoqonm", + Assertions.assertEquals("lrphwzsoldw", response.properties().serviceImpactingEvents().get(0).correlationId()); + Assertions.assertEquals("qdunvmnnrwrbior", response.properties().serviceImpactingEvents().get(0).status().value()); - Assertions.assertEquals("ekni", + Assertions.assertEquals("lywjhh", response.properties().serviceImpactingEvents().get(0).incidentProperties().title()); - Assertions.assertEquals("hqvcimpevfgmblr", + Assertions.assertEquals("nhxmsi", response.properties().serviceImpactingEvents().get(0).incidentProperties().service()); - Assertions.assertEquals("lbywdxsm", + Assertions.assertEquals("omi", response.properties().serviceImpactingEvents().get(0).incidentProperties().region()); - Assertions.assertEquals("cwrwfs", + Assertions.assertEquals("xggdufi", response.properties().serviceImpactingEvents().get(0).incidentProperties().incidentType()); + Assertions.assertEquals("zdwlvwlyoupfgfb", response.location()); + Assertions.assertEquals("ahbqactxtgzuk", response.id()); + Assertions.assertEquals("itmmqtgqqqxh", response.name()); + Assertions.assertEquals("n", response.type()); } } 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 index 97d55d53511ca..0baecc3dd6a6f 100644 --- 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 @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.resourcehealth.ResourceHealthManager; import com.azure.resourcemanager.resourcehealth.models.AvailabilityStateValues; @@ -24,72 +24,68 @@ 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\"}}]}}]}"; + = "{\"value\":[{\"properties\":{\"availabilityState\":\"Degraded\",\"title\":\"qxtjjfzqlqhyca\",\"summary\":\"dggxdbeesmi\",\"detailedStatus\":\"nlrariaawiuagy\",\"reasonType\":\"qfby\",\"context\":\"rfgi\",\"category\":\"tcojocqwo\",\"articleId\":\"nzjvusfzldm\",\"rootCauseAttributionTime\":\"2021-03-24T00:03:01Z\",\"healthEventType\":\"ylfsbtk\",\"healthEventCause\":\"pysownbt\",\"healthEventCategory\":\"bugrj\",\"healthEventId\":\"to\",\"resolutionETA\":\"2021-08-14T04:49:22Z\",\"occuredTime\":\"2021-05-06T01:49:14Z\",\"reasonChronicity\":\"Persistent\",\"reportedTime\":\"2021-05-31T05:32:56Z\",\"recentlyResolved\":{\"unavailableOccuredTime\":\"2021-11-04T14:09:09Z\",\"resolvedTime\":\"2021-12-05T14:05:21Z\",\"unavailableSummary\":\"yqdhcuplcplcw\"},\"recommendedActions\":[{\"action\":\"ihlhzdsqtzb\",\"actionUrl\":\"gnowcjhfgmveca\",\"_ActionUrl.Comment\":\"xmwoteyowcluqo\",\"actionUrlText\":\"kqvgqouw\"}],\"serviceImpactingEvents\":[{\"eventStartTime\":\"2021-03-15T08:57:58Z\",\"eventStatusLastModifiedTime\":\"2021-09-15T05:47:21Z\",\"correlationId\":\"ivqikfxcvhr\",\"status\":{\"value\":\"huagrttikteusqc\"},\"incidentProperties\":{\"title\":\"yklxubyjaffmmfbl\",\"service\":\"cuubgq\",\"region\":\"rtalmet\",\"incidentType\":\"wgdsl\"}},{\"eventStartTime\":\"2021-06-19T08:41:21Z\",\"eventStatusLastModifiedTime\":\"2021-03-30T18:43:15Z\",\"correlationId\":\"moo\",\"status\":{\"value\":\"seypxiutcxapz\"},\"incidentProperties\":{\"title\":\"petogebjox\",\"service\":\"hvnh\",\"region\":\"brqnkkzjcjb\",\"incidentType\":\"gaehvvibrxjjst\"}}]},\"location\":\"beitpkx\",\"id\":\"yhohujswtwkozzwc\",\"name\":\"lkb\",\"type\":\"wpfaj\"}]}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.availabilityStatuses() - .listByResourceGroup("ejnt", "sewgioilqukr", "dxtqmieoxo", com.azure.core.util.Context.NONE); + .listByResourceGroup("vhmgorffukis", "vwmzhwplefaxvxil", "btgn", 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, + Assertions.assertEquals(AvailabilityStateValues.DEGRADED, 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"), + Assertions.assertEquals("qxtjjfzqlqhyca", response.iterator().next().properties().title()); + Assertions.assertEquals("dggxdbeesmi", response.iterator().next().properties().summary()); + Assertions.assertEquals("nlrariaawiuagy", response.iterator().next().properties().detailedStatus()); + Assertions.assertEquals("qfby", response.iterator().next().properties().reasonType()); + Assertions.assertEquals("rfgi", response.iterator().next().properties().context()); + Assertions.assertEquals("tcojocqwo", response.iterator().next().properties().category()); + Assertions.assertEquals("nzjvusfzldm", response.iterator().next().properties().articleId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-24T00:03:01Z"), 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"), + Assertions.assertEquals("ylfsbtk", response.iterator().next().properties().healthEventType()); + Assertions.assertEquals("pysownbt", response.iterator().next().properties().healthEventCause()); + Assertions.assertEquals("bugrj", response.iterator().next().properties().healthEventCategory()); + Assertions.assertEquals("to", response.iterator().next().properties().healthEventId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-14T04:49:22Z"), response.iterator().next().properties().resolutionEta()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-16T02:48:21Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-05-06T01:49:14Z"), response.iterator().next().properties().occuredTime()); Assertions.assertEquals(ReasonChronicityTypes.PERSISTENT, response.iterator().next().properties().reasonChronicity()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-14T22:40:57Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-05-31T05:32:56Z"), response.iterator().next().properties().reportedTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-11T05:22:52Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-11-04T14:09:09Z"), response.iterator().next().properties().recentlyResolved().unavailableOccuredTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-06T01:04:21Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-12-05T14:05:21Z"), response.iterator().next().properties().recentlyResolved().resolvedTime()); - Assertions.assertEquals("urisjnhnytxifqj", + Assertions.assertEquals("yqdhcuplcplcw", response.iterator().next().properties().recentlyResolved().unavailableSummary()); - Assertions.assertEquals("rhublwpcesutrg", + Assertions.assertEquals("ihlhzdsqtzb", response.iterator().next().properties().recommendedActions().get(0).action()); - Assertions.assertEquals("pauutpw", + Assertions.assertEquals("gnowcjhfgmveca", response.iterator().next().properties().recommendedActions().get(0).actionUrl()); - Assertions.assertEquals("ypsxjvfoim", + Assertions.assertEquals("kqvgqouw", response.iterator().next().properties().recommendedActions().get(0).actionUrlText()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-05T12:18:52Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-03-15T08:57:58Z"), response.iterator().next().properties().serviceImpactingEvents().get(0).eventStartTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-05T04:29:27Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-09-15T05:47:21Z"), response.iterator().next().properties().serviceImpactingEvents().get(0).eventStatusLastModifiedTime()); - Assertions.assertEquals("qnrnrpxehuwryk", + Assertions.assertEquals("ivqikfxcvhr", response.iterator().next().properties().serviceImpactingEvents().get(0).correlationId()); - Assertions.assertEquals("ifmviklbydvk", + Assertions.assertEquals("huagrttikteusqc", response.iterator().next().properties().serviceImpactingEvents().get(0).status().value()); - Assertions.assertEquals("jdz", + Assertions.assertEquals("yklxubyjaffmmfbl", response.iterator().next().properties().serviceImpactingEvents().get(0).incidentProperties().title()); - Assertions.assertEquals("cvdsrhnj", + Assertions.assertEquals("cuubgq", response.iterator().next().properties().serviceImpactingEvents().get(0).incidentProperties().service()); - Assertions.assertEquals("olvtnovqfzge", + Assertions.assertEquals("rtalmet", response.iterator().next().properties().serviceImpactingEvents().get(0).incidentProperties().region()); - Assertions.assertEquals("dftuljltduce", + Assertions.assertEquals("wgdsl", response.iterator() .next() .properties() @@ -97,5 +93,9 @@ public void testListByResourceGroup() throws Exception { .get(0) .incidentProperties() .incidentType()); + Assertions.assertEquals("beitpkx", response.iterator().next().location()); + Assertions.assertEquals("yhohujswtwkozzwc", response.iterator().next().id()); + Assertions.assertEquals("lkb", response.iterator().next().name()); + Assertions.assertEquals("wpfaj", response.iterator().next().type()); } } 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 index e6baa9b8c595f..ae0cb3034a7af 100644 --- 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 @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.resourcehealth.ResourceHealthManager; import com.azure.resourcemanager.resourcehealth.models.AvailabilityStateValues; @@ -24,71 +24,67 @@ 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\"}}]}}]}"; + = "{\"value\":[{\"properties\":{\"availabilityState\":\"Unknown\",\"title\":\"atnwxyiopi\",\"summary\":\"qqfkuv\",\"detailedStatus\":\"xkdmligo\",\"reasonType\":\"brxk\",\"context\":\"loazuruocbgoo\",\"category\":\"te\",\"articleId\":\"bfhjxakvvjgsl\",\"rootCauseAttributionTime\":\"2021-09-04T03:37:27Z\",\"healthEventType\":\"lmywwtkgkxnyed\",\"healthEventCause\":\"gyvudtjuewbc\",\"healthEventCategory\":\"xuuwhcj\",\"healthEventId\":\"ccybvp\",\"resolutionETA\":\"2021-09-20T03:02:08Z\",\"occuredTime\":\"2021-11-06T02:11:56Z\",\"reasonChronicity\":\"Persistent\",\"reportedTime\":\"2021-09-23T17:21:27Z\",\"recentlyResolved\":{\"unavailableOccuredTime\":\"2021-08-18T20:25:34Z\",\"resolvedTime\":\"2021-05-27T09:18:41Z\",\"unavailableSummary\":\"mag\"},\"recommendedActions\":[{\"action\":\"ohpfkyrkdbdgiog\",\"actionUrl\":\"kmnwqjnobaiyhddv\",\"_ActionUrl.Comment\":\"cegfnmntfp\",\"actionUrlText\":\"memfnczdwvvbalxl\"},{\"action\":\"chp\",\"actionUrl\":\"bzevwrd\",\"_ActionUrl.Comment\":\"fukuvsjcswsmystu\",\"actionUrlText\":\"qypfcv\"},{\"action\":\"rchpqbmfpjbabwid\",\"actionUrl\":\"xsspuunnoxyhk\",\"_ActionUrl.Comment\":\"qddrihpfhoqcaae\",\"actionUrlText\":\"aomdjvlpjxx\"},{\"action\":\"brm\",\"actionUrl\":\"eivsiykzkdnc\",\"_ActionUrl.Comment\":\"xonbzoggculapz\",\"actionUrlText\":\"rpgogtqxep\"}],\"serviceImpactingEvents\":[{\"eventStartTime\":\"2021-06-16T11:51:19Z\",\"eventStatusLastModifiedTime\":\"2021-09-26T03:21:12Z\",\"correlationId\":\"lyjt\",\"status\":{\"value\":\"fqzhv\"},\"incidentProperties\":{\"title\":\"byfmowuxr\",\"service\":\"pvdwxf\",\"region\":\"iivwzjbhyzsxjrka\",\"incidentType\":\"trnegvmnvuqeqvld\"}}]},\"location\":\"astjbkkdmflvestm\",\"id\":\"uztcktyhjtqed\",\"name\":\"gzulwmmrqzzr\",\"type\":\"jvpglydzgk\"}]}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response - = manager.availabilityStatuses().listBySubscriptionId("bfvoowvrv", "t", com.azure.core.util.Context.NONE); + PagedIterable response = manager.availabilityStatuses() + .listBySubscriptionId("rxcpjuisavo", "qdzfvazivjlfrqtt", 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"), + Assertions.assertEquals("atnwxyiopi", response.iterator().next().properties().title()); + Assertions.assertEquals("qqfkuv", response.iterator().next().properties().summary()); + Assertions.assertEquals("xkdmligo", response.iterator().next().properties().detailedStatus()); + Assertions.assertEquals("brxk", response.iterator().next().properties().reasonType()); + Assertions.assertEquals("loazuruocbgoo", response.iterator().next().properties().context()); + Assertions.assertEquals("te", response.iterator().next().properties().category()); + Assertions.assertEquals("bfhjxakvvjgsl", response.iterator().next().properties().articleId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-04T03:37:27Z"), 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"), + Assertions.assertEquals("lmywwtkgkxnyed", response.iterator().next().properties().healthEventType()); + Assertions.assertEquals("gyvudtjuewbc", response.iterator().next().properties().healthEventCause()); + Assertions.assertEquals("xuuwhcj", response.iterator().next().properties().healthEventCategory()); + Assertions.assertEquals("ccybvp", response.iterator().next().properties().healthEventId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-20T03:02:08Z"), response.iterator().next().properties().resolutionEta()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-15T10:22:53Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-11-06T02:11:56Z"), response.iterator().next().properties().occuredTime()); Assertions.assertEquals(ReasonChronicityTypes.PERSISTENT, response.iterator().next().properties().reasonChronicity()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-04T17:22:28Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-09-23T17:21:27Z"), response.iterator().next().properties().reportedTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-20T06:33:49Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-08-18T20:25:34Z"), response.iterator().next().properties().recentlyResolved().unavailableOccuredTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-03T03:37:12Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-05-27T09:18:41Z"), response.iterator().next().properties().recentlyResolved().resolvedTime()); - Assertions.assertEquals("edltmmjihyeozp", - response.iterator().next().properties().recentlyResolved().unavailableSummary()); - Assertions.assertEquals("uyqncygupkvipmd", + Assertions.assertEquals("mag", response.iterator().next().properties().recentlyResolved().unavailableSummary()); + Assertions.assertEquals("ohpfkyrkdbdgiog", response.iterator().next().properties().recommendedActions().get(0).action()); - Assertions.assertEquals("wx", response.iterator().next().properties().recommendedActions().get(0).actionUrl()); - Assertions.assertEquals("xhojuj", + Assertions.assertEquals("kmnwqjnobaiyhddv", + response.iterator().next().properties().recommendedActions().get(0).actionUrl()); + Assertions.assertEquals("memfnczdwvvbalxl", response.iterator().next().properties().recommendedActions().get(0).actionUrlText()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-17T22:54:10Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-06-16T11:51:19Z"), response.iterator().next().properties().serviceImpactingEvents().get(0).eventStartTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-25T06:41:34Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-09-26T03:21:12Z"), response.iterator().next().properties().serviceImpactingEvents().get(0).eventStatusLastModifiedTime()); - Assertions.assertEquals("vhixbjxy", + Assertions.assertEquals("lyjt", response.iterator().next().properties().serviceImpactingEvents().get(0).correlationId()); - Assertions.assertEquals("yl", + Assertions.assertEquals("fqzhv", response.iterator().next().properties().serviceImpactingEvents().get(0).status().value()); - Assertions.assertEquals("o", + Assertions.assertEquals("byfmowuxr", response.iterator().next().properties().serviceImpactingEvents().get(0).incidentProperties().title()); - Assertions.assertEquals("ttpkiwkkbnujrywv", + Assertions.assertEquals("pvdwxf", response.iterator().next().properties().serviceImpactingEvents().get(0).incidentProperties().service()); - Assertions.assertEquals("lbfpncurd", + Assertions.assertEquals("iivwzjbhyzsxjrka", response.iterator().next().properties().serviceImpactingEvents().get(0).incidentProperties().region()); - Assertions.assertEquals("wiithtywub", + Assertions.assertEquals("trnegvmnvuqeqvld", response.iterator() .next() .properties() @@ -96,5 +92,9 @@ public void testListBySubscriptionId() throws Exception { .get(0) .incidentProperties() .incidentType()); + Assertions.assertEquals("astjbkkdmflvestm", response.iterator().next().location()); + Assertions.assertEquals("uztcktyhjtqed", response.iterator().next().id()); + Assertions.assertEquals("gzulwmmrqzzr", response.iterator().next().name()); + Assertions.assertEquals("jvpglydzgk", response.iterator().next().type()); } } 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 index 31a69f2c0561d..5655dd15a52ee 100644 --- 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 @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.resourcehealth.ResourceHealthManager; import com.azure.resourcemanager.resourcehealth.models.AvailabilityStateValues; @@ -24,72 +24,68 @@ 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\"}}]}}]}"; + = "{\"value\":[{\"properties\":{\"availabilityState\":\"Available\",\"title\":\"q\",\"summary\":\"f\",\"detailedStatus\":\"z\",\"reasonType\":\"iglaecx\",\"context\":\"t\",\"category\":\"okpvzm\",\"articleId\":\"t\",\"rootCauseAttributionTime\":\"2021-01-29T20:58:55Z\",\"healthEventType\":\"x\",\"healthEventCause\":\"firclnpkciayz\",\"healthEventCategory\":\"ykhyawfvjlboxqvk\",\"healthEventId\":\"mxho\",\"resolutionETA\":\"2021-09-19T13:24:45Z\",\"occuredTime\":\"2021-02-16T04:09:13Z\",\"reasonChronicity\":\"Persistent\",\"reportedTime\":\"2021-05-04T06:13:03Z\",\"recentlyResolved\":{\"unavailableOccuredTime\":\"2021-05-01T20:19:26Z\",\"resolvedTime\":\"2021-09-11T19:08:33Z\",\"unavailableSummary\":\"aauzzptjazysd\"},\"recommendedActions\":[{\"action\":\"wwvaiqyuvvfonk\",\"actionUrl\":\"hqyikvy\",\"_ActionUrl.Comment\":\"uyav\",\"actionUrlText\":\"wmn\"},{\"action\":\"ttijfybvpoekrs\",\"actionUrl\":\"gbdhuzqgnjdg\",\"_ActionUrl.Comment\":\"nscliqhzvhxnk\",\"actionUrlText\":\"tkubotppn\"}],\"serviceImpactingEvents\":[{\"eventStartTime\":\"2021-03-01T06:38:59Z\",\"eventStatusLastModifiedTime\":\"2021-01-05T01:25:57Z\",\"correlationId\":\"frbbc\",\"status\":{\"value\":\"agtltdhlfkqoj\"},\"incidentProperties\":{\"title\":\"vgtrdcnifmzzs\",\"service\":\"m\",\"region\":\"nysuxmprafwgckh\",\"incidentType\":\"xvd\"}}]},\"location\":\"fwafqrouda\",\"id\":\"mfdn\",\"name\":\"zydvfvf\",\"type\":\"jnaeois\"}]}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response = manager.availabilityStatuses() - .list("n", "rxcpjuisavo", "qdzfvazivjlfrqtt", com.azure.core.util.Context.NONE); + PagedIterable response + = manager.availabilityStatuses().list("vqeevtoep", "yutnwytpzdmov", "vf", 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, + Assertions.assertEquals(AvailabilityStateValues.AVAILABLE, 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"), + Assertions.assertEquals("q", response.iterator().next().properties().title()); + Assertions.assertEquals("f", response.iterator().next().properties().summary()); + Assertions.assertEquals("z", response.iterator().next().properties().detailedStatus()); + Assertions.assertEquals("iglaecx", response.iterator().next().properties().reasonType()); + Assertions.assertEquals("t", response.iterator().next().properties().context()); + Assertions.assertEquals("okpvzm", response.iterator().next().properties().category()); + Assertions.assertEquals("t", response.iterator().next().properties().articleId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-29T20:58:55Z"), 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"), + Assertions.assertEquals("x", response.iterator().next().properties().healthEventType()); + Assertions.assertEquals("firclnpkciayz", response.iterator().next().properties().healthEventCause()); + Assertions.assertEquals("ykhyawfvjlboxqvk", response.iterator().next().properties().healthEventCategory()); + Assertions.assertEquals("mxho", response.iterator().next().properties().healthEventId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-19T13:24:45Z"), response.iterator().next().properties().resolutionEta()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-11T22:31:41Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-02-16T04:09:13Z"), response.iterator().next().properties().occuredTime()); - Assertions.assertEquals(ReasonChronicityTypes.TRANSIENT, + Assertions.assertEquals(ReasonChronicityTypes.PERSISTENT, response.iterator().next().properties().reasonChronicity()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-05T15:52:55Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-05-04T06:13:03Z"), response.iterator().next().properties().reportedTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-23T09:29:02Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-05-01T20:19:26Z"), response.iterator().next().properties().recentlyResolved().unavailableOccuredTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-09T04:24:31Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-09-11T19:08:33Z"), response.iterator().next().properties().recentlyResolved().resolvedTime()); - Assertions.assertEquals("bzevwrd", + Assertions.assertEquals("aauzzptjazysd", response.iterator().next().properties().recentlyResolved().unavailableSummary()); - Assertions.assertEquals("kuvsjcswsm", + Assertions.assertEquals("wwvaiqyuvvfonk", response.iterator().next().properties().recommendedActions().get(0).action()); - Assertions.assertEquals("tuluq", + Assertions.assertEquals("hqyikvy", response.iterator().next().properties().recommendedActions().get(0).actionUrl()); - Assertions.assertEquals("bm", + Assertions.assertEquals("wmn", response.iterator().next().properties().recommendedActions().get(0).actionUrlText()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-28T09:36:55Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-03-01T06:38:59Z"), response.iterator().next().properties().serviceImpactingEvents().get(0).eventStartTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-25T18:54:33Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-01-05T01:25:57Z"), response.iterator().next().properties().serviceImpactingEvents().get(0).eventStatusLastModifiedTime()); - Assertions.assertEquals("fzwiivwzjbhyz", + Assertions.assertEquals("frbbc", response.iterator().next().properties().serviceImpactingEvents().get(0).correlationId()); - Assertions.assertEquals("rkambt", + Assertions.assertEquals("agtltdhlfkqoj", response.iterator().next().properties().serviceImpactingEvents().get(0).status().value()); - Assertions.assertEquals("gvmnvuqeq", + Assertions.assertEquals("vgtrdcnifmzzs", response.iterator().next().properties().serviceImpactingEvents().get(0).incidentProperties().title()); - Assertions.assertEquals("dspastjbkkdmfl", + Assertions.assertEquals("m", response.iterator().next().properties().serviceImpactingEvents().get(0).incidentProperties().service()); - Assertions.assertEquals("stmjlxrri", + Assertions.assertEquals("nysuxmprafwgckh", response.iterator().next().properties().serviceImpactingEvents().get(0).incidentProperties().region()); - Assertions.assertEquals("zapeewchpx", + Assertions.assertEquals("xvd", response.iterator() .next() .properties() @@ -97,5 +93,9 @@ public void testList() throws Exception { .get(0) .incidentProperties() .incidentType()); + Assertions.assertEquals("fwafqrouda", response.iterator().next().location()); + Assertions.assertEquals("mfdn", response.iterator().next().id()); + Assertions.assertEquals("zydvfvf", response.iterator().next().name()); + Assertions.assertEquals("jnaeois", response.iterator().next().type()); } } 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 index 47c1f4602c880..724f161c1f387 100644 --- 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.resourcehealth.ResourceHealthManager; import com.azure.resourcemanager.resourcehealth.models.AvailabilityStateValues; @@ -23,64 +23,62 @@ 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\"}}]}}"; + = "{\"properties\":{\"availabilityState\":\"Unavailable\",\"title\":\"ylweazulc\",\"summary\":\"thwwn\",\"detailedStatus\":\"hlf\",\"reasonType\":\"wpchwahf\",\"context\":\"usnfepgfewet\",\"category\":\"yxgncxykxhdjhli\",\"articleId\":\"bcxf\",\"rootCauseAttributionTime\":\"2021-02-16T23:35:43Z\",\"healthEventType\":\"orxvxcjzhqiz\",\"healthEventCause\":\"pxtgqscjav\",\"healthEventCategory\":\"juhdqazkmtgguwpi\",\"healthEventId\":\"ajc\",\"resolutionETA\":\"2021-08-06T00:13:47Z\",\"occuredTime\":\"2021-01-09T12:40:34Z\",\"reasonChronicity\":\"Transient\",\"reportedTime\":\"2020-12-20T00:44:48Z\",\"recentlyResolved\":{\"unavailableOccuredTime\":\"2021-08-19T01:45:54Z\",\"resolvedTime\":\"2021-08-27T11:32:55Z\",\"unavailableSummary\":\"neuvyinzqod\"},\"recommendedActions\":[{\"action\":\"shoxgsgb\",\"actionUrl\":\"gzdjtxvzf\",\"_ActionUrl.Comment\":\"q\",\"actionUrlText\":\"aqvlgafcqusr\"},{\"action\":\"etnwsdtutnw\",\"actionUrl\":\"uycvuzhyrmewip\",\"_ActionUrl.Comment\":\"ekdxuku\",\"actionUrlText\":\"sjjxundxgketw\"},{\"action\":\"hzjhf\",\"actionUrl\":\"hvvmuvgpmun\",\"_ActionUrl.Comment\":\"sx\",\"actionUrlText\":\"hfbuzjyihsasbhud\"},{\"action\":\"ohyuemslynsq\",\"actionUrl\":\"pfoobr\",\"_ActionUrl.Comment\":\"tyms\",\"actionUrlText\":\"ygqdnfwqzdz\"}],\"serviceImpactingEvents\":[{\"eventStartTime\":\"2021-07-15T09:02:03Z\",\"eventStatusLastModifiedTime\":\"2021-02-12T11:58:55Z\",\"correlationId\":\"fhqlyvi\",\"status\":{\"value\":\"wivkxo\"},\"incidentProperties\":{\"title\":\"nbixxrti\",\"service\":\"cpwpg\",\"region\":\"rc\",\"incidentType\":\"tso\"}},{\"eventStartTime\":\"2021-08-02T20:53:43Z\",\"eventStatusLastModifiedTime\":\"2021-03-24T12:08Z\",\"correlationId\":\"xpmyyefrpmpdnq\",\"status\":{\"value\":\"awaoqvmmbnpqfrt\"},\"incidentProperties\":{\"title\":\"zmegnitgvk\",\"service\":\"zyqdrfegcealzx\",\"region\":\"cansymoyqhlwigd\",\"incidentType\":\"bkbxgomfa\"}}]},\"location\":\"wasqvdaeyyg\",\"id\":\"wa\",\"name\":\"pqg\",\"type\":\"tjeaahhvjhh\"}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); AvailabilityStatus response = manager.childAvailabilityStatuses() - .getByResourceWithResponse("zjkjexfdeqv", "psylkkshkbffmbmx", "jrgywwpgjxsn", - com.azure.core.util.Context.NONE) + .getByResourceWithResponse("jwltlwtjjgu", "talhsnvkcdmxzr", "oaimlnw", 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"), + Assertions.assertEquals(AvailabilityStateValues.UNAVAILABLE, response.properties().availabilityState()); + Assertions.assertEquals("ylweazulc", response.properties().title()); + Assertions.assertEquals("thwwn", response.properties().summary()); + Assertions.assertEquals("hlf", response.properties().detailedStatus()); + Assertions.assertEquals("wpchwahf", response.properties().reasonType()); + Assertions.assertEquals("usnfepgfewet", response.properties().context()); + Assertions.assertEquals("yxgncxykxhdjhli", response.properties().category()); + Assertions.assertEquals("bcxf", response.properties().articleId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-16T23:35:43Z"), 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"), + Assertions.assertEquals("orxvxcjzhqiz", response.properties().healthEventType()); + Assertions.assertEquals("pxtgqscjav", response.properties().healthEventCause()); + Assertions.assertEquals("juhdqazkmtgguwpi", response.properties().healthEventCategory()); + Assertions.assertEquals("ajc", response.properties().healthEventId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-06T00:13:47Z"), response.properties().resolutionEta()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-09T12:40:34Z"), response.properties().occuredTime()); + Assertions.assertEquals(ReasonChronicityTypes.TRANSIENT, response.properties().reasonChronicity()); + Assertions.assertEquals(OffsetDateTime.parse("2020-12-20T00:44:48Z"), response.properties().reportedTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-19T01:45:54Z"), response.properties().recentlyResolved().unavailableOccuredTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-04T13:53:52Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-08-27T11:32:55Z"), 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"), + Assertions.assertEquals("neuvyinzqod", response.properties().recentlyResolved().unavailableSummary()); + Assertions.assertEquals("shoxgsgb", response.properties().recommendedActions().get(0).action()); + Assertions.assertEquals("gzdjtxvzf", response.properties().recommendedActions().get(0).actionUrl()); + Assertions.assertEquals("aqvlgafcqusr", response.properties().recommendedActions().get(0).actionUrlText()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-15T09:02:03Z"), response.properties().serviceImpactingEvents().get(0).eventStartTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-01T04:20:56Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-02-12T11:58:55Z"), 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", + Assertions.assertEquals("fhqlyvi", response.properties().serviceImpactingEvents().get(0).correlationId()); + Assertions.assertEquals("wivkxo", response.properties().serviceImpactingEvents().get(0).status().value()); + Assertions.assertEquals("nbixxrti", response.properties().serviceImpactingEvents().get(0).incidentProperties().title()); - Assertions.assertEquals("gfebwlnb", + Assertions.assertEquals("cpwpg", response.properties().serviceImpactingEvents().get(0).incidentProperties().service()); - Assertions.assertEquals("yreeudz", + Assertions.assertEquals("rc", response.properties().serviceImpactingEvents().get(0).incidentProperties().region()); - Assertions.assertEquals("vbpdqmjxlyyzglgo", + Assertions.assertEquals("tso", response.properties().serviceImpactingEvents().get(0).incidentProperties().incidentType()); + Assertions.assertEquals("wasqvdaeyyg", response.location()); + Assertions.assertEquals("wa", response.id()); + Assertions.assertEquals("pqg", response.name()); + Assertions.assertEquals("tjeaahhvjhh", response.type()); } } 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 index 771ad2ae6be6e..1b5ca7531bcaf 100644 --- 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 @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.resourcehealth.ResourceHealthManager; import com.azure.resourcemanager.resourcehealth.models.AvailabilityStateValues; @@ -24,71 +24,68 @@ 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\"}}]}}]}"; + = "{\"value\":[{\"properties\":{\"availabilityState\":\"Available\",\"title\":\"lxunsmjbnkppxy\",\"summary\":\"nlsvxeiz\",\"detailedStatus\":\"wklnsrmffeyc\",\"reasonType\":\"ktp\",\"context\":\"merteeammxqiek\",\"category\":\"zddrt\",\"articleId\":\"doj\",\"rootCauseAttributionTime\":\"2021-10-30T06:17:16Z\",\"healthEventType\":\"a\",\"healthEventCause\":\"efdeesve\",\"healthEventCategory\":\"ijpxtx\",\"healthEventId\":\"wprtu\",\"resolutionETA\":\"2021-03-21T18:51:28Z\",\"occuredTime\":\"2021-07-30T10:19:24Z\",\"reasonChronicity\":\"Persistent\",\"reportedTime\":\"2021-11-18T06:25:13Z\",\"recentlyResolved\":{\"unavailableOccuredTime\":\"2021-06-21T16:46:30Z\",\"resolvedTime\":\"2021-04-08T07:22:07Z\",\"unavailableSummary\":\"titvtzeexavox\"},\"recommendedActions\":[{\"action\":\"ecdmdqbwpy\",\"actionUrl\":\"tgsfja\",\"_ActionUrl.Comment\":\"slhhxudbxv\",\"actionUrlText\":\"htnsi\"},{\"action\":\"dhzmmesckdlp\",\"actionUrl\":\"zrcxfailcfxwmdbo\",\"_ActionUrl.Comment\":\"fgsftufqob\",\"actionUrlText\":\"lnacgcc\"},{\"action\":\"nhxk\",\"actionUrl\":\"v\",\"_ActionUrl.Comment\":\"nrzvuljraaer\",\"actionUrlText\":\"okqgukkjq\"},{\"action\":\"broyla\",\"actionUrl\":\"ulcdisdosf\",\"_ActionUrl.Comment\":\"jsvg\",\"actionUrlText\":\"whryvycytdcl\"}],\"serviceImpactingEvents\":[{\"eventStartTime\":\"2021-05-04T02:40:34Z\",\"eventStatusLastModifiedTime\":\"2021-04-16T04:23:03Z\",\"correlationId\":\"wmbtmvpdvjdhtt\",\"status\":{\"value\":\"fedxihchrphkm\"},\"incidentProperties\":{\"title\":\"dqns\",\"service\":\"zpbgtgkylkdg\",\"region\":\"jeuut\",\"incidentType\":\"xezw\"}},{\"eventStartTime\":\"2021-02-13T01:12:07Z\",\"eventStatusLastModifiedTime\":\"2021-10-29T09:06Z\",\"correlationId\":\"wnhhtqlgehgppip\",\"status\":{\"value\":\"pfeoajvgcxtxjcsh\"},\"incidentProperties\":{\"title\":\"idltugsresmkss\",\"service\":\"oiftxfkfwegprh\",\"region\":\"ill\",\"incidentType\":\"biqtgdq\"}},{\"eventStartTime\":\"2021-07-05T05:21:27Z\",\"eventStatusLastModifiedTime\":\"2021-06-27T02:38:30Z\",\"correlationId\":\"ldrizetpwbra\",\"status\":{\"value\":\"ibph\"},\"incidentProperties\":{\"title\":\"mizak\",\"service\":\"ankjpdnjzh\",\"region\":\"oylhjlmuoyxprimr\",\"incidentType\":\"pteecjme\"}},{\"eventStartTime\":\"2021-04-19T03:15:10Z\",\"eventStatusLastModifiedTime\":\"2021-10-04T08:29Z\",\"correlationId\":\"asylwx\",\"status\":{\"value\":\"umweoohguufuzboy\"},\"incidentProperties\":{\"title\":\"hwtzolb\",\"service\":\"mwmdxmebwjscjpa\",\"region\":\"xveabf\",\"incidentType\":\"nmwmqtibx\"}}]},\"location\":\"jddtvqct\",\"id\":\"apm\",\"name\":\"dqmeqwigpibudq\",\"type\":\"yxeb\"}]}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response - = manager.childAvailabilityStatuses().list("pxuckpggq", "wey", "rdhlis", com.azure.core.util.Context.NONE); + PagedIterable response = manager.childAvailabilityStatuses() + .list("akz", "bbjjidjksyxk", "xvxevblbjednljla", 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, + Assertions.assertEquals(AvailabilityStateValues.AVAILABLE, 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"), + Assertions.assertEquals("lxunsmjbnkppxy", response.iterator().next().properties().title()); + Assertions.assertEquals("nlsvxeiz", response.iterator().next().properties().summary()); + Assertions.assertEquals("wklnsrmffeyc", response.iterator().next().properties().detailedStatus()); + Assertions.assertEquals("ktp", response.iterator().next().properties().reasonType()); + Assertions.assertEquals("merteeammxqiek", response.iterator().next().properties().context()); + Assertions.assertEquals("zddrt", response.iterator().next().properties().category()); + Assertions.assertEquals("doj", response.iterator().next().properties().articleId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-30T06:17:16Z"), 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"), + Assertions.assertEquals("a", response.iterator().next().properties().healthEventType()); + Assertions.assertEquals("efdeesve", response.iterator().next().properties().healthEventCause()); + Assertions.assertEquals("ijpxtx", response.iterator().next().properties().healthEventCategory()); + Assertions.assertEquals("wprtu", response.iterator().next().properties().healthEventId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-21T18:51:28Z"), response.iterator().next().properties().resolutionEta()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-31T16:43:41Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-07-30T10:19:24Z"), response.iterator().next().properties().occuredTime()); - Assertions.assertEquals(ReasonChronicityTypes.TRANSIENT, + Assertions.assertEquals(ReasonChronicityTypes.PERSISTENT, response.iterator().next().properties().reasonChronicity()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-26T15:30:29Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-11-18T06:25:13Z"), response.iterator().next().properties().reportedTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-26T04:45:22Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-06-21T16:46:30Z"), response.iterator().next().properties().recentlyResolved().unavailableOccuredTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-23T16:05:03Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-04-08T07:22:07Z"), response.iterator().next().properties().recentlyResolved().resolvedTime()); - Assertions.assertEquals("mr", response.iterator().next().properties().recentlyResolved().unavailableSummary()); - Assertions.assertEquals("uifamowaziynknlq", + Assertions.assertEquals("titvtzeexavox", + response.iterator().next().properties().recentlyResolved().unavailableSummary()); + Assertions.assertEquals("ecdmdqbwpy", response.iterator().next().properties().recommendedActions().get(0).action()); - Assertions.assertEquals("dvpiwh", + Assertions.assertEquals("tgsfja", response.iterator().next().properties().recommendedActions().get(0).actionUrl()); - Assertions.assertEquals("ylr", + Assertions.assertEquals("htnsi", response.iterator().next().properties().recommendedActions().get(0).actionUrlText()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-02T10:25:29Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-05-04T02:40:34Z"), response.iterator().next().properties().serviceImpactingEvents().get(0).eventStartTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-13T02:27:50Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-04-16T04:23:03Z"), response.iterator().next().properties().serviceImpactingEvents().get(0).eventStatusLastModifiedTime()); - Assertions.assertEquals("mzyospspshck", + Assertions.assertEquals("wmbtmvpdvjdhtt", response.iterator().next().properties().serviceImpactingEvents().get(0).correlationId()); - Assertions.assertEquals("jpmspbpssdfppy", + Assertions.assertEquals("fedxihchrphkm", response.iterator().next().properties().serviceImpactingEvents().get(0).status().value()); - Assertions.assertEquals("ieyujtvc", + Assertions.assertEquals("dqns", response.iterator().next().properties().serviceImpactingEvents().get(0).incidentProperties().title()); - Assertions.assertEquals("cnyxrxmunjd", + Assertions.assertEquals("zpbgtgkylkdg", response.iterator().next().properties().serviceImpactingEvents().get(0).incidentProperties().service()); - Assertions.assertEquals("glnkvxlxpagl", + Assertions.assertEquals("jeuut", response.iterator().next().properties().serviceImpactingEvents().get(0).incidentProperties().region()); - Assertions.assertEquals("vbgkcvkhpzv", + Assertions.assertEquals("xezw", response.iterator() .next() .properties() @@ -96,5 +93,9 @@ public void testList() throws Exception { .get(0) .incidentProperties() .incidentType()); + Assertions.assertEquals("jddtvqct", response.iterator().next().location()); + Assertions.assertEquals("apm", response.iterator().next().id()); + Assertions.assertEquals("dqmeqwigpibudq", response.iterator().next().name()); + Assertions.assertEquals("yxeb", response.iterator().next().type()); } } 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 index a87ff63d878a9..ca4d48679068f 100644 --- 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 @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.resourcehealth.ResourceHealthManager; import com.azure.resourcemanager.resourcehealth.models.AvailabilityStateValues; @@ -24,72 +24,67 @@ 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\"}}]}}]}"; + = "{\"value\":[{\"properties\":{\"availabilityState\":\"Unavailable\",\"title\":\"phcnzqtpj\",\"summary\":\"qrhvthlaiwdcxsml\",\"detailedStatus\":\"hzdtxetlgydlh\",\"reasonType\":\"lnnpx\",\"context\":\"afiqgeaarbgjekg\",\"category\":\"lbyulidwcwvmze\",\"articleId\":\"o\",\"rootCauseAttributionTime\":\"2021-09-23T05:58:37Z\",\"healthEventType\":\"irwgdnqzbrf\",\"healthEventCause\":\"pzhz\",\"healthEventCategory\":\"ksjcitdigs\",\"healthEventId\":\"dglj\",\"resolutionETA\":\"2021-04-10T15:56:09Z\",\"occuredTime\":\"2021-07-01T19:27:50Z\",\"reasonChronicity\":\"Persistent\",\"reportedTime\":\"2021-03-17T16:50:59Z\",\"recentlyResolved\":{\"unavailableOccuredTime\":\"2021-01-19T11:09:06Z\",\"resolvedTime\":\"2021-07-15T19:37:53Z\",\"unavailableSummary\":\"tswfpfmdgycxnms\"},\"recommendedActions\":[{\"action\":\"jjyslurlps\",\"actionUrl\":\"kvp\",\"_ActionUrl.Comment\":\"wqslsrhmpqvw\",\"actionUrlText\":\"kondcb\"},{\"action\":\"imuvqejosovyrrl\",\"actionUrl\":\"esi\",\"_ActionUrl.Comment\":\"qtljqobbpihehc\",\"actionUrlText\":\"ybmrqbrjbbmp\"}],\"serviceImpactingEvents\":[{\"eventStartTime\":\"2021-09-29T14:25:41Z\",\"eventStatusLastModifiedTime\":\"2021-10-24T06:34:08Z\",\"correlationId\":\"e\",\"status\":{\"value\":\"s\"},\"incidentProperties\":{\"title\":\"jksghudg\",\"service\":\"xog\",\"region\":\"gsv\",\"incidentType\":\"jkxibda\"}},{\"eventStartTime\":\"2021-07-29T18:42:33Z\",\"eventStatusLastModifiedTime\":\"2021-04-30T22:42:06Z\",\"correlationId\":\"yomkxfbvfbhdy\",\"status\":{\"value\":\"pwpgddei\"},\"incidentProperties\":{\"title\":\"zovgkkumuikj\",\"service\":\"cazt\",\"region\":\"snsqowxwcoml\",\"incidentType\":\"ytwvczcswkacve\"}}]},\"location\":\"fdv\",\"id\":\"kltytmhdroz\",\"name\":\"nhd\",\"type\":\"lktgjc\"}]}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.childResources().list("qdf", "voniypfp", "bcpzgpxtivh", com.azure.core.util.Context.NONE); + = manager.childResources().list("vdulajv", "ejchcsrlz", "nmzlanru", 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, + Assertions.assertEquals(AvailabilityStateValues.UNAVAILABLE, 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"), + Assertions.assertEquals("phcnzqtpj", response.iterator().next().properties().title()); + Assertions.assertEquals("qrhvthlaiwdcxsml", response.iterator().next().properties().summary()); + Assertions.assertEquals("hzdtxetlgydlh", response.iterator().next().properties().detailedStatus()); + Assertions.assertEquals("lnnpx", response.iterator().next().properties().reasonType()); + Assertions.assertEquals("afiqgeaarbgjekg", response.iterator().next().properties().context()); + Assertions.assertEquals("lbyulidwcwvmze", response.iterator().next().properties().category()); + Assertions.assertEquals("o", response.iterator().next().properties().articleId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-23T05:58:37Z"), 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"), + Assertions.assertEquals("irwgdnqzbrf", response.iterator().next().properties().healthEventType()); + Assertions.assertEquals("pzhz", response.iterator().next().properties().healthEventCause()); + Assertions.assertEquals("ksjcitdigs", response.iterator().next().properties().healthEventCategory()); + Assertions.assertEquals("dglj", response.iterator().next().properties().healthEventId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-10T15:56:09Z"), response.iterator().next().properties().resolutionEta()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-14T07:01:39Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-07-01T19:27:50Z"), response.iterator().next().properties().occuredTime()); - Assertions.assertEquals(ReasonChronicityTypes.TRANSIENT, + Assertions.assertEquals(ReasonChronicityTypes.PERSISTENT, response.iterator().next().properties().reasonChronicity()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-14T22:56:45Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-03-17T16:50:59Z"), response.iterator().next().properties().reportedTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-27T05:54:41Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-01-19T11:09:06Z"), response.iterator().next().properties().recentlyResolved().unavailableOccuredTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-08T03:09:28Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-07-15T19:37:53Z"), response.iterator().next().properties().recentlyResolved().resolvedTime()); - Assertions.assertEquals("gmwohqfzizvu", + Assertions.assertEquals("tswfpfmdgycxnms", response.iterator().next().properties().recentlyResolved().unavailableSummary()); - Assertions.assertEquals("jsvthnwpzteko", + Assertions.assertEquals("jjyslurlps", response.iterator().next().properties().recommendedActions().get(0).action()); - Assertions.assertEquals("ribi", - response.iterator().next().properties().recommendedActions().get(0).actionUrl()); - Assertions.assertEquals("c", + Assertions.assertEquals("kvp", response.iterator().next().properties().recommendedActions().get(0).actionUrl()); + Assertions.assertEquals("kondcb", response.iterator().next().properties().recommendedActions().get(0).actionUrlText()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-10T19:12:24Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-09-29T14:25:41Z"), response.iterator().next().properties().serviceImpactingEvents().get(0).eventStartTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-21T03:40:41Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-10-24T06:34:08Z"), response.iterator().next().properties().serviceImpactingEvents().get(0).eventStatusLastModifiedTime()); - Assertions.assertEquals("gswvxwlmzqwm", + Assertions.assertEquals("e", response.iterator().next().properties().serviceImpactingEvents().get(0).correlationId()); - Assertions.assertEquals("njmxmcuqudtcvcl", + Assertions.assertEquals("s", response.iterator().next().properties().serviceImpactingEvents().get(0).status().value()); - Assertions.assertEquals("pdkvg", + Assertions.assertEquals("jksghudg", response.iterator().next().properties().serviceImpactingEvents().get(0).incidentProperties().title()); - Assertions.assertEquals("buiyji", + Assertions.assertEquals("xog", response.iterator().next().properties().serviceImpactingEvents().get(0).incidentProperties().service()); - Assertions.assertEquals("zphdugneiknp", + Assertions.assertEquals("gsv", response.iterator().next().properties().serviceImpactingEvents().get(0).incidentProperties().region()); - Assertions.assertEquals("xgjiuqh", + Assertions.assertEquals("jkxibda", response.iterator() .next() .properties() @@ -97,5 +92,9 @@ public void testList() throws Exception { .get(0) .incidentProperties() .incidentType()); + Assertions.assertEquals("fdv", response.iterator().next().location()); + Assertions.assertEquals("kltytmhdroz", response.iterator().next().id()); + Assertions.assertEquals("nhd", response.iterator().next().name()); + Assertions.assertEquals("lktgjc", response.iterator().next().type()); } } 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 index b73855446f094..1cb1ab66036d9 100644 --- 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 @@ -1,37 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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\"}]}") + "{\"id\":\"g\",\"name\":\"vwz\",\"regions\":[{\"id\":\"lmctlpd\",\"name\":\"itvgbmhrixkwm\"},{\"id\":\"jejveg\",\"name\":\"bpnaixexccbdre\"},{\"id\":\"hcexdrrvqa\",\"name\":\"kghtpwijnh\"}]}") .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()); + Assertions.assertEquals("g", model.id()); + Assertions.assertEquals("vwz", model.name()); + Assertions.assertEquals("lmctlpd", model.regions().get(0).id()); + Assertions.assertEquals("itvgbmhrixkwm", 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 index c17db784d8fe4..77eee3bfd1d15 100644 --- 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 @@ -1,239 +1,39 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.implementation.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\"}") + "{\"value\":[{\"properties\":{\"refreshTimestamp\":\"2020-12-27T18:10:38Z\",\"statusBanners\":[{\"title\":\"on\",\"message\":\"yhgfipnsx\",\"cloud\":\"cwaekrrjre\",\"lastModifiedTime\":\"2021-06-21T01:47:07Z\"},{\"title\":\"sgumhjglikkxwsl\",\"message\":\"bq\",\"cloud\":\"uzlm\",\"lastModifiedTime\":\"2021-08-06T01:26:51Z\"},{\"title\":\"fktgplc\",\"message\":\"wjxeznoigbr\",\"cloud\":\"w\",\"lastModifiedTime\":\"2021-04-19T12:13:28Z\"}],\"statusActiveEvents\":[{\"title\":\"saz\",\"description\":\"joqkagfhsxt\",\"trackingId\":\"ugzxnf\",\"startTime\":\"2021-11-07T16:18:26Z\",\"cloud\":\"xdtnkdmkqjjlw\",\"severity\":\"Error\",\"stage\":\"Active\",\"published\":true,\"lastModifiedTime\":\"2021-02-01T13:31:10Z\",\"impacts\":[{},{},{},{}]},{\"title\":\"bre\",\"description\":\"aays\",\"trackingId\":\"ixqtn\",\"startTime\":\"2021-12-01T00:50:25Z\",\"cloud\":\"zlwfffiakp\",\"severity\":\"Warning\",\"stage\":\"Active\",\"published\":true,\"lastModifiedTime\":\"2021-03-16T18:33:01Z\",\"impacts\":[{}]},{\"title\":\"jihy\",\"description\":\"zphv\",\"trackingId\":\"uyqncygupkvipmd\",\"startTime\":\"2021-01-20T09:00:38Z\",\"cloud\":\"qupevzh\",\"severity\":\"Error\",\"stage\":\"Archived\",\"published\":true,\"lastModifiedTime\":\"2021-06-04T10:51:44Z\",\"impacts\":[{},{}]},{\"title\":\"ypelmcu\",\"description\":\"ixbjx\",\"trackingId\":\"w\",\"startTime\":\"2021-05-17T18:45:20Z\",\"cloud\":\"coolsttpkiwkkb\",\"severity\":\"Error\",\"stage\":\"Archived\",\"published\":true,\"lastModifiedTime\":\"2021-06-06T05:18:15Z\",\"impacts\":[{},{},{}]}]},\"id\":\"pncur\",\"name\":\"oiwiithtywub\",\"type\":\"cbihwqk\"},{\"properties\":{\"refreshTimestamp\":\"2021-09-05T23:19:39Z\",\"statusBanners\":[{\"title\":\"chrdgoihxumwcto\",\"message\":\"zj\",\"cloud\":\"udfdlwgg\",\"lastModifiedTime\":\"2021-07-30T14:09:03Z\"},{\"title\":\"wtovvtgsein\",\"message\":\"iufxqknpir\",\"cloud\":\"epttwqmsniff\",\"lastModifiedTime\":\"2021-10-31T18:45:45Z\"}],\"statusActiveEvents\":[{\"title\":\"ojlpijnkrxf\",\"description\":\"dhcrati\",\"trackingId\":\"ronasxift\",\"startTime\":\"2021-07-25T20:54:55Z\",\"cloud\":\"zh\",\"severity\":\"Error\",\"stage\":\"Archived\",\"published\":true,\"lastModifiedTime\":\"2021-06-13T10:36:32Z\",\"impacts\":[{},{},{},{}]},{\"title\":\"nnxk\",\"description\":\"gnyhmossxkkg\",\"trackingId\":\"rrghxjbdhqxvcxgf\",\"startTime\":\"2021-06-30T13:21:57Z\",\"cloud\":\"ofbshr\",\"severity\":\"Error\",\"stage\":\"Resolve\",\"published\":false,\"lastModifiedTime\":\"2021-05-17T15:19:01Z\",\"impacts\":[{},{}]},{\"title\":\"bycnunvjsrtkf\",\"description\":\"nopqgikyzirtx\",\"trackingId\":\"uxzejntpsew\",\"startTime\":\"2021-09-17T14:36Z\",\"cloud\":\"l\",\"severity\":\"Error\",\"stage\":\"Active\",\"published\":true,\"lastModifiedTime\":\"2021-11-07T18:12:35Z\",\"impacts\":[{},{},{},{}]}]},\"id\":\"ox\",\"name\":\"rgguf\",\"type\":\"yaomtb\"},{\"properties\":{\"refreshTimestamp\":\"2021-04-24T04:26:41Z\",\"statusBanners\":[{\"title\":\"vkffovjzhpjb\",\"message\":\"gjmfxumvfcl\",\"cloud\":\"ovwxnbkfezzxsc\",\"lastModifiedTime\":\"2021-11-30T11:39:53Z\"}],\"statusActiveEvents\":[{\"title\":\"irujbz\",\"description\":\"mvzzbtdcqvp\",\"trackingId\":\"yujviylwdshfssn\",\"startTime\":\"2021-10-15T12:19:25Z\",\"cloud\":\"efr\",\"severity\":\"Information\",\"stage\":\"Resolve\",\"published\":false,\"lastModifiedTime\":\"2020-12-25T11:28:29Z\",\"impacts\":[{}]},{\"title\":\"otmrfhir\",\"description\":\"ymoxoftpipiwyczu\",\"trackingId\":\"a\",\"startTime\":\"2021-11-29T08:27:09Z\",\"cloud\":\"lihhyuspskasdvlm\",\"severity\":\"Information\",\"stage\":\"Resolve\",\"published\":false,\"lastModifiedTime\":\"2021-04-20T13:27:45Z\",\"impacts\":[{}]},{\"title\":\"amrsreuzv\",\"description\":\"risjnhnytxifqjz\",\"trackingId\":\"mrhublwpc\",\"startTime\":\"2021-06-28T02:18Z\",\"cloud\":\"rgjupauut\",\"severity\":\"Warning\",\"stage\":\"Active\",\"published\":false,\"lastModifiedTime\":\"2021-03-13T05:34:56Z\",\"impacts\":[{}]}]},\"id\":\"zpnfqntcypsxj\",\"name\":\"foimwkslircizjxv\",\"type\":\"dfcea\"},{\"properties\":{\"refreshTimestamp\":\"2021-02-03T07:24:07Z\",\"statusBanners\":[{\"title\":\"dyftumrtwna\",\"message\":\"slbi\",\"cloud\":\"ojgcyzt\",\"lastModifiedTime\":\"2021-06-12T09:34:33Z\"},{\"title\":\"nbaeqphchqn\",\"message\":\"rpxeh\",\"cloud\":\"rykqgaifmvikl\",\"lastModifiedTime\":\"2021-05-22T16:01:58Z\"},{\"title\":\"khbejdznxc\",\"message\":\"srhnjivo\",\"cloud\":\"tnovqfzgemjdftul\",\"lastModifiedTime\":\"2021-07-31T07:20:21Z\"}],\"statusActiveEvents\":[{\"title\":\"eamtmcz\",\"description\":\"m\",\"trackingId\":\"wcw\",\"startTime\":\"2021-10-13T19:06:04Z\",\"cloud\":\"knssxmojm\",\"severity\":\"Error\",\"stage\":\"Archived\",\"published\":false,\"lastModifiedTime\":\"2021-09-03T19:15:23Z\",\"impacts\":[{}]}]},\"id\":\"zqljyxgtczh\",\"name\":\"ydbsd\",\"type\":\"hmkxmaehvbb\"}],\"nextLink\":\"ripltf\"}") .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"), + Assertions.assertEquals(OffsetDateTime.parse("2020-12-27T18:10:38Z"), model.value().get(0).refreshTimestamp()); + Assertions.assertEquals("on", model.value().get(0).statusBanners().get(0).title()); + Assertions.assertEquals("yhgfipnsx", model.value().get(0).statusBanners().get(0).message()); + Assertions.assertEquals("cwaekrrjre", model.value().get(0).statusBanners().get(0).cloud()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-21T01:47:07Z"), 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"), + Assertions.assertEquals("saz", model.value().get(0).statusActiveEvents().get(0).title()); + Assertions.assertEquals("joqkagfhsxt", model.value().get(0).statusActiveEvents().get(0).description()); + Assertions.assertEquals("ugzxnf", model.value().get(0).statusActiveEvents().get(0).trackingId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-07T16:18:26Z"), 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"), + Assertions.assertEquals("xdtnkdmkqjjlw", model.value().get(0).statusActiveEvents().get(0).cloud()); + Assertions.assertEquals(SeverityValues.ERROR, model.value().get(0).statusActiveEvents().get(0).severity()); + Assertions.assertEquals(StageValues.ACTIVE, model.value().get(0).statusActiveEvents().get(0).stage()); + Assertions.assertTrue(model.value().get(0).statusActiveEvents().get(0).published()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-01T13:31:10Z"), 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()); + Assertions.assertEquals("ripltf", 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 index d0b88a8ae2aa4..65e98b931a5ec 100644 --- 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 @@ -1,95 +1,40 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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\":[{},{},{}]}]}]}") + "{\"refreshTimestamp\":\"2021-08-21T13:18:46Z\",\"statusBanners\":[{\"title\":\"j\",\"message\":\"ivfxzsjabibsyst\",\"cloud\":\"fsdjpvkvp\",\"lastModifiedTime\":\"2021-09-03T15:00:47Z\"}],\"statusActiveEvents\":[{\"title\":\"bzkdvn\",\"description\":\"abudurgk\",\"trackingId\":\"mokzhjjklf\",\"startTime\":\"2021-12-06T20:15:09Z\",\"cloud\":\"uwqlgzrfzeey\",\"severity\":\"Warning\",\"stage\":\"Resolve\",\"published\":true,\"lastModifiedTime\":\"2021-02-02T12:35:30Z\",\"impacts\":[{\"id\":\"jbsybbqw\",\"name\":\"t\",\"regions\":[{},{}]},{\"id\":\"fp\",\"name\":\"mpipaslthaqfxs\",\"regions\":[{},{},{}]}]},{\"title\":\"twbdsrezpdrhn\",\"description\":\"yowqkdwytisibir\",\"trackingId\":\"pikpz\",\"startTime\":\"2021-04-11T09:56:20Z\",\"cloud\":\"zanl\",\"severity\":\"Information\",\"stage\":\"Active\",\"published\":false,\"lastModifiedTime\":\"2021-07-20T21:52:58Z\",\"impacts\":[{\"id\":\"okixrjqcir\",\"name\":\"pfrlazsz\",\"regions\":[{},{}]}]},{\"title\":\"iin\",\"description\":\"pwp\",\"trackingId\":\"lwbtlhf\",\"startTime\":\"2021-08-09T06:27:36Z\",\"cloud\":\"dhszfjv\",\"severity\":\"Error\",\"stage\":\"Resolve\",\"published\":true,\"lastModifiedTime\":\"2021-02-22T06:27:51Z\",\"impacts\":[{\"id\":\"mqhldvrii\",\"name\":\"jnalghf\",\"regions\":[{},{},{}]}]},{\"title\":\"sexso\",\"description\":\"el\",\"trackingId\":\"hhahhxvrhmzkwpjg\",\"startTime\":\"2021-10-11T18:28:46Z\",\"cloud\":\"ughftqsx\",\"severity\":\"Error\",\"stage\":\"Archived\",\"published\":true,\"lastModifiedTime\":\"2021-05-23T18:59:06Z\",\"impacts\":[{\"id\":\"igrjguufzdm\",\"name\":\"qtfihwhbotzinga\",\"regions\":[{}]},{\"id\":\"ho\",\"name\":\"qzudphq\",\"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"), + Assertions.assertEquals(OffsetDateTime.parse("2021-08-21T13:18:46Z"), model.refreshTimestamp()); + Assertions.assertEquals("j", model.statusBanners().get(0).title()); + Assertions.assertEquals("ivfxzsjabibsyst", model.statusBanners().get(0).message()); + Assertions.assertEquals("fsdjpvkvp", model.statusBanners().get(0).cloud()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-03T15:00:47Z"), 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"), + Assertions.assertEquals("bzkdvn", model.statusActiveEvents().get(0).title()); + Assertions.assertEquals("abudurgk", model.statusActiveEvents().get(0).description()); + Assertions.assertEquals("mokzhjjklf", model.statusActiveEvents().get(0).trackingId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-12-06T20:15:09Z"), 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"), + Assertions.assertEquals("uwqlgzrfzeey", model.statusActiveEvents().get(0).cloud()); + Assertions.assertEquals(SeverityValues.WARNING, model.statusActiveEvents().get(0).severity()); + Assertions.assertEquals(StageValues.RESOLVE, model.statusActiveEvents().get(0).stage()); + Assertions.assertTrue(model.statusActiveEvents().get(0).published()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-02T12:35:30Z"), 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()); + Assertions.assertEquals("jbsybbqw", model.statusActiveEvents().get(0).impacts().get(0).id()); + Assertions.assertEquals("t", 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 index 9669a791430bc..87eb523098846 100644 --- 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 @@ -1,128 +1,40 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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\"}") + "{\"properties\":{\"refreshTimestamp\":\"2021-03-24T10:52:29Z\",\"statusBanners\":[{\"title\":\"ruvdmov\",\"message\":\"zlxwabmqoefkifr\",\"cloud\":\"puqujmqlgkfbtn\",\"lastModifiedTime\":\"2021-01-02T18:59:28Z\"},{\"title\":\"n\",\"message\":\"jcntuj\",\"cloud\":\"c\",\"lastModifiedTime\":\"2021-12-10T10:29:46Z\"}],\"statusActiveEvents\":[{\"title\":\"waezkojvd\",\"description\":\"zfoqouicybxar\",\"trackingId\":\"szufoxciqopidoa\",\"startTime\":\"2021-11-18T04:50:58Z\",\"cloud\":\"dhkha\",\"severity\":\"Warning\",\"stage\":\"Active\",\"published\":false,\"lastModifiedTime\":\"2021-02-10T22:24:58Z\",\"impacts\":[{\"id\":\"toego\",\"name\":\"wbw\",\"regions\":[{},{},{}]},{\"id\":\"zcmrvexztvb\",\"name\":\"gsfraoyzkoow\",\"regions\":[{},{},{},{}]},{\"id\":\"guxawqaldsyuuxi\",\"name\":\"rqf\",\"regions\":[{},{},{}]},{\"id\":\"znkbykutwpfhpagm\",\"name\":\"skdsnfdsdoakg\",\"regions\":[{}]}]},{\"title\":\"kkze\",\"description\":\"l\",\"trackingId\":\"wpusdsttwvogv\",\"startTime\":\"2021-11-22T07:37:21Z\",\"cloud\":\"dcngqqmoakufgmj\",\"severity\":\"Error\",\"stage\":\"Resolve\",\"published\":true,\"lastModifiedTime\":\"2020-12-27T08:20:19Z\",\"impacts\":[{\"id\":\"u\",\"name\":\"kopbminrf\",\"regions\":[{},{},{}]},{\"id\":\"uhhziuiefozbhdm\",\"name\":\"l\",\"regions\":[{},{},{},{}]},{\"id\":\"oftrmaequia\",\"name\":\"icslfaoq\",\"regions\":[{},{},{},{}]}]},{\"title\":\"ylhalnswhcc\",\"description\":\"hka\",\"trackingId\":\"witqscywuggwoluh\",\"startTime\":\"2021-06-06T07:58:35Z\",\"cloud\":\"emh\",\"severity\":\"Error\",\"stage\":\"Active\",\"published\":false,\"lastModifiedTime\":\"2021-01-28T00:27:19Z\",\"impacts\":[{\"id\":\"weyp\",\"name\":\"dxggicccnxqhuexm\",\"regions\":[{},{},{}]},{\"id\":\"stvlzywemhzrnc\",\"name\":\"tclusiypbsfgy\",\"regions\":[{},{}]},{\"id\":\"lfeadcygq\",\"name\":\"yhejhzisxgfp\",\"regions\":[{},{},{},{}]},{\"id\":\"p\",\"name\":\"ksrpqv\",\"regions\":[{},{}]}]},{\"title\":\"aehtwd\",\"description\":\"ftswibyrcdlbhsh\",\"trackingId\":\"p\",\"startTime\":\"2021-08-31T16:01:42Z\",\"cloud\":\"twitykhev\",\"severity\":\"Warning\",\"stage\":\"Archived\",\"published\":true,\"lastModifiedTime\":\"2021-02-15T16:19:47Z\",\"impacts\":[{\"id\":\"dnwzxltjcvnhltiu\",\"name\":\"xnavvwxq\",\"regions\":[{}]},{\"id\":\"unyowxwl\",\"name\":\"jrkvfgbvfvpdbo\",\"regions\":[{},{},{},{}]},{\"id\":\"zsjqlh\",\"name\":\"r\",\"regions\":[{},{}]}]}]},\"id\":\"ibqipqkg\",\"name\":\"vxndz\",\"type\":\"mkrefajpjorwkq\"}") .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"), + Assertions.assertEquals(OffsetDateTime.parse("2021-03-24T10:52:29Z"), model.refreshTimestamp()); + Assertions.assertEquals("ruvdmov", model.statusBanners().get(0).title()); + Assertions.assertEquals("zlxwabmqoefkifr", model.statusBanners().get(0).message()); + Assertions.assertEquals("puqujmqlgkfbtn", model.statusBanners().get(0).cloud()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-02T18:59:28Z"), 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"), + Assertions.assertEquals("waezkojvd", model.statusActiveEvents().get(0).title()); + Assertions.assertEquals("zfoqouicybxar", model.statusActiveEvents().get(0).description()); + Assertions.assertEquals("szufoxciqopidoa", model.statusActiveEvents().get(0).trackingId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-18T04:50:58Z"), model.statusActiveEvents().get(0).startTime()); - Assertions.assertEquals("xccedcpnmdyodn", model.statusActiveEvents().get(0).cloud()); + Assertions.assertEquals("dhkha", 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"), + Assertions.assertEquals(StageValues.ACTIVE, model.statusActiveEvents().get(0).stage()); + Assertions.assertFalse(model.statusActiveEvents().get(0).published()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-10T22:24:58Z"), 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()); + Assertions.assertEquals("toego", model.statusActiveEvents().get(0).impacts().get(0).id()); + Assertions.assertEquals("wbw", 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 index 7c9c55a7357bc..187b88334c197 100644 --- 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.resourcehealth.ResourceHealthManager; import com.azure.resourcemanager.resourcehealth.models.EmergingIssuesGetResult; @@ -24,35 +24,35 @@ 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\"}"; + = "{\"properties\":{\"refreshTimestamp\":\"2021-08-01T21:43:45Z\",\"statusBanners\":[{\"title\":\"wgfstmhqykizm\",\"message\":\"saoafcluqvox\",\"cloud\":\"cjimryvwgcwwpbmz\",\"lastModifiedTime\":\"2021-02-26T18:03:38Z\"},{\"title\":\"ydsx\",\"message\":\"fo\",\"cloud\":\"cbvopwndyqleallk\",\"lastModifiedTime\":\"2021-10-09T13:48:10Z\"},{\"title\":\"hlowkx\",\"message\":\"vbrdfjmzsyzfho\",\"cloud\":\"h\",\"lastModifiedTime\":\"2021-04-25T11:24:14Z\"},{\"title\":\"ychunsjlpjrtwszh\",\"message\":\"uic\",\"cloud\":\"vtrrmhwrbfdpyflu\",\"lastModifiedTime\":\"2021-09-29T23:38:37Z\"}],\"statusActiveEvents\":[{\"title\":\"r\",\"description\":\"uyzlw\",\"trackingId\":\"memhooclutnpq\",\"startTime\":\"2021-08-15T12:03:46Z\",\"cloud\":\"zjkmmykyujxs\",\"severity\":\"Warning\",\"stage\":\"Archived\",\"published\":false,\"lastModifiedTime\":\"2021-09-26T10:44:20Z\",\"impacts\":[{},{},{}]},{\"title\":\"m\",\"description\":\"zudnigrfiho\",\"trackingId\":\"e\",\"startTime\":\"2021-02-13T08:59:41Z\",\"cloud\":\"uzzjgnrefq\",\"severity\":\"Error\",\"stage\":\"Resolve\",\"published\":true,\"lastModifiedTime\":\"2021-06-08T10:08:27Z\",\"impacts\":[{},{},{},{}]}]},\"id\":\"ydiw\",\"name\":\"brkwpzdqt\",\"type\":\"hcspo\"}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); 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"), + Assertions.assertEquals(OffsetDateTime.parse("2021-08-01T21:43:45Z"), response.refreshTimestamp()); + Assertions.assertEquals("wgfstmhqykizm", response.statusBanners().get(0).title()); + Assertions.assertEquals("saoafcluqvox", response.statusBanners().get(0).message()); + Assertions.assertEquals("cjimryvwgcwwpbmz", response.statusBanners().get(0).cloud()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-26T18:03:38Z"), 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"), + Assertions.assertEquals("r", response.statusActiveEvents().get(0).title()); + Assertions.assertEquals("uyzlw", response.statusActiveEvents().get(0).description()); + Assertions.assertEquals("memhooclutnpq", response.statusActiveEvents().get(0).trackingId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-15T12:03:46Z"), 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"), + Assertions.assertEquals("zjkmmykyujxs", response.statusActiveEvents().get(0).cloud()); + Assertions.assertEquals(SeverityValues.WARNING, response.statusActiveEvents().get(0).severity()); + Assertions.assertEquals(StageValues.ARCHIVED, response.statusActiveEvents().get(0).stage()); + Assertions.assertFalse(response.statusActiveEvents().get(0).published()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-26T10:44:20Z"), 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 index 49d67d01b2cbe..5bb9570f72813 100644 --- 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 @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.resourcehealth.ResourceHealthManager; import com.azure.resourcemanager.resourcehealth.models.EmergingIssuesGetResult; @@ -24,36 +24,36 @@ 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\"}]}"; + = "{\"value\":[{\"properties\":{\"refreshTimestamp\":\"2021-04-20T18:33:38Z\",\"statusBanners\":[{\"title\":\"pie\",\"message\":\"bebjfu\",\"cloud\":\"moichdlpnfpubntn\",\"lastModifiedTime\":\"2021-11-11T15:52:58Z\"}],\"statusActiveEvents\":[{\"title\":\"qs\",\"description\":\"saaelca\",\"trackingId\":\"cjuhplrvkm\",\"startTime\":\"2021-05-02T17:14:54Z\",\"cloud\":\"jvlgfggcvkyyliz\",\"severity\":\"Error\",\"stage\":\"Archived\",\"published\":true,\"lastModifiedTime\":\"2021-04-05T14:08:59Z\",\"impacts\":[{},{},{}]},{\"title\":\"tl\",\"description\":\"mvagbwidqlvhuko\",\"trackingId\":\"ofizrvjfnmjmvlwy\",\"startTime\":\"2021-08-27T08:55:36Z\",\"cloud\":\"lkujrllfojui\",\"severity\":\"Warning\",\"stage\":\"Active\",\"published\":true,\"lastModifiedTime\":\"2021-03-13T00:09:12Z\",\"impacts\":[{},{},{},{}]},{\"title\":\"kzoeovvtzejetj\",\"description\":\"nt\",\"trackingId\":\"yjuzkdb\",\"startTime\":\"2021-08-08T17:33:37Z\",\"cloud\":\"xrzvhqjwtrhtgvgz\",\"severity\":\"Information\",\"stage\":\"Archived\",\"published\":true,\"lastModifiedTime\":\"2021-09-08T21:35:36Z\",\"impacts\":[{},{}]},{\"title\":\"smwr\",\"description\":\"cdxfzzzwyjafitl\",\"trackingId\":\"uy\",\"startTime\":\"2021-04-28T07:34:08Z\",\"cloud\":\"lg\",\"severity\":\"Information\",\"stage\":\"Active\",\"published\":false,\"lastModifiedTime\":\"2021-05-16T22:30:08Z\",\"impacts\":[{}]}]},\"id\":\"gzvlnsnn\",\"name\":\"zfpafolpymwamxqz\",\"type\":\"agpgdph\"}]}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.emergingIssues().list(com.azure.core.util.Context.NONE); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-03T01:39:50Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-04-20T18:33:38Z"), 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"), + Assertions.assertEquals("pie", response.iterator().next().statusBanners().get(0).title()); + Assertions.assertEquals("bebjfu", response.iterator().next().statusBanners().get(0).message()); + Assertions.assertEquals("moichdlpnfpubntn", response.iterator().next().statusBanners().get(0).cloud()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-11T15:52:58Z"), 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"), + Assertions.assertEquals("qs", response.iterator().next().statusActiveEvents().get(0).title()); + Assertions.assertEquals("saaelca", response.iterator().next().statusActiveEvents().get(0).description()); + Assertions.assertEquals("cjuhplrvkm", response.iterator().next().statusActiveEvents().get(0).trackingId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-02T17:14:54Z"), response.iterator().next().statusActiveEvents().get(0).startTime()); - Assertions.assertEquals("zhcoxovnekhe", response.iterator().next().statusActiveEvents().get(0).cloud()); + Assertions.assertEquals("jvlgfggcvkyyliz", 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"), + Assertions.assertEquals(StageValues.ARCHIVED, response.iterator().next().statusActiveEvents().get(0).stage()); + Assertions.assertTrue(response.iterator().next().statusActiveEvents().get(0).published()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-05T14:08:59Z"), 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 index 47c4a40998c35..f8d76a12d8eeb 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.generated; @@ -12,14 +12,7 @@ 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()); + = BinaryData.fromString("{\"message\":\"tdooaoj\"}").toObject(EventPropertiesAdditionalInformation.class); + Assertions.assertEquals("tdooaoj", 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 index 371a4000f8746..9d6b3b88702b1 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.generated; @@ -12,20 +12,9 @@ public final class EventPropertiesArticleTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { EventPropertiesArticle model = BinaryData - .fromString( - "{\"articleContent\":\"gvraeaen\",\"articleId\":\"nzar\",\"parameters\":\"datalquuijfqkacewii\"}") + .fromString("{\"articleContent\":\"yrs\",\"articleId\":\"sytgadgvraea\",\"parameters\":\"\\\"datae\\\"\"}") .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()); + Assertions.assertEquals("yrs", model.articleContent()); + Assertions.assertEquals("sytgadgvraea", 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 index 9de285a5d3d81..7a353d5a7522c 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.generated; @@ -12,18 +12,9 @@ public final class EventPropertiesRecommendedActionsItemTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { EventPropertiesRecommendedActionsItem model - = BinaryData.fromString("{\"groupId\":597105024,\"actionText\":\"qreyfkzi\"}") + = BinaryData.fromString("{\"groupId\":14517740,\"actionText\":\"tdqoaxoruzfgsq\"}") .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()); + Assertions.assertEquals(14517740, model.groupId()); + Assertions.assertEquals("tdqoaxoruzfgsq", 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 index e44fe54b96fc6..1eea1551f4048 100644 --- 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 @@ -1,56 +1,32 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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\"}]}]}") + "{\"impactedService\":\"osjswsr\",\"impactedServiceGuid\":\"lyzrpzbchckqqzqi\",\"impactedRegions\":[{\"impactedRegion\":\"suiizynkedyat\",\"status\":\"Resolved\",\"impactedSubscriptions\":[\"mibzyhwitsmypyyn\"],\"impactedTenants\":[\"pumnz\",\"mwzn\",\"abikns\"],\"lastUpdateTime\":\"2021-07-29T00:05:15Z\",\"updates\":[{\"summary\":\"bldtlww\",\"updateDateTime\":\"2021-03-07T19:07:21Z\",\"eventTags\":[\"tncvokot\"]},{\"summary\":\"xdy\",\"updateDateTime\":\"2021-07-08T09:31:36Z\",\"eventTags\":[\"cogjltdtbn\",\"hadoocrk\"]}]},{\"impactedRegion\":\"ikhnvpamqgxqq\",\"status\":\"Active\",\"impactedSubscriptions\":[\"ywggx\",\"allatmelwuipic\",\"jzkzi\",\"gvvcnayrhyr\"],\"impactedTenants\":[\"mueedndrdvstk\",\"qqtch\"],\"lastUpdateTime\":\"2021-06-10T11:36:20Z\",\"updates\":[{\"summary\":\"tdaaygdvwvg\",\"updateDateTime\":\"2021-06-07T06:53:10Z\",\"eventTags\":[\"wxrt\"]},{\"summary\":\"dxepxgyq\",\"updateDateTime\":\"2021-01-20T23:29:46Z\",\"eventTags\":[\"mnpkukghimdblxg\",\"imfnjhfjx\",\"mszkkfo\",\"rey\"]},{\"summary\":\"zi\",\"updateDateTime\":\"2021-01-04T11:20:29Z\",\"eventTags\":[\"n\",\"a\"]},{\"summary\":\"xwczelpcire\",\"updateDateTime\":\"2021-10-22T16:06Z\",\"eventTags\":[\"enwabfatk\",\"ddxbjhwuaanoz\"]}]}]}") .toObject(Impact.class); - Assertions.assertEquals("mslyzrpzbchckqqz", model.impactedService()); - Assertions.assertEquals("iysui", model.impactedRegions().get(0).impactedRegion()); + Assertions.assertEquals("osjswsr", model.impactedService()); + Assertions.assertEquals("lyzrpzbchckqqzqi", model.impactedServiceGuid()); + Assertions.assertEquals("suiizynkedyat", 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"), + Assertions.assertEquals("mibzyhwitsmypyyn", model.impactedRegions().get(0).impactedSubscriptions().get(0)); + Assertions.assertEquals("pumnz", model.impactedRegions().get(0).impactedTenants().get(0)); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-29T00:05:15Z"), 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"), + Assertions.assertEquals("bldtlww", model.impactedRegions().get(0).updates().get(0).summary()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-07T19:07:21Z"), model.impactedRegions().get(0).updates().get(0).updateDateTime()); + Assertions.assertEquals("tncvokot", model.impactedRegions().get(0).updates().get(0).eventTags().get(0)); } } 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 index 9e18cd64accde..f1560079b182a 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.generated; @@ -12,16 +12,8 @@ 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()); + = BinaryData.fromString("{\"id\":\"svfycxzbfv\",\"name\":\"wvrvmtg\"}").toObject(ImpactedRegion.class); + Assertions.assertEquals("svfycxzbfv", model.id()); + Assertions.assertEquals("wvrvmtg", 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 index 1d3d2eec2f7d3..b8cb3c8fbed6d 100644 --- 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 @@ -1,51 +1,28 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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\"}]}") + "{\"impactedRegion\":\"sphyoulpjrvxa\",\"status\":\"Resolved\",\"impactedSubscriptions\":[\"mjwosytx\",\"tcs\"],\"impactedTenants\":[\"k\",\"qumiek\",\"ez\",\"ikh\"],\"lastUpdateTime\":\"2021-03-18T15:32:34Z\",\"updates\":[{\"summary\":\"gqggebdunygae\",\"updateDateTime\":\"2021-06-18T06:51:38Z\",\"eventTags\":[\"fatpxllrxcyjmoa\",\"su\",\"arm\",\"wdmjsjqbjhhyx\"]},{\"summary\":\"wlycoduhpkxkg\",\"updateDateTime\":\"2021-11-24T05:25:20Z\",\"eventTags\":[\"qnajxqugj\",\"ky\",\"ubeddg\",\"sofwqmzqalkrmnji\"]}]}") .toObject(ImpactedServiceRegion.class); - Assertions.assertEquals("dtlwwrlkd", model.impactedRegion()); + Assertions.assertEquals("sphyoulpjrvxa", 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()); + Assertions.assertEquals("mjwosytx", model.impactedSubscriptions().get(0)); + Assertions.assertEquals("k", model.impactedTenants().get(0)); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-18T15:32:34Z"), model.lastUpdateTime()); + Assertions.assertEquals("gqggebdunygae", model.updates().get(0).summary()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-18T06:51:38Z"), model.updates().get(0).updateDateTime()); + Assertions.assertEquals("fatpxllrxcyjmoa", model.updates().get(0).eventTags().get(0)); } } 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 index bf66c32773ddc..092d17050ce5a 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.generated; @@ -11,17 +11,9 @@ 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()); + LinkDisplayText model = BinaryData.fromString("{\"value\":\"fsynljphuop\",\"localizedValue\":\"dlqiyntorzih\"}") + .toObject(LinkDisplayText.class); + Assertions.assertEquals("fsynljphuop", model.value()); + Assertions.assertEquals("dlqiyntorzih", 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 index d55889632c388..e78e57fe8bf66 100644 --- 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 @@ -1,12 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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; @@ -14,27 +13,12 @@ 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\"}") + "{\"type\":\"Button\",\"displayText\":{\"value\":\"rwlqu\",\"localizedValue\":\"jfqka\"},\"extensionName\":\"wiipfpub\",\"bladeName\":\"bwwift\",\"parameters\":\"\\\"dataqkvpuvksgplsakn\\\"\"}") .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()); + Assertions.assertEquals("rwlqu", model.displayText().value()); + Assertions.assertEquals("jfqka", model.displayText().localizedValue()); + Assertions.assertEquals("wiipfpub", model.extensionName()); + Assertions.assertEquals("bwwift", 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 index fec0a6028e0de..a1c6df8b1cf96 100644 --- 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 @@ -1,44 +1,28 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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\"}") + "{\"properties\":{\"displayName\":\"ofqweykhmenevfye\",\"dependsOn\":[\"hybcibv\",\"vdcsitynn\"],\"applicableScenarios\":[\"Alerts\",\"Alerts\",\"Alerts\",\"Alerts\"],\"supportedValues\":[{\"id\":\"iqscjeypv\",\"previousId\":\"zrkgqhcjrefovg\",\"serviceGuid\":\"qsl\",\"displayName\":\"yvxyqjp\",\"resourceTypes\":[\"t\",\"pngjcrcczsqpjhvm\",\"ajvnysounqe\",\"a\"],\"priority\":389510865},{\"id\":\"upfh\",\"previousId\":\"ltrpmopj\",\"serviceGuid\":\"matuok\",\"displayName\":\"fu\",\"resourceTypes\":[\"odsfcpkvxodpuozm\",\"zydagfuaxbezyiuo\",\"ktwh\"],\"priority\":291798162},{\"id\":\"zywqsmbsu\",\"previousId\":\"xim\",\"serviceGuid\":\"yocf\",\"displayName\":\"ksymd\",\"resourceTypes\":[\"tki\",\"uxh\",\"yudxorrqnbp\"],\"priority\":999035629},{\"id\":\"yifqrvkdvjsllrmv\",\"previousId\":\"f\",\"serviceGuid\":\"t\",\"displayName\":\"n\",\"resourceTypes\":[\"exxbczwtr\",\"wiqzbqjvsovmyo\",\"acspkwl\"],\"priority\":1196709774}]},\"id\":\"bpxjmfl\",\"name\":\"vvnchrkcc\",\"type\":\"wwzjuqkhrsajiwku\"}") .toObject(MetadataEntityInner.class); - Assertions.assertEquals("rbu", model.displayName()); - Assertions.assertEquals("vpnazzm", model.dependsOn().get(0)); + Assertions.assertEquals("ofqweykhmenevfye", model.displayName()); + Assertions.assertEquals("hybcibv", 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)); + Assertions.assertEquals("iqscjeypv", model.supportedValues().get(0).id()); + Assertions.assertEquals("zrkgqhcjrefovg", model.supportedValues().get(0).previousId()); + Assertions.assertEquals("qsl", model.supportedValues().get(0).serviceGuid()); + Assertions.assertEquals("yvxyqjp", model.supportedValues().get(0).displayName()); + Assertions.assertEquals("t", model.supportedValues().get(0).resourceTypes().get(0)); + Assertions.assertEquals(389510865, model.supportedValues().get(0).priority()); } } 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 index 51d1467337991..6b12b7b9c6057 100644 --- 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 @@ -1,95 +1,29 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.implementation.models.MetadataEntityListResult; 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\"}") + "{\"value\":[{\"properties\":{\"displayName\":\"aetcktvfcivfs\",\"dependsOn\":[\"m\",\"ctq\",\"jf\",\"ebrjcxe\"],\"applicableScenarios\":[\"Alerts\",\"Alerts\",\"Alerts\",\"Alerts\"],\"supportedValues\":[{\"id\":\"vjrbirphxepcyvah\",\"previousId\":\"ljkyqxjvuuj\",\"serviceGuid\":\"idokgjlj\",\"displayName\":\"xgvcl\",\"resourceTypes\":[\"sncghkjeszz\",\"bijhtxfvgxbf\",\"mxnehmp\"],\"priority\":1083472425},{\"id\":\"godebfqkkrbmpu\",\"previousId\":\"riwflzlfb\",\"serviceGuid\":\"puz\",\"displayName\":\"ispnqzahmgkbrp\",\"resourceTypes\":[\"hibnuqqkpika\",\"rgvtqag\"],\"priority\":1873718862},{\"id\":\"nhijggmebfsi\",\"previousId\":\"butr\",\"serviceGuid\":\"pnazzm\",\"displayName\":\"runmp\",\"resourceTypes\":[\"dbhrbnlankxm\",\"skpbhenbtkcxywn\",\"tnrsyn\"],\"priority\":123803740}]},\"id\":\"ybyxc\",\"name\":\"fclhaaxdbabphlwr\",\"type\":\"lfktsths\"},{\"properties\":{\"displayName\":\"cmnyyazttb\",\"dependsOn\":[\"rq\",\"uedck\"],\"applicableScenarios\":[\"Alerts\",\"Alerts\",\"Alerts\"],\"supportedValues\":[{\"id\":\"eyueaxibxujwb\",\"previousId\":\"walm\",\"serviceGuid\":\"yoxa\",\"displayName\":\"dkzjancuxrh\",\"resourceTypes\":[\"avxbniwdjswztsdb\",\"gnxytxhpzxbz\",\"fzab\",\"lcuhxwtctyqiklb\"],\"priority\":2077643232},{\"id\":\"lwzbhvgyugu\",\"previousId\":\"vmkfssxqu\",\"serviceGuid\":\"fpl\",\"displayName\":\"gsxnkjzkdeslpv\",\"resourceTypes\":[\"wiyighxpkdw\",\"baiuebbaumny\"],\"priority\":624396177},{\"id\":\"deoj\",\"previousId\":\"bckhsmtxpsi\",\"serviceGuid\":\"tfhvpesapskrdqmh\",\"displayName\":\"dhtldwkyz\",\"resourceTypes\":[\"tkncwsc\",\"svlxotogtwrup\"],\"priority\":1278272073}]},\"id\":\"nmic\",\"name\":\"kvceoveilovnotyf\",\"type\":\"fcnj\"},{\"properties\":{\"displayName\":\"nxdhbt\",\"dependsOn\":[\"h\",\"wpn\"],\"applicableScenarios\":[\"Alerts\"],\"supportedValues\":[{\"id\":\"rmclfplphoxu\",\"previousId\":\"rpabg\",\"serviceGuid\":\"psbjta\",\"displayName\":\"ugxywpmueef\",\"resourceTypes\":[\"fqkquj\",\"dsuyonobgla\"],\"priority\":713530304},{\"id\":\"tcc\",\"previousId\":\"yudxytlmoy\",\"serviceGuid\":\"vwfudwpzntxhd\",\"displayName\":\"lrqjbhckfr\",\"resourceTypes\":[\"xsbkyvpyca\",\"uzbpzkafku\"],\"priority\":2051758335}]},\"id\":\"nwbmeh\",\"name\":\"seyvj\",\"type\":\"srtslhspkdeem\"}],\"nextLink\":\"fm\"}") .toObject(MetadataEntityListResult.class); - Assertions.assertEquals("nqecanoaeup", model.value().get(0).displayName()); - Assertions.assertEquals("hltrpmopjmcmatuo", model.value().get(0).dependsOn().get(0)); + Assertions.assertEquals("aetcktvfcivfs", model.value().get(0).displayName()); + Assertions.assertEquals("m", 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()); + Assertions.assertEquals("vjrbirphxepcyvah", model.value().get(0).supportedValues().get(0).id()); + Assertions.assertEquals("ljkyqxjvuuj", model.value().get(0).supportedValues().get(0).previousId()); + Assertions.assertEquals("idokgjlj", model.value().get(0).supportedValues().get(0).serviceGuid()); + Assertions.assertEquals("xgvcl", model.value().get(0).supportedValues().get(0).displayName()); + Assertions.assertEquals("sncghkjeszz", model.value().get(0).supportedValues().get(0).resourceTypes().get(0)); + Assertions.assertEquals(1083472425, model.value().get(0).supportedValues().get(0).priority()); + Assertions.assertEquals("fm", 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 index 50b306ac6d371..96bba9e301ac6 100644 --- 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 @@ -1,48 +1,28 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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\"]}]}") + "{\"displayName\":\"oskg\",\"dependsOn\":[\"uuimjmvxieduug\"],\"applicableScenarios\":[\"Alerts\"],\"supportedValues\":[{\"id\":\"byao\",\"previousId\":\"e\",\"serviceGuid\":\"sonpclhocohs\",\"displayName\":\"ev\",\"resourceTypes\":[\"gz\",\"buhfmvfaxkffeiit\"],\"priority\":1335902799},{\"id\":\"ez\",\"previousId\":\"shxmzsbbzoggigrx\",\"serviceGuid\":\"ur\",\"displayName\":\"xxjnspydptk\",\"resourceTypes\":[\"kouknvudwtiu\",\"bldngkpoc\"],\"priority\":523665642},{\"id\":\"yxoegukgjnp\",\"previousId\":\"cgygev\",\"serviceGuid\":\"ntypmrbpizcdrqj\",\"displayName\":\"pyd\",\"resourceTypes\":[\"hxdeoejz\",\"cwif\",\"jttgzf\",\"ishc\"],\"priority\":1326905161},{\"id\":\"jdeyeamdpha\",\"previousId\":\"lpbuxwgipwhonowk\",\"serviceGuid\":\"hwankixzbinjepu\",\"displayName\":\"mryw\",\"resourceTypes\":[\"oqftiyqzrnkcq\",\"yx\",\"whzlsicohoq\",\"nwvlryavwhheunmm\"],\"priority\":1220710831}]}") .toObject(MetadataEntityProperties.class); - Assertions.assertEquals("rq", model.displayName()); - Assertions.assertEquals("dckzywbiexz", model.dependsOn().get(0)); + Assertions.assertEquals("oskg", model.displayName()); + Assertions.assertEquals("uuimjmvxieduug", 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)); + Assertions.assertEquals("byao", model.supportedValues().get(0).id()); + Assertions.assertEquals("e", model.supportedValues().get(0).previousId()); + Assertions.assertEquals("sonpclhocohs", model.supportedValues().get(0).serviceGuid()); + Assertions.assertEquals("ev", model.supportedValues().get(0).displayName()); + Assertions.assertEquals("gz", model.supportedValues().get(0).resourceTypes().get(0)); + Assertions.assertEquals(1335902799, model.supportedValues().get(0).priority()); } } 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 index bf3014bffe675..a7ef8bd3ce26d 100644 --- 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 @@ -1,33 +1,24 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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\"]}") + "{\"id\":\"xzko\",\"previousId\":\"cukoklyaxuconu\",\"serviceGuid\":\"zf\",\"displayName\":\"eyp\",\"resourceTypes\":[\"mjmwvvjektcx\",\"enhwlrs\",\"frzpwvlqdqgb\"],\"priority\":629213684}") .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)); + Assertions.assertEquals("xzko", model.id()); + Assertions.assertEquals("cukoklyaxuconu", model.previousId()); + Assertions.assertEquals("zf", model.serviceGuid()); + Assertions.assertEquals("eyp", model.displayName()); + Assertions.assertEquals("mjmwvvjektcx", model.resourceTypes().get(0)); + Assertions.assertEquals(629213684, model.priority()); } } 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 index daac58b792e89..0a290b7a397a3 100644 --- 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.resourcehealth.ResourceHealthManager; import com.azure.resourcemanager.resourcehealth.models.MetadataEntity; @@ -22,23 +22,26 @@ 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\"}"; + = "{\"properties\":{\"displayName\":\"ua\",\"dependsOn\":[\"kwrrwo\",\"cqucwyhahnom\",\"rkywuhpsvfuu\"],\"applicableScenarios\":[\"Alerts\",\"Alerts\",\"Alerts\",\"Alerts\"],\"supportedValues\":[{\"id\":\"alniexzsrzp\",\"previousId\":\"pqtybb\",\"serviceGuid\":\"pgdakchzyvli\",\"displayName\":\"nrkcxkj\",\"resourceTypes\":[\"xmysuxswqrntv\"],\"priority\":1670220024},{\"id\":\"psttexoq\",\"previousId\":\"wcyyufmhruncu\",\"serviceGuid\":\"qspkcdqzhlctd\",\"displayName\":\"nqndyfpchrqbn\",\"resourceTypes\":[\"cgegydcwbo\",\"jumvqqolihrraio\",\"aubrjtloq\",\"fuojrngif\"],\"priority\":193344927},{\"id\":\"asccbiui\",\"previousId\":\"dlyjdf\",\"serviceGuid\":\"mkyoqufdvruzsl\",\"displayName\":\"j\",\"resourceTypes\":[\"tfnmdx\",\"tngfdgugeyzihgr\",\"yui\"],\"priority\":1979493256},{\"id\":\"nmfpp\",\"previousId\":\"jee\",\"serviceGuid\":\"hyhsgzfczbg\",\"displayName\":\"fgbegl\",\"resourceTypes\":[\"eohibet\",\"luan\",\"rrfx\",\"eebtijvacvb\"],\"priority\":192666481}]},\"id\":\"qqxlajr\",\"name\":\"wxacevehj\",\"type\":\"uyxoaf\"}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); MetadataEntity response - = manager.metadatas().getEntityWithResponse("ekrsgs", com.azure.core.util.Context.NONE).getValue(); + = manager.metadatas().getEntityWithResponse("odxeszabbela", com.azure.core.util.Context.NONE).getValue(); - Assertions.assertEquals("huzqgn", response.displayName()); - Assertions.assertEquals("kynscliqhzv", response.dependsOn().get(0)); + Assertions.assertEquals("ua", response.displayName()); + Assertions.assertEquals("kwrrwo", 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)); + Assertions.assertEquals("alniexzsrzp", response.supportedValues().get(0).id()); + Assertions.assertEquals("pqtybb", response.supportedValues().get(0).previousId()); + Assertions.assertEquals("pgdakchzyvli", response.supportedValues().get(0).serviceGuid()); + Assertions.assertEquals("nrkcxkj", response.supportedValues().get(0).displayName()); + Assertions.assertEquals("xmysuxswqrntv", response.supportedValues().get(0).resourceTypes().get(0)); + Assertions.assertEquals(1670220024, response.supportedValues().get(0).priority()); } } 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 index eaf4b59b3da97..83d6f9ed9cb2a 100644 --- 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 @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.resourcehealth.ResourceHealthManager; import com.azure.resourcemanager.resourcehealth.models.MetadataEntity; @@ -23,23 +23,25 @@ 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\"}]}"; + = "{\"value\":[{\"properties\":{\"displayName\":\"qltfaey\",\"dependsOn\":[\"mfgvxirpghriypo\"],\"applicableScenarios\":[\"Alerts\",\"Alerts\",\"Alerts\",\"Alerts\"],\"supportedValues\":[{\"id\":\"rlpyznuciqdsmexi\",\"previousId\":\"dfuxtya\",\"serviceGuid\":\"ibmi\",\"displayName\":\"nnust\",\"resourceTypes\":[\"jh\",\"mgixhcmavmqfou\",\"or\",\"cgyypro\"],\"priority\":812539177},{\"id\":\"undmbx\",\"previousId\":\"gcmjkavl\",\"serviceGuid\":\"rb\",\"displayName\":\"tp\",\"resourceTypes\":[\"zfjltfvnzcyjto\",\"p\"],\"priority\":1964877049},{\"id\":\"pbdbzqgqqi\",\"previousId\":\"dsvqwt\",\"serviceGuid\":\"ky\",\"displayName\":\"cysihs\",\"resourceTypes\":[\"wdhohsdtmcdzsu\"],\"priority\":757345037}]},\"id\":\"dxbzlmcmuap\",\"name\":\"vhdbevwqqxey\",\"type\":\"ko\"}]}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); 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("qltfaey", response.iterator().next().displayName()); + Assertions.assertEquals("mfgvxirpghriypo", 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)); + Assertions.assertEquals("rlpyznuciqdsmexi", response.iterator().next().supportedValues().get(0).id()); + Assertions.assertEquals("dfuxtya", response.iterator().next().supportedValues().get(0).previousId()); + Assertions.assertEquals("ibmi", response.iterator().next().supportedValues().get(0).serviceGuid()); + Assertions.assertEquals("nnust", response.iterator().next().supportedValues().get(0).displayName()); + Assertions.assertEquals("jh", response.iterator().next().supportedValues().get(0).resourceTypes().get(0)); + Assertions.assertEquals(812539177, response.iterator().next().supportedValues().get(0).priority()); } } 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 index 5924eb980d42d..29df1fa0e09a6 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.generated; @@ -12,24 +12,11 @@ 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\"}") + "{\"provider\":\"lusarh\",\"resource\":\"fcqhsmyurkd\",\"operation\":\"lx\",\"description\":\"kuksjtxukcdm\"}") .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()); + Assertions.assertEquals("lusarh", model.provider()); + Assertions.assertEquals("fcqhsmyurkd", model.resource()); + Assertions.assertEquals("lx", model.operation()); + Assertions.assertEquals("kuksjtxukcdm", 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 index 5f157232a44a0..16093b4de4528 100644 --- 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 @@ -1,52 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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\"}}]}") + "{\"value\":[{\"name\":\"hq\",\"display\":{\"provider\":\"jxpybczmeh\",\"resource\":\"zopbsphrupidgs\",\"operation\":\"bejhphoycmsxa\",\"description\":\"hdxbmtqio\"}},{\"name\":\"zehtbmu\",\"display\":{\"provider\":\"wnoi\",\"resource\":\"wlrxyb\",\"operation\":\"oqijgkdmbpaz\",\"description\":\"bc\"}},{\"name\":\"pdznrbtcqqjnqgl\",\"display\":{\"provider\":\"nufo\",\"resource\":\"jywif\",\"operation\":\"esaagdfm\",\"description\":\"zlhjxrifkwmrvkt\"}}]}") .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()); + Assertions.assertEquals("hq", model.value().get(0).name()); + Assertions.assertEquals("jxpybczmeh", model.value().get(0).display().provider()); + Assertions.assertEquals("zopbsphrupidgs", model.value().get(0).display().resource()); + Assertions.assertEquals("bejhphoycmsxa", model.value().get(0).display().operation()); + Assertions.assertEquals("hdxbmtqio", 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 index e8a3c30f60307..3192fa7cdfce6 100644 --- 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 @@ -1,39 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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\"}}") + "{\"name\":\"zntocipaouajps\",\"display\":{\"provider\":\"mpoyfd\",\"resource\":\"ogknygjofjdd\",\"operation\":\"s\",\"description\":\"eupewnwreitjz\"}}") .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()); + Assertions.assertEquals("zntocipaouajps", model.name()); + Assertions.assertEquals("mpoyfd", model.display().provider()); + Assertions.assertEquals("ogknygjofjdd", model.display().resource()); + Assertions.assertEquals("s", model.display().operation()); + Assertions.assertEquals("eupewnwreitjz", 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 index f739bafa481b3..ccb3eca47a8c8 100644 --- 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.resourcehealth.ResourceHealthManager; import com.azure.resourcemanager.resourcehealth.models.OperationListResult; @@ -21,22 +21,22 @@ 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\"}}]}"; + = "{\"value\":[{\"name\":\"baxk\",\"display\":{\"provider\":\"wrck\",\"resource\":\"kl\",\"operation\":\"pluodpv\",\"description\":\"udlgzibthostgkts\"}}]}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); 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()); + Assertions.assertEquals("baxk", response.value().get(0).name()); + Assertions.assertEquals("wrck", response.value().get(0).display().provider()); + Assertions.assertEquals("kl", response.value().get(0).display().resource()); + Assertions.assertEquals("pluodpv", response.value().get(0).display().operation()); + Assertions.assertEquals("udlgzibthostgkts", 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 index 1a98fdc5bcf03..ae069e3f5ea5a 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.generated; @@ -12,21 +12,10 @@ 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\"}") + "{\"action\":\"zjaoyfhrtxil\",\"actionUrl\":\"rkujy\",\"_ActionUrl.Comment\":\"l\",\"actionUrlText\":\"uvfqawrlyxwj\"}") .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()); + Assertions.assertEquals("zjaoyfhrtxil", model.action()); + Assertions.assertEquals("rkujy", model.actionUrl()); + Assertions.assertEquals("uvfqawrlyxwj", 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 index 0635e23956a84..30881b4231031 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.generated; @@ -11,27 +11,12 @@ 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\"}") + ServiceImpactingEventIncidentProperties model = BinaryData.fromString( + "{\"title\":\"rfidfvzwdz\",\"service\":\"tymw\",\"region\":\"dkfthwxmnt\",\"incidentType\":\"waopvkmijcmmxd\"}") .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()); + Assertions.assertEquals("rfidfvzwdz", model.title()); + Assertions.assertEquals("tymw", model.service()); + Assertions.assertEquals("dkfthwxmnt", model.region()); + Assertions.assertEquals("waopvkmijcmmxd", 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 index 2f038b834b74b..ced38bd36ba27 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.generated; @@ -12,14 +12,7 @@ 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()); + = BinaryData.fromString("{\"value\":\"ufizuckyf\"}").toObject(ServiceImpactingEventStatus.class); + Assertions.assertEquals("ufizuckyf", 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 index c1d176a94a8a0..3e6c3639ae72e 100644 --- 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 @@ -1,13 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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; @@ -15,37 +13,15 @@ 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\"}}") + "{\"eventStartTime\":\"2021-05-18T18:45:02Z\",\"eventStatusLastModifiedTime\":\"2021-08-01T09:30:41Z\",\"correlationId\":\"b\",\"status\":{\"value\":\"vtb\"},\"incidentProperties\":{\"title\":\"sszdnru\",\"service\":\"guhmuouqfpr\",\"region\":\"wbnguitnwui\",\"incidentType\":\"a\"}}") .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()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-18T18:45:02Z"), model.eventStartTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-01T09:30:41Z"), model.eventStatusLastModifiedTime()); + Assertions.assertEquals("b", model.correlationId()); + Assertions.assertEquals("vtb", model.status().value()); + Assertions.assertEquals("sszdnru", model.incidentProperties().title()); + Assertions.assertEquals("guhmuouqfpr", model.incidentProperties().service()); + Assertions.assertEquals("wbnguitnwui", model.incidentProperties().region()); + Assertions.assertEquals("a", 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 index 41111d25f714f..446f063100d7f 100644 --- 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 @@ -1,81 +1,34 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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\"}]}]}") + "{\"title\":\"gvvs\",\"description\":\"yajguqfhwygzlv\",\"trackingId\":\"kfxu\",\"startTime\":\"2021-10-16T01:46:34Z\",\"cloud\":\"wzrmuh\",\"severity\":\"Error\",\"stage\":\"Active\",\"published\":false,\"lastModifiedTime\":\"2021-07-29T16:55:48Z\",\"impacts\":[{\"id\":\"psvuoymgc\",\"name\":\"lvez\",\"regions\":[{\"id\":\"lmfeokerq\",\"name\":\"yhko\"},{\"id\":\"pg\",\"name\":\"dkow\"}]},{\"id\":\"bqpc\",\"name\":\"kbwcc\",\"regions\":[{\"id\":\"cdwxlpq\",\"name\":\"ftnkhtj\"},{\"id\":\"i\",\"name\":\"wfqatmtd\"},{\"id\":\"mdvy\",\"name\":\"ikdgszywkbir\"}]},{\"id\":\"uzhlhkjoqrv\",\"name\":\"aatjinrvgoupmfi\",\"regions\":[{\"id\":\"gjio\",\"name\":\"vrwxkv\"},{\"id\":\"k\",\"name\":\"lqwjygvjayvblm\"},{\"id\":\"k\",\"name\":\"hbxvvyhgsopbyrqu\"}]}]}") .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("gvvs", model.title()); + Assertions.assertEquals("yajguqfhwygzlv", model.description()); + Assertions.assertEquals("kfxu", model.trackingId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-16T01:46:34Z"), model.startTime()); + Assertions.assertEquals("wzrmuh", model.cloud()); + Assertions.assertEquals(SeverityValues.ERROR, 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()); + Assertions.assertFalse(model.published()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-29T16:55:48Z"), model.lastModifiedTime()); + Assertions.assertEquals("psvuoymgc", model.impacts().get(0).id()); + Assertions.assertEquals("lvez", model.impacts().get(0).name()); + Assertions.assertEquals("lmfeokerq", model.impacts().get(0).regions().get(0).id()); + Assertions.assertEquals("yhko", 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 index a7ceae26cc336..483e3926b0f62 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.generated; @@ -13,24 +13,11 @@ 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\"}") + "{\"title\":\"kfwynw\",\"message\":\"tbvkayhmtnvyq\",\"cloud\":\"tkzwpcnpwzc\",\"lastModifiedTime\":\"2021-05-22T23:16:36Z\"}") .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()); + Assertions.assertEquals("kfwynw", model.title()); + Assertions.assertEquals("tbvkayhmtnvyq", model.message()); + Assertions.assertEquals("tkzwpcnpwzc", model.cloud()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-22T23:16:36Z"), 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 index f968baef08555..2122bcc350f9d 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resourcehealth.generated; @@ -12,18 +12,11 @@ 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\"}") + Update model = BinaryData.fromString( + "{\"summary\":\"xacqqudfnbyx\",\"updateDateTime\":\"2021-01-28T01:39:16Z\",\"eventTags\":[\"jyvayffimrzrtuz\",\"ogs\"]}") .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()); + Assertions.assertEquals("xacqqudfnbyx", model.summary()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-28T01:39:16Z"), model.updateDateTime()); + Assertions.assertEquals("jyvayffimrzrtuz", model.eventTags().get(0)); } } diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/tsp-location.yaml b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/tsp-location.yaml new file mode 100644 index 0000000000000..c23ba590dc4c2 --- /dev/null +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/ResourceHealth +commit: cd1e3be9d1e6861bce41a7ecfbbaccb68c9bc25a +repo: Azure/azure-rest-api-specs +additionalDirectories: