diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/CHANGELOG.md b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/CHANGELOG.md
index 862d2c155e45..faa60a2b574b 100644
--- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/CHANGELOG.md
+++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/CHANGELOG.md
@@ -1,14 +1,158 @@
# Release History
-## 1.1.0-beta.4 (Unreleased)
+## 1.0.0-beta.1 (2025-05-13)
+
+- Azure Resource Manager ResourceHealth client library for Java. This package contains Microsoft Azure SDK for ResourceHealth Management SDK. The Resource Health Client. Package tag package-2025-05-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
### Features Added
-### Breaking Changes
+* `models.EventsOperations` was added
+
+* `models.EventLevelValues` was added
+
+* `models.IssueNameParameter` was added
+
+* `models.SecurityAdvisoryImpactedResources` was added
+
+* `models.KeyValueItem` was added
+
+* `models.Impact` was added
+
+* `models.ImpactedResources` was added
+
+* `models.EventTypeValues` was added
+
+* `models.MetadataEntity` was added
+
+* `models.StatusBanner` was added
+
+* `models.EventPropertiesRecommendedActionsItem` was added
+
+* `models.Events` was added
+
+* `models.ImpactedServiceRegion` was added
+
+* `models.EventStatusValues` was added
+
+* `models.EmergingIssueImpact` was added
+
+* `models.EventOperations` was added
+
+* `models.Event` was added
+
+* `models.ChildAvailabilityStatuses` was added
+
+* `models.EmergingIssues` was added
+
+* `models.EmergingIssuesGetResult` was added
+
+* `models.Metadatas` was added
+
+* `models.SeverityValues` was added
+
+* `models.StageValues` was added
+
+* `models.ChildResources` was added
+
+* `models.ImpactedRegion` was added
+
+* `models.EventPropertiesRecommendedActions` was added
+
+* `models.EventImpactedResourceListResult` was added
+
+* `models.StatusActiveEvent` was added
+
+* `models.MetadataEntityListResult` was added
+
+* `models.LinkTypeValues` was added
+
+* `models.EventImpactedResource` was added
+
+* `models.LevelValues` was added
+
+* `models.EmergingIssueListResult` was added
+
+* `models.Faq` was added
+
+* `models.EventSourceValues` was added
+
+* `models.Link` was added
+
+* `models.Scenario` was added
+
+* `models.LinkDisplayText` was added
+
+* `models.Update` was added
+
+* `models.EventPropertiesArticle` was added
+
+* `models.EventPropertiesAdditionalInformation` was added
+
+* `models.MetadataSupportedValueDetail` was added
+
+#### `models.ServiceImpactingEventStatus` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.RecommendedAction` was modified
+
+* `actionUrlComment()` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+* `withActionUrlComment(java.lang.String)` was added
+
+#### `ResourceHealthManager` was modified
+
+* `eventOperations()` was added
+* `eventsOperations()` was added
+* `impactedResources()` was added
+* `childAvailabilityStatuses()` was added
+* `securityAdvisoryImpactedResources()` was added
+* `emergingIssues()` was added
+* `childResources()` was added
+* `metadatas()` was added
+
+#### `models.AvailabilityStatusProperties` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+* `withCategory(java.lang.String)` was added
+* `withContext(java.lang.String)` was added
+* `category()` was added
+* `articleId()` was added
+* `withArticleId(java.lang.String)` was added
+* `context()` was added
+
+#### `models.OperationDisplay` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.ServiceImpactingEvent` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.ServiceImpactingEventIncidentProperties` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
+
+#### `models.Operation` was modified
+
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
+
+#### `models.AvailabilityStatusPropertiesRecentlyResolved` was modified
+
+* `toJson(com.azure.json.JsonWriter)` was added
+* `fromJson(com.azure.json.JsonReader)` was added
-### Bugs Fixed
+#### `models.AvailabilityStatusListResult` was modified
-### Other Changes
+* `fromJson(com.azure.json.JsonReader)` was added
+* `toJson(com.azure.json.JsonWriter)` was added
## 1.1.0-beta.3 (2024-12-06)
diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/README.md b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/README.md
index bbef5482494d..1b5f8f9d2480 100644
--- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/README.md
+++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/README.md
@@ -2,7 +2,7 @@
Azure Resource Manager ResourceHealth client library for Java.
-This package contains Microsoft Azure SDK for ResourceHealth Management SDK. The Resource Health Client. Package tag package-preview-2023-10. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
+This package contains Microsoft Azure SDK for ResourceHealth Management SDK. The Resource Health Client. Package tag package-2025-05-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
## We'd love to hear your feedback
@@ -52,7 +52,7 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment
Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code:
```java
-AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE);
+AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD);
TokenCredential credential = new DefaultAzureCredentialBuilder()
.authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint())
.build();
@@ -60,7 +60,7 @@ ResourceHealthManager manager = ResourceHealthManager
.authenticate(credential, profile);
```
-The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise.
+The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise.
See [Authentication][authenticate] for more options.
@@ -100,5 +100,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m
[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md
[coc]: https://opensource.microsoft.com/codeofconduct/
[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/
-
-
diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/SAMPLE.md b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/SAMPLE.md
index 1432eb3f78a9..2e98822a39da 100644
--- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/SAMPLE.md
+++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/SAMPLE.md
@@ -59,23 +59,22 @@
```java
/**
- * Samples for AvailabilityStatuses GetByResource.
+ * Samples for AvailabilityStatuses ListByResourceGroup.
*/
-public final class AvailabilityStatusesGetByResourceSamples {
+public final class AvailabilityStatusesListByResourceGroupSamples {
/*
* x-ms-original-file:
- * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/
- * AvailabilityStatus_GetByResource.json
+ * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/
+ * AvailabilityStatuses_ListByResourceGroup.json
*/
/**
- * Sample code: GetCurrentHealthByResource.
+ * Sample code: ListByResourceGroup.
*
* @param manager Entry point to ResourceHealthManager.
*/
- public static void
- getCurrentHealthByResource(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
+ public static void listByResourceGroup(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
manager.availabilityStatuses()
- .getByResourceWithResponse("resourceUri", null, "recommendedactions", com.azure.core.util.Context.NONE);
+ .listByResourceGroup("resourceGroupName", null, "recommendedactions", com.azure.core.util.Context.NONE);
}
}
```
@@ -84,22 +83,21 @@ public final class AvailabilityStatusesGetByResourceSamples {
```java
/**
- * Samples for AvailabilityStatuses List.
+ * Samples for Metadata List.
*/
-public final class AvailabilityStatusesListSamples {
+public final class MetadataListSamples {
/*
* x-ms-original-file:
- * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/
- * AvailabilityStatuses_List.json
+ * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/Metadata_List.
+ * json
*/
/**
- * Sample code: GetHealthHistoryByResource.
+ * Sample code: GetMetadata.
*
* @param manager Entry point to ResourceHealthManager.
*/
- public static void
- getHealthHistoryByResource(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
- manager.availabilityStatuses().list("resourceUri", null, null, com.azure.core.util.Context.NONE);
+ public static void getMetadata(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
+ manager.metadatas().list(com.azure.core.util.Context.NONE);
}
}
```
@@ -108,22 +106,21 @@ public final class AvailabilityStatusesListSamples {
```java
/**
- * Samples for AvailabilityStatuses ListByResourceGroup.
+ * Samples for EmergingIssues List.
*/
-public final class AvailabilityStatusesListByResourceGroupSamples {
+public final class EmergingIssuesListSamples {
/*
* x-ms-original-file:
- * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/
- * AvailabilityStatuses_ListByResourceGroup.json
+ * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/
+ * EmergingIssues_List.json
*/
/**
- * Sample code: ListByResourceGroup.
+ * Sample code: GetEmergingIssues.
*
* @param manager Entry point to ResourceHealthManager.
*/
- public static void listByResourceGroup(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
- manager.availabilityStatuses()
- .listByResourceGroup("resourceGroupName", null, "recommendedactions", com.azure.core.util.Context.NONE);
+ public static void getEmergingIssues(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
+ manager.emergingIssues().list(com.azure.core.util.Context.NONE);
}
}
```
@@ -132,23 +129,21 @@ public final class AvailabilityStatusesListByResourceGroupSamples {
```java
/**
- * Samples for AvailabilityStatuses ListBySubscriptionId.
+ * Samples for Metadata GetEntity.
*/
-public final class AvailabilityStatusesListBySubscriptionIdSamples {
+public final class MetadataGetEntitySamples {
/*
* x-ms-original-file:
- * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/
- * AvailabilityStatuses_ListBySubscriptionId.json
+ * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/
+ * Metadata_GetEntity.json
*/
/**
- * Sample code: ListHealthBySubscriptionId.
+ * Sample code: GetMetadata.
*
* @param manager Entry point to ResourceHealthManager.
*/
- public static void
- listHealthBySubscriptionId(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
- manager.availabilityStatuses()
- .listBySubscriptionId(null, "recommendedactions", com.azure.core.util.Context.NONE);
+ public static void getMetadata(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
+ manager.metadatas().getEntityWithResponse("status", com.azure.core.util.Context.NONE);
}
}
```
@@ -157,25 +152,23 @@ public final class AvailabilityStatusesListBySubscriptionIdSamples {
```java
/**
- * Samples for ChildAvailabilityStatuses GetByResource.
+ * Samples for SecurityAdvisoryImpactedResources ListByTenantIdAndEventId.
*/
-public final class ChildAvailabilityStatusesGetByResourceSamples {
+public final class SecurityAdvisoryImpactedResourcesListByTenantIdAndEventIdSamples {
/*
* x-ms-original-file:
- * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/
- * ChildAvailabilityStatus_GetByResource.json
+ * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/
+ * SecurityAdvisoryImpactedResources_ListByTenantId_ListByEventId.json
*/
/**
- * Sample code: GetChildCurrentHealthByResource.
+ * Sample code: ListSecurityAdvisoryImpactedResourcesByTenantId.
*
* @param manager Entry point to ResourceHealthManager.
*/
- public static void
- getChildCurrentHealthByResource(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
- manager.childAvailabilityStatuses()
- .getByResourceWithResponse(
- "subscriptions/227b734f-e14f-4de6-b7fc-3190c21e69f6/resourceGroups/JUHACKETRHCTEST/providers/Microsoft.Compute/virtualMachineScaleSets/rhctest/virtualMachines/4",
- null, "recommendedactions", com.azure.core.util.Context.NONE);
+ public static void listSecurityAdvisoryImpactedResourcesByTenantId(
+ com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
+ manager.securityAdvisoryImpactedResources()
+ .listByTenantIdAndEventId("BC_1-FXZ", null, com.azure.core.util.Context.NONE);
}
}
```
@@ -184,25 +177,21 @@ public final class ChildAvailabilityStatusesGetByResourceSamples {
```java
/**
- * Samples for ChildAvailabilityStatuses List.
+ * Samples for ImpactedResources Get.
*/
-public final class ChildAvailabilityStatusesListSamples {
+public final class ImpactedResourcesGetSamples {
/*
* x-ms-original-file:
- * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/
- * ChildAvailabilityStatuses_List.json
+ * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/
+ * ImpactedResources_Get.json
*/
/**
- * Sample code: GetChildHealthHistoryByResource.
+ * Sample code: ImpactedResourcesGet.
*
* @param manager Entry point to ResourceHealthManager.
*/
- public static void
- getChildHealthHistoryByResource(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
- manager.childAvailabilityStatuses()
- .list(
- "subscriptions/227b734f-e14f-4de6-b7fc-3190c21e69f6/resourceGroups/JUHACKETRHCTEST/providers/Microsoft.Compute/virtualMachineScaleSets/rhctest/virtualMachines/4",
- null, null, com.azure.core.util.Context.NONE);
+ public static void impactedResourcesGet(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
+ manager.impactedResources().getWithResponse("BC_1-FXZ", "abc-123-ghj-456", com.azure.core.util.Context.NONE);
}
}
```
@@ -211,22 +200,24 @@ public final class ChildAvailabilityStatusesListSamples {
```java
/**
- * Samples for ChildResources List.
+ * Samples for EventsOperation List.
*/
-public final class ChildResourcesListSamples {
+public final class EventsOperationListSamples {
/*
* x-ms-original-file:
- * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/
- * ChildResources_List.json
+ * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/
+ * Events_ListBySubscriptionId.json
*/
/**
- * Sample code: GetCurrentChildHealthByResource.
+ * Sample code: ListEventsBySubscriptionId.
*
* @param manager Entry point to ResourceHealthManager.
*/
public static void
- getCurrentChildHealthByResource(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
- manager.childResources().list("resourceUri", null, null, com.azure.core.util.Context.NONE);
+ listEventsBySubscriptionId(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
+ manager.eventsOperations()
+ .list("service eq 'Virtual Machines' or region eq 'West US'", "5/12/2025",
+ com.azure.core.util.Context.NONE);
}
}
```
@@ -234,24 +225,26 @@ public final class ChildResourcesListSamples {
### EmergingIssues_Get
```java
-import com.azure.resourcemanager.resourcehealth.models.IssueNameParameter;
-
/**
- * Samples for EmergingIssues Get.
+ * Samples for EventsOperation ListBySingleResource.
*/
-public final class EmergingIssuesGetSamples {
+public final class EventsOperationListBySingleResourceSamples {
/*
* x-ms-original-file:
- * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/
- * EmergingIssues_Get.json
+ * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/
+ * Events_ListBySingleResource.json
*/
/**
- * Sample code: GetEmergingIssues.
+ * Sample code: ListEventsBySingleResource.
*
* @param manager Entry point to ResourceHealthManager.
*/
- public static void getEmergingIssues(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
- manager.emergingIssues().getWithResponse(IssueNameParameter.DEFAULT, com.azure.core.util.Context.NONE);
+ public static void
+ listEventsBySingleResource(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
+ manager.eventsOperations()
+ .listBySingleResource(
+ "subscriptions/4abcdefgh-ijkl-mnop-qrstuvwxyz/resourceGroups/rhctestenv/providers/Microsoft.Compute/virtualMachines/rhctestenvV1PI",
+ null, com.azure.core.util.Context.NONE);
}
}
```
@@ -260,21 +253,24 @@ public final class EmergingIssuesGetSamples {
```java
/**
- * Samples for EmergingIssues List.
+ * Samples for EventOperation GetBySubscriptionIdAndTrackingId.
*/
-public final class EmergingIssuesListSamples {
+public final class EventOperationGetBySubscriptionIdAndTrackingIdSamples {
/*
* x-ms-original-file:
- * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/
- * EmergingIssues_List.json
+ * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/
+ * Event_GetBySubscriptionIdAndTrackingId.json
*/
/**
- * Sample code: GetEmergingIssues.
+ * Sample code: SecurityAdvisoriesEventBySubscriptionIdAndTrackingId.
*
* @param manager Entry point to ResourceHealthManager.
*/
- public static void getEmergingIssues(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
- manager.emergingIssues().list(com.azure.core.util.Context.NONE);
+ public static void securityAdvisoriesEventBySubscriptionIdAndTrackingId(
+ com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
+ manager.eventOperations()
+ .getBySubscriptionIdAndTrackingIdWithResponse("eventTrackingId", "properties/status eq 'Active'",
+ "5/12/2025", com.azure.core.util.Context.NONE);
}
}
```
@@ -282,24 +278,24 @@ public final class EmergingIssuesListSamples {
### EventOperation_FetchDetailsBySubscriptionIdAndTrackingId
```java
+import com.azure.resourcemanager.resourcehealth.models.IssueNameParameter;
+
/**
- * Samples for EventOperation FetchDetailsBySubscriptionIdAndTrackingId.
+ * Samples for EmergingIssues Get.
*/
-public final class EventOperationFetchDetailsBySubscriptionIdAndTrackingIdSamples {
+public final class EmergingIssuesGetSamples {
/*
* x-ms-original-file:
- * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/
- * Event_fetchDetailsBySubscriptionIdAndTrackingId.json
+ * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/
+ * EmergingIssues_Get.json
*/
/**
- * Sample code: EventDetailsBySubscriptionIdAndTrackingId.
+ * Sample code: GetEmergingIssues.
*
* @param manager Entry point to ResourceHealthManager.
*/
- public static void eventDetailsBySubscriptionIdAndTrackingId(
- com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
- manager.eventOperations()
- .fetchDetailsBySubscriptionIdAndTrackingIdWithResponse("eventTrackingId", com.azure.core.util.Context.NONE);
+ public static void getEmergingIssues(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
+ manager.emergingIssues().getWithResponse(IssueNameParameter.DEFAULT, com.azure.core.util.Context.NONE);
}
}
```
@@ -308,23 +304,22 @@ public final class EventOperationFetchDetailsBySubscriptionIdAndTrackingIdSample
```java
/**
- * Samples for EventOperation FetchDetailsByTenantIdAndTrackingId.
+ * Samples for ImpactedResources ListByTenantIdAndEventId.
*/
-public final class EventOperationFetchDetailsByTenantIdAndTrackingIdSamples {
+public final class ImpactedResourcesListByTenantIdAndEventIdSamples {
/*
* x-ms-original-file:
- * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/
- * Event_fetchDetailsByTenantIdAndTrackingId.json
+ * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/
+ * ImpactedResources_ListByTenantId_ListByEventId.json
*/
/**
- * Sample code: EventDetailsByTenantIdAndTrackingId.
+ * Sample code: ListEventsByTenantId.
*
* @param manager Entry point to ResourceHealthManager.
*/
- public static void
- eventDetailsByTenantIdAndTrackingId(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
- manager.eventOperations()
- .fetchDetailsByTenantIdAndTrackingIdWithResponse("eventTrackingId", com.azure.core.util.Context.NONE);
+ public static void listEventsByTenantId(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
+ manager.impactedResources()
+ .listByTenantIdAndEventId("BC_1-FXZ", "targetRegion eq 'westus'", com.azure.core.util.Context.NONE);
}
}
```
@@ -333,24 +328,23 @@ public final class EventOperationFetchDetailsByTenantIdAndTrackingIdSamples {
```java
/**
- * Samples for EventOperation GetBySubscriptionIdAndTrackingId.
+ * Samples for EventsOperation ListByTenantId.
*/
-public final class EventOperationGetBySubscriptionIdAndTrackingIdSamples {
+public final class EventsOperationListByTenantIdSamples {
/*
* x-ms-original-file:
- * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/
- * Event_GetBySubscriptionIdAndTrackingId.json
+ * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/
+ * Events_ListByTenantId.json
*/
/**
- * Sample code: SecurityAdvisoriesEventBySubscriptionIdAndTrackingId.
+ * Sample code: ListEventsByTenantId.
*
* @param manager Entry point to ResourceHealthManager.
*/
- public static void securityAdvisoriesEventBySubscriptionIdAndTrackingId(
- com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
- manager.eventOperations()
- .getBySubscriptionIdAndTrackingIdWithResponse("eventTrackingId", "properties/status eq 'Active'",
- "7/10/2022", com.azure.core.util.Context.NONE);
+ public static void listEventsByTenantId(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
+ manager.eventsOperations()
+ .listByTenantId("service eq 'Virtual Machines' or region eq 'West US'", "7/24/2020",
+ com.azure.core.util.Context.NONE);
}
}
```
@@ -359,24 +353,25 @@ public final class EventOperationGetBySubscriptionIdAndTrackingIdSamples {
```java
/**
- * Samples for EventOperation GetByTenantIdAndTrackingId.
+ * Samples for ChildAvailabilityStatuses GetByResource.
*/
-public final class EventOperationGetByTenantIdAndTrackingIdSamples {
+public final class ChildAvailabilityStatusesGetByResourceSamples {
/*
* x-ms-original-file:
- * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/
- * Event_GetByTenantIdAndTrackingId.json
+ * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/
+ * ChildAvailabilityStatus_GetByResource.json
*/
/**
- * Sample code: EventByTenantIdAndTrackingId.
+ * Sample code: GetChildCurrentHealthByResource.
*
* @param manager Entry point to ResourceHealthManager.
*/
public static void
- eventByTenantIdAndTrackingId(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
- manager.eventOperations()
- .getByTenantIdAndTrackingIdWithResponse("eventTrackingId", "properties/status eq 'Active'", "7/10/2022",
- com.azure.core.util.Context.NONE);
+ getChildCurrentHealthByResource(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
+ manager.childAvailabilityStatuses()
+ .getByResourceWithResponse(
+ "subscriptions/227b734f-e14f-4de6-b7fc-3190c21e69f6/resourceGroups/JUHACKETRHCTEST/providers/Microsoft.Compute/virtualMachineScaleSets/rhctest/virtualMachines/4",
+ null, "recommendedactions", com.azure.core.util.Context.NONE);
}
}
```
@@ -385,24 +380,22 @@ public final class EventOperationGetByTenantIdAndTrackingIdSamples {
```java
/**
- * Samples for EventsOperation List.
+ * Samples for ChildResources List.
*/
-public final class EventsOperationListSamples {
+public final class ChildResourcesListSamples {
/*
* x-ms-original-file:
- * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/
- * Events_ListBySubscriptionId.json
+ * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/
+ * ChildResources_List.json
*/
/**
- * Sample code: ListEventsBySubscriptionId.
+ * Sample code: GetCurrentChildHealthByResource.
*
* @param manager Entry point to ResourceHealthManager.
*/
public static void
- listEventsBySubscriptionId(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
- manager.eventsOperations()
- .list("service eq 'Virtual Machines' or region eq 'West US'", "7/24/2020",
- com.azure.core.util.Context.NONE);
+ getCurrentChildHealthByResource(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
+ manager.childResources().list("resourceUri", null, null, com.azure.core.util.Context.NONE);
}
}
```
@@ -411,25 +404,23 @@ public final class EventsOperationListSamples {
```java
/**
- * Samples for EventsOperation ListBySingleResource.
+ * Samples for EventOperation FetchDetailsByTenantIdAndTrackingId.
*/
-public final class EventsOperationListBySingleResourceSamples {
+public final class EventOperationFetchDetailsByTenantIdAndTrackingIdSamples {
/*
* x-ms-original-file:
- * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/
- * Events_ListBySingleResource.json
+ * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/
+ * Event_fetchDetailsByTenantIdAndTrackingId.json
*/
/**
- * Sample code: ListEventsBySingleResource.
+ * Sample code: EventDetailsByTenantIdAndTrackingId.
*
* @param manager Entry point to ResourceHealthManager.
*/
public static void
- listEventsBySingleResource(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
- manager.eventsOperations()
- .listBySingleResource(
- "subscriptions/4abcdefgh-ijkl-mnop-qrstuvwxyz/resourceGroups/rhctestenv/providers/Microsoft.Compute/virtualMachines/rhctestenvV1PI",
- null, com.azure.core.util.Context.NONE);
+ eventDetailsByTenantIdAndTrackingId(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
+ manager.eventOperations()
+ .fetchDetailsByTenantIdAndTrackingIdWithResponse("eventTrackingId", com.azure.core.util.Context.NONE);
}
}
```
@@ -438,23 +429,23 @@ public final class EventsOperationListBySingleResourceSamples {
```java
/**
- * Samples for EventsOperation ListByTenantId.
+ * Samples for EventOperation FetchDetailsBySubscriptionIdAndTrackingId.
*/
-public final class EventsOperationListByTenantIdSamples {
+public final class EventOperationFetchDetailsBySubscriptionIdAndTrackingIdSamples {
/*
* x-ms-original-file:
- * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/
- * Events_ListByTenantId.json
+ * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/
+ * Event_fetchDetailsBySubscriptionIdAndTrackingId.json
*/
/**
- * Sample code: ListEventsByTenantId.
+ * Sample code: EventDetailsBySubscriptionIdAndTrackingId.
*
* @param manager Entry point to ResourceHealthManager.
*/
- public static void listEventsByTenantId(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
- manager.eventsOperations()
- .listByTenantId("service eq 'Virtual Machines' or region eq 'West US'", "7/24/2020",
- com.azure.core.util.Context.NONE);
+ public static void eventDetailsBySubscriptionIdAndTrackingId(
+ com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
+ manager.eventOperations()
+ .fetchDetailsBySubscriptionIdAndTrackingIdWithResponse("eventTrackingId", com.azure.core.util.Context.NONE);
}
}
```
@@ -463,21 +454,23 @@ public final class EventsOperationListByTenantIdSamples {
```java
/**
- * Samples for ImpactedResources Get.
+ * Samples for AvailabilityStatuses GetByResource.
*/
-public final class ImpactedResourcesGetSamples {
+public final class AvailabilityStatusesGetByResourceSamples {
/*
* x-ms-original-file:
- * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/
- * ImpactedResources_Get.json
+ * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/
+ * AvailabilityStatus_GetByResource.json
*/
/**
- * Sample code: ImpactedResourcesGet.
+ * Sample code: GetCurrentHealthByResource.
*
* @param manager Entry point to ResourceHealthManager.
*/
- public static void impactedResourcesGet(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
- manager.impactedResources().getWithResponse("BC_1-FXZ", "abc-123-ghj-456", com.azure.core.util.Context.NONE);
+ public static void
+ getCurrentHealthByResource(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
+ manager.availabilityStatuses()
+ .getByResourceWithResponse("resourceUri", null, "recommendedactions", com.azure.core.util.Context.NONE);
}
}
```
@@ -486,22 +479,25 @@ public final class ImpactedResourcesGetSamples {
```java
/**
- * Samples for ImpactedResources GetByTenantId.
+ * Samples for ChildAvailabilityStatuses List.
*/
-public final class ImpactedResourcesGetByTenantIdSamples {
+public final class ChildAvailabilityStatusesListSamples {
/*
* x-ms-original-file:
- * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/
- * ImpactedResources_GetByTenantId.json
+ * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/
+ * ChildAvailabilityStatuses_List.json
*/
/**
- * Sample code: ImpactedResourcesGet.
+ * Sample code: GetChildHealthHistoryByResource.
*
* @param manager Entry point to ResourceHealthManager.
*/
- public static void impactedResourcesGet(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
- manager.impactedResources()
- .getByTenantIdWithResponse("BC_1-FXZ", "abc-123-ghj-456", com.azure.core.util.Context.NONE);
+ public static void
+ getChildHealthHistoryByResource(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
+ manager.childAvailabilityStatuses()
+ .list(
+ "subscriptions/227b734f-e14f-4de6-b7fc-3190c21e69f6/resourceGroups/JUHACKETRHCTEST/providers/Microsoft.Compute/virtualMachineScaleSets/rhctest/virtualMachines/4",
+ null, null, com.azure.core.util.Context.NONE);
}
}
```
@@ -510,23 +506,23 @@ public final class ImpactedResourcesGetByTenantIdSamples {
```java
/**
- * Samples for ImpactedResources ListBySubscriptionIdAndEventId.
+ * Samples for AvailabilityStatuses ListBySubscriptionId.
*/
-public final class ImpactedResourcesListBySubscriptionIdAndEventIdSamples {
+public final class AvailabilityStatusesListBySubscriptionIdSamples {
/*
* x-ms-original-file:
- * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/
- * ImpactedResources_ListBySubscriptionId_ListByEventId.json
+ * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/
+ * AvailabilityStatuses_ListBySubscriptionId.json
*/
/**
- * Sample code: ListImpactedResourcesBySubscriptionId.
+ * Sample code: ListHealthBySubscriptionId.
*
* @param manager Entry point to ResourceHealthManager.
*/
public static void
- listImpactedResourcesBySubscriptionId(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
- manager.impactedResources()
- .listBySubscriptionIdAndEventId("BC_1-FXZ", "targetRegion eq 'westus'", com.azure.core.util.Context.NONE);
+ listHealthBySubscriptionId(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
+ manager.availabilityStatuses()
+ .listBySubscriptionId(null, "recommendedactions", com.azure.core.util.Context.NONE);
}
}
```
@@ -535,22 +531,24 @@ public final class ImpactedResourcesListBySubscriptionIdAndEventIdSamples {
```java
/**
- * Samples for ImpactedResources ListByTenantIdAndEventId.
+ * Samples for EventOperation GetByTenantIdAndTrackingId.
*/
-public final class ImpactedResourcesListByTenantIdAndEventIdSamples {
+public final class EventOperationGetByTenantIdAndTrackingIdSamples {
/*
* x-ms-original-file:
- * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/
- * ImpactedResources_ListByTenantId_ListByEventId.json
+ * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/
+ * Event_GetByTenantIdAndTrackingId.json
*/
/**
- * Sample code: ListEventsByTenantId.
+ * Sample code: EventByTenantIdAndTrackingId.
*
* @param manager Entry point to ResourceHealthManager.
*/
- public static void listEventsByTenantId(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
- manager.impactedResources()
- .listByTenantIdAndEventId("BC_1-FXZ", "targetRegion eq 'westus'", com.azure.core.util.Context.NONE);
+ public static void
+ eventByTenantIdAndTrackingId(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
+ manager.eventOperations()
+ .getByTenantIdAndTrackingIdWithResponse("eventTrackingId", "properties/status eq 'Active'", "7/10/2022",
+ com.azure.core.util.Context.NONE);
}
}
```
@@ -559,21 +557,23 @@ public final class ImpactedResourcesListByTenantIdAndEventIdSamples {
```java
/**
- * Samples for Metadata GetEntity.
+ * Samples for SecurityAdvisoryImpactedResources ListBySubscriptionIdAndEventId.
*/
-public final class MetadataGetEntitySamples {
+public final class SecurityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdSamples {
/*
* x-ms-original-file:
- * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/
- * Metadata_GetEntity.json
+ * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/
+ * SecurityAdvisoryImpactedResources_ListBySubscriptionId_ListByEventId.json
*/
/**
- * Sample code: GetMetadata.
+ * Sample code: ListSecurityAdvisoryImpactedResourcesBySubscriptionId.
*
* @param manager Entry point to ResourceHealthManager.
*/
- public static void getMetadata(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
- manager.metadatas().getEntityWithResponse("status", com.azure.core.util.Context.NONE);
+ public static void listSecurityAdvisoryImpactedResourcesBySubscriptionId(
+ com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
+ manager.securityAdvisoryImpactedResources()
+ .listBySubscriptionIdAndEventId("BC_1-FXZ", null, com.azure.core.util.Context.NONE);
}
}
```
@@ -582,21 +582,22 @@ public final class MetadataGetEntitySamples {
```java
/**
- * Samples for Metadata List.
+ * Samples for AvailabilityStatuses List.
*/
-public final class MetadataListSamples {
+public final class AvailabilityStatusesListSamples {
/*
* x-ms-original-file:
- * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/
- * Metadata_List.json
+ * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/
+ * AvailabilityStatuses_List.json
*/
/**
- * Sample code: GetMetadata.
+ * Sample code: GetHealthHistoryByResource.
*
* @param manager Entry point to ResourceHealthManager.
*/
- public static void getMetadata(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
- manager.metadatas().list(com.azure.core.util.Context.NONE);
+ public static void
+ getHealthHistoryByResource(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
+ manager.availabilityStatuses().list("resourceUri", null, null, com.azure.core.util.Context.NONE);
}
}
```
@@ -605,21 +606,23 @@ public final class MetadataListSamples {
```java
/**
- * Samples for Operations List.
+ * Samples for ImpactedResources ListBySubscriptionIdAndEventId.
*/
-public final class OperationsListSamples {
+public final class ImpactedResourcesListBySubscriptionIdAndEventIdSamples {
/*
* x-ms-original-file:
- * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/
- * Operations_List.json
+ * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/
+ * ImpactedResources_ListBySubscriptionId_ListByEventId.json
*/
/**
- * Sample code: GetOperationsList.
+ * Sample code: ListImpactedResourcesBySubscriptionId.
*
* @param manager Entry point to ResourceHealthManager.
*/
- public static void getOperationsList(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
- manager.operations().listWithResponse(com.azure.core.util.Context.NONE);
+ public static void
+ listImpactedResourcesBySubscriptionId(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
+ manager.impactedResources()
+ .listBySubscriptionIdAndEventId("BC_1-FXZ", "targetRegion eq 'westus'", com.azure.core.util.Context.NONE);
}
}
```
@@ -628,23 +631,22 @@ public final class OperationsListSamples {
```java
/**
- * Samples for SecurityAdvisoryImpactedResources ListBySubscriptionIdAndEventId.
+ * Samples for ImpactedResources GetByTenantId.
*/
-public final class SecurityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdSamples {
+public final class ImpactedResourcesGetByTenantIdSamples {
/*
* x-ms-original-file:
- * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/
- * SecurityAdvisoryImpactedResources_ListBySubscriptionId_ListByEventId.json
+ * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/
+ * ImpactedResources_GetByTenantId.json
*/
/**
- * Sample code: ListSecurityAdvisoryImpactedResourcesBySubscriptionId.
+ * Sample code: ImpactedResourcesGet.
*
* @param manager Entry point to ResourceHealthManager.
*/
- public static void listSecurityAdvisoryImpactedResourcesBySubscriptionId(
- com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
- manager.securityAdvisoryImpactedResources()
- .listBySubscriptionIdAndEventId("BC_1-FXZ", null, com.azure.core.util.Context.NONE);
+ public static void impactedResourcesGet(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
+ manager.impactedResources()
+ .getByTenantIdWithResponse("BC_1-FXZ", "abc-123-ghj-456", com.azure.core.util.Context.NONE);
}
}
```
@@ -653,23 +655,21 @@ public final class SecurityAdvisoryImpactedResourcesListBySubscriptionIdAndEvent
```java
/**
- * Samples for SecurityAdvisoryImpactedResources ListByTenantIdAndEventId.
+ * Samples for Operations List.
*/
-public final class SecurityAdvisoryImpactedResourcesListByTenantIdAndEventIdSamples {
+public final class OperationsListSamples {
/*
* x-ms-original-file:
- * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/
- * SecurityAdvisoryImpactedResources_ListByTenantId_ListByEventId.json
+ * specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2025-05-01/examples/Operations_List
+ * .json
*/
/**
- * Sample code: ListSecurityAdvisoryImpactedResourcesByTenantId.
+ * Sample code: GetOperationsList.
*
* @param manager Entry point to ResourceHealthManager.
*/
- public static void listSecurityAdvisoryImpactedResourcesByTenantId(
- com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
- manager.securityAdvisoryImpactedResources()
- .listByTenantIdAndEventId("BC_1-FXZ", null, com.azure.core.util.Context.NONE);
+ public static void getOperationsList(com.azure.resourcemanager.resourcehealth.ResourceHealthManager manager) {
+ manager.operations().listWithResponse(com.azure.core.util.Context.NONE);
}
}
```
diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/pom.xml b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/pom.xml
index ae1ab2868b1a..eedb21debdf7 100644
--- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/pom.xml
+++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/pom.xml
@@ -18,7 +18,7 @@
jar
Microsoft Azure SDK for ResourceHealth Management
- This package contains Microsoft Azure SDK for ResourceHealth Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Resource Health Client. Package tag package-preview-2023-10.
+ This package contains Microsoft Azure SDK for ResourceHealth Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Resource Health Client. Package tag package-2025-05-01.
https://github.com/Azure/azure-sdk-for-java
@@ -46,7 +46,6 @@
0
0
true
- false
diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/ResourceHealthManager.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/ResourceHealthManager.java
index 9f8bc6e49d27..b195cca20b5a 100644
--- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/ResourceHealthManager.java
+++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/ResourceHealthManager.java
@@ -22,6 +22,7 @@
import com.azure.core.http.policy.UserAgentPolicy;
import com.azure.core.management.profile.AzureProfile;
import com.azure.core.util.Configuration;
+import com.azure.core.util.CoreUtils;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.resourcehealth.fluent.MicrosoftResourceHealth;
import com.azure.resourcemanager.resourcehealth.implementation.AvailabilityStatusesImpl;
@@ -49,6 +50,7 @@
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.List;
+import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
@@ -129,6 +131,9 @@ public static Configurable configure() {
*/
public static final class Configurable {
private static final ClientLogger LOGGER = new ClientLogger(Configurable.class);
+ private static final String SDK_VERSION = "version";
+ private static final Map PROPERTIES
+ = CoreUtils.getProperties("azure-resourcemanager-resourcehealth.properties");
private HttpClient httpClient;
private HttpLogOptions httpLogOptions;
@@ -236,12 +241,14 @@ public ResourceHealthManager authenticate(TokenCredential credential, AzureProfi
Objects.requireNonNull(credential, "'credential' cannot be null.");
Objects.requireNonNull(profile, "'profile' cannot be null.");
+ String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion");
+
StringBuilder userAgentBuilder = new StringBuilder();
userAgentBuilder.append("azsdk-java")
.append("-")
.append("com.azure.resourcemanager.resourcehealth")
.append("/")
- .append("1.1.0-beta.3");
+ .append(clientVersion);
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
userAgentBuilder.append(" (")
.append(Configuration.getGlobalConfiguration().get("java.version"))
diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/EventOperationsClient.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/EventOperationsClient.java
index 2702bc16ac1a..b6ecb56cac3d 100644
--- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/EventOperationsClient.java
+++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/EventOperationsClient.java
@@ -20,8 +20,8 @@ public interface EventOperationsClient {
* @param eventTrackingId Event Id which uniquely identifies ServiceHealth event.
* @param filter The filter to apply on the operation. For more information please see
* https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN.
- * @param queryStartTime Specifies from when to return events, based on the lastUpdateTime property. For example,
- * queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020.
+ * @param queryStartTime Specifies from when to return events (default is 3 days), based on the lastUpdateTime
+ * property. For example, queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
@@ -46,7 +46,8 @@ Response getBySubscriptionIdAndTrackingIdWithResponse(String eventTr
/**
* Service health event details in the subscription by event tracking id. This can be used to fetch sensitive
- * properties for Security Advisory events.
+ * properties for Security Advisory events. Please see
+ * https://learn.microsoft.com/en-us/azure/service-health/security-advisories-elevated-access.
*
* @param eventTrackingId Event Id which uniquely identifies ServiceHealth event.
* @param context The context to associate with this operation.
@@ -60,7 +61,8 @@ Response getBySubscriptionIdAndTrackingIdWithResponse(String eventTr
/**
* Service health event details in the subscription by event tracking id. This can be used to fetch sensitive
- * properties for Security Advisory events.
+ * properties for Security Advisory events. Please see
+ * https://learn.microsoft.com/en-us/azure/service-health/security-advisories-elevated-access.
*
* @param eventTrackingId Event Id which uniquely identifies ServiceHealth event.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -77,8 +79,8 @@ Response getBySubscriptionIdAndTrackingIdWithResponse(String eventTr
* @param eventTrackingId Event Id which uniquely identifies ServiceHealth event.
* @param filter The filter to apply on the operation. For more information please see
* https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN.
- * @param queryStartTime Specifies from when to return events, based on the lastUpdateTime property. For example,
- * queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020.
+ * @param queryStartTime Specifies from when to return events (default is 3 days), based on the lastUpdateTime
+ * property. For example, queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
@@ -103,7 +105,8 @@ Response getByTenantIdAndTrackingIdWithResponse(String eventTracking
/**
* Service health event details in the tenant by event tracking id. This can be used to fetch sensitive properties
- * for Security Advisory events.
+ * for Security Advisory events. Please see
+ * https://learn.microsoft.com/en-us/azure/service-health/security-advisories-elevated-access.
*
* @param eventTrackingId Event Id which uniquely identifies ServiceHealth event.
* @param context The context to associate with this operation.
@@ -117,7 +120,8 @@ Response getByTenantIdAndTrackingIdWithResponse(String eventTracking
/**
* Service health event details in the tenant by event tracking id. This can be used to fetch sensitive properties
- * for Security Advisory events.
+ * for Security Advisory events. Please see
+ * https://learn.microsoft.com/en-us/azure/service-health/security-advisories-elevated-access.
*
* @param eventTrackingId Event Id which uniquely identifies ServiceHealth event.
* @throws IllegalArgumentException thrown if parameters fail the validation.
diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/EventsOperationsClient.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/EventsOperationsClient.java
index 902133437630..214b51367922 100644
--- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/EventsOperationsClient.java
+++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/EventsOperationsClient.java
@@ -29,8 +29,8 @@ public interface EventsOperationsClient {
*
* @param filter The filter to apply on the operation. For more information please see
* https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN.
- * @param queryStartTime Specifies from when to return events, based on the lastUpdateTime property. For example,
- * queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020.
+ * @param queryStartTime Specifies from when to return events (default is 3 days), based on the lastUpdateTime
+ * property. For example, queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
@@ -55,8 +55,8 @@ public interface EventsOperationsClient {
*
* @param filter The filter to apply on the operation. For more information please see
* https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN.
- * @param queryStartTime Specifies from when to return events, based on the lastUpdateTime property. For example,
- * queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020.
+ * @param queryStartTime Specifies from when to return events (default is 3 days), based on the lastUpdateTime
+ * property. For example, queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EventImpactedResourceInner.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EventImpactedResourceInner.java
index 85b243165baa..a22565a87edf 100644
--- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EventImpactedResourceInner.java
+++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EventImpactedResourceInner.java
@@ -125,51 +125,6 @@ public String targetRegion() {
return this.innerProperties() == null ? null : this.innerProperties().targetRegion();
}
- /**
- * Get the resourceName property: Resource name of the impacted resource.
- *
- * @return the resourceName value.
- */
- public String resourceName() {
- return this.innerProperties() == null ? null : this.innerProperties().resourceName();
- }
-
- /**
- * Get the resourceGroup property: Resource group name of the impacted resource.
- *
- * @return the resourceGroup value.
- */
- public String resourceGroup() {
- return this.innerProperties() == null ? null : this.innerProperties().resourceGroup();
- }
-
- /**
- * Get the status property: Status of the impacted resource.
- *
- * @return the status value.
- */
- public String status() {
- return this.innerProperties() == null ? null : this.innerProperties().status();
- }
-
- /**
- * Get the maintenanceStartTime property: Start time of maintenance for the impacted resource.
- *
- * @return the maintenanceStartTime value.
- */
- public String maintenanceStartTime() {
- return this.innerProperties() == null ? null : this.innerProperties().maintenanceStartTime();
- }
-
- /**
- * Get the maintenanceEndTime property: End time of maintenance for the impacted resource.
- *
- * @return the maintenanceEndTime value.
- */
- public String maintenanceEndTime() {
- return this.innerProperties() == null ? null : this.innerProperties().maintenanceEndTime();
- }
-
/**
* Get the info property: Additional information.
*
diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EventImpactedResourceProperties.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EventImpactedResourceProperties.java
index 6c1c5910be76..2686aa2204db 100644
--- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EventImpactedResourceProperties.java
+++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EventImpactedResourceProperties.java
@@ -33,31 +33,6 @@ public final class EventImpactedResourceProperties implements JsonSerializable info = reader.readArray(reader1 -> KeyValueItem.fromJson(reader1));
deserializedEventImpactedResourceProperties.info = info;
diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EventInner.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EventInner.java
index e26a5f1fb6c7..1e03c0692676 100644
--- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EventInner.java
+++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EventInner.java
@@ -16,7 +16,6 @@
import com.azure.resourcemanager.resourcehealth.models.EventPropertiesRecommendedActions;
import com.azure.resourcemanager.resourcehealth.models.EventSourceValues;
import com.azure.resourcemanager.resourcehealth.models.EventStatusValues;
-import com.azure.resourcemanager.resourcehealth.models.EventSubTypeValues;
import com.azure.resourcemanager.resourcehealth.models.EventTypeValues;
import com.azure.resourcemanager.resourcehealth.models.Faq;
import com.azure.resourcemanager.resourcehealth.models.Impact;
@@ -133,31 +132,6 @@ public EventInner withEventType(EventTypeValues eventType) {
return this;
}
- /**
- * Get the eventSubType property: Sub type of the event. Currently used to determine retirement communications for
- * health advisory events.
- *
- * @return the eventSubType value.
- */
- public EventSubTypeValues eventSubType() {
- return this.innerProperties() == null ? null : this.innerProperties().eventSubType();
- }
-
- /**
- * Set the eventSubType property: Sub type of the event. Currently used to determine retirement communications for
- * health advisory events.
- *
- * @param eventSubType the eventSubType value to set.
- * @return the EventInner object itself.
- */
- public EventInner withEventSubType(EventSubTypeValues eventSubType) {
- if (this.innerProperties() == null) {
- this.innerProperties = new EventProperties();
- }
- this.innerProperties().withEventSubType(eventSubType);
- return this;
- }
-
/**
* Get the eventSource property: Source of event.
*
@@ -228,7 +202,8 @@ public EventInner withTitle(String title) {
}
/**
- * Get the summary property: Summary text of event.
+ * Get the summary property: Summary text of event. Use fetchEventDetails endpoint to get summary of sensitive
+ * events.
*
* @return the summary value.
*/
@@ -237,7 +212,8 @@ public String summary() {
}
/**
- * Set the summary property: Summary text of event.
+ * Set the summary property: Summary text of event. Use fetchEventDetails endpoint to get summary of sensitive
+ * events.
*
* @param summary the summary value to set.
* @return the EventInner object itself.
@@ -319,6 +295,33 @@ public EventInner withEventLevel(EventLevelValues eventLevel) {
return this;
}
+ /**
+ * Get the isEventSensitive property: If true the event may contains sensitive data. Use the post
+ * events/{trackingId}/fetchEventDetails endpoint to fetch sensitive data see
+ * https://learn.microsoft.com/en-us/azure/service-health/security-advisories-elevated-access.
+ *
+ * @return the isEventSensitive value.
+ */
+ public Boolean isEventSensitive() {
+ return this.innerProperties() == null ? null : this.innerProperties().isEventSensitive();
+ }
+
+ /**
+ * Set the isEventSensitive property: If true the event may contains sensitive data. Use the post
+ * events/{trackingId}/fetchEventDetails endpoint to fetch sensitive data see
+ * https://learn.microsoft.com/en-us/azure/service-health/security-advisories-elevated-access.
+ *
+ * @param isEventSensitive the isEventSensitive value to set.
+ * @return the EventInner object itself.
+ */
+ public EventInner withIsEventSensitive(Boolean isEventSensitive) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new EventProperties();
+ }
+ this.innerProperties().withIsEventSensitive(isEventSensitive);
+ return this;
+ }
+
/**
* Get the externalIncidentId property: The id of the Incident.
*
@@ -574,7 +577,7 @@ public EventInner withEnableMicrosoftSupport(Boolean enableMicrosoftSupport) {
/**
* Get the description property: Contains the communication message for the event, that could include summary, root
- * cause and other details.
+ * cause and other details. Use fetchEventDetails endpoint to get description of sensitive events.
*
* @return the description value.
*/
@@ -584,7 +587,7 @@ public String description() {
/**
* Set the description property: Contains the communication message for the event, that could include summary, root
- * cause and other details.
+ * cause and other details. Use fetchEventDetails endpoint to get description of sensitive events.
*
* @param description the description value to set.
* @return the EventInner object itself.
@@ -788,73 +791,45 @@ public EventInner withImpactType(String impactType) {
}
/**
- * Get the maintenanceId property: Unique identifier for planned maintenance event.
- *
- * @return the maintenanceId value.
- */
- public String maintenanceId() {
- return this.innerProperties() == null ? null : this.innerProperties().maintenanceId();
- }
-
- /**
- * Set the maintenanceId property: Unique identifier for planned maintenance event.
- *
- * @param maintenanceId the maintenanceId value to set.
- * @return the EventInner object itself.
- */
- public EventInner withMaintenanceId(String maintenanceId) {
- if (this.innerProperties() == null) {
- this.innerProperties = new EventProperties();
- }
- this.innerProperties().withMaintenanceId(maintenanceId);
- return this;
- }
-
- /**
- * Get the maintenanceType property: The type of planned maintenance event.
- *
- * @return the maintenanceType value.
- */
- public String maintenanceType() {
- return this.innerProperties() == null ? null : this.innerProperties().maintenanceType();
- }
-
- /**
- * Set the maintenanceType property: The type of planned maintenance event.
- *
- * @param maintenanceType the maintenanceType value to set.
- * @return the EventInner object itself.
- */
- public EventInner withMaintenanceType(String maintenanceType) {
- if (this.innerProperties() == null) {
- this.innerProperties = new EventProperties();
- }
- this.innerProperties().withMaintenanceType(maintenanceType);
- return this;
- }
-
- /**
- * Get the argQuery property: Azure Resource Graph query to fetch the affected resources from their existing Azure
- * Resource Graph locations.
+ * Get the eventTags property: A list of metadata tags associated with the event. Possible values include:
+ * -Action Recommended: Action may be required by you to avoid possible disruptions or mitigate risks for your
+ * services. It is recommended to evaluate these actions and the potential impact on your services.
+ * - False Positive: After investigation, we've determined your service is healthy and service issues did not impact
+ * your services as originally communicated.
+ * - Preliminary PIR: For our largest, most impactful service issues a Preliminary Post Incident Review (PIR) is
+ * published generally within 72 hours of mitigation, to summarize what we have learned so far from the
+ * still-in-progress investigation.
+ * - Final PIR: For service issues, a Final Post Incident Review (PIR) may be published to provide additional
+ * details or learnings. Sometimes this requires us to complete an internal retrospective, generally within 14 days
+ * of mitigation.
*
- * @return the argQuery value.
+ * @return the eventTags value.
*/
- public String argQuery() {
- return this.innerProperties() == null ? null : this.innerProperties().argQuery();
+ public List eventTags() {
+ return this.innerProperties() == null ? null : this.innerProperties().eventTags();
}
/**
- * Set the argQuery property: Azure Resource Graph query to fetch the affected resources from their existing Azure
- * Resource Graph locations.
+ * Set the eventTags property: A list of metadata tags associated with the event. Possible values include:
+ * -Action Recommended: Action may be required by you to avoid possible disruptions or mitigate risks for your
+ * services. It is recommended to evaluate these actions and the potential impact on your services.
+ * - False Positive: After investigation, we've determined your service is healthy and service issues did not impact
+ * your services as originally communicated.
+ * - Preliminary PIR: For our largest, most impactful service issues a Preliminary Post Incident Review (PIR) is
+ * published generally within 72 hours of mitigation, to summarize what we have learned so far from the
+ * still-in-progress investigation.
+ * - Final PIR: For service issues, a Final Post Incident Review (PIR) may be published to provide additional
+ * details or learnings. Sometimes this requires us to complete an internal retrospective, generally within 14 days
+ * of mitigation.
*
- * @param argQuery the argQuery value to set.
+ * @param eventTags the eventTags value to set.
* @return the EventInner object itself.
*/
- public EventInner withArgQuery(String argQuery) {
+ public EventInner withEventTags(List eventTags) {
if (this.innerProperties() == null) {
this.innerProperties = new EventProperties();
}
- this.innerProperties().withArgQuery(argQuery);
+ this.innerProperties().withEventTags(eventTags);
return this;
}
diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EventProperties.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EventProperties.java
index c4959ce3e569..c24dd3879537 100644
--- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EventProperties.java
+++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/models/EventProperties.java
@@ -16,7 +16,6 @@
import com.azure.resourcemanager.resourcehealth.models.EventPropertiesRecommendedActions;
import com.azure.resourcemanager.resourcehealth.models.EventSourceValues;
import com.azure.resourcemanager.resourcehealth.models.EventStatusValues;
-import com.azure.resourcemanager.resourcehealth.models.EventSubTypeValues;
import com.azure.resourcemanager.resourcehealth.models.EventTypeValues;
import com.azure.resourcemanager.resourcehealth.models.Faq;
import com.azure.resourcemanager.resourcehealth.models.Impact;
@@ -37,11 +36,6 @@ public final class EventProperties implements JsonSerializable
*/
private EventTypeValues eventType;
- /*
- * Sub type of the event. Currently used to determine retirement communications for health advisory events
- */
- private EventSubTypeValues eventSubType;
-
/*
* Source of event.
*/
@@ -58,7 +52,7 @@ public final class EventProperties implements JsonSerializable
private String title;
/*
- * Summary text of event.
+ * Summary text of event. Use fetchEventDetails endpoint to get summary of sensitive events.
*/
private String summary;
@@ -77,6 +71,13 @@ public final class EventProperties implements JsonSerializable
*/
private EventLevelValues eventLevel;
+ /*
+ * If true the event may contains sensitive data. Use the post events/{trackingId}/fetchEventDetails endpoint to
+ * fetch sensitive data see
+ * https://learn.microsoft.com/en-us/azure/service-health/security-advisories-elevated-access
+ */
+ private Boolean isEventSensitive;
+
/*
* The id of the Incident
*/
@@ -133,7 +134,8 @@ public final class EventProperties implements JsonSerializable
private Boolean enableMicrosoftSupport;
/*
- * Contains the communication message for the event, that could include summary, root cause and other details.
+ * Contains the communication message for the event, that could include summary, root cause and other details. Use
+ * fetchEventDetails endpoint to get description of sensitive events.
*/
private String description;
@@ -180,19 +182,19 @@ public final class EventProperties implements JsonSerializable
private String impactType;
/*
- * Unique identifier for planned maintenance event.
+ * A list of metadata tags associated with the event. Possible values include:
+ * -Action Recommended: Action may be required by you to avoid possible disruptions or mitigate risks for your
+ * services. It is recommended to evaluate these actions and the potential impact on your services.
+ * - False Positive: After investigation, we've determined your service is healthy and service issues did not impact
+ * your services as originally communicated.
+ * - Preliminary PIR: For our largest, most impactful service issues a Preliminary Post Incident Review (PIR) is
+ * published generally within 72 hours of mitigation, to summarize what we have learned so far from the
+ * still-in-progress investigation.
+ * - Final PIR: For service issues, a Final Post Incident Review (PIR) may be published to provide additional
+ * details or learnings. Sometimes this requires us to complete an internal retrospective, generally within 14 days
+ * of mitigation.
*/
- private String maintenanceId;
-
- /*
- * The type of planned maintenance event.
- */
- private String maintenanceType;
-
- /*
- * Azure Resource Graph query to fetch the affected resources from their existing Azure Resource Graph locations.
- */
- private String argQuery;
+ private List eventTags;
/**
* Creates an instance of EventProperties class.
@@ -220,28 +222,6 @@ public EventProperties withEventType(EventTypeValues eventType) {
return this;
}
- /**
- * Get the eventSubType property: Sub type of the event. Currently used to determine retirement communications for
- * health advisory events.
- *
- * @return the eventSubType value.
- */
- public EventSubTypeValues eventSubType() {
- return this.eventSubType;
- }
-
- /**
- * Set the eventSubType property: Sub type of the event. Currently used to determine retirement communications for
- * health advisory events.
- *
- * @param eventSubType the eventSubType value to set.
- * @return the EventProperties object itself.
- */
- public EventProperties withEventSubType(EventSubTypeValues eventSubType) {
- this.eventSubType = eventSubType;
- return this;
- }
-
/**
* Get the eventSource property: Source of event.
*
@@ -303,7 +283,8 @@ public EventProperties withTitle(String title) {
}
/**
- * Get the summary property: Summary text of event.
+ * Get the summary property: Summary text of event. Use fetchEventDetails endpoint to get summary of sensitive
+ * events.
*
* @return the summary value.
*/
@@ -312,7 +293,8 @@ public String summary() {
}
/**
- * Set the summary property: Summary text of event.
+ * Set the summary property: Summary text of event. Use fetchEventDetails endpoint to get summary of sensitive
+ * events.
*
* @param summary the summary value to set.
* @return the EventProperties object itself.
@@ -382,6 +364,30 @@ public EventProperties withEventLevel(EventLevelValues eventLevel) {
return this;
}
+ /**
+ * Get the isEventSensitive property: If true the event may contains sensitive data. Use the post
+ * events/{trackingId}/fetchEventDetails endpoint to fetch sensitive data see
+ * https://learn.microsoft.com/en-us/azure/service-health/security-advisories-elevated-access.
+ *
+ * @return the isEventSensitive value.
+ */
+ public Boolean isEventSensitive() {
+ return this.isEventSensitive;
+ }
+
+ /**
+ * Set the isEventSensitive property: If true the event may contains sensitive data. Use the post
+ * events/{trackingId}/fetchEventDetails endpoint to fetch sensitive data see
+ * https://learn.microsoft.com/en-us/azure/service-health/security-advisories-elevated-access.
+ *
+ * @param isEventSensitive the isEventSensitive value to set.
+ * @return the EventProperties object itself.
+ */
+ public EventProperties withIsEventSensitive(Boolean isEventSensitive) {
+ this.isEventSensitive = isEventSensitive;
+ return this;
+ }
+
/**
* Get the externalIncidentId property: The id of the Incident.
*
@@ -604,7 +610,7 @@ public EventProperties withEnableMicrosoftSupport(Boolean enableMicrosoftSupport
/**
* Get the description property: Contains the communication message for the event, that could include summary, root
- * cause and other details.
+ * cause and other details. Use fetchEventDetails endpoint to get description of sensitive events.
*
* @return the description value.
*/
@@ -614,7 +620,7 @@ public String description() {
/**
* Set the description property: Contains the communication message for the event, that could include summary, root
- * cause and other details.
+ * cause and other details. Use fetchEventDetails endpoint to get description of sensitive events.
*
* @param description the description value to set.
* @return the EventProperties object itself.
@@ -791,64 +797,42 @@ public EventProperties withImpactType(String impactType) {
}
/**
- * Get the maintenanceId property: Unique identifier for planned maintenance event.
- *
- * @return the maintenanceId value.
- */
- public String maintenanceId() {
- return this.maintenanceId;
- }
-
- /**
- * Set the maintenanceId property: Unique identifier for planned maintenance event.
- *
- * @param maintenanceId the maintenanceId value to set.
- * @return the EventProperties object itself.
- */
- public EventProperties withMaintenanceId(String maintenanceId) {
- this.maintenanceId = maintenanceId;
- return this;
- }
-
- /**
- * Get the maintenanceType property: The type of planned maintenance event.
- *
- * @return the maintenanceType value.
- */
- public String maintenanceType() {
- return this.maintenanceType;
- }
-
- /**
- * Set the maintenanceType property: The type of planned maintenance event.
- *
- * @param maintenanceType the maintenanceType value to set.
- * @return the EventProperties object itself.
- */
- public EventProperties withMaintenanceType(String maintenanceType) {
- this.maintenanceType = maintenanceType;
- return this;
- }
-
- /**
- * Get the argQuery property: Azure Resource Graph query to fetch the affected resources from their existing Azure
- * Resource Graph locations.
+ * Get the eventTags property: A list of metadata tags associated with the event. Possible values include:
+ * -Action Recommended: Action may be required by you to avoid possible disruptions or mitigate risks for your
+ * services. It is recommended to evaluate these actions and the potential impact on your services.
+ * - False Positive: After investigation, we've determined your service is healthy and service issues did not impact
+ * your services as originally communicated.
+ * - Preliminary PIR: For our largest, most impactful service issues a Preliminary Post Incident Review (PIR) is
+ * published generally within 72 hours of mitigation, to summarize what we have learned so far from the
+ * still-in-progress investigation.
+ * - Final PIR: For service issues, a Final Post Incident Review (PIR) may be published to provide additional
+ * details or learnings. Sometimes this requires us to complete an internal retrospective, generally within 14 days
+ * of mitigation.
*
- * @return the argQuery value.
+ * @return the eventTags value.
*/
- public String argQuery() {
- return this.argQuery;
+ public List eventTags() {
+ return this.eventTags;
}
/**
- * Set the argQuery property: Azure Resource Graph query to fetch the affected resources from their existing Azure
- * Resource Graph locations.
+ * Set the eventTags property: A list of metadata tags associated with the event. Possible values include:
+ * -Action Recommended: Action may be required by you to avoid possible disruptions or mitigate risks for your
+ * services. It is recommended to evaluate these actions and the potential impact on your services.
+ * - False Positive: After investigation, we've determined your service is healthy and service issues did not impact
+ * your services as originally communicated.
+ * - Preliminary PIR: For our largest, most impactful service issues a Preliminary Post Incident Review (PIR) is
+ * published generally within 72 hours of mitigation, to summarize what we have learned so far from the
+ * still-in-progress investigation.
+ * - Final PIR: For service issues, a Final Post Incident Review (PIR) may be published to provide additional
+ * details or learnings. Sometimes this requires us to complete an internal retrospective, generally within 14 days
+ * of mitigation.
*
- * @param argQuery the argQuery value to set.
+ * @param eventTags the eventTags value to set.
* @return the EventProperties object itself.
*/
- public EventProperties withArgQuery(String argQuery) {
- this.argQuery = argQuery;
+ public EventProperties withEventTags(List eventTags) {
+ this.eventTags = eventTags;
return this;
}
@@ -885,7 +869,6 @@ public void validate() {
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("eventType", this.eventType == null ? null : this.eventType.toString());
- jsonWriter.writeStringField("eventSubType", this.eventSubType == null ? null : this.eventSubType.toString());
jsonWriter.writeStringField("eventSource", this.eventSource == null ? null : this.eventSource.toString());
jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString());
jsonWriter.writeStringField("title", this.title);
@@ -893,6 +876,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStringField("header", this.headerProperty);
jsonWriter.writeStringField("level", this.level == null ? null : this.level.toString());
jsonWriter.writeStringField("eventLevel", this.eventLevel == null ? null : this.eventLevel.toString());
+ jsonWriter.writeBooleanField("isEventSensitive", this.isEventSensitive);
jsonWriter.writeStringField("externalIncidentId", this.externalIncidentId);
jsonWriter.writeStringField("reason", this.reason);
jsonWriter.writeJsonField("article", this.article);
@@ -918,9 +902,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeJsonField("additionalInformation", this.additionalInformation);
jsonWriter.writeNumberField("duration", this.duration);
jsonWriter.writeStringField("impactType", this.impactType);
- jsonWriter.writeStringField("maintenanceId", this.maintenanceId);
- jsonWriter.writeStringField("maintenanceType", this.maintenanceType);
- jsonWriter.writeStringField("argQuery", this.argQuery);
+ jsonWriter.writeArrayField("eventTags", this.eventTags, (writer, element) -> writer.writeString(element));
return jsonWriter.writeEndObject();
}
@@ -941,8 +923,6 @@ public static EventProperties fromJson(JsonReader jsonReader) throws IOException
if ("eventType".equals(fieldName)) {
deserializedEventProperties.eventType = EventTypeValues.fromString(reader.getString());
- } else if ("eventSubType".equals(fieldName)) {
- deserializedEventProperties.eventSubType = EventSubTypeValues.fromString(reader.getString());
} else if ("eventSource".equals(fieldName)) {
deserializedEventProperties.eventSource = EventSourceValues.fromString(reader.getString());
} else if ("status".equals(fieldName)) {
@@ -957,6 +937,8 @@ public static EventProperties fromJson(JsonReader jsonReader) throws IOException
deserializedEventProperties.level = LevelValues.fromString(reader.getString());
} else if ("eventLevel".equals(fieldName)) {
deserializedEventProperties.eventLevel = EventLevelValues.fromString(reader.getString());
+ } else if ("isEventSensitive".equals(fieldName)) {
+ deserializedEventProperties.isEventSensitive = reader.getNullable(JsonReader::getBoolean);
} else if ("externalIncidentId".equals(fieldName)) {
deserializedEventProperties.externalIncidentId = reader.getString();
} else if ("reason".equals(fieldName)) {
@@ -1004,12 +986,9 @@ public static EventProperties fromJson(JsonReader jsonReader) throws IOException
deserializedEventProperties.duration = reader.getNullable(JsonReader::getInt);
} else if ("impactType".equals(fieldName)) {
deserializedEventProperties.impactType = reader.getString();
- } else if ("maintenanceId".equals(fieldName)) {
- deserializedEventProperties.maintenanceId = reader.getString();
- } else if ("maintenanceType".equals(fieldName)) {
- deserializedEventProperties.maintenanceType = reader.getString();
- } else if ("argQuery".equals(fieldName)) {
- deserializedEventProperties.argQuery = reader.getString();
+ } else if ("eventTags".equals(fieldName)) {
+ List eventTags = reader.readArray(reader1 -> reader1.getString());
+ deserializedEventProperties.eventTags = eventTags;
} else {
reader.skipChildren();
}
diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/AvailabilityStatusesClientImpl.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/AvailabilityStatusesClientImpl.java
index bc92739a9149..ea330ad1cdbc 100644
--- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/AvailabilityStatusesClientImpl.java
+++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/AvailabilityStatusesClientImpl.java
@@ -25,6 +25,7 @@
import com.azure.core.management.exception.ManagementException;
import com.azure.core.util.Context;
import com.azure.core.util.FluxUtil;
+import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.resourcehealth.fluent.AvailabilityStatusesClient;
import com.azure.resourcemanager.resourcehealth.fluent.models.AvailabilityStatusInner;
import com.azure.resourcemanager.resourcehealth.models.AvailabilityStatusListResult;
@@ -71,6 +72,15 @@ Mono> listBySubscriptionId(@HostParam("$h
@PathParam("subscriptionId") String subscriptionId, @QueryParam("$expand") String expand,
@HeaderParam("Accept") String accept, Context context);
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/availabilityStatuses")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response listBySubscriptionIdSync(@HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter,
+ @PathParam("subscriptionId") String subscriptionId, @QueryParam("$expand") String expand,
+ @HeaderParam("Accept") String accept, Context context);
+
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ResourceHealth/availabilityStatuses")
@ExpectedResponses({ 200 })
@@ -81,6 +91,16 @@ Mono> listByResourceGroup(@HostParam("$ho
@QueryParam("$filter") String filter, @QueryParam("$expand") String expand,
@HeaderParam("Accept") String accept, Context context);
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ResourceHealth/availabilityStatuses")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response listByResourceGroupSync(@HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion,
+ @QueryParam("$filter") String filter, @QueryParam("$expand") String expand,
+ @HeaderParam("Accept") String accept, Context context);
+
@Headers({ "Content-Type: application/json" })
@Get("/{resourceUri}/providers/Microsoft.ResourceHealth/availabilityStatuses/current")
@ExpectedResponses({ 200 })
@@ -90,6 +110,15 @@ Mono> getByResource(@HostParam("$host") String
@QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter,
@QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context);
+ @Headers({ "Content-Type: application/json" })
+ @Get("/{resourceUri}/providers/Microsoft.ResourceHealth/availabilityStatuses/current")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response getByResourceSync(@HostParam("$host") String endpoint,
+ @PathParam(value = "resourceUri", encoded = true) String resourceUri,
+ @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter,
+ @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context);
+
@Headers({ "Content-Type: application/json" })
@Get("/{resourceUri}/providers/Microsoft.ResourceHealth/availabilityStatuses")
@ExpectedResponses({ 200 })
@@ -99,6 +128,15 @@ Mono> list(@HostParam("$host") String end
@QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter,
@QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context);
+ @Headers({ "Content-Type: application/json" })
+ @Get("/{resourceUri}/providers/Microsoft.ResourceHealth/availabilityStatuses")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response listSync(@HostParam("$host") String endpoint,
+ @PathParam(value = "resourceUri", encoded = true) String resourceUri,
+ @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter,
+ @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context);
+
@Headers({ "Content-Type: application/json" })
@Get("{nextLink}")
@ExpectedResponses({ 200 })
@@ -107,6 +145,14 @@ Mono> listBySubscriptionIdNext(
@PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint,
@HeaderParam("Accept") String accept, Context context);
+ @Headers({ "Content-Type: application/json" })
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response listBySubscriptionIdNextSync(
+ @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept, Context context);
+
@Headers({ "Content-Type: application/json" })
@Get("{nextLink}")
@ExpectedResponses({ 200 })
@@ -115,6 +161,14 @@ Mono> listByResourceGroupNext(
@PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint,
@HeaderParam("Accept") String accept, Context context);
+ @Headers({ "Content-Type: application/json" })
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response listByResourceGroupNextSync(
+ @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept, Context context);
+
@Headers({ "Content-Type: application/json" })
@Get("{nextLink}")
@ExpectedResponses({ 200 })
@@ -122,6 +176,14 @@ Mono> listByResourceGroupNext(
Mono> listNext(
@PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint,
@HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response listNextSync(
+ @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept, Context context);
}
/**
@@ -156,39 +218,6 @@ private Mono> listBySubscriptionIdSingleP
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
- /**
- * Lists the current availability status for all the resources in the subscription.
- *
- * @param filter The filter to apply on the operation. For more information please see
- * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN.
- * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the List availabilityStatus operation response along with {@link PagedResponse} on successful completion
- * of {@link Mono}.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> listBySubscriptionIdSinglePageAsync(String filter,
- String expand, Context context) {
- if (this.client.getEndpoint() == null) {
- return Mono.error(
- new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
- }
- if (this.client.getSubscriptionId() == null) {
- return Mono.error(new IllegalArgumentException(
- "Parameter this.client.getSubscriptionId() is required and cannot be null."));
- }
- final String accept = "application/json";
- context = this.client.mergeContext(context);
- return service
- .listBySubscriptionId(this.client.getEndpoint(), this.client.getApiVersion(), filter,
- this.client.getSubscriptionId(), expand, accept, context)
- .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
- res.getValue().value(), res.getValue().nextLink(), null));
- }
-
/**
* Lists the current availability status for all the resources in the subscription.
*
@@ -221,6 +250,36 @@ private PagedFlux listBySubscriptionIdAsync() {
nextLink -> listBySubscriptionIdNextSinglePageAsync(nextLink));
}
+ /**
+ * Lists the current availability status for all the resources in the subscription.
+ *
+ * @param filter The filter to apply on the operation. For more information please see
+ * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN.
+ * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the List availabilityStatus operation response along with {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listBySubscriptionIdSinglePage(String filter, String expand) {
+ if (this.client.getEndpoint() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ Response res = service.listBySubscriptionIdSync(this.client.getEndpoint(),
+ this.client.getApiVersion(), filter, this.client.getSubscriptionId(), expand, accept, Context.NONE);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
+ }
+
/**
* Lists the current availability status for all the resources in the subscription.
*
@@ -231,13 +290,26 @@ private PagedFlux listBySubscriptionIdAsync() {
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the List availabilityStatus operation response as paginated response with {@link PagedFlux}.
+ * @return the List availabilityStatus operation response along with {@link PagedResponse}.
*/
- @ServiceMethod(returns = ReturnType.COLLECTION)
- private PagedFlux listBySubscriptionIdAsync(String filter, String expand,
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listBySubscriptionIdSinglePage(String filter, String expand,
Context context) {
- return new PagedFlux<>(() -> listBySubscriptionIdSinglePageAsync(filter, expand, context),
- nextLink -> listBySubscriptionIdNextSinglePageAsync(nextLink, context));
+ if (this.client.getEndpoint() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ Response res = service.listBySubscriptionIdSync(this.client.getEndpoint(),
+ this.client.getApiVersion(), filter, this.client.getSubscriptionId(), expand, accept, context);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
}
/**
@@ -251,7 +323,8 @@ private PagedFlux listBySubscriptionIdAsync(String filt
public PagedIterable listBySubscriptionId() {
final String filter = null;
final String expand = null;
- return new PagedIterable<>(listBySubscriptionIdAsync(filter, expand));
+ return new PagedIterable<>(() -> listBySubscriptionIdSinglePage(filter, expand),
+ nextLink -> listBySubscriptionIdNextSinglePage(nextLink));
}
/**
@@ -268,7 +341,8 @@ public PagedIterable listBySubscriptionId() {
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listBySubscriptionId(String filter, String expand, Context context) {
- return new PagedIterable<>(listBySubscriptionIdAsync(filter, expand, context));
+ return new PagedIterable<>(() -> listBySubscriptionIdSinglePage(filter, expand, context),
+ nextLink -> listBySubscriptionIdNextSinglePage(nextLink, context));
}
/**
@@ -316,52 +390,31 @@ private Mono> listByResourceGroupSinglePa
* @param filter The filter to apply on the operation. For more information please see
* https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN.
* @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response.
- * @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the List availabilityStatus operation response along with {@link PagedResponse} on successful completion
- * of {@link Mono}.
+ * @return the List availabilityStatus operation response as paginated response with {@link PagedFlux}.
*/
- @ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName,
- String filter, String expand, Context context) {
- if (this.client.getEndpoint() == null) {
- return Mono.error(
- new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
- }
- if (this.client.getSubscriptionId() == null) {
- return Mono.error(new IllegalArgumentException(
- "Parameter this.client.getSubscriptionId() is required and cannot be null."));
- }
- if (resourceGroupName == null) {
- return Mono
- .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
- }
- final String accept = "application/json";
- context = this.client.mergeContext(context);
- return service
- .listByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
- this.client.getApiVersion(), filter, expand, accept, context)
- .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
- res.getValue().value(), res.getValue().nextLink(), null));
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter,
+ String expand) {
+ return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, expand),
+ nextLink -> listByResourceGroupNextSinglePageAsync(nextLink));
}
/**
* Lists the current availability status for all the resources in the resource group.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param filter The filter to apply on the operation. For more information please see
- * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN.
- * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the List availabilityStatus operation response as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
- private PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter,
- String expand) {
+ private PagedFlux listByResourceGroupAsync(String resourceGroupName) {
+ final String filter = null;
+ final String expand = null;
return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, expand),
nextLink -> listByResourceGroupNextSinglePageAsync(nextLink));
}
@@ -370,17 +423,37 @@ private PagedFlux listByResourceGroupAsync(String resou
* Lists the current availability status for all the resources in the resource group.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param filter The filter to apply on the operation. For more information please see
+ * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN.
+ * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the List availabilityStatus operation response as paginated response with {@link PagedFlux}.
+ * @return the List availabilityStatus operation response along with {@link PagedResponse}.
*/
- @ServiceMethod(returns = ReturnType.COLLECTION)
- private PagedFlux listByResourceGroupAsync(String resourceGroupName) {
- final String filter = null;
- final String expand = null;
- return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, expand),
- nextLink -> listByResourceGroupNextSinglePageAsync(nextLink));
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listByResourceGroupSinglePage(String resourceGroupName,
+ String filter, String expand) {
+ if (this.client.getEndpoint() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ Response res
+ = service.listByResourceGroupSync(this.client.getEndpoint(), this.client.getSubscriptionId(),
+ resourceGroupName, this.client.getApiVersion(), filter, expand, accept, Context.NONE);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
}
/**
@@ -394,13 +467,31 @@ private PagedFlux listByResourceGroupAsync(String resou
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the List availabilityStatus operation response as paginated response with {@link PagedFlux}.
+ * @return the List availabilityStatus operation response along with {@link PagedResponse}.
*/
- @ServiceMethod(returns = ReturnType.COLLECTION)
- private PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter,
- String expand, Context context) {
- return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, expand, context),
- nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context));
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listByResourceGroupSinglePage(String resourceGroupName,
+ String filter, String expand, Context context) {
+ if (this.client.getEndpoint() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ Response res
+ = service.listByResourceGroupSync(this.client.getEndpoint(), this.client.getSubscriptionId(),
+ resourceGroupName, this.client.getApiVersion(), filter, expand, accept, context);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
}
/**
@@ -416,7 +507,8 @@ private PagedFlux listByResourceGroupAsync(String resou
public PagedIterable listByResourceGroup(String resourceGroupName) {
final String filter = null;
final String expand = null;
- return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, expand));
+ return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, filter, expand),
+ nextLink -> listByResourceGroupNextSinglePage(nextLink));
}
/**
@@ -435,7 +527,8 @@ public PagedIterable listByResourceGroup(String resourc
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listByResourceGroup(String resourceGroupName, String filter,
String expand, Context context) {
- return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, expand, context));
+ return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, filter, expand, context),
+ nextLink -> listByResourceGroupNextSinglePage(nextLink, context));
}
/**
@@ -472,40 +565,6 @@ private Mono> getByResourceWithResponseAsync(S
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
- /**
- * Gets current availability status for a single resource.
- *
- * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type.
- * Currently the API support not nested and one nesting level resource types :
- * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}
- * and
- * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}.
- * @param filter The filter to apply on the operation. For more information please see
- * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN.
- * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return current availability status for a single resource along with {@link Response} on successful completion of
- * {@link Mono}.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> getByResourceWithResponseAsync(String resourceUri, String filter,
- String expand, Context context) {
- if (this.client.getEndpoint() == null) {
- return Mono.error(
- new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
- }
- if (resourceUri == null) {
- return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null."));
- }
- final String accept = "application/json";
- context = this.client.mergeContext(context);
- return service.getByResource(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), filter,
- expand, accept, context);
- }
-
/**
* Gets current availability status for a single resource.
*
@@ -547,7 +606,18 @@ private Mono getByResourceAsync(String resourceUri) {
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getByResourceWithResponse(String resourceUri, String filter, String expand,
Context context) {
- return getByResourceWithResponseAsync(resourceUri, filter, expand, context).block();
+ if (this.client.getEndpoint() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (resourceUri == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter resourceUri is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return service.getByResourceSync(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), filter,
+ expand, accept, context);
}
/**
@@ -617,29 +687,15 @@ private Mono> listSinglePageAsync(String
* @param filter The filter to apply on the operation. For more information please see
* https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN.
* @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response.
- * @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the List availabilityStatus operation response along with {@link PagedResponse} on successful completion
- * of {@link Mono}.
+ * @return the List availabilityStatus operation response as paginated response with {@link PagedFlux}.
*/
- @ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> listSinglePageAsync(String resourceUri, String filter,
- String expand, Context context) {
- if (this.client.getEndpoint() == null) {
- return Mono.error(
- new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
- }
- if (resourceUri == null) {
- return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null."));
- }
- final String accept = "application/json";
- context = this.client.mergeContext(context);
- return service
- .list(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), filter, expand, accept, context)
- .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
- res.getValue().value(), res.getValue().nextLink(), null));
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(String resourceUri, String filter, String expand) {
+ return new PagedFlux<>(() -> listSinglePageAsync(resourceUri, filter, expand),
+ nextLink -> listNextSinglePageAsync(nextLink));
}
/**
@@ -650,16 +706,15 @@ private Mono> listSinglePageAsync(String
* /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}
* and
* /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}.
- * @param filter The filter to apply on the operation. For more information please see
- * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN.
- * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the List availabilityStatus operation response as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
- private PagedFlux listAsync(String resourceUri, String filter, String expand) {
+ private PagedFlux listAsync(String resourceUri) {
+ final String filter = null;
+ final String expand = null;
return new PagedFlux<>(() -> listSinglePageAsync(resourceUri, filter, expand),
nextLink -> listNextSinglePageAsync(nextLink));
}
@@ -672,17 +727,30 @@ private PagedFlux listAsync(String resourceUri, String
* /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}
* and
* /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}.
+ * @param filter The filter to apply on the operation. For more information please see
+ * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN.
+ * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the List availabilityStatus operation response as paginated response with {@link PagedFlux}.
+ * @return the List availabilityStatus operation response along with {@link PagedResponse}.
*/
- @ServiceMethod(returns = ReturnType.COLLECTION)
- private PagedFlux listAsync(String resourceUri) {
- final String filter = null;
- final String expand = null;
- return new PagedFlux<>(() -> listSinglePageAsync(resourceUri, filter, expand),
- nextLink -> listNextSinglePageAsync(nextLink));
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listSinglePage(String resourceUri, String filter, String expand) {
+ if (this.client.getEndpoint() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (resourceUri == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter resourceUri is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ Response res = service.listSync(this.client.getEndpoint(), resourceUri,
+ this.client.getApiVersion(), filter, expand, accept, Context.NONE);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
}
/**
@@ -700,13 +768,25 @@ private PagedFlux listAsync(String resourceUri) {
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the List availabilityStatus operation response as paginated response with {@link PagedFlux}.
+ * @return the List availabilityStatus operation response along with {@link PagedResponse}.
*/
- @ServiceMethod(returns = ReturnType.COLLECTION)
- private PagedFlux listAsync(String resourceUri, String filter, String expand,
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listSinglePage(String resourceUri, String filter, String expand,
Context context) {
- return new PagedFlux<>(() -> listSinglePageAsync(resourceUri, filter, expand, context),
- nextLink -> listNextSinglePageAsync(nextLink, context));
+ if (this.client.getEndpoint() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (resourceUri == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter resourceUri is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ Response res = service.listSync(this.client.getEndpoint(), resourceUri,
+ this.client.getApiVersion(), filter, expand, accept, context);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
}
/**
@@ -726,7 +806,8 @@ private PagedFlux listAsync(String resourceUri, String
public PagedIterable list(String resourceUri) {
final String filter = null;
final String expand = null;
- return new PagedIterable<>(listAsync(resourceUri, filter, expand));
+ return new PagedIterable<>(() -> listSinglePage(resourceUri, filter, expand),
+ nextLink -> listNextSinglePage(nextLink));
}
/**
@@ -749,7 +830,8 @@ public PagedIterable list(String resourceUri) {
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable list(String resourceUri, String filter, String expand,
Context context) {
- return new PagedIterable<>(listAsync(resourceUri, filter, expand, context));
+ return new PagedIterable<>(() -> listSinglePage(resourceUri, filter, expand, context),
+ nextLink -> listNextSinglePage(nextLink, context));
}
/**
@@ -780,6 +862,33 @@ private Mono> listBySubscriptionIdNextSin
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the List availabilityStatus operation response along with {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listBySubscriptionIdNextSinglePage(String nextLink) {
+ if (nextLink == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ Response res
+ = service.listBySubscriptionIdNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
+ }
+
/**
* Get the next page of items.
*
@@ -788,24 +897,25 @@ private Mono> listBySubscriptionIdNextSin
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the List availabilityStatus operation response along with {@link PagedResponse} on successful completion
- * of {@link Mono}.
+ * @return the List availabilityStatus operation response along with {@link PagedResponse}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> listBySubscriptionIdNextSinglePageAsync(String nextLink,
+ private PagedResponse listBySubscriptionIdNextSinglePage(String nextLink,
Context context) {
if (nextLink == null) {
- return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
}
if (this.client.getEndpoint() == null) {
- return Mono.error(
- new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
}
final String accept = "application/json";
- context = this.client.mergeContext(context);
- return service.listBySubscriptionIdNext(nextLink, this.client.getEndpoint(), accept, context)
- .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
- res.getValue().value(), res.getValue().nextLink(), null));
+ Response res
+ = service.listBySubscriptionIdNextSync(nextLink, this.client.getEndpoint(), accept, context);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
}
/**
@@ -836,6 +946,33 @@ private Mono> listByResourceGroupNextSing
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the List availabilityStatus operation response along with {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listByResourceGroupNextSinglePage(String nextLink) {
+ if (nextLink == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ Response res
+ = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
+ }
+
/**
* Get the next page of items.
*
@@ -844,24 +981,24 @@ private Mono> listByResourceGroupNextSing
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the List availabilityStatus operation response along with {@link PagedResponse} on successful completion
- * of {@link Mono}.
+ * @return the List availabilityStatus operation response along with {@link PagedResponse}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> listByResourceGroupNextSinglePageAsync(String nextLink,
- Context context) {
+ private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) {
if (nextLink == null) {
- return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
}
if (this.client.getEndpoint() == null) {
- return Mono.error(
- new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
}
final String accept = "application/json";
- context = this.client.mergeContext(context);
- return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)
- .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
- res.getValue().value(), res.getValue().nextLink(), null));
+ Response res
+ = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
}
/**
@@ -890,6 +1027,33 @@ private Mono> listNextSinglePageAsync(Str
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the List availabilityStatus operation response along with {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listNextSinglePage(String nextLink) {
+ if (nextLink == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ Response res
+ = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
+ }
+
/**
* Get the next page of items.
*
@@ -898,22 +1062,25 @@ private Mono> listNextSinglePageAsync(Str
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the List availabilityStatus operation response along with {@link PagedResponse} on successful completion
- * of {@link Mono}.
+ * @return the List availabilityStatus operation response along with {@link PagedResponse}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> listNextSinglePageAsync(String nextLink, Context context) {
+ private PagedResponse listNextSinglePage(String nextLink, Context context) {
if (nextLink == null) {
- return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
}
if (this.client.getEndpoint() == null) {
- return Mono.error(
- new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
}
final String accept = "application/json";
- context = this.client.mergeContext(context);
- return service.listNext(nextLink, this.client.getEndpoint(), accept, context)
- .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
- res.getValue().value(), res.getValue().nextLink(), null));
+ Response res
+ = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
}
+
+ private static final ClientLogger LOGGER = new ClientLogger(AvailabilityStatusesClientImpl.class);
}
diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/ChildAvailabilityStatusesClientImpl.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/ChildAvailabilityStatusesClientImpl.java
index 08998a98a13d..2394a0079dc4 100644
--- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/ChildAvailabilityStatusesClientImpl.java
+++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/ChildAvailabilityStatusesClientImpl.java
@@ -25,6 +25,7 @@
import com.azure.core.management.exception.ManagementException;
import com.azure.core.util.Context;
import com.azure.core.util.FluxUtil;
+import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.resourcehealth.fluent.ChildAvailabilityStatusesClient;
import com.azure.resourcemanager.resourcehealth.fluent.models.AvailabilityStatusInner;
import com.azure.resourcemanager.resourcehealth.models.AvailabilityStatusListResult;
@@ -71,6 +72,15 @@ Mono> getByResource(@HostParam("$host") String
@QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter,
@QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context);
+ @Headers({ "Content-Type: application/json" })
+ @Get("/{resourceUri}/providers/Microsoft.ResourceHealth/childAvailabilityStatuses/current")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response getByResourceSync(@HostParam("$host") String endpoint,
+ @PathParam(value = "resourceUri", encoded = true) String resourceUri,
+ @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter,
+ @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context);
+
@Headers({ "Content-Type: application/json" })
@Get("/{resourceUri}/providers/Microsoft.ResourceHealth/childAvailabilityStatuses")
@ExpectedResponses({ 200 })
@@ -80,6 +90,15 @@ Mono> list(@HostParam("$host") String end
@QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter,
@QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context);
+ @Headers({ "Content-Type: application/json" })
+ @Get("/{resourceUri}/providers/Microsoft.ResourceHealth/childAvailabilityStatuses")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response listSync(@HostParam("$host") String endpoint,
+ @PathParam(value = "resourceUri", encoded = true) String resourceUri,
+ @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter,
+ @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context);
+
@Headers({ "Content-Type: application/json" })
@Get("{nextLink}")
@ExpectedResponses({ 200 })
@@ -87,6 +106,14 @@ Mono> list(@HostParam("$host") String end
Mono> listNext(
@PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint,
@HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response listNextSync(
+ @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept, Context context);
}
/**
@@ -121,38 +148,6 @@ private Mono> getByResourceWithResponseAsync(S
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
- /**
- * Gets current availability status for a single resource.
- *
- * @param resourceUri The fully qualified ID of the resource, including the resource name and resource type.
- * Currently the API only support one nesting level resource types :
- * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}.
- * @param filter The filter to apply on the operation. For more information please see
- * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN.
- * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return current availability status for a single resource along with {@link Response} on successful completion of
- * {@link Mono}.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> getByResourceWithResponseAsync(String resourceUri, String filter,
- String expand, Context context) {
- if (this.client.getEndpoint() == null) {
- return Mono.error(
- new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
- }
- if (resourceUri == null) {
- return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null."));
- }
- final String accept = "application/json";
- context = this.client.mergeContext(context);
- return service.getByResource(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), filter,
- expand, accept, context);
- }
-
/**
* Gets current availability status for a single resource.
*
@@ -190,7 +185,18 @@ private Mono getByResourceAsync(String resourceUri) {
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getByResourceWithResponse(String resourceUri, String filter, String expand,
Context context) {
- return getByResourceWithResponseAsync(resourceUri, filter, expand, context).block();
+ if (this.client.getEndpoint() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (resourceUri == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter resourceUri is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return service.getByResourceSync(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), filter,
+ expand, accept, context);
}
/**
@@ -256,29 +262,15 @@ private Mono> listSinglePageAsync(String
* @param filter The filter to apply on the operation. For more information please see
* https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN.
* @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response.
- * @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the List availabilityStatus operation response along with {@link PagedResponse} on successful completion
- * of {@link Mono}.
+ * @return the List availabilityStatus operation response as paginated response with {@link PagedFlux}.
*/
- @ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> listSinglePageAsync(String resourceUri, String filter,
- String expand, Context context) {
- if (this.client.getEndpoint() == null) {
- return Mono.error(
- new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
- }
- if (resourceUri == null) {
- return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null."));
- }
- final String accept = "application/json";
- context = this.client.mergeContext(context);
- return service
- .list(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), filter, expand, accept, context)
- .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
- res.getValue().value(), res.getValue().nextLink(), null));
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(String resourceUri, String filter, String expand) {
+ return new PagedFlux<>(() -> listSinglePageAsync(resourceUri, filter, expand),
+ nextLink -> listNextSinglePageAsync(nextLink));
}
/**
@@ -288,16 +280,15 @@ private Mono> listSinglePageAsync(String
* @param resourceUri The fully qualified ID of the resource, including the resource name and resource type.
* Currently the API only support one nesting level resource types :
* /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}.
- * @param filter The filter to apply on the operation. For more information please see
- * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN.
- * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the List availabilityStatus operation response as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
- private PagedFlux listAsync(String resourceUri, String filter, String expand) {
+ private PagedFlux listAsync(String resourceUri) {
+ final String filter = null;
+ final String expand = null;
return new PagedFlux<>(() -> listSinglePageAsync(resourceUri, filter, expand),
nextLink -> listNextSinglePageAsync(nextLink));
}
@@ -309,17 +300,30 @@ private PagedFlux listAsync(String resourceUri, String
* @param resourceUri The fully qualified ID of the resource, including the resource name and resource type.
* Currently the API only support one nesting level resource types :
* /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}.
+ * @param filter The filter to apply on the operation. For more information please see
+ * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN.
+ * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the List availabilityStatus operation response as paginated response with {@link PagedFlux}.
+ * @return the List availabilityStatus operation response along with {@link PagedResponse}.
*/
- @ServiceMethod(returns = ReturnType.COLLECTION)
- private PagedFlux listAsync(String resourceUri) {
- final String filter = null;
- final String expand = null;
- return new PagedFlux<>(() -> listSinglePageAsync(resourceUri, filter, expand),
- nextLink -> listNextSinglePageAsync(nextLink));
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listSinglePage(String resourceUri, String filter, String expand) {
+ if (this.client.getEndpoint() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (resourceUri == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter resourceUri is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ Response res = service.listSync(this.client.getEndpoint(), resourceUri,
+ this.client.getApiVersion(), filter, expand, accept, Context.NONE);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
}
/**
@@ -336,13 +340,25 @@ private PagedFlux listAsync(String resourceUri) {
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the List availabilityStatus operation response as paginated response with {@link PagedFlux}.
+ * @return the List availabilityStatus operation response along with {@link PagedResponse}.
*/
- @ServiceMethod(returns = ReturnType.COLLECTION)
- private PagedFlux listAsync(String resourceUri, String filter, String expand,
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listSinglePage(String resourceUri, String filter, String expand,
Context context) {
- return new PagedFlux<>(() -> listSinglePageAsync(resourceUri, filter, expand, context),
- nextLink -> listNextSinglePageAsync(nextLink, context));
+ if (this.client.getEndpoint() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (resourceUri == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter resourceUri is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ Response res = service.listSync(this.client.getEndpoint(), resourceUri,
+ this.client.getApiVersion(), filter, expand, accept, context);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
}
/**
@@ -361,7 +377,8 @@ private PagedFlux listAsync(String resourceUri, String
public PagedIterable list(String resourceUri) {
final String filter = null;
final String expand = null;
- return new PagedIterable<>(listAsync(resourceUri, filter, expand));
+ return new PagedIterable<>(() -> listSinglePage(resourceUri, filter, expand),
+ nextLink -> listNextSinglePage(nextLink));
}
/**
@@ -383,7 +400,8 @@ public PagedIterable list(String resourceUri) {
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable list(String resourceUri, String filter, String expand,
Context context) {
- return new PagedIterable<>(listAsync(resourceUri, filter, expand, context));
+ return new PagedIterable<>(() -> listSinglePage(resourceUri, filter, expand, context),
+ nextLink -> listNextSinglePage(nextLink, context));
}
/**
@@ -412,6 +430,33 @@ private Mono> listNextSinglePageAsync(Str
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the List availabilityStatus operation response along with {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listNextSinglePage(String nextLink) {
+ if (nextLink == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ Response res
+ = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
+ }
+
/**
* Get the next page of items.
*
@@ -420,22 +465,25 @@ private Mono> listNextSinglePageAsync(Str
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the List availabilityStatus operation response along with {@link PagedResponse} on successful completion
- * of {@link Mono}.
+ * @return the List availabilityStatus operation response along with {@link PagedResponse}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> listNextSinglePageAsync(String nextLink, Context context) {
+ private PagedResponse listNextSinglePage(String nextLink, Context context) {
if (nextLink == null) {
- return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
}
if (this.client.getEndpoint() == null) {
- return Mono.error(
- new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
}
final String accept = "application/json";
- context = this.client.mergeContext(context);
- return service.listNext(nextLink, this.client.getEndpoint(), accept, context)
- .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
- res.getValue().value(), res.getValue().nextLink(), null));
+ Response res
+ = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
}
+
+ private static final ClientLogger LOGGER = new ClientLogger(ChildAvailabilityStatusesClientImpl.class);
}
diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/ChildResourcesClientImpl.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/ChildResourcesClientImpl.java
index e6b1c9604736..3978a89c5d82 100644
--- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/ChildResourcesClientImpl.java
+++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/ChildResourcesClientImpl.java
@@ -25,6 +25,7 @@
import com.azure.core.management.exception.ManagementException;
import com.azure.core.util.Context;
import com.azure.core.util.FluxUtil;
+import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.resourcehealth.fluent.ChildResourcesClient;
import com.azure.resourcemanager.resourcehealth.fluent.models.AvailabilityStatusInner;
import com.azure.resourcemanager.resourcehealth.models.AvailabilityStatusListResult;
@@ -71,6 +72,15 @@ Mono> list(@HostParam("$host") String end
@QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter,
@QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context);
+ @Headers({ "Content-Type: application/json" })
+ @Get("/{resourceUri}/providers/Microsoft.ResourceHealth/childResources")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response listSync(@HostParam("$host") String endpoint,
+ @PathParam(value = "resourceUri", encoded = true) String resourceUri,
+ @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter,
+ @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context);
+
@Headers({ "Content-Type: application/json" })
@Get("{nextLink}")
@ExpectedResponses({ 200 })
@@ -78,6 +88,14 @@ Mono> list(@HostParam("$host") String end
Mono> listNext(
@PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint,
@HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response listNextSync(
+ @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept, Context context);
}
/**
@@ -125,29 +143,15 @@ private Mono> listSinglePageAsync(String
* @param filter The filter to apply on the operation. For more information please see
* https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN.
* @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response.
- * @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the List availabilityStatus operation response along with {@link PagedResponse} on successful completion
- * of {@link Mono}.
+ * @return the List availabilityStatus operation response as paginated response with {@link PagedFlux}.
*/
- @ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> listSinglePageAsync(String resourceUri, String filter,
- String expand, Context context) {
- if (this.client.getEndpoint() == null) {
- return Mono.error(
- new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
- }
- if (resourceUri == null) {
- return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null."));
- }
- final String accept = "application/json";
- context = this.client.mergeContext(context);
- return service
- .list(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), filter, expand, accept, context)
- .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
- res.getValue().value(), res.getValue().nextLink(), null));
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(String resourceUri, String filter, String expand) {
+ return new PagedFlux<>(() -> listSinglePageAsync(resourceUri, filter, expand),
+ nextLink -> listNextSinglePageAsync(nextLink));
}
/**
@@ -157,16 +161,15 @@ private Mono> listSinglePageAsync(String
* @param resourceUri The fully qualified ID of the resource, including the resource name and resource type.
* Currently the API only support not nested parent resource type:
* /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}.
- * @param filter The filter to apply on the operation. For more information please see
- * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN.
- * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the List availabilityStatus operation response as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
- private PagedFlux listAsync(String resourceUri, String filter, String expand) {
+ private PagedFlux listAsync(String resourceUri) {
+ final String filter = null;
+ final String expand = null;
return new PagedFlux<>(() -> listSinglePageAsync(resourceUri, filter, expand),
nextLink -> listNextSinglePageAsync(nextLink));
}
@@ -178,17 +181,30 @@ private PagedFlux listAsync(String resourceUri, String
* @param resourceUri The fully qualified ID of the resource, including the resource name and resource type.
* Currently the API only support not nested parent resource type:
* /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}.
+ * @param filter The filter to apply on the operation. For more information please see
+ * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN.
+ * @param expand Setting $expand=recommendedactions in url query expands the recommendedactions in the response.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the List availabilityStatus operation response as paginated response with {@link PagedFlux}.
+ * @return the List availabilityStatus operation response along with {@link PagedResponse}.
*/
- @ServiceMethod(returns = ReturnType.COLLECTION)
- private PagedFlux listAsync(String resourceUri) {
- final String filter = null;
- final String expand = null;
- return new PagedFlux<>(() -> listSinglePageAsync(resourceUri, filter, expand),
- nextLink -> listNextSinglePageAsync(nextLink));
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listSinglePage(String resourceUri, String filter, String expand) {
+ if (this.client.getEndpoint() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (resourceUri == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter resourceUri is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ Response res = service.listSync(this.client.getEndpoint(), resourceUri,
+ this.client.getApiVersion(), filter, expand, accept, Context.NONE);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
}
/**
@@ -205,13 +221,25 @@ private PagedFlux listAsync(String resourceUri) {
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the List availabilityStatus operation response as paginated response with {@link PagedFlux}.
+ * @return the List availabilityStatus operation response along with {@link PagedResponse}.
*/
- @ServiceMethod(returns = ReturnType.COLLECTION)
- private PagedFlux listAsync(String resourceUri, String filter, String expand,
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listSinglePage(String resourceUri, String filter, String expand,
Context context) {
- return new PagedFlux<>(() -> listSinglePageAsync(resourceUri, filter, expand, context),
- nextLink -> listNextSinglePageAsync(nextLink, context));
+ if (this.client.getEndpoint() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (resourceUri == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter resourceUri is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ Response res = service.listSync(this.client.getEndpoint(), resourceUri,
+ this.client.getApiVersion(), filter, expand, accept, context);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
}
/**
@@ -230,7 +258,8 @@ private PagedFlux listAsync(String resourceUri, String
public PagedIterable list(String resourceUri) {
final String filter = null;
final String expand = null;
- return new PagedIterable<>(listAsync(resourceUri, filter, expand));
+ return new PagedIterable<>(() -> listSinglePage(resourceUri, filter, expand),
+ nextLink -> listNextSinglePage(nextLink));
}
/**
@@ -252,7 +281,8 @@ public PagedIterable list(String resourceUri) {
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable list(String resourceUri, String filter, String expand,
Context context) {
- return new PagedIterable<>(listAsync(resourceUri, filter, expand, context));
+ return new PagedIterable<>(() -> listSinglePage(resourceUri, filter, expand, context),
+ nextLink -> listNextSinglePage(nextLink, context));
}
/**
@@ -281,6 +311,33 @@ private Mono> listNextSinglePageAsync(Str
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the List availabilityStatus operation response along with {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listNextSinglePage(String nextLink) {
+ if (nextLink == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ Response res
+ = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
+ }
+
/**
* Get the next page of items.
*
@@ -289,22 +346,25 @@ private Mono> listNextSinglePageAsync(Str
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the List availabilityStatus operation response along with {@link PagedResponse} on successful completion
- * of {@link Mono}.
+ * @return the List availabilityStatus operation response along with {@link PagedResponse}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> listNextSinglePageAsync(String nextLink, Context context) {
+ private PagedResponse listNextSinglePage(String nextLink, Context context) {
if (nextLink == null) {
- return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
}
if (this.client.getEndpoint() == null) {
- return Mono.error(
- new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
}
final String accept = "application/json";
- context = this.client.mergeContext(context);
- return service.listNext(nextLink, this.client.getEndpoint(), accept, context)
- .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
- res.getValue().value(), res.getValue().nextLink(), null));
+ Response res
+ = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
}
+
+ private static final ClientLogger LOGGER = new ClientLogger(ChildResourcesClientImpl.class);
}
diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EmergingIssuesClientImpl.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EmergingIssuesClientImpl.java
index 5c0566f5bf14..882f8adc50a1 100644
--- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EmergingIssuesClientImpl.java
+++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EmergingIssuesClientImpl.java
@@ -25,6 +25,7 @@
import com.azure.core.management.exception.ManagementException;
import com.azure.core.util.Context;
import com.azure.core.util.FluxUtil;
+import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.resourcehealth.fluent.EmergingIssuesClient;
import com.azure.resourcemanager.resourcehealth.fluent.models.EmergingIssuesGetResultInner;
import com.azure.resourcemanager.resourcehealth.models.EmergingIssueListResult;
@@ -70,6 +71,13 @@ public interface EmergingIssuesService {
Mono> list(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
+ @Headers({ "Content-Type: application/json" })
+ @Get("/providers/Microsoft.ResourceHealth/emergingIssues")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response listSync(@HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
+
@Headers({ "Content-Type: application/json" })
@Get("/providers/Microsoft.ResourceHealth/emergingIssues/{issueName}")
@ExpectedResponses({ 200 })
@@ -78,12 +86,27 @@ Mono> get(@HostParam("$host") String endp
@PathParam("issueName") IssueNameParameter issueName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, Context context);
+ @Headers({ "Content-Type: application/json" })
+ @Get("/providers/Microsoft.ResourceHealth/emergingIssues/{issueName}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response getSync(@HostParam("$host") String endpoint,
+ @PathParam("issueName") IssueNameParameter issueName, @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept, Context context);
+
@Headers({ "Content-Type: application/json" })
@Get("{nextLink}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink,
@HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context);
}
/**
@@ -111,23 +134,13 @@ private Mono> listSinglePageAsync()
/**
* Lists Azure services' emerging issues.
*
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the list of emerging issues along with {@link PagedResponse} on successful completion of {@link Mono}.
+ * @return the list of emerging issues as paginated response with {@link PagedFlux}.
*/
- @ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> listSinglePageAsync(Context context) {
- if (this.client.getEndpoint() == null) {
- return Mono.error(
- new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
- }
- final String accept = "application/json";
- context = this.client.mergeContext(context);
- return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)
- .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
- res.getValue().value(), res.getValue().nextLink(), null));
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync() {
+ return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink));
}
/**
@@ -135,11 +148,20 @@ private Mono> listSinglePageAsync(Co
*
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the list of emerging issues as paginated response with {@link PagedFlux}.
+ * @return the list of emerging issues along with {@link PagedResponse}.
*/
- @ServiceMethod(returns = ReturnType.COLLECTION)
- private PagedFlux listAsync() {
- return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink));
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listSinglePage() {
+ if (this.client.getEndpoint() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ Response res
+ = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, Context.NONE);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
}
/**
@@ -149,12 +171,20 @@ private PagedFlux listAsync() {
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the list of emerging issues as paginated response with {@link PagedFlux}.
+ * @return the list of emerging issues along with {@link PagedResponse}.
*/
- @ServiceMethod(returns = ReturnType.COLLECTION)
- private PagedFlux listAsync(Context context) {
- return new PagedFlux<>(() -> listSinglePageAsync(context),
- nextLink -> listNextSinglePageAsync(nextLink, context));
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listSinglePage(Context context) {
+ if (this.client.getEndpoint() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ Response res
+ = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
}
/**
@@ -166,7 +196,7 @@ private PagedFlux listAsync(Context context) {
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable list() {
- return new PagedIterable<>(listAsync());
+ return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink));
}
/**
@@ -180,7 +210,7 @@ public PagedIterable list() {
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable list(Context context) {
- return new PagedIterable<>(listAsync(context));
+ return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context));
}
/**
@@ -207,31 +237,6 @@ private Mono> getWithResponseAsync(IssueN
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
- /**
- * Gets Azure services' emerging issues.
- *
- * @param issueName The name of the emerging issue.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return azure services' emerging issues along with {@link Response} on successful completion of {@link Mono}.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> getWithResponseAsync(IssueNameParameter issueName,
- Context context) {
- if (this.client.getEndpoint() == null) {
- return Mono.error(
- new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
- }
- if (issueName == null) {
- return Mono.error(new IllegalArgumentException("Parameter issueName is required and cannot be null."));
- }
- final String accept = "application/json";
- context = this.client.mergeContext(context);
- return service.get(this.client.getEndpoint(), issueName, this.client.getApiVersion(), accept, context);
- }
-
/**
* Gets Azure services' emerging issues.
*
@@ -258,7 +263,17 @@ private Mono getAsync(IssueNameParameter issueName
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getWithResponse(IssueNameParameter issueName, Context context) {
- return getWithResponseAsync(issueName, context).block();
+ if (this.client.getEndpoint() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (issueName == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter issueName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return service.getSync(this.client.getEndpoint(), issueName, this.client.getApiVersion(), accept, context);
}
/**
@@ -300,6 +315,33 @@ private Mono> listNextSinglePageAsyn
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the list of emerging issues along with {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listNextSinglePage(String nextLink) {
+ if (nextLink == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ Response res
+ = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
+ }
+
/**
* Get the next page of items.
*
@@ -308,22 +350,25 @@ private Mono> listNextSinglePageAsyn
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the list of emerging issues along with {@link PagedResponse} on successful completion of {@link Mono}.
+ * @return the list of emerging issues along with {@link PagedResponse}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> listNextSinglePageAsync(String nextLink,
- Context context) {
+ private PagedResponse listNextSinglePage(String nextLink, Context context) {
if (nextLink == null) {
- return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
}
if (this.client.getEndpoint() == null) {
- return Mono.error(
- new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
}
final String accept = "application/json";
- context = this.client.mergeContext(context);
- return service.listNext(nextLink, this.client.getEndpoint(), accept, context)
- .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
- res.getValue().value(), res.getValue().nextLink(), null));
+ Response res
+ = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
}
+
+ private static final ClientLogger LOGGER = new ClientLogger(EmergingIssuesClientImpl.class);
}
diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EventImpactedResourceImpl.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EventImpactedResourceImpl.java
index 6320d53e5ab2..75746bba5df8 100644
--- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EventImpactedResourceImpl.java
+++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EventImpactedResourceImpl.java
@@ -50,26 +50,6 @@ public String targetRegion() {
return this.innerModel().targetRegion();
}
- public String resourceName() {
- return this.innerModel().resourceName();
- }
-
- public String resourceGroup() {
- return this.innerModel().resourceGroup();
- }
-
- public String status() {
- return this.innerModel().status();
- }
-
- public String maintenanceStartTime() {
- return this.innerModel().maintenanceStartTime();
- }
-
- public String maintenanceEndTime() {
- return this.innerModel().maintenanceEndTime();
- }
-
public List info() {
List inner = this.innerModel().info();
if (inner != null) {
diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EventImpl.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EventImpl.java
index 94ccd1b69e59..ed5b5b130af4 100644
--- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EventImpl.java
+++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EventImpl.java
@@ -13,7 +13,6 @@
import com.azure.resourcemanager.resourcehealth.models.EventPropertiesRecommendedActions;
import com.azure.resourcemanager.resourcehealth.models.EventSourceValues;
import com.azure.resourcemanager.resourcehealth.models.EventStatusValues;
-import com.azure.resourcemanager.resourcehealth.models.EventSubTypeValues;
import com.azure.resourcemanager.resourcehealth.models.EventTypeValues;
import com.azure.resourcemanager.resourcehealth.models.Faq;
import com.azure.resourcemanager.resourcehealth.models.Impact;
@@ -53,10 +52,6 @@ public EventTypeValues eventType() {
return this.innerModel().eventType();
}
- public EventSubTypeValues eventSubType() {
- return this.innerModel().eventSubType();
- }
-
public EventSourceValues eventSource() {
return this.innerModel().eventSource();
}
@@ -85,6 +80,10 @@ public EventLevelValues eventLevel() {
return this.innerModel().eventLevel();
}
+ public Boolean isEventSensitive() {
+ return this.innerModel().isEventSensitive();
+ }
+
public String externalIncidentId() {
return this.innerModel().externalIncidentId();
}
@@ -180,16 +179,13 @@ public String impactType() {
return this.innerModel().impactType();
}
- public String maintenanceId() {
- return this.innerModel().maintenanceId();
- }
-
- public String maintenanceType() {
- return this.innerModel().maintenanceType();
- }
-
- public String argQuery() {
- return this.innerModel().argQuery();
+ public List eventTags() {
+ List inner = this.innerModel().eventTags();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
}
public EventInner innerModel() {
diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EventOperationsClientImpl.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EventOperationsClientImpl.java
index d03670d4f7b1..9387a343de3b 100644
--- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EventOperationsClientImpl.java
+++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EventOperationsClientImpl.java
@@ -22,6 +22,7 @@
import com.azure.core.management.exception.ManagementException;
import com.azure.core.util.Context;
import com.azure.core.util.FluxUtil;
+import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.resourcehealth.fluent.EventOperationsClient;
import com.azure.resourcemanager.resourcehealth.fluent.models.EventInner;
import reactor.core.publisher.Mono;
@@ -68,6 +69,16 @@ Mono> getBySubscriptionIdAndTrackingId(@HostParam("$host")
@PathParam("eventTrackingId") String eventTrackingId, @HeaderParam("Accept") String accept,
Context context);
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/events/{eventTrackingId}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response getBySubscriptionIdAndTrackingIdSync(@HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter,
+ @QueryParam("queryStartTime") String queryStartTime, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("eventTrackingId") String eventTrackingId, @HeaderParam("Accept") String accept,
+ Context context);
+
@Headers({ "Content-Type: application/json" })
@Post("/subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/events/{eventTrackingId}/fetchEventDetails")
@ExpectedResponses({ 200 })
@@ -77,6 +88,15 @@ Mono> fetchDetailsBySubscriptionIdAndTrackingId(@HostParam(
@PathParam("eventTrackingId") String eventTrackingId, @HeaderParam("Accept") String accept,
Context context);
+ @Headers({ "Content-Type: application/json" })
+ @Post("/subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/events/{eventTrackingId}/fetchEventDetails")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response fetchDetailsBySubscriptionIdAndTrackingIdSync(@HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("eventTrackingId") String eventTrackingId, @HeaderParam("Accept") String accept,
+ Context context);
+
@Headers({ "Content-Type: application/json" })
@Get("/providers/Microsoft.ResourceHealth/events/{eventTrackingId}")
@ExpectedResponses({ 200 })
@@ -86,6 +106,15 @@ Mono> getByTenantIdAndTrackingId(@HostParam("$host") String
@QueryParam("queryStartTime") String queryStartTime, @PathParam("eventTrackingId") String eventTrackingId,
@HeaderParam("Accept") String accept, Context context);
+ @Headers({ "Content-Type: application/json" })
+ @Get("/providers/Microsoft.ResourceHealth/events/{eventTrackingId}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response getByTenantIdAndTrackingIdSync(@HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter,
+ @QueryParam("queryStartTime") String queryStartTime, @PathParam("eventTrackingId") String eventTrackingId,
+ @HeaderParam("Accept") String accept, Context context);
+
@Headers({ "Content-Type: application/json" })
@Post("/providers/Microsoft.ResourceHealth/events/{eventTrackingId}/fetchEventDetails")
@ExpectedResponses({ 200 })
@@ -93,6 +122,14 @@ Mono> getByTenantIdAndTrackingId(@HostParam("$host") String
Mono> fetchDetailsByTenantIdAndTrackingId(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("eventTrackingId") String eventTrackingId,
@HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Post("/providers/Microsoft.ResourceHealth/events/{eventTrackingId}/fetchEventDetails")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response fetchDetailsByTenantIdAndTrackingIdSync(@HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("eventTrackingId") String eventTrackingId,
+ @HeaderParam("Accept") String accept, Context context);
}
/**
@@ -101,8 +138,8 @@ Mono> fetchDetailsByTenantIdAndTrackingId(@HostParam("$host
* @param eventTrackingId Event Id which uniquely identifies ServiceHealth event.
* @param filter The filter to apply on the operation. For more information please see
* https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN.
- * @param queryStartTime Specifies from when to return events, based on the lastUpdateTime property. For example,
- * queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020.
+ * @param queryStartTime Specifies from when to return events (default is 3 days), based on the lastUpdateTime
+ * property. For example, queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
@@ -131,41 +168,6 @@ private Mono> getBySubscriptionIdAndTrackingIdWithResponseA
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
- /**
- * Service health event in the subscription by event tracking id.
- *
- * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event.
- * @param filter The filter to apply on the operation. For more information please see
- * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN.
- * @param queryStartTime Specifies from when to return events, based on the lastUpdateTime property. For example,
- * queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return service health event along with {@link Response} on successful completion of {@link Mono}.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> getBySubscriptionIdAndTrackingIdWithResponseAsync(String eventTrackingId,
- String filter, String queryStartTime, Context context) {
- if (this.client.getEndpoint() == null) {
- return Mono.error(
- new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
- }
- if (this.client.getSubscriptionId() == null) {
- return Mono.error(new IllegalArgumentException(
- "Parameter this.client.getSubscriptionId() is required and cannot be null."));
- }
- if (eventTrackingId == null) {
- return Mono
- .error(new IllegalArgumentException("Parameter eventTrackingId is required and cannot be null."));
- }
- final String accept = "application/json";
- context = this.client.mergeContext(context);
- return service.getBySubscriptionIdAndTrackingId(this.client.getEndpoint(), this.client.getApiVersion(), filter,
- queryStartTime, this.client.getSubscriptionId(), eventTrackingId, accept, context);
- }
-
/**
* Service health event in the subscription by event tracking id.
*
@@ -189,8 +191,8 @@ private Mono getBySubscriptionIdAndTrackingIdAsync(String eventTrack
* @param eventTrackingId Event Id which uniquely identifies ServiceHealth event.
* @param filter The filter to apply on the operation. For more information please see
* https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN.
- * @param queryStartTime Specifies from when to return events, based on the lastUpdateTime property. For example,
- * queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020.
+ * @param queryStartTime Specifies from when to return events (default is 3 days), based on the lastUpdateTime
+ * property. For example, queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
@@ -200,8 +202,23 @@ private Mono getBySubscriptionIdAndTrackingIdAsync(String eventTrack
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getBySubscriptionIdAndTrackingIdWithResponse(String eventTrackingId, String filter,
String queryStartTime, Context context) {
- return getBySubscriptionIdAndTrackingIdWithResponseAsync(eventTrackingId, filter, queryStartTime, context)
- .block();
+ if (this.client.getEndpoint() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (eventTrackingId == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter eventTrackingId is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return service.getBySubscriptionIdAndTrackingIdSync(this.client.getEndpoint(), this.client.getApiVersion(),
+ filter, queryStartTime, this.client.getSubscriptionId(), eventTrackingId, accept, context);
}
/**
@@ -223,7 +240,8 @@ public EventInner getBySubscriptionIdAndTrackingId(String eventTrackingId) {
/**
* Service health event details in the subscription by event tracking id. This can be used to fetch sensitive
- * properties for Security Advisory events.
+ * properties for Security Advisory events. Please see
+ * https://learn.microsoft.com/en-us/azure/service-health/security-advisories-elevated-access.
*
* @param eventTrackingId Event Id which uniquely identifies ServiceHealth event.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -255,39 +273,8 @@ public EventInner getBySubscriptionIdAndTrackingId(String eventTrackingId) {
/**
* Service health event details in the subscription by event tracking id. This can be used to fetch sensitive
- * properties for Security Advisory events.
- *
- * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return service health event along with {@link Response} on successful completion of {@link Mono}.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- private Mono>
- fetchDetailsBySubscriptionIdAndTrackingIdWithResponseAsync(String eventTrackingId, Context context) {
- if (this.client.getEndpoint() == null) {
- return Mono.error(
- new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
- }
- if (this.client.getSubscriptionId() == null) {
- return Mono.error(new IllegalArgumentException(
- "Parameter this.client.getSubscriptionId() is required and cannot be null."));
- }
- if (eventTrackingId == null) {
- return Mono
- .error(new IllegalArgumentException("Parameter eventTrackingId is required and cannot be null."));
- }
- final String accept = "application/json";
- context = this.client.mergeContext(context);
- return service.fetchDetailsBySubscriptionIdAndTrackingId(this.client.getEndpoint(), this.client.getApiVersion(),
- this.client.getSubscriptionId(), eventTrackingId, accept, context);
- }
-
- /**
- * Service health event details in the subscription by event tracking id. This can be used to fetch sensitive
- * properties for Security Advisory events.
+ * properties for Security Advisory events. Please see
+ * https://learn.microsoft.com/en-us/azure/service-health/security-advisories-elevated-access.
*
* @param eventTrackingId Event Id which uniquely identifies ServiceHealth event.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -303,7 +290,8 @@ private Mono fetchDetailsBySubscriptionIdAndTrackingIdAsync(String e
/**
* Service health event details in the subscription by event tracking id. This can be used to fetch sensitive
- * properties for Security Advisory events.
+ * properties for Security Advisory events. Please see
+ * https://learn.microsoft.com/en-us/azure/service-health/security-advisories-elevated-access.
*
* @param eventTrackingId Event Id which uniquely identifies ServiceHealth event.
* @param context The context to associate with this operation.
@@ -315,12 +303,29 @@ private Mono fetchDetailsBySubscriptionIdAndTrackingIdAsync(String e
@ServiceMethod(returns = ReturnType.SINGLE)
public Response fetchDetailsBySubscriptionIdAndTrackingIdWithResponse(String eventTrackingId,
Context context) {
- return fetchDetailsBySubscriptionIdAndTrackingIdWithResponseAsync(eventTrackingId, context).block();
+ if (this.client.getEndpoint() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (eventTrackingId == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter eventTrackingId is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return service.fetchDetailsBySubscriptionIdAndTrackingIdSync(this.client.getEndpoint(),
+ this.client.getApiVersion(), this.client.getSubscriptionId(), eventTrackingId, accept, context);
}
/**
* Service health event details in the subscription by event tracking id. This can be used to fetch sensitive
- * properties for Security Advisory events.
+ * properties for Security Advisory events. Please see
+ * https://learn.microsoft.com/en-us/azure/service-health/security-advisories-elevated-access.
*
* @param eventTrackingId Event Id which uniquely identifies ServiceHealth event.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -339,8 +344,8 @@ public EventInner fetchDetailsBySubscriptionIdAndTrackingId(String eventTracking
* @param eventTrackingId Event Id which uniquely identifies ServiceHealth event.
* @param filter The filter to apply on the operation. For more information please see
* https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN.
- * @param queryStartTime Specifies from when to return events, based on the lastUpdateTime property. For example,
- * queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020.
+ * @param queryStartTime Specifies from when to return events (default is 3 days), based on the lastUpdateTime
+ * property. For example, queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
@@ -364,37 +369,6 @@ private Mono> getByTenantIdAndTrackingIdWithResponseAsync(S
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
- /**
- * Service health event in the tenant by event tracking id.
- *
- * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event.
- * @param filter The filter to apply on the operation. For more information please see
- * https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN.
- * @param queryStartTime Specifies from when to return events, based on the lastUpdateTime property. For example,
- * queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return service health event along with {@link Response} on successful completion of {@link Mono}.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> getByTenantIdAndTrackingIdWithResponseAsync(String eventTrackingId,
- String filter, String queryStartTime, Context context) {
- if (this.client.getEndpoint() == null) {
- return Mono.error(
- new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
- }
- if (eventTrackingId == null) {
- return Mono
- .error(new IllegalArgumentException("Parameter eventTrackingId is required and cannot be null."));
- }
- final String accept = "application/json";
- context = this.client.mergeContext(context);
- return service.getByTenantIdAndTrackingId(this.client.getEndpoint(), this.client.getApiVersion(), filter,
- queryStartTime, eventTrackingId, accept, context);
- }
-
/**
* Service health event in the tenant by event tracking id.
*
@@ -418,8 +392,8 @@ private Mono getByTenantIdAndTrackingIdAsync(String eventTrackingId)
* @param eventTrackingId Event Id which uniquely identifies ServiceHealth event.
* @param filter The filter to apply on the operation. For more information please see
* https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN.
- * @param queryStartTime Specifies from when to return events, based on the lastUpdateTime property. For example,
- * queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020.
+ * @param queryStartTime Specifies from when to return events (default is 3 days), based on the lastUpdateTime
+ * property. For example, queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
@@ -429,7 +403,18 @@ private Mono getByTenantIdAndTrackingIdAsync(String eventTrackingId)
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getByTenantIdAndTrackingIdWithResponse(String eventTrackingId, String filter,
String queryStartTime, Context context) {
- return getByTenantIdAndTrackingIdWithResponseAsync(eventTrackingId, filter, queryStartTime, context).block();
+ if (this.client.getEndpoint() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (eventTrackingId == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter eventTrackingId is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return service.getByTenantIdAndTrackingIdSync(this.client.getEndpoint(), this.client.getApiVersion(), filter,
+ queryStartTime, eventTrackingId, accept, context);
}
/**
@@ -450,7 +435,8 @@ public EventInner getByTenantIdAndTrackingId(String eventTrackingId) {
/**
* Service health event details in the tenant by event tracking id. This can be used to fetch sensitive properties
- * for Security Advisory events.
+ * for Security Advisory events. Please see
+ * https://learn.microsoft.com/en-us/azure/service-health/security-advisories-elevated-access.
*
* @param eventTrackingId Event Id which uniquely identifies ServiceHealth event.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -477,35 +463,8 @@ private Mono> fetchDetailsByTenantIdAndTrackingIdWithRespon
/**
* Service health event details in the tenant by event tracking id. This can be used to fetch sensitive properties
- * for Security Advisory events.
- *
- * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return service health event along with {@link Response} on successful completion of {@link Mono}.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> fetchDetailsByTenantIdAndTrackingIdWithResponseAsync(String eventTrackingId,
- Context context) {
- if (this.client.getEndpoint() == null) {
- return Mono.error(
- new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
- }
- if (eventTrackingId == null) {
- return Mono
- .error(new IllegalArgumentException("Parameter eventTrackingId is required and cannot be null."));
- }
- final String accept = "application/json";
- context = this.client.mergeContext(context);
- return service.fetchDetailsByTenantIdAndTrackingId(this.client.getEndpoint(), this.client.getApiVersion(),
- eventTrackingId, accept, context);
- }
-
- /**
- * Service health event details in the tenant by event tracking id. This can be used to fetch sensitive properties
- * for Security Advisory events.
+ * for Security Advisory events. Please see
+ * https://learn.microsoft.com/en-us/azure/service-health/security-advisories-elevated-access.
*
* @param eventTrackingId Event Id which uniquely identifies ServiceHealth event.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -521,7 +480,8 @@ private Mono fetchDetailsByTenantIdAndTrackingIdAsync(String eventTr
/**
* Service health event details in the tenant by event tracking id. This can be used to fetch sensitive properties
- * for Security Advisory events.
+ * for Security Advisory events. Please see
+ * https://learn.microsoft.com/en-us/azure/service-health/security-advisories-elevated-access.
*
* @param eventTrackingId Event Id which uniquely identifies ServiceHealth event.
* @param context The context to associate with this operation.
@@ -533,12 +493,24 @@ private Mono fetchDetailsByTenantIdAndTrackingIdAsync(String eventTr
@ServiceMethod(returns = ReturnType.SINGLE)
public Response fetchDetailsByTenantIdAndTrackingIdWithResponse(String eventTrackingId,
Context context) {
- return fetchDetailsByTenantIdAndTrackingIdWithResponseAsync(eventTrackingId, context).block();
+ if (this.client.getEndpoint() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (eventTrackingId == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter eventTrackingId is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return service.fetchDetailsByTenantIdAndTrackingIdSync(this.client.getEndpoint(), this.client.getApiVersion(),
+ eventTrackingId, accept, context);
}
/**
* Service health event details in the tenant by event tracking id. This can be used to fetch sensitive properties
- * for Security Advisory events.
+ * for Security Advisory events. Please see
+ * https://learn.microsoft.com/en-us/azure/service-health/security-advisories-elevated-access.
*
* @param eventTrackingId Event Id which uniquely identifies ServiceHealth event.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -550,4 +522,6 @@ public Response fetchDetailsByTenantIdAndTrackingIdWithResponse(Stri
public EventInner fetchDetailsByTenantIdAndTrackingId(String eventTrackingId) {
return fetchDetailsByTenantIdAndTrackingIdWithResponse(eventTrackingId, Context.NONE).getValue();
}
+
+ private static final ClientLogger LOGGER = new ClientLogger(EventOperationsClientImpl.class);
}
diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EventsOperationsClientImpl.java b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EventsOperationsClientImpl.java
index 45ff567e7674..449e8a40245a 100644
--- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EventsOperationsClientImpl.java
+++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/implementation/EventsOperationsClientImpl.java
@@ -25,6 +25,7 @@
import com.azure.core.management.exception.ManagementException;
import com.azure.core.util.Context;
import com.azure.core.util.FluxUtil;
+import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.resourcehealth.fluent.EventsOperationsClient;
import com.azure.resourcemanager.resourcehealth.fluent.models.EventInner;
import com.azure.resourcemanager.resourcehealth.models.Events;
@@ -70,6 +71,14 @@ Mono> list(@HostParam("$host") String endpoint, @QueryParam("ap
@QueryParam("$filter") String filter, @QueryParam("queryStartTime") String queryStartTime,
@PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context);
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/events")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response listSync(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion,
+ @QueryParam("$filter") String filter, @QueryParam("queryStartTime") String queryStartTime,
+ @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context);
+
@Headers({ "Content-Type: application/json" })
@Get("/providers/Microsoft.ResourceHealth/events")
@ExpectedResponses({ 200 })
@@ -78,6 +87,14 @@ Mono> listByTenantId(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter,
@QueryParam("queryStartTime") String queryStartTime, @HeaderParam("Accept") String accept, Context context);
+ @Headers({ "Content-Type: application/json" })
+ @Get("/providers/Microsoft.ResourceHealth/events")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response listByTenantIdSync(@HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter,
+ @QueryParam("queryStartTime") String queryStartTime, @HeaderParam("Accept") String accept, Context context);
+
@Headers({ "Content-Type: application/json" })
@Get("/{resourceUri}/providers/Microsoft.ResourceHealth/events")
@ExpectedResponses({ 200 })
@@ -87,6 +104,15 @@ Mono> listBySingleResource(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter,
@HeaderParam("Accept") String accept, Context context);
+ @Headers({ "Content-Type: application/json" })
+ @Get("/{resourceUri}/providers/Microsoft.ResourceHealth/events")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response listBySingleResourceSync(@HostParam("$host") String endpoint,
+ @PathParam(value = "resourceUri", encoded = true) String resourceUri,
+ @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter,
+ @HeaderParam("Accept") String accept, Context context);
+
@Headers({ "Content-Type: application/json" })
@Get("{nextLink}")
@ExpectedResponses({ 200 })
@@ -94,6 +120,13 @@ Mono> listBySingleResource(@HostParam("$host") String endpoint,
Mono> listBySubscriptionIdNext(@PathParam(value = "nextLink", encoded = true) String nextLink,
@HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context);
+ @Headers({ "Content-Type: application/json" })
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response listBySubscriptionIdNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context);
+
@Headers({ "Content-Type: application/json" })
@Get("{nextLink}")
@ExpectedResponses({ 200 })
@@ -101,12 +134,26 @@ Mono> listBySubscriptionIdNext(@PathParam(value = "nextLink", e
Mono> listByTenantIdNext(@PathParam(value = "nextLink", encoded = true) String nextLink,
@HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context);
+ @Headers({ "Content-Type: application/json" })
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response listByTenantIdNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context);
+
@Headers({ "Content-Type: application/json" })
@Get("{nextLink}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listBySingleResourceNext(@PathParam(value = "nextLink", encoded = true) String nextLink,
@HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response