diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/CHANGELOG.md b/sdk/resourcemanager/resourcehealth/armresourcehealth/CHANGELOG.md index d1b734d6f791..ff290fed5a98 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/CHANGELOG.md +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/CHANGELOG.md @@ -1,5 +1,14 @@ # Release History +## 1.4.0 (2025-05-13) +### Features Added + +- New field `EventTags`, `IsEventSensitive` in struct `EventProperties` +- New field `ImpactedServiceGUID` in struct `Impact` +- New field `PreviousID`, `ServiceGUID` in struct `MetadataSupportedValueDetail` +- New field `EventTags` in struct `Update` + + ## 1.4.0-beta.2 (2024-02-07) ### Bugs Fixed diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/autorest.md b/sdk/resourcemanager/resourcehealth/armresourcehealth/autorest.md index e25c5cd9a50f..815e838cb917 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/autorest.md +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/resourcehealth/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/resourcehealth/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/resourcehealth/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/resourcehealth/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.4.0-beta.2 -tag: package-preview-2023-10 +module-version: 1.4.0 ``` diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/availabilitystatuses_client.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/availabilitystatuses_client.go index 7a0280d3f34e..57b32136e046 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/availabilitystatuses_client.go +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/availabilitystatuses_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewAvailabilityStatusesClient(subscriptionID string, credential azcore.Toke // GetByResource - Gets current availability status for a single resource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-01-preview +// Generated from API version 2025-05-01 // - 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} @@ -91,7 +88,7 @@ func (client *AvailabilityStatusesClient) getByResourceCreateRequest(ctx context if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2023-10-01-preview") + reqQP.Set("api-version", "2025-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -108,7 +105,7 @@ func (client *AvailabilityStatusesClient) getByResourceHandleResponse(resp *http // NewListPager - Lists all historical availability transitions and impacting events for a single resource. // -// Generated from API version 2023-10-01-preview +// Generated from API version 2025-05-01 // - 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} @@ -154,7 +151,7 @@ func (client *AvailabilityStatusesClient) listCreateRequest(ctx context.Context, if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2023-10-01-preview") + reqQP.Set("api-version", "2025-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -171,7 +168,7 @@ func (client *AvailabilityStatusesClient) listHandleResponse(resp *http.Response // NewListByResourceGroupPager - Lists the current availability status for all the resources in the resource group. // -// Generated from API version 2023-10-01-preview +// Generated from API version 2025-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - AvailabilityStatusesClientListByResourceGroupOptions contains the optional parameters for the AvailabilityStatusesClient.NewListByResourceGroupPager // method. @@ -220,7 +217,7 @@ func (client *AvailabilityStatusesClient) listByResourceGroupCreateRequest(ctx c if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2023-10-01-preview") + reqQP.Set("api-version", "2025-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -237,7 +234,7 @@ func (client *AvailabilityStatusesClient) listByResourceGroupHandleResponse(resp // NewListBySubscriptionIDPager - Lists the current availability status for all the resources in the subscription. // -// Generated from API version 2023-10-01-preview +// Generated from API version 2025-05-01 // - options - AvailabilityStatusesClientListBySubscriptionIDOptions contains the optional parameters for the AvailabilityStatusesClient.NewListBySubscriptionIDPager // method. func (client *AvailabilityStatusesClient) NewListBySubscriptionIDPager(options *AvailabilityStatusesClientListBySubscriptionIDOptions) *runtime.Pager[AvailabilityStatusesClientListBySubscriptionIDResponse] { @@ -281,7 +278,7 @@ func (client *AvailabilityStatusesClient) listBySubscriptionIDCreateRequest(ctx if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2023-10-01-preview") + reqQP.Set("api-version", "2025-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/availabilitystatuses_client_example_test.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/availabilitystatuses_client_example_test.go deleted file mode 100644 index 3e27366c9f6e..000000000000 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/availabilitystatuses_client_example_test.go +++ /dev/null @@ -1,326 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armresourcehealth_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resourcehealth/armresourcehealth" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/AvailabilityStatuses_ListBySubscriptionId.json -func ExampleAvailabilityStatusesClient_NewListBySubscriptionIDPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresourcehealth.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAvailabilityStatusesClient().NewListBySubscriptionIDPager(&armresourcehealth.AvailabilityStatusesClientListBySubscriptionIDOptions{Filter: nil, - Expand: to.Ptr("recommendedactions"), - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AvailabilityStatusListResult = armresourcehealth.AvailabilityStatusListResult{ - // Value: []*armresourcehealth.AvailabilityStatus{ - // { - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.ResourceHealth/AvailabilityStatuses"), - // ID: to.Ptr("/providers/Microsoft.ResourceHealth/AvailabilityStatueses/current"), - // Location: to.Ptr("eastus"), - // Properties: &armresourcehealth.AvailabilityStatusProperties{ - // AvailabilityState: to.Ptr(armresourcehealth.AvailabilityStateValuesAvailable), - // Category: to.Ptr("Unplanned"), - // Context: to.Ptr("Platform Initiated"), - // DetailedStatus: to.Ptr("We have not seen any issues with your virtual machine"), - // OccurredTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-03-29T09:12:00.000Z"); return t}()), - // ReasonChronicity: to.Ptr(armresourcehealth.ReasonChronicityTypesPersistent), - // ReasonType: to.Ptr("Unplanned"), - // RecentlyResolved: &armresourcehealth.AvailabilityStatusPropertiesRecentlyResolved{ - // ResolvedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-28T00:49:00.000Z"); return t}()), - // UnavailableOccurredTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-28T00:48:00.000Z"); return t}()), - // UnavailabilitySummary: to.Ptr("We are sorry your SQL database is unavailable"), - // }, - // RecommendedActions: []*armresourcehealth.RecommendedAction{ - // { - // Action: to.Ptr("To start this virtualmachine, open the resource blade and click Start"), - // ActionURL: to.Ptr("<#ResourceBlade>"), - // ActionURLText: to.Ptr("resourceblade"), - // }}, - // ReportedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-05-04T14:11:29.759Z"); return t}()), - // Summary: to.Ptr("Vm is available"), - // Title: to.Ptr("Available"), - // }, - // }, - // { - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.ResourceHealth/AvailabilityStatuses"), - // ID: to.Ptr("/providers/Microsoft.ResourceHealth/AvailabilityStatueses/current"), - // Location: to.Ptr("eastus"), - // Properties: &armresourcehealth.AvailabilityStatusProperties{ - // AvailabilityState: to.Ptr(armresourcehealth.AvailabilityStateValuesUnavailable), - // DetailedStatus: to.Ptr("Diskproblemsarepreventingusfromautomaticallyrecoveringyourvirtualmachine"), - // OccurredTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-03-29T09:12:00.000Z"); return t}()), - // ReasonChronicity: to.Ptr(armresourcehealth.ReasonChronicityTypesPersistent), - // ReasonType: to.Ptr("Unplanned"), - // RecommendedActions: []*armresourcehealth.RecommendedAction{ - // { - // Action: to.Ptr("To start this virtualmachine, open the resource blade"), - // ActionURL: to.Ptr("<#ResourceBlade>"), - // ActionURLText: to.Ptr("resourceblade"), - // }, - // { - // Action: to.Ptr("If you are experiencing problems you believe are caused by Azure, contact support"), - // ActionURL: to.Ptr("<#SupportCase>"), - // ActionURLText: to.Ptr("contactsupport"), - // }}, - // ReportedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-05-04T14:11:29.759Z"); return t}()), - // ResolutionETA: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-03-29T09:37:00.000Z"); return t}()), - // RootCauseAttributionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-03-29T09:13:00.000Z"); return t}()), - // Summary: to.Ptr("We are sorry, we couldn't automatically recovery our virtualmachine"), - // Title: to.Ptr("Unavailable"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/AvailabilityStatuses_ListByResourceGroup.json -func ExampleAvailabilityStatusesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresourcehealth.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAvailabilityStatusesClient().NewListByResourceGroupPager("resourceGroupName", &armresourcehealth.AvailabilityStatusesClientListByResourceGroupOptions{Filter: nil, - Expand: to.Ptr("recommendedactions"), - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AvailabilityStatusListResult = armresourcehealth.AvailabilityStatusListResult{ - // Value: []*armresourcehealth.AvailabilityStatus{ - // { - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.ResourceHealth/AvailabilityStatuses"), - // ID: to.Ptr("/providers/Microsoft.ResourceHealth/AvailabilityStatueses/current"), - // Location: to.Ptr("eastus"), - // Properties: &armresourcehealth.AvailabilityStatusProperties{ - // AvailabilityState: to.Ptr(armresourcehealth.AvailabilityStateValuesAvailable), - // Category: to.Ptr("Unplanned"), - // Context: to.Ptr("Platform Initiated"), - // DetailedStatus: to.Ptr("We have not seen any issues with your virtual machine"), - // OccurredTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-03-29T09:12:00.000Z"); return t}()), - // ReasonChronicity: to.Ptr(armresourcehealth.ReasonChronicityTypesPersistent), - // ReasonType: to.Ptr("Unplanned"), - // RecentlyResolved: &armresourcehealth.AvailabilityStatusPropertiesRecentlyResolved{ - // ResolvedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-28T00:49:00.000Z"); return t}()), - // UnavailableOccurredTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-28T00:48:00.000Z"); return t}()), - // UnavailabilitySummary: to.Ptr("We are sorry your SQL database is unavailable"), - // }, - // RecommendedActions: []*armresourcehealth.RecommendedAction{ - // { - // Action: to.Ptr("To start this virtualmachine, open the resource blade and click Start"), - // ActionURL: to.Ptr("<#ResourceBlade>"), - // ActionURLText: to.Ptr("resourceblade"), - // }}, - // ReportedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-05-04T14:11:29.759Z"); return t}()), - // Summary: to.Ptr("Vm is available"), - // Title: to.Ptr("Available"), - // }, - // }, - // { - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.ResourceHealth/AvailabilityStatuses"), - // ID: to.Ptr("/providers/Microsoft.ResourceHealth/AvailabilityStatueses/current"), - // Location: to.Ptr("eastus"), - // Properties: &armresourcehealth.AvailabilityStatusProperties{ - // AvailabilityState: to.Ptr(armresourcehealth.AvailabilityStateValuesUnavailable), - // DetailedStatus: to.Ptr("Diskproblemsarepreventingusfromautomaticallyrecoveringyourvirtualmachine"), - // OccurredTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-03-29T09:12:00.000Z"); return t}()), - // ReasonChronicity: to.Ptr(armresourcehealth.ReasonChronicityTypesPersistent), - // ReasonType: to.Ptr("Unplanned"), - // RecommendedActions: []*armresourcehealth.RecommendedAction{ - // { - // Action: to.Ptr("To start this virtualmachine, open the resource blade"), - // ActionURL: to.Ptr("<#ResourceBlade>"), - // ActionURLText: to.Ptr("resourceblade"), - // }, - // { - // Action: to.Ptr("If you are experiencing problems you believe are caused by Azure, contact support"), - // ActionURL: to.Ptr("<#SupportCase>"), - // ActionURLText: to.Ptr("contactsupport"), - // }}, - // ReportedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-05-04T14:11:29.759Z"); return t}()), - // ResolutionETA: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-03-29T09:37:00.000Z"); return t}()), - // RootCauseAttributionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-03-29T09:13:00.000Z"); return t}()), - // Summary: to.Ptr("We are sorry, we couldn't automatically recovery our virtualmachine"), - // Title: to.Ptr("Unavailable"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/AvailabilityStatus_GetByResource.json -func ExampleAvailabilityStatusesClient_GetByResource() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresourcehealth.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAvailabilityStatusesClient().GetByResource(ctx, "resourceUri", &armresourcehealth.AvailabilityStatusesClientGetByResourceOptions{Filter: nil, - Expand: to.Ptr("recommendedactions"), - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AvailabilityStatus = armresourcehealth.AvailabilityStatus{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.ResourceHealth/AvailabilityStatuses"), - // ID: to.Ptr("/subscriptions/4abcdefgh-ijkl-mnop-qrstuvwxyz/resourceGroups/rhctestenv/providers/Microsoft.ClassicCompute/virtualMachines /rhctestenvV1PI/providers/Microsoft.ResourceHealth/availabilityStatuses/current"), - // Location: to.Ptr("eastus"), - // Properties: &armresourcehealth.AvailabilityStatusProperties{ - // AvailabilityState: to.Ptr(armresourcehealth.AvailabilityStateValuesUnavailable), - // Category: to.Ptr("Unplanned"), - // Context: to.Ptr("Platform Initiated"), - // DetailedStatus: to.Ptr("Disk problems are preventing us from automatically recovering your virtual machine"), - // OccurredTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-03-29T09:12:00.000Z"); return t}()), - // ReasonChronicity: to.Ptr(armresourcehealth.ReasonChronicityTypesPersistent), - // ReasonType: to.Ptr("Unplanned"), - // RecommendedActions: []*armresourcehealth.RecommendedAction{ - // { - // Action: to.Ptr("To start this virtual machine, open the resource blade and click Start"), - // ActionURL: to.Ptr("<#ResourceBlade>"), - // ActionURLText: to.Ptr("resource blade"), - // }, - // { - // Action: to.Ptr("If you are experiencing problems you believe are caused by Azure, contact support"), - // ActionURL: to.Ptr("<#SupportCase>"), - // ActionURLText: to.Ptr("contact support"), - // }}, - // ReportedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-05-04T14:11:29.759Z"); return t}()), - // ResolutionETA: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-03-29T09:37:00.000Z"); return t}()), - // RootCauseAttributionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-03-29T09:13:00.000Z"); return t}()), - // Summary: to.Ptr("We're sorry, we couldn't automatically recover your virtual machine"), - // Title: to.Ptr("Unavailable"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/AvailabilityStatuses_List.json -func ExampleAvailabilityStatusesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresourcehealth.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAvailabilityStatusesClient().NewListPager("resourceUri", &armresourcehealth.AvailabilityStatusesClientListOptions{Filter: nil, - Expand: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AvailabilityStatusListResult = armresourcehealth.AvailabilityStatusListResult{ - // Value: []*armresourcehealth.AvailabilityStatus{ - // { - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.ResourceHealth/AvailabilityStatuses"), - // ID: to.Ptr("/subscriptions/4abcdefgh-ijkl-mnop-qrstuvwxyz/resourceGroups/rhctestenv/providers/Microsoft.ClassicCompute/virtualMachines/rhctes tenvV1PI/providers/Microsoft.ResourceHealth/availabilityStatuses/current"), - // Location: to.Ptr("eastus"), - // Properties: &armresourcehealth.AvailabilityStatusProperties{ - // AvailabilityState: to.Ptr(armresourcehealth.AvailabilityStateValuesUnavailable), - // Category: to.Ptr("Unplanned"), - // Context: to.Ptr("Platform Initiated"), - // DetailedStatus: to.Ptr("Disk problems are preventing us from automatically recovering your virtual machine"), - // OccurredTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-03-29T09:12:00.000Z"); return t}()), - // ReasonChronicity: to.Ptr(armresourcehealth.ReasonChronicityTypesPersistent), - // ReasonType: to.Ptr("Unplanned"), - // ReportedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-05-04T14:11:29.759Z"); return t}()), - // ResolutionETA: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-03-29T09:37:00.000Z"); return t}()), - // RootCauseAttributionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-03-29T09:13:00.000Z"); return t}()), - // ServiceImpactingEvents: []*armresourcehealth.ServiceImpactingEvent{ - // { - // CorrelationID: to.Ptr("b56d0180-2d6c-4f7b-b750-c1eca681874c"), - // EventStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-05-02T19:23:13.711Z"); return t}()), - // EventStatusLastModifiedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-05-02T19:27:04.954Z"); return t}()), - // IncidentProperties: &armresourcehealth.ServiceImpactingEventIncidentProperties{ - // IncidentType: to.Ptr("outage"), - // Region: to.Ptr("East US"), - // Service: to.Ptr("Virtual Machines"), - // Title: to.Ptr("Virtual Machines - West Europe [West Europe]"), - // }, - // Status: &armresourcehealth.ServiceImpactingEventStatus{ - // Value: to.Ptr("Resolved"), - // }, - // }}, - // Summary: to.Ptr("We're sorry, we couldn't automatically recover your virtual machine"), - // Title: to.Ptr("Unavailable"), - // }, - // }, - // { - // Name: to.Ptr("2016-03-28+16%3a23%3a00Z"), - // Type: to.Ptr("Microsoft.ResourceHealth/AvailabilityStatuses"), - // ID: to.Ptr("/subscriptions/4abcdefgh-ijkl-mnop-qrstuvwxyz/resourceGroups/rhctestenv/providers/Microsoft.ClassicCompute/virtualMachines/rhctes tenvV1PI/providers/Microsoft.ResourceHealth/availabilityStatuses/2016-03-28+16%3a23%3a00Z"), - // Location: to.Ptr("eastus"), - // Properties: &armresourcehealth.AvailabilityStatusProperties{ - // AvailabilityState: to.Ptr(armresourcehealth.AvailabilityStateValuesAvailable), - // DetailedStatus: to.Ptr("There aren’t any known Azure platform problems affecting this virtual machine"), - // OccurredTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-03-28T16:23:00.000Z"); return t}()), - // ReasonChronicity: to.Ptr(armresourcehealth.ReasonChronicityTypesPersistent), - // Summary: to.Ptr("This virtual machine is running normally"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/childavailabilitystatuses_client.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/childavailabilitystatuses_client.go index 342db187163e..8863866cc115 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/childavailabilitystatuses_client.go +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/childavailabilitystatuses_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -41,7 +38,7 @@ func NewChildAvailabilityStatusesClient(credential azcore.TokenCredential, optio // GetByResource - Gets current availability status for a single resource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-01-preview +// Generated from API version 2025-05-01 // - 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} @@ -84,7 +81,7 @@ func (client *ChildAvailabilityStatusesClient) getByResourceCreateRequest(ctx co if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2023-10-01-preview") + reqQP.Set("api-version", "2025-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -102,7 +99,7 @@ func (client *ChildAvailabilityStatusesClient) getByResourceHandleResponse(resp // NewListPager - Lists the historical availability statuses for a single child resource. Use the nextLink property in the // response to get the next page of availability status // -// Generated from API version 2023-10-01-preview +// Generated from API version 2025-05-01 // - 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} @@ -146,7 +143,7 @@ func (client *ChildAvailabilityStatusesClient) listCreateRequest(ctx context.Con if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2023-10-01-preview") + reqQP.Set("api-version", "2025-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/childavailabilitystatuses_client_example_test.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/childavailabilitystatuses_client_example_test.go deleted file mode 100644 index efdcfdd954c3..000000000000 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/childavailabilitystatuses_client_example_test.go +++ /dev/null @@ -1,227 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armresourcehealth_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resourcehealth/armresourcehealth" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ChildAvailabilityStatus_GetByResource.json -func ExampleChildAvailabilityStatusesClient_GetByResource() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresourcehealth.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewChildAvailabilityStatusesClient().GetByResource(ctx, "subscriptions/227b734f-e14f-4de6-b7fc-3190c21e69f6/resourceGroups/JUHACKETRHCTEST/providers/Microsoft.Compute/virtualMachineScaleSets/rhctest/virtualMachines/4", &armresourcehealth.ChildAvailabilityStatusesClientGetByResourceOptions{Filter: nil, - Expand: to.Ptr("recommendedactions"), - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AvailabilityStatus = armresourcehealth.AvailabilityStatus{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.ResourceHealth/AvailabilityStatuses"), - // ID: to.Ptr("/subscriptions/227b734f-e14f-4de6-b7fc-3190c21e69f6/resourceGroups/JUHACKETRHCTEST/providers/Microsoft.Compute/virtualMachineScaleSets/rhctest/virtualMachines/4/providers/Microsoft.ResourceHealth/child/availabilityStatuses/current"), - // Location: to.Ptr("southcentralus"), - // Properties: &armresourcehealth.AvailabilityStatusProperties{ - // AvailabilityState: to.Ptr(armresourcehealth.AvailabilityStateValuesAvailable), - // DetailedStatus: to.Ptr(""), - // OccurredTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-30T23:37:44.000Z"); return t}()), - // ReasonChronicity: to.Ptr(armresourcehealth.ReasonChronicityTypesPersistent), - // ReasonType: to.Ptr(""), - // RecommendedActions: []*armresourcehealth.RecommendedAction{ - // { - // Action: to.Ptr("To start this virtual machine, open the resource blade and click Start"), - // ActionURL: to.Ptr("<#ResourceBlade>"), - // ActionURLText: to.Ptr("resource blade"), - // }, - // { - // Action: to.Ptr("If you are experiencing problems you believe are caused by Azure, contact support"), - // ActionURL: to.Ptr("<#SupportCase>"), - // ActionURLText: to.Ptr("contact support"), - // }}, - // ReportedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-12-04T01:19:11.955Z"); return t}()), - // Summary: to.Ptr("There aren't any known Azure platform problems affecting this virtual machine"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ChildAvailabilityStatuses_List.json -func ExampleChildAvailabilityStatusesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresourcehealth.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewChildAvailabilityStatusesClient().NewListPager("subscriptions/227b734f-e14f-4de6-b7fc-3190c21e69f6/resourceGroups/JUHACKETRHCTEST/providers/Microsoft.Compute/virtualMachineScaleSets/rhctest/virtualMachines/4", &armresourcehealth.ChildAvailabilityStatusesClientListOptions{Filter: nil, - Expand: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AvailabilityStatusListResult = armresourcehealth.AvailabilityStatusListResult{ - // Value: []*armresourcehealth.AvailabilityStatus{ - // { - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.ResourceHealth/AvailabilityStatuses"), - // ID: to.Ptr("/subscriptions/227b734f-e14f-4de6-b7fc-3190c21e69f6/resourceGroups/JUHACKETRHCTEST/providers/Microsoft.Compute/virtualMachineScaleSets/rhctest/virtualMachines/4/providers/Microsoft.ResourceHealth/availabilityStatuses/current"), - // Location: to.Ptr("southcentralus"), - // Properties: &armresourcehealth.AvailabilityStatusProperties{ - // AvailabilityState: to.Ptr(armresourcehealth.AvailabilityStateValuesAvailable), - // DetailedStatus: to.Ptr(""), - // OccurredTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-30T23:37:44.000Z"); return t}()), - // ReasonChronicity: to.Ptr(armresourcehealth.ReasonChronicityTypesTransient), - // ReasonType: to.Ptr(""), - // RecommendedActions: []*armresourcehealth.RecommendedAction{ - // { - // Action: to.Ptr("If you're having problems, use the Troubleshoot tool to get recommended solutions."), - // ActionURL: to.Ptr("<#TroubleshootV2Blade>"), - // ActionURLText: to.Ptr("Troubleshoot tool"), - // }, - // { - // Action: to.Ptr("If you are experiencing problems you believe are caused by Azure, contact support"), - // ActionURL: to.Ptr("<#SupportCase>"), - // ActionURLText: to.Ptr("contact support"), - // }}, - // ReportedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-12-05T19:45:45.664Z"); return t}()), - // Summary: to.Ptr("There aren't any known Azure platform problems affecting this virtual machine"), - // }, - // }, - // { - // Name: to.Ptr("2018-11-30+23%3a36%3a03Z"), - // Type: to.Ptr("Microsoft.ResourceHealth/AvailabilityStatuses"), - // ID: to.Ptr("/subscriptions/227b734f-e14f-4de6-b7fc-3190c21e69f6/resourceGroups/JUHACKETRHCTEST/providers/Microsoft.Compute/virtualMachineScaleSets/rhctest/virtualMachines/4/providers/Microsoft.ResourceHealth/availabilityStatuses/2018-11-30+23%3a36%3a03Z"), - // Location: to.Ptr("southcentralus"), - // Properties: &armresourcehealth.AvailabilityStatusProperties{ - // AvailabilityState: to.Ptr(armresourcehealth.AvailabilityStateValuesUnavailable), - // DetailedStatus: to.Ptr(""), - // OccurredTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-30T23:36:03.000Z"); return t}()), - // ReasonChronicity: to.Ptr(armresourcehealth.ReasonChronicityTypesTransient), - // ReasonType: to.Ptr("Customer Initiated"), - // RecommendedActions: []*armresourcehealth.RecommendedAction{ - // { - // Action: to.Ptr("Check back here for status updates"), - // ActionURL: to.Ptr(""), - // ActionURLText: to.Ptr(""), - // }, - // { - // Action: to.Ptr("If you are experiencing problems you believe are caused by Azure, contact support"), - // ActionURL: to.Ptr("<#SupportCase>"), - // ActionURLText: to.Ptr("contact support"), - // }}, - // ResolutionETA: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-30T23:56:03.000Z"); return t}()), - // RootCauseAttributionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-30T23:36:02.514Z"); return t}()), - // Summary: to.Ptr("This virtual machine is rebooting as requested by an authorized user or process. It will be back online after the reboot completes."), - // }, - // }, - // { - // Name: to.Ptr("2018-11-30+22%3a32%3a12Z"), - // Type: to.Ptr("Microsoft.ResourceHealth/AvailabilityStatuses"), - // ID: to.Ptr("/subscriptions/227b734f-e14f-4de6-b7fc-3190c21e69f6/resourceGroups/JUHACKETRHCTEST/providers/Microsoft.Compute/virtualMachineScaleSets/rhctest/virtualMachines/4/providers/Microsoft.ResourceHealth/availabilityStatuses/2018-11-30+22%3a32%3a12Z"), - // Location: to.Ptr("southcentralus"), - // Properties: &armresourcehealth.AvailabilityStatusProperties{ - // AvailabilityState: to.Ptr(armresourcehealth.AvailabilityStateValuesAvailable), - // DetailedStatus: to.Ptr(""), - // OccurredTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-30T22:32:12.000Z"); return t}()), - // ReasonChronicity: to.Ptr(armresourcehealth.ReasonChronicityTypesTransient), - // ReasonType: to.Ptr(""), - // RecommendedActions: []*armresourcehealth.RecommendedAction{ - // { - // Action: to.Ptr("If you're having problems, use the Troubleshoot tool to get recommended solutions."), - // ActionURL: to.Ptr("<#TroubleshootV2Blade>"), - // ActionURLText: to.Ptr("Troubleshoot tool"), - // }, - // { - // Action: to.Ptr("If you are experiencing problems you believe are caused by Azure, contact support"), - // ActionURL: to.Ptr("<#SupportCase>"), - // ActionURLText: to.Ptr("contact support"), - // }}, - // Summary: to.Ptr("There aren't any known Azure platform problems affecting this virtual machine"), - // }, - // }, - // { - // Name: to.Ptr("2018-11-30+22%3a30%3a23Z"), - // Type: to.Ptr("Microsoft.ResourceHealth/AvailabilityStatuses"), - // ID: to.Ptr("/subscriptions/227b734f-e14f-4de6-b7fc-3190c21e69f6/resourceGroups/JUHACKETRHCTEST/providers/Microsoft.Compute/virtualMachineScaleSets/rhctest/virtualMachines/4/providers/Microsoft.ResourceHealth/availabilityStatuses/2018-11-30+22%3a30%3a23Z"), - // Location: to.Ptr("southcentralus"), - // Properties: &armresourcehealth.AvailabilityStatusProperties{ - // AvailabilityState: to.Ptr(armresourcehealth.AvailabilityStateValuesUnavailable), - // DetailedStatus: to.Ptr(""), - // OccurredTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-30T22:30:23.000Z"); return t}()), - // ReasonChronicity: to.Ptr(armresourcehealth.ReasonChronicityTypesTransient), - // ReasonType: to.Ptr("Customer Initiated"), - // RecommendedActions: []*armresourcehealth.RecommendedAction{ - // { - // Action: to.Ptr("Check back here for status updates"), - // ActionURL: to.Ptr(""), - // ActionURLText: to.Ptr(""), - // }, - // { - // Action: to.Ptr("If you are experiencing problems you believe are caused by Azure, contact support"), - // ActionURL: to.Ptr("<#SupportCase>"), - // ActionURLText: to.Ptr("contact support"), - // }}, - // ResolutionETA: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-30T22:50:23.000Z"); return t}()), - // RootCauseAttributionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-30T22:30:22.256Z"); return t}()), - // Summary: to.Ptr("This virtual machine is rebooting as requested by an authorized user or process. It will be back online after the reboot completes."), - // }, - // }, - // { - // Name: to.Ptr("2018-11-21+00%3a00%3a00Z"), - // Type: to.Ptr("Microsoft.ResourceHealth/AvailabilityStatuses"), - // ID: to.Ptr("/subscriptions/227b734f-e14f-4de6-b7fc-3190c21e69f6/resourceGroups/JUHACKETRHCTEST/providers/Microsoft.Compute/virtualMachineScaleSets/rhctest/virtualMachines/4/providers/Microsoft.ResourceHealth/availabilityStatuses/2018-11-21+00%3a00%3a00Z"), - // Location: to.Ptr("southcentralus"), - // Properties: &armresourcehealth.AvailabilityStatusProperties{ - // AvailabilityState: to.Ptr(armresourcehealth.AvailabilityStateValuesAvailable), - // DetailedStatus: to.Ptr(""), - // OccurredTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-21T00:00:00.000Z"); return t}()), - // ReasonChronicity: to.Ptr(armresourcehealth.ReasonChronicityTypesTransient), - // ReasonType: to.Ptr(""), - // RecommendedActions: []*armresourcehealth.RecommendedAction{ - // { - // Action: to.Ptr("If you're having problems, use the Troubleshoot tool to get recommended solutions."), - // ActionURL: to.Ptr("<#TroubleshootV2Blade>"), - // ActionURLText: to.Ptr("Troubleshoot tool"), - // }, - // { - // Action: to.Ptr("If you are experiencing problems you believe are caused by Azure, contact support"), - // ActionURL: to.Ptr("<#SupportCase>"), - // ActionURLText: to.Ptr("contact support"), - // }}, - // Summary: to.Ptr("There aren't any known Azure platform problems affecting this virtual machine"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/childresources_client.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/childresources_client.go index 58a8b858aabd..29d43250079b 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/childresources_client.go +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/childresources_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -41,7 +38,7 @@ func NewChildResourcesClient(credential azcore.TokenCredential, options *arm.Cli // NewListPager - Lists the all the children and its current health status for a parent resource. Use the nextLink property // in the response to get the next page of children current health // -// Generated from API version 2023-10-01-preview +// Generated from API version 2025-05-01 // - 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} @@ -84,7 +81,7 @@ func (client *ChildResourcesClient) listCreateRequest(ctx context.Context, resou if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2023-10-01-preview") + reqQP.Set("api-version", "2025-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/childresources_client_example_test.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/childresources_client_example_test.go deleted file mode 100644 index 7384b7cdc95e..000000000000 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/childresources_client_example_test.go +++ /dev/null @@ -1,123 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armresourcehealth_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resourcehealth/armresourcehealth" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ChildResources_List.json -func ExampleChildResourcesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresourcehealth.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewChildResourcesClient().NewListPager("resourceUri", &armresourcehealth.ChildResourcesClientListOptions{Filter: nil, - Expand: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AvailabilityStatusListResult = armresourcehealth.AvailabilityStatusListResult{ - // Value: []*armresourcehealth.AvailabilityStatus{ - // { - // Name: to.Ptr("rhctest_0"), - // Type: to.Ptr("Microsoft.ResourceHealth/AvailabilityStatuses"), - // ID: to.Ptr("/subscriptions/227b734f-e14f-4de6-b7fc-3190c21e69f6/resourceGroups/JUHACKETRHCTEST/providers/Microsoft.Compute/virtualMachineScaleSets/rhctest/virtualMachines/0/providers/Microsoft.ResourceHealth/child/availabilityStatuses/current"), - // Location: to.Ptr("southcentralus"), - // Properties: &armresourcehealth.AvailabilityStatusProperties{ - // AvailabilityState: to.Ptr(armresourcehealth.AvailabilityStateValuesAvailable), - // DetailedStatus: to.Ptr(""), - // OccurredTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-30T23:37:43.000Z"); return t}()), - // ReasonChronicity: to.Ptr(armresourcehealth.ReasonChronicityTypesPersistent), - // ReasonType: to.Ptr(""), - // ReportedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-12-04T01:18:25.575Z"); return t}()), - // Summary: to.Ptr("There aren't any known Azure platform problems affecting this virtual machine"), - // }, - // }, - // { - // Name: to.Ptr("rhctest_3"), - // Type: to.Ptr("Microsoft.ResourceHealth/AvailabilityStatuses"), - // ID: to.Ptr("/subscriptions/227b734f-e14f-4de6-b7fc-3190c21e69f6/resourceGroups/JUHACKETRHCTEST/providers/Microsoft.Compute/virtualMachineScaleSets/rhctest/virtualMachines/3/providers/Microsoft.ResourceHealth/child/availabilityStatuses/current"), - // Location: to.Ptr("southcentralus"), - // Properties: &armresourcehealth.AvailabilityStatusProperties{ - // AvailabilityState: to.Ptr(armresourcehealth.AvailabilityStateValuesAvailable), - // DetailedStatus: to.Ptr(""), - // OccurredTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-30T23:37:41.000Z"); return t}()), - // ReasonChronicity: to.Ptr(armresourcehealth.ReasonChronicityTypesPersistent), - // ReasonType: to.Ptr(""), - // ReportedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-12-04T01:18:25.575Z"); return t}()), - // Summary: to.Ptr("There aren't any known Azure platform problems affecting this virtual machine"), - // }, - // }, - // { - // Name: to.Ptr("rhctest_1"), - // Type: to.Ptr("Microsoft.ResourceHealth/AvailabilityStatuses"), - // ID: to.Ptr("/subscriptions/227b734f-e14f-4de6-b7fc-3190c21e69f6/resourceGroups/JUHACKETRHCTEST/providers/Microsoft.Compute/virtualMachineScaleSets/rhctest/virtualMachines/1/providers/Microsoft.ResourceHealth/child/availabilityStatuses/current"), - // Location: to.Ptr("southcentralus"), - // Properties: &armresourcehealth.AvailabilityStatusProperties{ - // AvailabilityState: to.Ptr(armresourcehealth.AvailabilityStateValuesAvailable), - // DetailedStatus: to.Ptr(""), - // OccurredTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-30T23:37:48.000Z"); return t}()), - // ReasonChronicity: to.Ptr(armresourcehealth.ReasonChronicityTypesPersistent), - // ReasonType: to.Ptr(""), - // ReportedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-12-04T01:18:25.575Z"); return t}()), - // Summary: to.Ptr("There aren't any known Azure platform problems affecting this virtual machine"), - // }, - // }, - // { - // Name: to.Ptr("rhctest_2"), - // Type: to.Ptr("Microsoft.ResourceHealth/AvailabilityStatuses"), - // ID: to.Ptr("/subscriptions/227b734f-e14f-4de6-b7fc-3190c21e69f6/resourceGroups/JUHACKETRHCTEST/providers/Microsoft.Compute/virtualMachineScaleSets/rhctest/virtualMachines/2/providers/Microsoft.ResourceHealth/child/availabilityStatuses/current"), - // Location: to.Ptr("southcentralus"), - // Properties: &armresourcehealth.AvailabilityStatusProperties{ - // AvailabilityState: to.Ptr(armresourcehealth.AvailabilityStateValuesAvailable), - // DetailedStatus: to.Ptr(""), - // OccurredTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-30T23:37:43.000Z"); return t}()), - // ReasonChronicity: to.Ptr(armresourcehealth.ReasonChronicityTypesPersistent), - // ReasonType: to.Ptr(""), - // ReportedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-12-04T01:18:25.575Z"); return t}()), - // Summary: to.Ptr("There aren't any known Azure platform problems affecting this virtual machine"), - // }, - // }, - // { - // Name: to.Ptr("rhctest_4"), - // Type: to.Ptr("Microsoft.ResourceHealth/AvailabilityStatuses"), - // ID: to.Ptr("/subscriptions/227b734f-e14f-4de6-b7fc-3190c21e69f6/resourceGroups/JUHACKETRHCTEST/providers/Microsoft.Compute/virtualMachineScaleSets/rhctest/virtualMachines/4/providers/Microsoft.ResourceHealth/child/availabilityStatuses/current"), - // Location: to.Ptr("southcentralus"), - // Properties: &armresourcehealth.AvailabilityStatusProperties{ - // AvailabilityState: to.Ptr(armresourcehealth.AvailabilityStateValuesAvailable), - // DetailedStatus: to.Ptr(""), - // OccurredTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-30T23:37:44.000Z"); return t}()), - // ReasonChronicity: to.Ptr(armresourcehealth.ReasonChronicityTypesPersistent), - // ReasonType: to.Ptr(""), - // ReportedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-12-04T01:18:25.575Z"); return t}()), - // Summary: to.Ptr("There aren't any known Azure platform problems affecting this virtual machine"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/client_factory.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/client_factory.go index 45fcea1cc323..238320d962d3 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/client_factory.go +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/client_factory.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/constants.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/constants.go index a078529e484f..c7bcd1231be4 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/constants.go +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/constants.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -10,7 +7,7 @@ package armresourcehealth const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resourcehealth/armresourcehealth" - moduleVersion = "v1.4.0-beta.2" + moduleVersion = "v1.4.0" ) // AvailabilityStateValues - Impacted resource status of the resource. @@ -105,20 +102,6 @@ func PossibleEventStatusValuesValues() []EventStatusValues { } } -// EventSubTypeValues - Sub type of the event. Currently used to determine retirement communications for health advisory events -type EventSubTypeValues string - -const ( - EventSubTypeValuesRetirement EventSubTypeValues = "Retirement" -) - -// PossibleEventSubTypeValuesValues returns the possible values for the EventSubTypeValues const type. -func PossibleEventSubTypeValuesValues() []EventSubTypeValues { - return []EventSubTypeValues{ - EventSubTypeValuesRetirement, - } -} - // EventTypeValues - Type of event. type EventTypeValues string diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/emergingissues_client.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/emergingissues_client.go index c8882d3f80c6..e2cf41651fa0 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/emergingissues_client.go +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/emergingissues_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -43,7 +40,7 @@ func NewEmergingIssuesClient(credential azcore.TokenCredential, options *arm.Cli // Get - Gets Azure services' emerging issues. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-01-preview +// Generated from API version 2025-05-01 // - issueName - The name of the emerging issue. // - options - EmergingIssuesClientGetOptions contains the optional parameters for the EmergingIssuesClient.Get method. func (client *EmergingIssuesClient) Get(ctx context.Context, issueName IssueNameParameter, options *EmergingIssuesClientGetOptions) (EmergingIssuesClientGetResponse, error) { @@ -69,7 +66,7 @@ func (client *EmergingIssuesClient) Get(ctx context.Context, issueName IssueName } // getCreateRequest creates the Get request. -func (client *EmergingIssuesClient) getCreateRequest(ctx context.Context, issueName IssueNameParameter, options *EmergingIssuesClientGetOptions) (*policy.Request, error) { +func (client *EmergingIssuesClient) getCreateRequest(ctx context.Context, issueName IssueNameParameter, _ *EmergingIssuesClientGetOptions) (*policy.Request, error) { urlPath := "/providers/Microsoft.ResourceHealth/emergingIssues/{issueName}" if issueName == "" { return nil, errors.New("parameter issueName cannot be empty") @@ -80,7 +77,7 @@ func (client *EmergingIssuesClient) getCreateRequest(ctx context.Context, issueN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-01-preview") + reqQP.Set("api-version", "2025-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -97,7 +94,7 @@ func (client *EmergingIssuesClient) getHandleResponse(resp *http.Response) (Emer // NewListPager - Lists Azure services' emerging issues. // -// Generated from API version 2023-10-01-preview +// Generated from API version 2025-05-01 // - options - EmergingIssuesClientListOptions contains the optional parameters for the EmergingIssuesClient.NewListPager method. func (client *EmergingIssuesClient) NewListPager(options *EmergingIssuesClientListOptions) *runtime.Pager[EmergingIssuesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[EmergingIssuesClientListResponse]{ @@ -123,14 +120,14 @@ func (client *EmergingIssuesClient) NewListPager(options *EmergingIssuesClientLi } // listCreateRequest creates the List request. -func (client *EmergingIssuesClient) listCreateRequest(ctx context.Context, options *EmergingIssuesClientListOptions) (*policy.Request, error) { +func (client *EmergingIssuesClient) listCreateRequest(ctx context.Context, _ *EmergingIssuesClientListOptions) (*policy.Request, error) { urlPath := "/providers/Microsoft.ResourceHealth/emergingIssues" req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-01-preview") + reqQP.Set("api-version", "2025-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/emergingissues_client_example_test.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/emergingissues_client_example_test.go deleted file mode 100644 index 27963aa373fd..000000000000 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/emergingissues_client_example_test.go +++ /dev/null @@ -1,202 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armresourcehealth_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resourcehealth/armresourcehealth" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/EmergingIssues_List.json -func ExampleEmergingIssuesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresourcehealth.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewEmergingIssuesClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.EmergingIssueListResult = armresourcehealth.EmergingIssueListResult{ - // Value: []*armresourcehealth.EmergingIssuesGetResult{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("/providers/Microsoft.ResourceHealth/emergingissues"), - // ID: to.Ptr("/providers/Microsoft.ResourceHealth/emergingissues/default"), - // Properties: &armresourcehealth.EmergingIssue{ - // RefreshTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-17T09:12:00.000Z"); return t}()), - // StatusActiveEvents: []*armresourcehealth.StatusActiveEvent{ - // { - // Description: to.Ptr("Virtual Machines case"), - // Cloud: to.Ptr("Public"), - // Impacts: []*armresourcehealth.EmergingIssueImpact{ - // { - // Name: to.Ptr("Virtual Machines"), - // ID: to.Ptr("virtual-machines"), - // Regions: []*armresourcehealth.ImpactedRegion{ - // { - // Name: to.Ptr("Central US"), - // ID: to.Ptr("us-central"), - // }, - // { - // Name: to.Ptr("East US"), - // ID: to.Ptr("us-east"), - // }}, - // }}, - // LastModifiedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-15T08:10:00.000Z"); return t}()), - // Published: to.Ptr(true), - // Severity: to.Ptr(armresourcehealth.SeverityValuesInformation), - // Stage: to.Ptr(armresourcehealth.StageValuesActive), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-15T08:06:00.000Z"); return t}()), - // Title: to.Ptr("Automatic updates to the dial tone page from ACM - SHD event"), - // TrackingID: to.Ptr("KTTK-TZ8"), - // }, - // { - // Description: to.Ptr("All Azure SQL service management requests (create, update, delete, etc.) are serviced through the SQL Control Plane infrastructure. Engineers determined that during this issue, the control plane service became unhealthy after receiving a significant increase in internally generated operations and reaching an operational threshold. This led to service management requests becoming unable to complete, which in-turn resulted in timeouts and throttling. Subsequent investigation by engineers determined this issue was due service requests from an internal Azure group that triggered a bug which caused an excessive number of internally generated operations."), - // Cloud: to.Ptr("Public"), - // Impacts: []*armresourcehealth.EmergingIssueImpact{ - // { - // Name: to.Ptr("SQL Database"), - // ID: to.Ptr("sql-database"), - // Regions: []*armresourcehealth.ImpactedRegion{ - // { - // Name: to.Ptr("West Europe"), - // ID: to.Ptr("europe-west"), - // }}, - // }}, - // LastModifiedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-16T05:11:00.000Z"); return t}()), - // Published: to.Ptr(true), - // Severity: to.Ptr(armresourcehealth.SeverityValuesError), - // Stage: to.Ptr(armresourcehealth.StageValuesActive), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-16T05:11:00.000Z"); return t}()), - // Title: to.Ptr("Azure SQL Database - West Europe"), - // TrackingID: to.Ptr("4KHK-LS8"), - // }}, - // StatusBanners: []*armresourcehealth.StatusBanner{ - // { - // Cloud: to.Ptr("Public"), - // LastModifiedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-15T08:04:00.000Z"); return t}()), - // Message: to.Ptr("Testing backup site"), - // Title: to.Ptr("Automatic updates to the dial tone page from ACM - banner"), - // }, - // { - // Cloud: to.Ptr("Public"), - // LastModifiedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-15T10:15:00.000Z"); return t}()), - // Message: to.Ptr("A subset of customers using Storage in West Europe experienced service availability issues. In addition, resources with dependencies on the impacted storage scale units may have experienced downstream impact in the form of availability issues, connection failures, or high latency. Engineers are investigating the root cause."), - // Title: to.Ptr("Storage - West Europe"), - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/EmergingIssues_Get.json -func ExampleEmergingIssuesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresourcehealth.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewEmergingIssuesClient().Get(ctx, armresourcehealth.IssueNameParameterDefault, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.EmergingIssuesGetResult = armresourcehealth.EmergingIssuesGetResult{ - // Name: to.Ptr("default"), - // Type: to.Ptr("/providers/Microsoft.ResourceHealth/emergingissues"), - // ID: to.Ptr("/providers/Microsoft.ResourceHealth/emergingissues/default"), - // Properties: &armresourcehealth.EmergingIssue{ - // RefreshTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-17T09:12:00.000Z"); return t}()), - // StatusActiveEvents: []*armresourcehealth.StatusActiveEvent{ - // { - // Description: to.Ptr("Virtual Machines case"), - // Cloud: to.Ptr("Public"), - // Impacts: []*armresourcehealth.EmergingIssueImpact{ - // { - // Name: to.Ptr("Virtual Machines"), - // ID: to.Ptr("virtual-machines"), - // Regions: []*armresourcehealth.ImpactedRegion{ - // { - // Name: to.Ptr("Central US"), - // ID: to.Ptr("us-central"), - // }, - // { - // Name: to.Ptr("East US"), - // ID: to.Ptr("us-east"), - // }}, - // }}, - // LastModifiedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-15T08:10:00.000Z"); return t}()), - // Published: to.Ptr(true), - // Severity: to.Ptr(armresourcehealth.SeverityValuesInformation), - // Stage: to.Ptr(armresourcehealth.StageValuesActive), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-15T08:06:00.000Z"); return t}()), - // Title: to.Ptr("Automatic updates to the dial tone page from ACM - SHD event"), - // TrackingID: to.Ptr("KTTK-TZ8"), - // }, - // { - // Description: to.Ptr("All Azure SQL service management requests (create, update, delete, etc.) are serviced through the SQL Control Plane infrastructure. Engineers determined that during this issue, the control plane service became unhealthy after receiving a significant increase in internally generated operations and reaching an operational threshold. This led to service management requests becoming unable to complete, which in-turn resulted in timeouts and throttling. Subsequent investigation by engineers determined this issue was due service requests from an internal Azure group that triggered a bug which caused an excessive number of internally generated operations."), - // Cloud: to.Ptr("Public"), - // Impacts: []*armresourcehealth.EmergingIssueImpact{ - // { - // Name: to.Ptr("SQL Database"), - // ID: to.Ptr("sql-database"), - // Regions: []*armresourcehealth.ImpactedRegion{ - // { - // Name: to.Ptr("West Europe"), - // ID: to.Ptr("europe-west"), - // }}, - // }}, - // LastModifiedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-16T05:11:00.000Z"); return t}()), - // Published: to.Ptr(true), - // Severity: to.Ptr(armresourcehealth.SeverityValuesError), - // Stage: to.Ptr(armresourcehealth.StageValuesActive), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-16T05:11:00.000Z"); return t}()), - // Title: to.Ptr("Azure SQL Database - West Europe"), - // TrackingID: to.Ptr("4KHK-LS8"), - // }}, - // StatusBanners: []*armresourcehealth.StatusBanner{ - // { - // Cloud: to.Ptr("Public"), - // LastModifiedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-15T08:04:00.000Z"); return t}()), - // Message: to.Ptr("Testing backup site"), - // Title: to.Ptr("Automatic updates to the dial tone page from ACM - banner"), - // }, - // { - // Cloud: to.Ptr("Public"), - // LastModifiedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-15T10:15:00.000Z"); return t}()), - // Message: to.Ptr("A subset of customers using Storage in West Europe experienced service availability issues. In addition, resources with dependencies on the impacted storage scale units may have experienced downstream impact in the form of availability issues, connection failures, or high latency. Engineers are investigating the root cause."), - // Title: to.Ptr("Storage - West Europe"), - // }}, - // }, - // } -} diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/event_client.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/event_client.go index 61e8c3c2ba64..ade92762b3df 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/event_client.go +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/event_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -44,10 +41,11 @@ func NewEventClient(subscriptionID string, credential azcore.TokenCredential, op } // FetchDetailsBySubscriptionIDAndTrackingID - Service health event details in the subscription by event tracking id. This -// can be used to fetch sensitive properties for Security Advisory events +// can be used to fetch sensitive properties for Security Advisory events. Please see +// https://learn.microsoft.com/en-us/azure/service-health/security-advisories-elevated-access // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-01-preview +// Generated from API version 2025-05-01 // - eventTrackingID - Event Id which uniquely identifies ServiceHealth event. // - options - EventClientFetchDetailsBySubscriptionIDAndTrackingIDOptions contains the optional parameters for the EventClient.FetchDetailsBySubscriptionIDAndTrackingID // method. @@ -74,7 +72,7 @@ func (client *EventClient) FetchDetailsBySubscriptionIDAndTrackingID(ctx context } // fetchDetailsBySubscriptionIDAndTrackingIDCreateRequest creates the FetchDetailsBySubscriptionIDAndTrackingID request. -func (client *EventClient) fetchDetailsBySubscriptionIDAndTrackingIDCreateRequest(ctx context.Context, eventTrackingID string, options *EventClientFetchDetailsBySubscriptionIDAndTrackingIDOptions) (*policy.Request, error) { +func (client *EventClient) fetchDetailsBySubscriptionIDAndTrackingIDCreateRequest(ctx context.Context, eventTrackingID string, _ *EventClientFetchDetailsBySubscriptionIDAndTrackingIDOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/events/{eventTrackingId}/fetchEventDetails" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -89,7 +87,7 @@ func (client *EventClient) fetchDetailsBySubscriptionIDAndTrackingIDCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-01-preview") + reqQP.Set("api-version", "2025-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -105,10 +103,11 @@ func (client *EventClient) fetchDetailsBySubscriptionIDAndTrackingIDHandleRespon } // FetchDetailsByTenantIDAndTrackingID - Service health event details in the tenant by event tracking id. This can be used -// to fetch sensitive properties for Security Advisory events +// to fetch sensitive properties for Security Advisory events. Please see +// https://learn.microsoft.com/en-us/azure/service-health/security-advisories-elevated-access // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-01-preview +// Generated from API version 2025-05-01 // - eventTrackingID - Event Id which uniquely identifies ServiceHealth event. // - options - EventClientFetchDetailsByTenantIDAndTrackingIDOptions contains the optional parameters for the EventClient.FetchDetailsByTenantIDAndTrackingID // method. @@ -135,7 +134,7 @@ func (client *EventClient) FetchDetailsByTenantIDAndTrackingID(ctx context.Conte } // fetchDetailsByTenantIDAndTrackingIDCreateRequest creates the FetchDetailsByTenantIDAndTrackingID request. -func (client *EventClient) fetchDetailsByTenantIDAndTrackingIDCreateRequest(ctx context.Context, eventTrackingID string, options *EventClientFetchDetailsByTenantIDAndTrackingIDOptions) (*policy.Request, error) { +func (client *EventClient) fetchDetailsByTenantIDAndTrackingIDCreateRequest(ctx context.Context, eventTrackingID string, _ *EventClientFetchDetailsByTenantIDAndTrackingIDOptions) (*policy.Request, error) { urlPath := "/providers/Microsoft.ResourceHealth/events/{eventTrackingId}/fetchEventDetails" if eventTrackingID == "" { return nil, errors.New("parameter eventTrackingID cannot be empty") @@ -146,7 +145,7 @@ func (client *EventClient) fetchDetailsByTenantIDAndTrackingIDCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-01-preview") + reqQP.Set("api-version", "2025-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -164,7 +163,7 @@ func (client *EventClient) fetchDetailsByTenantIDAndTrackingIDHandleResponse(res // GetBySubscriptionIDAndTrackingID - Service health event in the subscription by event tracking id // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-01-preview +// Generated from API version 2025-05-01 // - eventTrackingID - Event Id which uniquely identifies ServiceHealth event. // - options - EventClientGetBySubscriptionIDAndTrackingIDOptions contains the optional parameters for the EventClient.GetBySubscriptionIDAndTrackingID // method. @@ -209,7 +208,7 @@ func (client *EventClient) getBySubscriptionIDAndTrackingIDCreateRequest(ctx con if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2023-10-01-preview") + reqQP.Set("api-version", "2025-05-01") if options != nil && options.QueryStartTime != nil { reqQP.Set("queryStartTime", *options.QueryStartTime) } @@ -230,7 +229,7 @@ func (client *EventClient) getBySubscriptionIDAndTrackingIDHandleResponse(resp * // GetByTenantIDAndTrackingID - Service health event in the tenant by event tracking id // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-01-preview +// Generated from API version 2025-05-01 // - eventTrackingID - Event Id which uniquely identifies ServiceHealth event. // - options - EventClientGetByTenantIDAndTrackingIDOptions contains the optional parameters for the EventClient.GetByTenantIDAndTrackingID // method. @@ -271,7 +270,7 @@ func (client *EventClient) getByTenantIDAndTrackingIDCreateRequest(ctx context.C if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2023-10-01-preview") + reqQP.Set("api-version", "2025-05-01") if options != nil && options.QueryStartTime != nil { reqQP.Set("queryStartTime", *options.QueryStartTime) } diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/event_client_example_test.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/event_client_example_test.go deleted file mode 100644 index 46c5985d644b..000000000000 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/event_client_example_test.go +++ /dev/null @@ -1,449 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armresourcehealth_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resourcehealth/armresourcehealth" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/Event_GetBySubscriptionIdAndTrackingId.json -func ExampleEventClient_GetBySubscriptionIDAndTrackingID() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresourcehealth.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewEventClient().GetBySubscriptionIDAndTrackingID(ctx, "eventTrackingId", &armresourcehealth.EventClientGetBySubscriptionIDAndTrackingIDOptions{Filter: to.Ptr("properties/status eq 'Active'"), - QueryStartTime: to.Ptr("7/10/2022"), - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Event = armresourcehealth.Event{ - // Name: to.Ptr("{eventTrackingId}"), - // Type: to.Ptr("/providers/Microsoft.ResourceHealth/events"), - // ID: to.Ptr("/providers/Microsoft.ResourceHealth/events/{eventTrackingId}"), - // Properties: &armresourcehealth.EventProperties{ - // ArgQuery: to.Ptr("{argQuery}"), - // Article: &armresourcehealth.EventPropertiesArticle{ - // ArticleContent: to.Ptr("An outage alert is being investigated. More information will be provided as it is known"), - // }, - // EnableChatWithUs: to.Ptr(false), - // EnableMicrosoftSupport: to.Ptr(true), - // EventLevel: to.Ptr(armresourcehealth.EventLevelValuesInformational), - // EventSource: to.Ptr(armresourcehealth.EventSourceValuesResourceHealth), - // EventType: to.Ptr(armresourcehealth.EventTypeValuesServiceIssue), - // Faqs: []*armresourcehealth.Faq{ - // { - // Answer: to.Ptr("This is an answer"), - // LocaleCode: to.Ptr("en"), - // Question: to.Ptr("This is a question"), - // }}, - // Header: to.Ptr("Your service might have been impacted by an Azure service issue"), - // HirStage: to.Ptr("resolved"), - // Impact: []*armresourcehealth.Impact{ - // { - // ImpactedRegions: []*armresourcehealth.ImpactedServiceRegion{ - // { - // ImpactedRegion: to.Ptr("West US"), - // ImpactedSubscriptions: []*string{ - // to.Ptr("{subscriptionId}")}, - // ImpactedTenants: []*string{ - // }, - // LastUpdateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-05T21:05:00.000Z"); return t}()), - // Status: to.Ptr(armresourcehealth.EventStatusValuesActive), - // }}, - // ImpactedService: to.Ptr("Virtual Machines"), - // }}, - // ImpactMitigationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-08T00:00:00.000Z"); return t}()), - // ImpactStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-07T00:00:00.000Z"); return t}()), - // IsHIR: to.Ptr(false), - // LastUpdateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-08T00:00:00.000Z"); return t}()), - // Level: to.Ptr(armresourcehealth.LevelValuesWarning), - // Links: []*armresourcehealth.Link{ - // { - // Type: to.Ptr(armresourcehealth.LinkTypeValuesHyperlink), - // BladeName: to.Ptr("RequestRCABlade"), - // DisplayText: &armresourcehealth.LinkDisplayText{ - // LocalizedValue: to.Ptr("Request RCA"), - // Value: to.Ptr("Request RCA"), - // }, - // ExtensionName: to.Ptr("Microsoft_Azure_Health"), - // Parameters: map[string]any{ - // "rcaRequested": "False", - // "trackingId": "{eventTrackingId}", - // }, - // }, - // { - // Type: to.Ptr(armresourcehealth.LinkTypeValuesButton), - // BladeName: to.Ptr("AzureHealthBrowseBlade"), - // DisplayText: &armresourcehealth.LinkDisplayText{ - // LocalizedValue: to.Ptr("Sign up for updates"), - // Value: to.Ptr("Sign up for updates"), - // }, - // ExtensionName: to.Ptr("Microsoft_Azure_Health"), - // Parameters: map[string]any{ - // "trackingId": "{eventTrackingId}", - // }, - // }}, - // MaintenanceID: to.Ptr("{maintenanceId}"), - // MaintenanceType: to.Ptr("{maintenanceType}"), - // Priority: to.Ptr[int32](2), - // RecommendedActions: &armresourcehealth.EventPropertiesRecommendedActions{ - // Actions: []*armresourcehealth.EventPropertiesRecommendedActionsItem{ - // { - // ActionText: to.Ptr("action 1"), - // GroupID: to.Ptr[int32](23243), - // }, - // { - // ActionText: to.Ptr("action 2"), - // GroupID: to.Ptr[int32](23432), - // }}, - // LocaleCode: to.Ptr("en"), - // Message: to.Ptr("Recommended actions title"), - // }, - // Status: to.Ptr(armresourcehealth.EventStatusValuesActive), - // Summary: to.Ptr("An outage alert is being investigated. More information will be provided as it is known."), - // Title: to.Ptr("ACTIVE: Virtual machines in West US"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/Event_fetchDetailsBySubscriptionIdAndTrackingId.json -func ExampleEventClient_FetchDetailsBySubscriptionIDAndTrackingID() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresourcehealth.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewEventClient().FetchDetailsBySubscriptionIDAndTrackingID(ctx, "eventTrackingId", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Event = armresourcehealth.Event{ - // Name: to.Ptr("{eventTrackingId}"), - // Type: to.Ptr("/providers/Microsoft.ResourceHealth/events"), - // ID: to.Ptr("/providers/Microsoft.ResourceHealth/events/{eventTrackingId}"), - // Properties: &armresourcehealth.EventProperties{ - // ArgQuery: to.Ptr("{argQuery}"), - // Article: &armresourcehealth.EventPropertiesArticle{ - // ArticleContent: to.Ptr("An outage alert is being investigated. More information will be provided as it is known"), - // }, - // EnableChatWithUs: to.Ptr(false), - // EnableMicrosoftSupport: to.Ptr(true), - // EventLevel: to.Ptr(armresourcehealth.EventLevelValuesInformational), - // EventSource: to.Ptr(armresourcehealth.EventSourceValuesResourceHealth), - // EventType: to.Ptr(armresourcehealth.EventTypeValuesServiceIssue), - // Faqs: []*armresourcehealth.Faq{ - // { - // Answer: to.Ptr("This is an answer"), - // LocaleCode: to.Ptr("en"), - // Question: to.Ptr("This is a question"), - // }}, - // Header: to.Ptr("Your service might have been impacted by an Azure service issue"), - // HirStage: to.Ptr("resolved"), - // Impact: []*armresourcehealth.Impact{ - // { - // ImpactedRegions: []*armresourcehealth.ImpactedServiceRegion{ - // { - // ImpactedRegion: to.Ptr("West US"), - // ImpactedSubscriptions: []*string{ - // to.Ptr("{subscriptionId}")}, - // ImpactedTenants: []*string{ - // }, - // LastUpdateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-05T21:05:00.000Z"); return t}()), - // Status: to.Ptr(armresourcehealth.EventStatusValuesActive), - // }}, - // ImpactedService: to.Ptr("Virtual Machines"), - // }}, - // ImpactMitigationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-08T00:00:00.000Z"); return t}()), - // ImpactStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-07T00:00:00.000Z"); return t}()), - // IsHIR: to.Ptr(false), - // LastUpdateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-08T00:00:00.000Z"); return t}()), - // Level: to.Ptr(armresourcehealth.LevelValuesWarning), - // Links: []*armresourcehealth.Link{ - // { - // Type: to.Ptr(armresourcehealth.LinkTypeValuesHyperlink), - // BladeName: to.Ptr("RequestRCABlade"), - // DisplayText: &armresourcehealth.LinkDisplayText{ - // LocalizedValue: to.Ptr("Request RCA"), - // Value: to.Ptr("Request RCA"), - // }, - // ExtensionName: to.Ptr("Microsoft_Azure_Health"), - // Parameters: map[string]any{ - // "rcaRequested": "False", - // "trackingId": "{eventTrackingId}", - // }, - // }, - // { - // Type: to.Ptr(armresourcehealth.LinkTypeValuesButton), - // BladeName: to.Ptr("AzureHealthBrowseBlade"), - // DisplayText: &armresourcehealth.LinkDisplayText{ - // LocalizedValue: to.Ptr("Sign up for updates"), - // Value: to.Ptr("Sign up for updates"), - // }, - // ExtensionName: to.Ptr("Microsoft_Azure_Health"), - // Parameters: map[string]any{ - // "trackingId": "{eventTrackingId}", - // }, - // }}, - // MaintenanceID: to.Ptr("{maintenanceId}"), - // MaintenanceType: to.Ptr("{maintenanceType}"), - // Priority: to.Ptr[int32](2), - // RecommendedActions: &armresourcehealth.EventPropertiesRecommendedActions{ - // Actions: []*armresourcehealth.EventPropertiesRecommendedActionsItem{ - // { - // ActionText: to.Ptr("action 1"), - // GroupID: to.Ptr[int32](23243), - // }, - // { - // ActionText: to.Ptr("action 2"), - // GroupID: to.Ptr[int32](23432), - // }}, - // LocaleCode: to.Ptr("en"), - // Message: to.Ptr("Recommended actions title"), - // }, - // Status: to.Ptr(armresourcehealth.EventStatusValuesActive), - // Summary: to.Ptr("An outage alert is being investigated. More information will be provided as it is known."), - // Title: to.Ptr("ACTIVE: Virtual machines in West US"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/Event_GetByTenantIdAndTrackingId.json -func ExampleEventClient_GetByTenantIDAndTrackingID() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresourcehealth.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewEventClient().GetByTenantIDAndTrackingID(ctx, "eventTrackingId", &armresourcehealth.EventClientGetByTenantIDAndTrackingIDOptions{Filter: to.Ptr("properties/status eq 'Active'"), - QueryStartTime: to.Ptr("7/10/2022"), - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Event = armresourcehealth.Event{ - // Name: to.Ptr("{eventTrackingId}"), - // Type: to.Ptr("/providers/Microsoft.ResourceHealth/events"), - // ID: to.Ptr("/providers/Microsoft.ResourceHealth/events/{eventTrackingId}"), - // Properties: &armresourcehealth.EventProperties{ - // Article: &armresourcehealth.EventPropertiesArticle{ - // ArticleContent: to.Ptr("An outage alert is being investigated. More information will be provided as it is known"), - // }, - // EnableChatWithUs: to.Ptr(false), - // EnableMicrosoftSupport: to.Ptr(true), - // EventLevel: to.Ptr(armresourcehealth.EventLevelValuesInformational), - // EventSource: to.Ptr(armresourcehealth.EventSourceValuesResourceHealth), - // EventType: to.Ptr(armresourcehealth.EventTypeValuesServiceIssue), - // Faqs: []*armresourcehealth.Faq{ - // { - // Answer: to.Ptr("This is an answer"), - // LocaleCode: to.Ptr("en"), - // Question: to.Ptr("This is a question"), - // }}, - // Header: to.Ptr("Your service might have been impacted by an Azure service issue"), - // HirStage: to.Ptr("resolved"), - // Impact: []*armresourcehealth.Impact{ - // { - // ImpactedRegions: []*armresourcehealth.ImpactedServiceRegion{ - // { - // ImpactedRegion: to.Ptr("West US"), - // ImpactedSubscriptions: []*string{ - // }, - // ImpactedTenants: []*string{ - // to.Ptr("00000000-0000-0000-0000-000000000000")}, - // LastUpdateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-05T21:05:00.000Z"); return t}()), - // Status: to.Ptr(armresourcehealth.EventStatusValuesActive), - // }}, - // ImpactedService: to.Ptr("Virtual Machines"), - // }}, - // ImpactMitigationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-08T00:00:00.000Z"); return t}()), - // ImpactStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-07T00:00:00.000Z"); return t}()), - // IsHIR: to.Ptr(false), - // LastUpdateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-08T00:00:00.000Z"); return t}()), - // Level: to.Ptr(armresourcehealth.LevelValuesWarning), - // Links: []*armresourcehealth.Link{ - // { - // Type: to.Ptr(armresourcehealth.LinkTypeValuesHyperlink), - // BladeName: to.Ptr("RequestRCABlade"), - // DisplayText: &armresourcehealth.LinkDisplayText{ - // LocalizedValue: to.Ptr("Request RCA"), - // Value: to.Ptr("Request RCA"), - // }, - // ExtensionName: to.Ptr("Microsoft_Azure_Health"), - // Parameters: map[string]any{ - // "rcaRequested": "False", - // "trackingId": "{eventTrackingId}", - // }, - // }, - // { - // Type: to.Ptr(armresourcehealth.LinkTypeValuesButton), - // BladeName: to.Ptr("AzureHealthBrowseBlade"), - // DisplayText: &armresourcehealth.LinkDisplayText{ - // LocalizedValue: to.Ptr("Sign up for updates"), - // Value: to.Ptr("Sign up for updates"), - // }, - // ExtensionName: to.Ptr("Microsoft_Azure_Health"), - // Parameters: map[string]any{ - // "trackingId": "{eventTrackingId}", - // }, - // }}, - // Priority: to.Ptr[int32](2), - // RecommendedActions: &armresourcehealth.EventPropertiesRecommendedActions{ - // Actions: []*armresourcehealth.EventPropertiesRecommendedActionsItem{ - // { - // ActionText: to.Ptr("action 1"), - // GroupID: to.Ptr[int32](23243), - // }, - // { - // ActionText: to.Ptr("action 2"), - // GroupID: to.Ptr[int32](23432), - // }}, - // LocaleCode: to.Ptr("en"), - // Message: to.Ptr("Recommended actions title"), - // }, - // Status: to.Ptr(armresourcehealth.EventStatusValuesActive), - // Summary: to.Ptr("An outage alert is being investigated. More information will be provided as it is known."), - // Title: to.Ptr("ACTIVE: Virtual machines in West US"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/Event_fetchDetailsByTenantIdAndTrackingId.json -func ExampleEventClient_FetchDetailsByTenantIDAndTrackingID() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresourcehealth.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewEventClient().FetchDetailsByTenantIDAndTrackingID(ctx, "eventTrackingId", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Event = armresourcehealth.Event{ - // Name: to.Ptr("{eventTrackingId}"), - // Type: to.Ptr("/providers/Microsoft.ResourceHealth/events"), - // ID: to.Ptr("/providers/Microsoft.ResourceHealth/events/{eventTrackingId}"), - // Properties: &armresourcehealth.EventProperties{ - // Article: &armresourcehealth.EventPropertiesArticle{ - // ArticleContent: to.Ptr("An outage alert is being investigated. More information will be provided as it is known"), - // }, - // EnableChatWithUs: to.Ptr(false), - // EnableMicrosoftSupport: to.Ptr(true), - // EventLevel: to.Ptr(armresourcehealth.EventLevelValuesInformational), - // EventSource: to.Ptr(armresourcehealth.EventSourceValuesResourceHealth), - // EventType: to.Ptr(armresourcehealth.EventTypeValuesServiceIssue), - // Faqs: []*armresourcehealth.Faq{ - // { - // Answer: to.Ptr("This is an answer"), - // LocaleCode: to.Ptr("en"), - // Question: to.Ptr("This is a question"), - // }}, - // Header: to.Ptr("Your service might have been impacted by an Azure service issue"), - // HirStage: to.Ptr("resolved"), - // Impact: []*armresourcehealth.Impact{ - // { - // ImpactedRegions: []*armresourcehealth.ImpactedServiceRegion{ - // { - // ImpactedRegion: to.Ptr("West US"), - // ImpactedSubscriptions: []*string{ - // }, - // ImpactedTenants: []*string{ - // to.Ptr("00000000-0000-0000-0000-000000000000")}, - // LastUpdateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-05T21:05:00.000Z"); return t}()), - // Status: to.Ptr(armresourcehealth.EventStatusValuesActive), - // }}, - // ImpactedService: to.Ptr("Virtual Machines"), - // }}, - // ImpactMitigationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-08T00:00:00.000Z"); return t}()), - // ImpactStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-07T00:00:00.000Z"); return t}()), - // IsHIR: to.Ptr(false), - // LastUpdateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-08T00:00:00.000Z"); return t}()), - // Level: to.Ptr(armresourcehealth.LevelValuesWarning), - // Links: []*armresourcehealth.Link{ - // { - // Type: to.Ptr(armresourcehealth.LinkTypeValuesHyperlink), - // BladeName: to.Ptr("RequestRCABlade"), - // DisplayText: &armresourcehealth.LinkDisplayText{ - // LocalizedValue: to.Ptr("Request RCA"), - // Value: to.Ptr("Request RCA"), - // }, - // ExtensionName: to.Ptr("Microsoft_Azure_Health"), - // Parameters: map[string]any{ - // "rcaRequested": "False", - // "trackingId": "{eventTrackingId}", - // }, - // }, - // { - // Type: to.Ptr(armresourcehealth.LinkTypeValuesButton), - // BladeName: to.Ptr("AzureHealthBrowseBlade"), - // DisplayText: &armresourcehealth.LinkDisplayText{ - // LocalizedValue: to.Ptr("Sign up for updates"), - // Value: to.Ptr("Sign up for updates"), - // }, - // ExtensionName: to.Ptr("Microsoft_Azure_Health"), - // Parameters: map[string]any{ - // "trackingId": "{eventTrackingId}", - // }, - // }}, - // Priority: to.Ptr[int32](2), - // RecommendedActions: &armresourcehealth.EventPropertiesRecommendedActions{ - // Actions: []*armresourcehealth.EventPropertiesRecommendedActionsItem{ - // { - // ActionText: to.Ptr("action 1"), - // GroupID: to.Ptr[int32](23243), - // }, - // { - // ActionText: to.Ptr("action 2"), - // GroupID: to.Ptr[int32](23432), - // }}, - // LocaleCode: to.Ptr("en"), - // Message: to.Ptr("Recommended actions title"), - // }, - // Status: to.Ptr(armresourcehealth.EventStatusValuesActive), - // Summary: to.Ptr("An outage alert is being investigated. More information will be provided as it is known."), - // Title: to.Ptr("ACTIVE: Virtual machines in West US"), - // }, - // } -} diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/events_client.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/events_client.go index a6b9394fd4e7..7baa9346d54a 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/events_client.go +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/events_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -45,7 +42,7 @@ func NewEventsClient(subscriptionID string, credential azcore.TokenCredential, o // NewListBySingleResourcePager - Lists current service health events for given resource. // -// Generated from API version 2023-10-01-preview +// Generated from API version 2025-05-01 // - 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} @@ -88,7 +85,7 @@ func (client *EventsClient) listBySingleResourceCreateRequest(ctx context.Contex if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2023-10-01-preview") + reqQP.Set("api-version", "2025-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -105,7 +102,7 @@ func (client *EventsClient) listBySingleResourceHandleResponse(resp *http.Respon // NewListBySubscriptionIDPager - Lists service health events in the subscription. // -// Generated from API version 2023-10-01-preview +// Generated from API version 2025-05-01 // - options - EventsClientListBySubscriptionIDOptions contains the optional parameters for the EventsClient.NewListBySubscriptionIDPager // method. func (client *EventsClient) NewListBySubscriptionIDPager(options *EventsClientListBySubscriptionIDOptions) *runtime.Pager[EventsClientListBySubscriptionIDResponse] { @@ -146,7 +143,7 @@ func (client *EventsClient) listBySubscriptionIDCreateRequest(ctx context.Contex if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2023-10-01-preview") + reqQP.Set("api-version", "2025-05-01") if options != nil && options.QueryStartTime != nil { reqQP.Set("queryStartTime", *options.QueryStartTime) } @@ -166,7 +163,7 @@ func (client *EventsClient) listBySubscriptionIDHandleResponse(resp *http.Respon // NewListByTenantIDPager - Lists current service health events in the tenant. // -// Generated from API version 2023-10-01-preview +// Generated from API version 2025-05-01 // - options - EventsClientListByTenantIDOptions contains the optional parameters for the EventsClient.NewListByTenantIDPager // method. func (client *EventsClient) NewListByTenantIDPager(options *EventsClientListByTenantIDOptions) *runtime.Pager[EventsClientListByTenantIDResponse] { @@ -203,7 +200,7 @@ func (client *EventsClient) listByTenantIDCreateRequest(ctx context.Context, opt if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2023-10-01-preview") + reqQP.Set("api-version", "2025-05-01") if options != nil && options.QueryStartTime != nil { reqQP.Set("queryStartTime", *options.QueryStartTime) } diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/events_client_example_test.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/events_client_example_test.go deleted file mode 100644 index ba1b6e0dd6db..000000000000 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/events_client_example_test.go +++ /dev/null @@ -1,402 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armresourcehealth_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resourcehealth/armresourcehealth" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/Events_ListBySubscriptionId.json -func ExampleEventsClient_NewListBySubscriptionIDPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresourcehealth.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewEventsClient().NewListBySubscriptionIDPager(&armresourcehealth.EventsClientListBySubscriptionIDOptions{Filter: to.Ptr("service eq 'Virtual Machines' or region eq 'West US'"), - QueryStartTime: to.Ptr("7/24/2020"), - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.Events = armresourcehealth.Events{ - // Value: []*armresourcehealth.Event{ - // { - // Name: to.Ptr("BC_1-FXZ"), - // Type: to.Ptr("/providers/Microsoft.ResourceHealth/events"), - // ID: to.Ptr("/providers/Microsoft.ResourceHealth/events/BC_1-FXZ"), - // Properties: &armresourcehealth.EventProperties{ - // ArgQuery: to.Ptr("{argQuery}"), - // Article: &armresourcehealth.EventPropertiesArticle{ - // ArticleContent: to.Ptr("An outage alert is being investigated. More information will be provided as it is known"), - // }, - // EnableChatWithUs: to.Ptr(false), - // EnableMicrosoftSupport: to.Ptr(true), - // EventLevel: to.Ptr(armresourcehealth.EventLevelValuesInformational), - // EventSource: to.Ptr(armresourcehealth.EventSourceValuesResourceHealth), - // EventType: to.Ptr(armresourcehealth.EventTypeValuesServiceIssue), - // Faqs: []*armresourcehealth.Faq{ - // { - // Answer: to.Ptr("This is an answer"), - // LocaleCode: to.Ptr("en"), - // Question: to.Ptr("This is a question"), - // }}, - // Header: to.Ptr("Your service might have been impacted by an Azure service issue"), - // HirStage: to.Ptr("resolved"), - // Impact: []*armresourcehealth.Impact{ - // { - // ImpactedRegions: []*armresourcehealth.ImpactedServiceRegion{ - // { - // ImpactedRegion: to.Ptr("West US"), - // ImpactedSubscriptions: []*string{ - // to.Ptr("{subscriptionId}")}, - // ImpactedTenants: []*string{ - // }, - // LastUpdateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-05T21:05:00.000Z"); return t}()), - // Status: to.Ptr(armresourcehealth.EventStatusValuesActive), - // }}, - // ImpactedService: to.Ptr("Virtual Machines"), - // }}, - // ImpactMitigationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-08T00:00:00.000Z"); return t}()), - // ImpactStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-07T00:00:00.000Z"); return t}()), - // IsHIR: to.Ptr(false), - // LastUpdateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-08T00:00:00.000Z"); return t}()), - // Level: to.Ptr(armresourcehealth.LevelValuesWarning), - // Links: []*armresourcehealth.Link{ - // { - // Type: to.Ptr(armresourcehealth.LinkTypeValuesHyperlink), - // BladeName: to.Ptr("RequestRCABlade"), - // DisplayText: &armresourcehealth.LinkDisplayText{ - // LocalizedValue: to.Ptr("Request RCA"), - // Value: to.Ptr("Request RCA"), - // }, - // ExtensionName: to.Ptr("Microsoft_Azure_Health"), - // Parameters: map[string]any{ - // "rcaRequested": "False", - // "trackingId": "BC_1-FXZ", - // }, - // }, - // { - // Type: to.Ptr(armresourcehealth.LinkTypeValuesButton), - // BladeName: to.Ptr("AzureHealthBrowseBlade"), - // DisplayText: &armresourcehealth.LinkDisplayText{ - // LocalizedValue: to.Ptr("Sign up for updates"), - // Value: to.Ptr("Sign up for updates"), - // }, - // ExtensionName: to.Ptr("Microsoft_Azure_Health"), - // Parameters: map[string]any{ - // "trackingId": "BC_1-FXZ", - // }, - // }}, - // MaintenanceID: to.Ptr("{maintenanceId}"), - // MaintenanceType: to.Ptr("{maintenanceType}"), - // Priority: to.Ptr[int32](2), - // RecommendedActions: &armresourcehealth.EventPropertiesRecommendedActions{ - // Actions: []*armresourcehealth.EventPropertiesRecommendedActionsItem{ - // { - // ActionText: to.Ptr("action 1"), - // GroupID: to.Ptr[int32](23243), - // }, - // { - // ActionText: to.Ptr("action 2"), - // GroupID: to.Ptr[int32](23432), - // }}, - // LocaleCode: to.Ptr("en"), - // Message: to.Ptr("Recommended actions title"), - // }, - // Status: to.Ptr(armresourcehealth.EventStatusValuesActive), - // Summary: to.Ptr("An outage alert is being investigated. More information will be provided as it is known."), - // Title: to.Ptr("ACTIVE: Virtual machines in West US"), - // }, - // }, - // { - // Name: to.Ptr("ABH3-RET"), - // Type: to.Ptr("Microsoft.ResourceHealth/events"), - // ID: to.Ptr("Microsoft.ResourceHealth/events/ABH3-RET"), - // Properties: &armresourcehealth.EventProperties{ - // Description: to.Ptr("retirement test"), - // EventLevel: to.Ptr(armresourcehealth.EventLevelValuesWarning), - // EventSource: to.Ptr(armresourcehealth.EventSourceValuesServiceHealth), - // EventSubType: to.Ptr(armresourcehealth.EventSubTypeValuesRetirement), - // EventType: to.Ptr(armresourcehealth.EventTypeValuesHealthAdvisory), - // Header: to.Ptr("retirement test"), - // Impact: []*armresourcehealth.Impact{ - // { - // ImpactedRegions: []*armresourcehealth.ImpactedServiceRegion{ - // { - // ImpactedRegion: to.Ptr("West US"), - // ImpactedSubscriptions: []*string{ - // to.Ptr("{subscriptionId}")}, - // ImpactedTenants: []*string{ - // }, - // LastUpdateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-14T20:10:00.000Z"); return t}()), - // Status: to.Ptr(armresourcehealth.EventStatusValuesActive), - // }}, - // ImpactedService: to.Ptr("Virtual Machines"), - // }}, - // ImpactMitigationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-14T20:10:00.000Z"); return t}()), - // ImpactStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-14T19:10:00.000Z"); return t}()), - // IsHIR: to.Ptr(false), - // LastUpdateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-14T20:10:00.000Z"); return t}()), - // Level: to.Ptr(armresourcehealth.LevelValuesWarning), - // PlatformInitiated: to.Ptr(true), - // Priority: to.Ptr[int32](22), - // RecommendedActions: &armresourcehealth.EventPropertiesRecommendedActions{ - // }, - // Status: to.Ptr(armresourcehealth.EventStatusValuesActive), - // Summary: to.Ptr("retirement test"), - // Title: to.Ptr("retirement test"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/Events_ListByTenantId.json -func ExampleEventsClient_NewListByTenantIDPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresourcehealth.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewEventsClient().NewListByTenantIDPager(&armresourcehealth.EventsClientListByTenantIDOptions{Filter: to.Ptr("service eq 'Virtual Machines' or region eq 'West US'"), - QueryStartTime: to.Ptr("7/24/2020"), - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.Events = armresourcehealth.Events{ - // Value: []*armresourcehealth.Event{ - // { - // Name: to.Ptr("BC_1-FXZ"), - // Type: to.Ptr("/providers/Microsoft.ResourceHealth/events"), - // ID: to.Ptr("/providers/Microsoft.ResourceHealth/events/BC_1-FXZ"), - // Properties: &armresourcehealth.EventProperties{ - // Article: &armresourcehealth.EventPropertiesArticle{ - // ArticleContent: to.Ptr("An outage alert is being investigated. More information will be provided as it is known"), - // }, - // EnableChatWithUs: to.Ptr(false), - // EnableMicrosoftSupport: to.Ptr(true), - // EventLevel: to.Ptr(armresourcehealth.EventLevelValuesInformational), - // EventSource: to.Ptr(armresourcehealth.EventSourceValuesServiceHealth), - // EventType: to.Ptr(armresourcehealth.EventTypeValuesServiceIssue), - // Faqs: []*armresourcehealth.Faq{ - // { - // Answer: to.Ptr("This is an answer"), - // LocaleCode: to.Ptr("en"), - // Question: to.Ptr("This is a question"), - // }}, - // Header: to.Ptr("Your service might have been impacted by an Azure service issue"), - // HirStage: to.Ptr("resolved"), - // Impact: []*armresourcehealth.Impact{ - // { - // ImpactedRegions: []*armresourcehealth.ImpactedServiceRegion{ - // { - // ImpactedRegion: to.Ptr("West US"), - // ImpactedSubscriptions: []*string{ - // }, - // ImpactedTenants: []*string{ - // to.Ptr("00000000-0000-0000-0000-000000000000")}, - // LastUpdateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-05T21:05:00.000Z"); return t}()), - // Status: to.Ptr(armresourcehealth.EventStatusValuesActive), - // }}, - // ImpactedService: to.Ptr("Virtual Machines"), - // }}, - // ImpactMitigationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-08T00:00:00.000Z"); return t}()), - // ImpactStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-07T00:00:00.000Z"); return t}()), - // IsHIR: to.Ptr(false), - // LastUpdateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-08T00:00:00.000Z"); return t}()), - // Level: to.Ptr(armresourcehealth.LevelValuesWarning), - // Links: []*armresourcehealth.Link{ - // { - // Type: to.Ptr(armresourcehealth.LinkTypeValuesHyperlink), - // BladeName: to.Ptr("RequestRCABlade"), - // DisplayText: &armresourcehealth.LinkDisplayText{ - // LocalizedValue: to.Ptr("Request RCA"), - // Value: to.Ptr("Request RCA"), - // }, - // ExtensionName: to.Ptr("Microsoft_Azure_Health"), - // Parameters: map[string]any{ - // "rcaRequested": "False", - // "trackingId": "BC_1-FXZ", - // }, - // }, - // { - // Type: to.Ptr(armresourcehealth.LinkTypeValuesButton), - // BladeName: to.Ptr("AzureHealthBrowseBlade"), - // DisplayText: &armresourcehealth.LinkDisplayText{ - // LocalizedValue: to.Ptr("Sign up for updates"), - // Value: to.Ptr("Sign up for updates"), - // }, - // ExtensionName: to.Ptr("Microsoft_Azure_Health"), - // Parameters: map[string]any{ - // "trackingId": "BC_1-FXZ", - // }, - // }}, - // Priority: to.Ptr[int32](2), - // RecommendedActions: &armresourcehealth.EventPropertiesRecommendedActions{ - // Actions: []*armresourcehealth.EventPropertiesRecommendedActionsItem{ - // { - // ActionText: to.Ptr("action 1"), - // GroupID: to.Ptr[int32](23243), - // }, - // { - // ActionText: to.Ptr("action 2"), - // GroupID: to.Ptr[int32](23432), - // }}, - // LocaleCode: to.Ptr("en"), - // Message: to.Ptr("Recommended actions title"), - // }, - // Status: to.Ptr(armresourcehealth.EventStatusValuesActive), - // Summary: to.Ptr("An outage alert is being investigated. More information will be provided as it is known."), - // Title: to.Ptr("ACTIVE: Virtual machines in West US"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/Events_ListBySingleResource.json -func ExampleEventsClient_NewListBySingleResourcePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresourcehealth.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewEventsClient().NewListBySingleResourcePager("subscriptions/4abcdefgh-ijkl-mnop-qrstuvwxyz/resourceGroups/rhctestenv/providers/Microsoft.Compute/virtualMachines/rhctestenvV1PI", &armresourcehealth.EventsClientListBySingleResourceOptions{Filter: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.Events = armresourcehealth.Events{ - // Value: []*armresourcehealth.Event{ - // { - // Name: to.Ptr("BC_1-FXZ"), - // Type: to.Ptr("/providers/Microsoft.ResourceHealth/events"), - // ID: to.Ptr("/providers/Microsoft.ResourceHealth/events/BC_1-FXZ"), - // Properties: &armresourcehealth.EventProperties{ - // Article: &armresourcehealth.EventPropertiesArticle{ - // ArticleContent: to.Ptr("An outage alert is being investigated. More information will be provided as it is known"), - // }, - // EnableChatWithUs: to.Ptr(false), - // EnableMicrosoftSupport: to.Ptr(true), - // EventLevel: to.Ptr(armresourcehealth.EventLevelValuesInformational), - // EventSource: to.Ptr(armresourcehealth.EventSourceValuesResourceHealth), - // EventType: to.Ptr(armresourcehealth.EventTypeValuesServiceIssue), - // Faqs: []*armresourcehealth.Faq{ - // { - // Answer: to.Ptr("This is an answer"), - // LocaleCode: to.Ptr("en"), - // Question: to.Ptr("This is a question"), - // }}, - // Header: to.Ptr("Your service might have been impacted by an Azure service issue"), - // HirStage: to.Ptr("active"), - // Impact: []*armresourcehealth.Impact{ - // { - // ImpactedRegions: []*armresourcehealth.ImpactedServiceRegion{ - // { - // ImpactedRegion: to.Ptr("West US"), - // ImpactedSubscriptions: []*string{ - // to.Ptr("{subscriptionId}")}, - // LastUpdateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-05T21:05:00.000Z"); return t}()), - // Status: to.Ptr(armresourcehealth.EventStatusValuesActive), - // }}, - // ImpactedService: to.Ptr("Virtual Machines"), - // }}, - // ImpactMitigationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-08T00:00:00.000Z"); return t}()), - // ImpactStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-07T00:00:00.000Z"); return t}()), - // IsHIR: to.Ptr(false), - // LastUpdateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-08T00:00:00.000Z"); return t}()), - // Level: to.Ptr(armresourcehealth.LevelValuesWarning), - // Links: []*armresourcehealth.Link{ - // { - // Type: to.Ptr(armresourcehealth.LinkTypeValuesHyperlink), - // BladeName: to.Ptr("RequestRCABlade"), - // DisplayText: &armresourcehealth.LinkDisplayText{ - // LocalizedValue: to.Ptr("Request RCA"), - // Value: to.Ptr("Request RCA"), - // }, - // ExtensionName: to.Ptr("Microsoft_Azure_Health"), - // Parameters: map[string]any{ - // "rcaRequested": "False", - // "trackingId": "BC_1-FXZ", - // }, - // }, - // { - // Type: to.Ptr(armresourcehealth.LinkTypeValuesButton), - // BladeName: to.Ptr("AzureHealthBrowseBlade"), - // DisplayText: &armresourcehealth.LinkDisplayText{ - // LocalizedValue: to.Ptr("Sign up for updates"), - // Value: to.Ptr("Sign up for updates"), - // }, - // ExtensionName: to.Ptr("Microsoft_Azure_Health"), - // Parameters: map[string]any{ - // "trackingId": "BC_1-FXZ", - // }, - // }}, - // Priority: to.Ptr[int32](2), - // RecommendedActions: &armresourcehealth.EventPropertiesRecommendedActions{ - // Actions: []*armresourcehealth.EventPropertiesRecommendedActionsItem{ - // { - // ActionText: to.Ptr("action 1"), - // GroupID: to.Ptr[int32](23243), - // }, - // { - // ActionText: to.Ptr("action 2"), - // GroupID: to.Ptr[int32](23432), - // }}, - // LocaleCode: to.Ptr("en"), - // Message: to.Ptr("Recommended actions title"), - // }, - // Status: to.Ptr(armresourcehealth.EventStatusValuesActive), - // Summary: to.Ptr("An outage alert is being investigated. More information will be provided as it is known."), - // Title: to.Ptr("ACTIVE: Virtual machines in West US"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/availabilitystatuses_server.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/availabilitystatuses_server.go index ed5671aea724..ababd7fdafbf 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/availabilitystatuses_server.go +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/availabilitystatuses_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -70,27 +67,46 @@ func (a *AvailabilityStatusesServerTransport) Do(req *http.Request) (*http.Respo return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return a.dispatchToMethodFake(req, method) +} - switch method { - case "AvailabilityStatusesClient.GetByResource": - resp, err = a.dispatchGetByResource(req) - case "AvailabilityStatusesClient.NewListPager": - resp, err = a.dispatchNewListPager(req) - case "AvailabilityStatusesClient.NewListByResourceGroupPager": - resp, err = a.dispatchNewListByResourceGroupPager(req) - case "AvailabilityStatusesClient.NewListBySubscriptionIDPager": - resp, err = a.dispatchNewListBySubscriptionIDPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (a *AvailabilityStatusesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if availabilityStatusesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = availabilityStatusesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "AvailabilityStatusesClient.GetByResource": + res.resp, res.err = a.dispatchGetByResource(req) + case "AvailabilityStatusesClient.NewListPager": + res.resp, res.err = a.dispatchNewListPager(req) + case "AvailabilityStatusesClient.NewListByResourceGroupPager": + res.resp, res.err = a.dispatchNewListByResourceGroupPager(req) + case "AvailabilityStatusesClient.NewListBySubscriptionIDPager": + res.resp, res.err = a.dispatchNewListBySubscriptionIDPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *AvailabilityStatusesServerTransport) dispatchGetByResource(req *http.Request) (*http.Response, error) { @@ -300,3 +316,9 @@ func (a *AvailabilityStatusesServerTransport) dispatchNewListBySubscriptionIDPag } return resp, nil } + +// set this to conditionally intercept incoming requests to AvailabilityStatusesServerTransport +var availabilityStatusesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/childavailabilitystatuses_server.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/childavailabilitystatuses_server.go index 7bcaf91aaa33..f26f1918c353 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/childavailabilitystatuses_server.go +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/childavailabilitystatuses_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -58,23 +55,42 @@ func (c *ChildAvailabilityStatusesServerTransport) Do(req *http.Request) (*http. return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return c.dispatchToMethodFake(req, method) +} - switch method { - case "ChildAvailabilityStatusesClient.GetByResource": - resp, err = c.dispatchGetByResource(req) - case "ChildAvailabilityStatusesClient.NewListPager": - resp, err = c.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (c *ChildAvailabilityStatusesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if childAvailabilityStatusesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = childAvailabilityStatusesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ChildAvailabilityStatusesClient.GetByResource": + res.resp, res.err = c.dispatchGetByResource(req) + case "ChildAvailabilityStatusesClient.NewListPager": + res.resp, res.err = c.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (c *ChildAvailabilityStatusesServerTransport) dispatchGetByResource(req *http.Request) (*http.Response, error) { @@ -178,3 +194,9 @@ func (c *ChildAvailabilityStatusesServerTransport) dispatchNewListPager(req *htt } return resp, nil } + +// set this to conditionally intercept incoming requests to ChildAvailabilityStatusesServerTransport +var childAvailabilityStatusesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/childresources_server.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/childresources_server.go index 12c7fb0b314b..117fd8d2085a 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/childresources_server.go +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/childresources_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -53,21 +50,40 @@ func (c *ChildResourcesServerTransport) Do(req *http.Request) (*http.Response, e return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return c.dispatchToMethodFake(req, method) +} - switch method { - case "ChildResourcesClient.NewListPager": - resp, err = c.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (c *ChildResourcesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if childResourcesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = childResourcesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ChildResourcesClient.NewListPager": + res.resp, res.err = c.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (c *ChildResourcesServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { @@ -124,3 +140,9 @@ func (c *ChildResourcesServerTransport) dispatchNewListPager(req *http.Request) } return resp, nil } + +// set this to conditionally intercept incoming requests to ChildResourcesServerTransport +var childResourcesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/emergingissues_server.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/emergingissues_server.go index 93e83d088f55..77a409a792ab 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/emergingissues_server.go +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/emergingissues_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -58,23 +55,42 @@ func (e *EmergingIssuesServerTransport) Do(req *http.Request) (*http.Response, e return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return e.dispatchToMethodFake(req, method) +} - switch method { - case "EmergingIssuesClient.Get": - resp, err = e.dispatchGet(req) - case "EmergingIssuesClient.NewListPager": - resp, err = e.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (e *EmergingIssuesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if emergingIssuesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = emergingIssuesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "EmergingIssuesClient.Get": + res.resp, res.err = e.dispatchGet(req) + case "EmergingIssuesClient.NewListPager": + res.resp, res.err = e.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (e *EmergingIssuesServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -138,3 +154,9 @@ func (e *EmergingIssuesServerTransport) dispatchNewListPager(req *http.Request) } return resp, nil } + +// set this to conditionally intercept incoming requests to EmergingIssuesServerTransport +var emergingIssuesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/event_server.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/event_server.go index 5e042cf87ec9..182f6223551d 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/event_server.go +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/event_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -61,27 +58,46 @@ func (e *EventServerTransport) Do(req *http.Request) (*http.Response, error) { return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return e.dispatchToMethodFake(req, method) +} - switch method { - case "EventClient.FetchDetailsBySubscriptionIDAndTrackingID": - resp, err = e.dispatchFetchDetailsBySubscriptionIDAndTrackingID(req) - case "EventClient.FetchDetailsByTenantIDAndTrackingID": - resp, err = e.dispatchFetchDetailsByTenantIDAndTrackingID(req) - case "EventClient.GetBySubscriptionIDAndTrackingID": - resp, err = e.dispatchGetBySubscriptionIDAndTrackingID(req) - case "EventClient.GetByTenantIDAndTrackingID": - resp, err = e.dispatchGetByTenantIDAndTrackingID(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (e *EventServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if eventServerTransportInterceptor != nil { + res.resp, res.err, intercepted = eventServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "EventClient.FetchDetailsBySubscriptionIDAndTrackingID": + res.resp, res.err = e.dispatchFetchDetailsBySubscriptionIDAndTrackingID(req) + case "EventClient.FetchDetailsByTenantIDAndTrackingID": + res.resp, res.err = e.dispatchFetchDetailsByTenantIDAndTrackingID(req) + case "EventClient.GetBySubscriptionIDAndTrackingID": + res.resp, res.err = e.dispatchGetBySubscriptionIDAndTrackingID(req) + case "EventClient.GetByTenantIDAndTrackingID": + res.resp, res.err = e.dispatchGetByTenantIDAndTrackingID(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (e *EventServerTransport) dispatchFetchDetailsBySubscriptionIDAndTrackingID(req *http.Request) (*http.Response, error) { @@ -235,3 +251,9 @@ func (e *EventServerTransport) dispatchGetByTenantIDAndTrackingID(req *http.Requ } return resp, nil } + +// set this to conditionally intercept incoming requests to EventServerTransport +var eventServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/events_server.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/events_server.go index b5d2bd9277a3..228589317380 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/events_server.go +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/events_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -65,25 +62,44 @@ func (e *EventsServerTransport) Do(req *http.Request) (*http.Response, error) { return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return e.dispatchToMethodFake(req, method) +} - switch method { - case "EventsClient.NewListBySingleResourcePager": - resp, err = e.dispatchNewListBySingleResourcePager(req) - case "EventsClient.NewListBySubscriptionIDPager": - resp, err = e.dispatchNewListBySubscriptionIDPager(req) - case "EventsClient.NewListByTenantIDPager": - resp, err = e.dispatchNewListByTenantIDPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (e *EventsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if eventsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = eventsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "EventsClient.NewListBySingleResourcePager": + res.resp, res.err = e.dispatchNewListBySingleResourcePager(req) + case "EventsClient.NewListBySubscriptionIDPager": + res.resp, res.err = e.dispatchNewListBySubscriptionIDPager(req) + case "EventsClient.NewListByTenantIDPager": + res.resp, res.err = e.dispatchNewListByTenantIDPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (e *EventsServerTransport) dispatchNewListBySingleResourcePager(req *http.Request) (*http.Response, error) { @@ -230,3 +246,9 @@ func (e *EventsServerTransport) dispatchNewListByTenantIDPager(req *http.Request } return resp, nil } + +// set this to conditionally intercept incoming requests to EventsServerTransport +var eventsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/impactedresources_server.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/impactedresources_server.go index c5463fa00f82..6519604235a2 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/impactedresources_server.go +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/impactedresources_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -68,27 +65,46 @@ func (i *ImpactedResourcesServerTransport) Do(req *http.Request) (*http.Response return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return i.dispatchToMethodFake(req, method) +} - switch method { - case "ImpactedResourcesClient.Get": - resp, err = i.dispatchGet(req) - case "ImpactedResourcesClient.GetByTenantID": - resp, err = i.dispatchGetByTenantID(req) - case "ImpactedResourcesClient.NewListBySubscriptionIDAndEventIDPager": - resp, err = i.dispatchNewListBySubscriptionIDAndEventIDPager(req) - case "ImpactedResourcesClient.NewListByTenantIDAndEventIDPager": - resp, err = i.dispatchNewListByTenantIDAndEventIDPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (i *ImpactedResourcesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if impactedResourcesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = impactedResourcesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ImpactedResourcesClient.Get": + res.resp, res.err = i.dispatchGet(req) + case "ImpactedResourcesClient.GetByTenantID": + res.resp, res.err = i.dispatchGetByTenantID(req) + case "ImpactedResourcesClient.NewListBySubscriptionIDAndEventIDPager": + res.resp, res.err = i.dispatchNewListBySubscriptionIDAndEventIDPager(req) + case "ImpactedResourcesClient.NewListByTenantIDAndEventIDPager": + res.resp, res.err = i.dispatchNewListByTenantIDAndEventIDPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (i *ImpactedResourcesServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -254,3 +270,9 @@ func (i *ImpactedResourcesServerTransport) dispatchNewListByTenantIDAndEventIDPa } return resp, nil } + +// set this to conditionally intercept incoming requests to ImpactedResourcesServerTransport +var impactedResourcesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/internal.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/internal.go index 55ac7c4dc64f..c7991eb32fb0 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/internal.go +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/internal.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,6 +12,11 @@ import ( "sync" ) +type result struct { + resp *http.Response + err error +} + type nonRetriableError struct { error } diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/metadata_server.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/metadata_server.go index 7691a58bc416..467a8a12bffb 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/metadata_server.go +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/metadata_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -58,23 +55,42 @@ func (m *MetadataServerTransport) Do(req *http.Request) (*http.Response, error) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return m.dispatchToMethodFake(req, method) +} - switch method { - case "MetadataClient.GetEntity": - resp, err = m.dispatchGetEntity(req) - case "MetadataClient.NewListPager": - resp, err = m.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (m *MetadataServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if metadataServerTransportInterceptor != nil { + res.resp, res.err, intercepted = metadataServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "MetadataClient.GetEntity": + res.resp, res.err = m.dispatchGetEntity(req) + case "MetadataClient.NewListPager": + res.resp, res.err = m.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (m *MetadataServerTransport) dispatchGetEntity(req *http.Request) (*http.Response, error) { @@ -132,3 +148,9 @@ func (m *MetadataServerTransport) dispatchNewListPager(req *http.Request) (*http } return resp, nil } + +// set this to conditionally intercept incoming requests to MetadataServerTransport +var metadataServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/operations_server.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/operations_server.go index 95e21e29f23e..57487fbe5210 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/operations_server.go +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/operations_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,21 +44,40 @@ func (o *OperationsServerTransport) Do(req *http.Request) (*http.Response, error return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return o.dispatchToMethodFake(req, method) +} - switch method { - case "OperationsClient.List": - resp, err = o.dispatchList(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (o *OperationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if operationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = operationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "OperationsClient.List": + res.resp, res.err = o.dispatchList(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (o *OperationsServerTransport) dispatchList(req *http.Request) (*http.Response, error) { @@ -82,3 +98,9 @@ func (o *OperationsServerTransport) dispatchList(req *http.Request) (*http.Respo } return resp, nil } + +// set this to conditionally intercept incoming requests to OperationsServerTransport +var operationsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/securityadvisoryimpactedresources_server.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/securityadvisoryimpactedresources_server.go index fe76ac45f411..3dc063bfded2 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/securityadvisoryimpactedresources_server.go +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/securityadvisoryimpactedresources_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -59,23 +56,42 @@ func (s *SecurityAdvisoryImpactedResourcesServerTransport) Do(req *http.Request) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "SecurityAdvisoryImpactedResourcesClient.NewListBySubscriptionIDAndEventIDPager": - resp, err = s.dispatchNewListBySubscriptionIDAndEventIDPager(req) - case "SecurityAdvisoryImpactedResourcesClient.NewListByTenantIDAndEventIDPager": - resp, err = s.dispatchNewListByTenantIDAndEventIDPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *SecurityAdvisoryImpactedResourcesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if securityAdvisoryImpactedResourcesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = securityAdvisoryImpactedResourcesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "SecurityAdvisoryImpactedResourcesClient.NewListBySubscriptionIDAndEventIDPager": + res.resp, res.err = s.dispatchNewListBySubscriptionIDAndEventIDPager(req) + case "SecurityAdvisoryImpactedResourcesClient.NewListByTenantIDAndEventIDPager": + res.resp, res.err = s.dispatchNewListByTenantIDAndEventIDPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *SecurityAdvisoryImpactedResourcesServerTransport) dispatchNewListBySubscriptionIDAndEventIDPager(req *http.Request) (*http.Response, error) { @@ -175,3 +191,9 @@ func (s *SecurityAdvisoryImpactedResourcesServerTransport) dispatchNewListByTena } return resp, nil } + +// set this to conditionally intercept incoming requests to SecurityAdvisoryImpactedResourcesServerTransport +var securityAdvisoryImpactedResourcesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/server_factory.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/server_factory.go index 359230e38f50..80290051719c 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/server_factory.go +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/server_factory.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -19,15 +16,34 @@ import ( // ServerFactory is a fake server for instances of the armresourcehealth.ClientFactory type. type ServerFactory struct { - AvailabilityStatusesServer AvailabilityStatusesServer - ChildAvailabilityStatusesServer ChildAvailabilityStatusesServer - ChildResourcesServer ChildResourcesServer - EmergingIssuesServer EmergingIssuesServer - EventServer EventServer - EventsServer EventsServer - ImpactedResourcesServer ImpactedResourcesServer - MetadataServer MetadataServer - OperationsServer OperationsServer + // AvailabilityStatusesServer contains the fakes for client AvailabilityStatusesClient + AvailabilityStatusesServer AvailabilityStatusesServer + + // ChildAvailabilityStatusesServer contains the fakes for client ChildAvailabilityStatusesClient + ChildAvailabilityStatusesServer ChildAvailabilityStatusesServer + + // ChildResourcesServer contains the fakes for client ChildResourcesClient + ChildResourcesServer ChildResourcesServer + + // EmergingIssuesServer contains the fakes for client EmergingIssuesClient + EmergingIssuesServer EmergingIssuesServer + + // EventServer contains the fakes for client EventClient + EventServer EventServer + + // EventsServer contains the fakes for client EventsClient + EventsServer EventsServer + + // ImpactedResourcesServer contains the fakes for client ImpactedResourcesClient + ImpactedResourcesServer ImpactedResourcesServer + + // MetadataServer contains the fakes for client MetadataClient + MetadataServer MetadataServer + + // OperationsServer contains the fakes for client OperationsClient + OperationsServer OperationsServer + + // SecurityAdvisoryImpactedResourcesServer contains the fakes for client SecurityAdvisoryImpactedResourcesClient SecurityAdvisoryImpactedResourcesServer SecurityAdvisoryImpactedResourcesServer } diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/time_rfc3339.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/time_rfc3339.go deleted file mode 100644 index 81f308b0d343..000000000000 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/fake/time_rfc3339.go +++ /dev/null @@ -1,110 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" - "regexp" - "strings" - "time" -) - -// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) - -const ( - utcDateTime = "2006-01-02T15:04:05.999999999" - utcDateTimeJSON = `"` + utcDateTime + `"` - utcDateTimeNoT = "2006-01-02 15:04:05.999999999" - utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` - dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` - dateTimeJSON = `"` + time.RFC3339Nano + `"` - dateTimeJSONNoT = `"` + dateTimeNoT + `"` -) - -type dateTimeRFC3339 time.Time - -func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalJSON() -} - -func (t dateTimeRFC3339) MarshalText() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalText() -} - -func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - tzOffset := tzOffsetRegex.Match(data) - hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") - var layout string - if tzOffset && hasT { - layout = dateTimeJSON - } else if tzOffset { - layout = dateTimeJSONNoT - } else if hasT { - layout = utcDateTimeJSON - } else { - layout = utcDateTimeJSONNoT - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - tzOffset := tzOffsetRegex.Match(data) - hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") - var layout string - if tzOffset && hasT { - layout = time.RFC3339Nano - } else if tzOffset { - layout = dateTimeNoT - } else if hasT { - layout = utcDateTime - } else { - layout = utcDateTimeNoT - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) Parse(layout, value string) error { - p, err := time.Parse(layout, strings.ToUpper(value)) - *t = dateTimeRFC3339(p) - return err -} - -func (t dateTimeRFC3339) String() string { - return time.Time(t).Format(time.RFC3339Nano) -} - -func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { - if t == nil { - return - } else if azcore.IsNullValue(t) { - m[k] = nil - return - } else if reflect.ValueOf(t).IsNil() { - return - } - m[k] = (*dateTimeRFC3339)(t) -} - -func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || string(data) == "null" { - return nil - } - var aux dateTimeRFC3339 - if err := json.Unmarshal(data, &aux); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - *t = (*time.Time)(&aux) - return nil -} diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/go.mod b/sdk/resourcemanager/resourcehealth/armresourcehealth/go.mod index b6c2a03a998b..ba1dbf4670e8 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/go.mod +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/go.mod @@ -2,20 +2,10 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resourcehealth/armr go 1.23.0 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.1 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.1 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2 // indirect - github.com/golang-jwt/jwt/v5 v5.2.2 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect - golang.org/x/crypto v0.36.0 // indirect golang.org/x/net v0.38.0 // indirect - golang.org/x/sys v0.31.0 // indirect golang.org/x/text v0.23.0 // indirect ) diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/go.sum b/sdk/resourcemanager/resourcehealth/armresourcehealth/go.sum index 4bacf756f06c..4de695d9e23a 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/go.sum +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/go.sum @@ -1,44 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.1 h1:DSDNVxqkoXJiko6x8a90zidoYqnYYa6c1MTzDKzKkTo= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.1/go.mod h1:zGqV2R4Cr/k8Uye5w+dgQ06WJtEcbQG/8J7BB6hnCr4= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2 h1:F0gBpfdPLGsw+nsgk6aqqkZS1jiixa5WwFe3fk/T3Ys= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2/go.mod h1:SqINnQ9lVVdRlyC8cd1lCI0SdX4n2paeABd2K8ggfnE= -github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2 h1:yz1bePFlP5Vws5+8ez6T3HWXPmwOK7Yvq8QxDBD3SKY= -github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2/go.mod h1:Pa9ZNPuoNu/GztvBSKk9J1cDJW6vk/n0zLtV4mgd8N8= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY= -github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1 h1:WJTmL004Abzc5wDB5VtZG2PJk5ndYDgVacGqfirKxjM= -github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1/go.mod h1:tCcJZ0uHAmvjsVYzEFivsRTN00oz5BEsRgQHu5JZ9WE= -github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2 h1:oygO0locgZJe7PpYPXT5A29ZkwJaPqcva7BVeemZOZs= -github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= -github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= -github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= -github.com/golang-jwt/jwt/v5 v5.2.2 h1:Rl4B7itRWVtYIHFrSNd7vhTiz9UpLdi6gZhZ3wEeDy8= -github.com/golang-jwt/jwt/v5 v5.2.2/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/keybase/go-keychain v0.0.0-20231219164618-57a3676c3af6 h1:IsMZxCuZqKuao2vNdfD82fjjgPLfyHLpR41Z88viRWs= -github.com/keybase/go-keychain v0.0.0-20231219164618-57a3676c3af6/go.mod h1:3VeWNIJaW+O5xpRQbPp0Ybqu1vJd/pm7s2F473HRrkw= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/redis/go-redis/v9 v9.7.0 h1:HhLSs+B6O021gwzl+locl0zEDnyNkxMtf/Z3NNBMa9E= -github.com/redis/go-redis/v9 v9.7.0/go.mod h1:f6zhXITC7JUJIlPEiBOTXxJgPLdZcA93GewI7inzyWw= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34= -golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc= golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8= golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= -golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/impactedresources_client.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/impactedresources_client.go index a23c42beb7f6..f391ef6eee1b 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/impactedresources_client.go +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/impactedresources_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewImpactedResourcesClient(subscriptionID string, credential azcore.TokenCr // Get - Gets the specific impacted resource in the subscription by an event. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-01-preview +// Generated from API version 2025-05-01 // - eventTrackingID - Event Id which uniquely identifies ServiceHealth event. // - impactedResourceName - Name of the Impacted Resource. // - options - ImpactedResourcesClientGetOptions contains the optional parameters for the ImpactedResourcesClient.Get method. @@ -73,7 +70,7 @@ func (client *ImpactedResourcesClient) Get(ctx context.Context, eventTrackingID } // getCreateRequest creates the Get request. -func (client *ImpactedResourcesClient) getCreateRequest(ctx context.Context, eventTrackingID string, impactedResourceName string, options *ImpactedResourcesClientGetOptions) (*policy.Request, error) { +func (client *ImpactedResourcesClient) getCreateRequest(ctx context.Context, eventTrackingID string, impactedResourceName string, _ *ImpactedResourcesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/events/{eventTrackingId}/impactedResources/{impactedResourceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -92,7 +89,7 @@ func (client *ImpactedResourcesClient) getCreateRequest(ctx context.Context, eve return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-01-preview") + reqQP.Set("api-version", "2025-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -110,7 +107,7 @@ func (client *ImpactedResourcesClient) getHandleResponse(resp *http.Response) (I // GetByTenantID - Gets the specific impacted resource in the tenant by an event. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-01-preview +// Generated from API version 2025-05-01 // - eventTrackingID - Event Id which uniquely identifies ServiceHealth event. // - impactedResourceName - Name of the Impacted Resource. // - options - ImpactedResourcesClientGetByTenantIDOptions contains the optional parameters for the ImpactedResourcesClient.GetByTenantID @@ -138,7 +135,7 @@ func (client *ImpactedResourcesClient) GetByTenantID(ctx context.Context, eventT } // getByTenantIDCreateRequest creates the GetByTenantID request. -func (client *ImpactedResourcesClient) getByTenantIDCreateRequest(ctx context.Context, eventTrackingID string, impactedResourceName string, options *ImpactedResourcesClientGetByTenantIDOptions) (*policy.Request, error) { +func (client *ImpactedResourcesClient) getByTenantIDCreateRequest(ctx context.Context, eventTrackingID string, impactedResourceName string, _ *ImpactedResourcesClientGetByTenantIDOptions) (*policy.Request, error) { urlPath := "/providers/Microsoft.ResourceHealth/events/{eventTrackingId}/impactedResources/{impactedResourceName}" if eventTrackingID == "" { return nil, errors.New("parameter eventTrackingID cannot be empty") @@ -153,7 +150,7 @@ func (client *ImpactedResourcesClient) getByTenantIDCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-01-preview") + reqQP.Set("api-version", "2025-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -170,7 +167,7 @@ func (client *ImpactedResourcesClient) getByTenantIDHandleResponse(resp *http.Re // NewListBySubscriptionIDAndEventIDPager - Lists impacted resources in the subscription by an event. // -// Generated from API version 2023-10-01-preview +// Generated from API version 2025-05-01 // - eventTrackingID - Event Id which uniquely identifies ServiceHealth event. // - options - ImpactedResourcesClientListBySubscriptionIDAndEventIDOptions contains the optional parameters for the ImpactedResourcesClient.NewListBySubscriptionIDAndEventIDPager // method. @@ -216,7 +213,7 @@ func (client *ImpactedResourcesClient) listBySubscriptionIDAndEventIDCreateReque if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2023-10-01-preview") + reqQP.Set("api-version", "2025-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -233,7 +230,7 @@ func (client *ImpactedResourcesClient) listBySubscriptionIDAndEventIDHandleRespo // NewListByTenantIDAndEventIDPager - Lists impacted resources in the tenant by an event. // -// Generated from API version 2023-10-01-preview +// Generated from API version 2025-05-01 // - eventTrackingID - Event Id which uniquely identifies ServiceHealth event. // - options - ImpactedResourcesClientListByTenantIDAndEventIDOptions contains the optional parameters for the ImpactedResourcesClient.NewListByTenantIDAndEventIDPager // method. @@ -275,7 +272,7 @@ func (client *ImpactedResourcesClient) listByTenantIDAndEventIDCreateRequest(ctx if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2023-10-01-preview") + reqQP.Set("api-version", "2025-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/impactedresources_client_example_test.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/impactedresources_client_example_test.go deleted file mode 100644 index 56b67e600ef0..000000000000 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/impactedresources_client_example_test.go +++ /dev/null @@ -1,214 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armresourcehealth_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resourcehealth/armresourcehealth" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ImpactedResources_ListBySubscriptionId_ListByEventId.json -func ExampleImpactedResourcesClient_NewListBySubscriptionIDAndEventIDPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresourcehealth.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewImpactedResourcesClient().NewListBySubscriptionIDAndEventIDPager("BC_1-FXZ", &armresourcehealth.ImpactedResourcesClientListBySubscriptionIDAndEventIDOptions{Filter: to.Ptr("targetRegion eq 'westus'")}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.EventImpactedResourceListResult = armresourcehealth.EventImpactedResourceListResult{ - // Value: []*armresourcehealth.EventImpactedResource{ - // { - // Name: to.Ptr("abc-123-ghj-456"), - // Type: to.Ptr("Microsoft.ResourceHealth/events/impactedResources"), - // ID: to.Ptr("/subscriptions/{subscripitionId}/providers/Microsoft.ResourceHealth/events/BC_1-FXZ/impactedResources/abc-123-ghj-456"), - // Properties: &armresourcehealth.EventImpactedResourceProperties{ - // MaintenanceEndTime: to.Ptr("2023-08-30T00:00:00.00Z"), - // MaintenanceStartTime: to.Ptr("2023-08-15T23:32:39.76Z"), - // ResourceGroup: to.Ptr("TEST"), - // ResourceName: to.Ptr("testvm"), - // Status: to.Ptr("Pending"), - // TargetRegion: to.Ptr("westus"), - // TargetResourceID: to.Ptr("/subscriptions/4970d23e-ed41-4670-9c19-02a1d2808dd9/resourceGroups/TEST/providers/Microsoft.Compute/virtualMachines/testvm"), - // TargetResourceType: to.Ptr("Microsoft.Compute/VirtualMachines"), - // }, - // }, - // { - // Name: to.Ptr("jkl-901-hgy-445"), - // Type: to.Ptr("Microsoft.ResourceHealth/events/impactedResources"), - // ID: to.Ptr("/subscriptions/{subscripitionId}/providers/Microsoft.ResourceHealth/events/BC_1-FXZ/impactedResources/jkl-901-hgy-445"), - // Properties: &armresourcehealth.EventImpactedResourceProperties{ - // Info: []*armresourcehealth.KeyValueItem{ - // { - // Key: to.Ptr("ContainerGrp"), - // Value: to.Ptr("xyz"), - // }, - // { - // Key: to.Ptr("UserGuid"), - // Value: to.Ptr("guid"), - // }, - // { - // Key: to.Ptr("AplicationID"), - // Value: to.Ptr("Abc"), - // }, - // { - // Key: to.Ptr("UserPrincipalObjectId"), - // Value: to.Ptr("def"), - // }}, - // }, - // }, - // { - // Name: to.Ptr("wer-345-tyu-789"), - // Type: to.Ptr("Microsoft.ResourceHealth/events/impactedResources"), - // ID: to.Ptr("/subscriptions/{subscripitionId}/providers/Microsoft.ResourceHealth/events/BC_1-FXZ/impactedResources/wer-345-tyu-789"), - // Properties: &armresourcehealth.EventImpactedResourceProperties{ - // MaintenanceEndTime: to.Ptr("2023-08-30T00:00:00.00Z"), - // MaintenanceStartTime: to.Ptr("2023-08-15T23:32:39.76Z"), - // ResourceGroup: to.Ptr("Dev2"), - // ResourceName: to.Ptr("testvm2"), - // Status: to.Ptr("Pending"), - // TargetRegion: to.Ptr("westus"), - // TargetResourceID: to.Ptr("/subscriptions/4970d23e-ed41-4670-9c19-02a1d2808dd9/resourceGroups/Dev2/providers/Microsoft.Compute/virtualMachines/testvm2"), - // TargetResourceType: to.Ptr("Microsoft.Compute/VirtualMachines"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ImpactedResources_Get.json -func ExampleImpactedResourcesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresourcehealth.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewImpactedResourcesClient().Get(ctx, "BC_1-FXZ", "abc-123-ghj-456", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.EventImpactedResource = armresourcehealth.EventImpactedResource{ - // Name: to.Ptr("abc-123-ghj-456"), - // Type: to.Ptr("Microsoft.ResourceHealth/events/impactedResources"), - // ID: to.Ptr("/subscriptions/{subscripitionId}/providers/Microsoft.ResourceHealth/events/BC_1-FXZ/impactedResources/abc-123-ghj-456"), - // Properties: &armresourcehealth.EventImpactedResourceProperties{ - // MaintenanceEndTime: to.Ptr("2023-08-30T00:00:00.00Z"), - // MaintenanceStartTime: to.Ptr("2023-08-15T23:32:39.76Z"), - // ResourceGroup: to.Ptr("TEST"), - // ResourceName: to.Ptr("testvm"), - // Status: to.Ptr("Pending"), - // TargetRegion: to.Ptr("westus"), - // TargetResourceID: to.Ptr("/subscriptions/4970d23e-ed41-4670-9c19-02a1d2808dd9/resourceGroups/TEST/providers/Microsoft.Compute/virtualMachines/testvm"), - // TargetResourceType: to.Ptr("Microsoft.Compute/VirtualMachines"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ImpactedResources_ListByTenantId_ListByEventId.json -func ExampleImpactedResourcesClient_NewListByTenantIDAndEventIDPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresourcehealth.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewImpactedResourcesClient().NewListByTenantIDAndEventIDPager("BC_1-FXZ", &armresourcehealth.ImpactedResourcesClientListByTenantIDAndEventIDOptions{Filter: to.Ptr("targetRegion eq 'westus'")}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.EventImpactedResourceListResult = armresourcehealth.EventImpactedResourceListResult{ - // Value: []*armresourcehealth.EventImpactedResource{ - // { - // Name: to.Ptr("abc-123-ghj-456"), - // Type: to.Ptr("Microsoft.ResourceHealth/events/impactedResources"), - // ID: to.Ptr("/providers/Microsoft.ResourceHealth/events/BC_1-FXZ/impactedResources/abc-123-ghj-456"), - // Properties: &armresourcehealth.EventImpactedResourceProperties{ - // TargetRegion: to.Ptr("westus"), - // TargetResourceID: to.Ptr("{resourceId-1}"), - // TargetResourceType: to.Ptr("Microsoft.Compute/VirtualMachines"), - // }, - // }, - // { - // Name: to.Ptr("wer-345-tyu-789"), - // Type: to.Ptr("Microsoft.ResourceHealth/events/impactedResources"), - // ID: to.Ptr("/providers/Microsoft.ResourceHealth/events/BC_1-FXZ/impactedResources/wer-345-tyu-789"), - // Properties: &armresourcehealth.EventImpactedResourceProperties{ - // TargetRegion: to.Ptr("westus"), - // TargetResourceID: to.Ptr("{resourceId-2}"), - // TargetResourceType: to.Ptr("Microsoft.Compute/VirtualMachines"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/ImpactedResources_GetByTenantId.json -func ExampleImpactedResourcesClient_GetByTenantID() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresourcehealth.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewImpactedResourcesClient().GetByTenantID(ctx, "BC_1-FXZ", "abc-123-ghj-456", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.EventImpactedResource = armresourcehealth.EventImpactedResource{ - // Name: to.Ptr("abc-123-ghj-456"), - // Type: to.Ptr("Microsoft.ResourceHealth/events/impactedResources"), - // ID: to.Ptr("providers/Microsoft.ResourceHealth/events/BC_1-FXZ/impactedResources/abc-123-ghj-456"), - // Properties: &armresourcehealth.EventImpactedResourceProperties{ - // TargetRegion: to.Ptr("westus"), - // TargetResourceID: to.Ptr("{resourceId}"), - // TargetResourceType: to.Ptr("Microsoft.Compute/VirtualMachines"), - // }, - // } -} diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/metadata_client.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/metadata_client.go index 4c83c98194f3..8794d812e147 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/metadata_client.go +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/metadata_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -43,7 +40,7 @@ func NewMetadataClient(credential azcore.TokenCredential, options *arm.ClientOpt // GetEntity - Gets the list of metadata entities. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-01-preview +// Generated from API version 2025-05-01 // - name - Name of metadata entity. // - options - MetadataClientGetEntityOptions contains the optional parameters for the MetadataClient.GetEntity method. func (client *MetadataClient) GetEntity(ctx context.Context, name string, options *MetadataClientGetEntityOptions) (MetadataClientGetEntityResponse, error) { @@ -69,7 +66,7 @@ func (client *MetadataClient) GetEntity(ctx context.Context, name string, option } // getEntityCreateRequest creates the GetEntity request. -func (client *MetadataClient) getEntityCreateRequest(ctx context.Context, name string, options *MetadataClientGetEntityOptions) (*policy.Request, error) { +func (client *MetadataClient) getEntityCreateRequest(ctx context.Context, name string, _ *MetadataClientGetEntityOptions) (*policy.Request, error) { urlPath := "/providers/Microsoft.ResourceHealth/metadata/{name}" if name == "" { return nil, errors.New("parameter name cannot be empty") @@ -80,7 +77,7 @@ func (client *MetadataClient) getEntityCreateRequest(ctx context.Context, name s return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-01-preview") + reqQP.Set("api-version", "2025-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -97,7 +94,7 @@ func (client *MetadataClient) getEntityHandleResponse(resp *http.Response) (Meta // NewListPager - Gets the list of metadata entities. // -// Generated from API version 2023-10-01-preview +// Generated from API version 2025-05-01 // - options - MetadataClientListOptions contains the optional parameters for the MetadataClient.NewListPager method. func (client *MetadataClient) NewListPager(options *MetadataClientListOptions) *runtime.Pager[MetadataClientListResponse] { return runtime.NewPager(runtime.PagingHandler[MetadataClientListResponse]{ @@ -123,14 +120,14 @@ func (client *MetadataClient) NewListPager(options *MetadataClientListOptions) * } // listCreateRequest creates the List request. -func (client *MetadataClient) listCreateRequest(ctx context.Context, options *MetadataClientListOptions) (*policy.Request, error) { +func (client *MetadataClient) listCreateRequest(ctx context.Context, _ *MetadataClientListOptions) (*policy.Request, error) { urlPath := "/providers/Microsoft.ResourceHealth/metadata" req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-01-preview") + reqQP.Set("api-version", "2025-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/metadata_client_example_test.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/metadata_client_example_test.go deleted file mode 100644 index c33ec12ab599..000000000000 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/metadata_client_example_test.go +++ /dev/null @@ -1,1987 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armresourcehealth_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resourcehealth/armresourcehealth" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/Metadata_List.json -func ExampleMetadataClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresourcehealth.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMetadataClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.MetadataEntityListResult = armresourcehealth.MetadataEntityListResult{ - // Value: []*armresourcehealth.MetadataEntity{ - // { - // Name: to.Ptr("status"), - // Type: to.Ptr("Microsoft.ResourceHealth/metadata"), - // ID: to.Ptr("/providers/Microsoft.ResourceHealth/metadata/status"), - // Properties: &armresourcehealth.MetadataEntityProperties{ - // ApplicableScenarios: []*armresourcehealth.Scenario{ - // to.Ptr(armresourcehealth.ScenarioAlerts)}, - // DisplayName: to.Ptr("Status"), - // SupportedValues: []*armresourcehealth.MetadataSupportedValueDetail{ - // { - // DisplayName: to.Ptr("Active"), - // ID: to.Ptr("Active"), - // }, - // { - // DisplayName: to.Ptr("Resolved"), - // ID: to.Ptr("Resolved"), - // }, - // { - // DisplayName: to.Ptr("In Progress"), - // ID: to.Ptr("In Progress"), - // }, - // { - // DisplayName: to.Ptr("Updated"), - // ID: to.Ptr("Updated"), - // }}, - // }, - // }, - // { - // Name: to.Ptr("level"), - // Type: to.Ptr("Microsoft.ResourceHealth/metadata"), - // ID: to.Ptr("/providers/Microsoft.ResourceHealth/metadata/level"), - // Properties: &armresourcehealth.MetadataEntityProperties{ - // ApplicableScenarios: []*armresourcehealth.Scenario{ - // to.Ptr(armresourcehealth.ScenarioAlerts)}, - // DisplayName: to.Ptr("Level"), - // SupportedValues: []*armresourcehealth.MetadataSupportedValueDetail{ - // { - // DisplayName: to.Ptr("Informational"), - // ID: to.Ptr("Informational"), - // }, - // { - // DisplayName: to.Ptr("Critical"), - // ID: to.Ptr("Critical"), - // }}, - // }, - // }, - // { - // Name: to.Ptr("cause"), - // Type: to.Ptr("Microsoft.ResourceHealth/metadata"), - // ID: to.Ptr("/providers/Microsoft.ResourceHealth/metadata/cause"), - // Properties: &armresourcehealth.MetadataEntityProperties{ - // ApplicableScenarios: []*armresourcehealth.Scenario{ - // to.Ptr(armresourcehealth.ScenarioAlerts)}, - // DisplayName: to.Ptr("Cause"), - // SupportedValues: []*armresourcehealth.MetadataSupportedValueDetail{ - // { - // DisplayName: to.Ptr("Platform Initiated"), - // ID: to.Ptr("PlatformInitiated"), - // }, - // { - // DisplayName: to.Ptr("User Initiated"), - // ID: to.Ptr("UserInitiated"), - // }, - // { - // DisplayName: to.Ptr("Unknown"), - // ID: to.Ptr("Unknown"), - // }}, - // }, - // }, - // { - // Name: to.Ptr("previousHealthStatus"), - // Type: to.Ptr("Microsoft.ResourceHealth/metadata"), - // ID: to.Ptr("/providers/Microsoft.ResourceHealth/metadata/previousHealthStatus"), - // Properties: &armresourcehealth.MetadataEntityProperties{ - // ApplicableScenarios: []*armresourcehealth.Scenario{ - // to.Ptr(armresourcehealth.ScenarioAlerts)}, - // DisplayName: to.Ptr("Previous Health Status"), - // SupportedValues: []*armresourcehealth.MetadataSupportedValueDetail{ - // { - // DisplayName: to.Ptr("Available"), - // ID: to.Ptr("Available"), - // }, - // { - // DisplayName: to.Ptr("Unavailable"), - // ID: to.Ptr("Unavailable"), - // }, - // { - // DisplayName: to.Ptr("Degraded"), - // ID: to.Ptr("Degraded"), - // }, - // { - // DisplayName: to.Ptr("Unknown"), - // ID: to.Ptr("Unknown"), - // }}, - // }, - // }, - // { - // Name: to.Ptr("currentHealthStatus"), - // Type: to.Ptr("Microsoft.ResourceHealth/metadata"), - // ID: to.Ptr("/providers/Microsoft.ResourceHealth/metadata/currentHealthStatus"), - // Properties: &armresourcehealth.MetadataEntityProperties{ - // ApplicableScenarios: []*armresourcehealth.Scenario{ - // to.Ptr(armresourcehealth.ScenarioAlerts)}, - // DisplayName: to.Ptr("Current Health Status"), - // SupportedValues: []*armresourcehealth.MetadataSupportedValueDetail{ - // { - // DisplayName: to.Ptr("Available"), - // ID: to.Ptr("Available"), - // }, - // { - // DisplayName: to.Ptr("Unavailable"), - // ID: to.Ptr("Unavailable"), - // }, - // { - // DisplayName: to.Ptr("Degraded"), - // ID: to.Ptr("Degraded"), - // }, - // { - // DisplayName: to.Ptr("Unknown"), - // ID: to.Ptr("Unknown"), - // }}, - // }, - // }, - // { - // Name: to.Ptr("supportedResourceType"), - // Type: to.Ptr("Microsoft.ResourceHealth/metadata"), - // ID: to.Ptr("/providers/Microsoft.ResourceHealth/metadata/supportedResourceType"), - // Properties: &armresourcehealth.MetadataEntityProperties{ - // DisplayName: to.Ptr("Supported Resource Type"), - // SupportedValues: []*armresourcehealth.MetadataSupportedValueDetail{ - // { - // DisplayName: to.Ptr("Analysis Services"), - // ID: to.Ptr("Microsoft.AnalysisServices/servers"), - // }, - // { - // DisplayName: to.Ptr("API Management service"), - // ID: to.Ptr("Microsoft.ApiManagement/service"), - // }, - // { - // DisplayName: to.Ptr("Microsoft.AppPlatform/Spring"), - // ID: to.Ptr("Microsoft.AppPlatform/Spring"), - // }, - // { - // DisplayName: to.Ptr("Azure Data Explorer Cluster"), - // ID: to.Ptr("Microsoft.Kusto/Clusters"), - // }, - // { - // DisplayName: to.Ptr("Azure Data Explorer Data Connection"), - // ID: to.Ptr("Microsoft.Kusto/clusters/databases/dataconnections"), - // }, - // { - // DisplayName: to.Ptr("microsoft.fluidrelay/fluidrelayservers"), - // ID: to.Ptr("microsoft.fluidrelay/fluidrelayservers"), - // }, - // { - // DisplayName: to.Ptr("AKS cluster"), - // ID: to.Ptr("microsoft.ContainerService/managedClusters"), - // }, - // { - // DisplayName: to.Ptr("Microsoft.Dashboard/grafana"), - // ID: to.Ptr("Microsoft.Dashboard/grafana"), - // }, - // { - // DisplayName: to.Ptr("Azure Purview"), - // ID: to.Ptr("Microsoft.Purview/accounts"), - // }, - // { - // DisplayName: to.Ptr("Microsoft.SignalRService/SignalR"), - // ID: to.Ptr("Microsoft.SignalRService/SignalR"), - // }, - // { - // DisplayName: to.Ptr("Microsoft.SignalRService/WebPubSub"), - // ID: to.Ptr("Microsoft.SignalRService/WebPubSub"), - // }, - // { - // DisplayName: to.Ptr("Batch account"), - // ID: to.Ptr("Microsoft.Batch/batchAccounts"), - // }, - // { - // DisplayName: to.Ptr("Redis cache"), - // ID: to.Ptr("Microsoft.Cache/Redis"), - // }, - // { - // DisplayName: to.Ptr("Cdn profile"), - // ID: to.Ptr("Microsoft.Cdn/profiles"), - // }, - // { - // DisplayName: to.Ptr("Cloud services (classic)"), - // ID: to.Ptr("Microsoft.ClassicCompute/DomainNames"), - // }, - // { - // DisplayName: to.Ptr("Virtual machine (classic)"), - // ID: to.Ptr("Microsoft.ClassicCompute/virtualMachines"), - // }, - // { - // DisplayName: to.Ptr("Cognitive Services account"), - // ID: to.Ptr("Microsoft.CognitiveServices/accounts"), - // }, - // { - // DisplayName: to.Ptr("Azure Dedicated Host"), - // ID: to.Ptr("Microsoft.Compute/hostGroups/hosts"), - // }, - // { - // DisplayName: to.Ptr("Virtual machine"), - // ID: to.Ptr("Microsoft.Compute/virtualMachines"), - // }, - // { - // DisplayName: to.Ptr("Virtual machine scale sets"), - // ID: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // }, - // { - // DisplayName: to.Ptr("microsoft.connectedvmwarevsphere/vcenters"), - // ID: to.Ptr("microsoft.connectedvmwarevsphere/vcenters"), - // }, - // { - // DisplayName: to.Ptr("Data factory"), - // ID: to.Ptr("Microsoft.DataFactory/factories"), - // }, - // { - // DisplayName: to.Ptr("Data Lake Analytics account"), - // ID: to.Ptr("Microsoft.DataLakeAnalytics/accounts"), - // }, - // { - // DisplayName: to.Ptr("Data Lake Store account"), - // ID: to.Ptr("Microsoft.DataLakeStore/accounts"), - // }, - // { - // DisplayName: to.Ptr("Azure Database Migration Service"), - // ID: to.Ptr("Microsoft.DataMigration/services"), - // }, - // { - // DisplayName: to.Ptr("Microsoft.DataProtection/BackupVaults"), - // ID: to.Ptr("Microsoft.DataProtection/BackupVaults"), - // }, - // { - // DisplayName: to.Ptr("Azure Data Share account"), - // ID: to.Ptr("Microsoft.DataShare/accounts"), - // }, - // { - // DisplayName: to.Ptr("Azure Database for MariaDB servers"), - // ID: to.Ptr("Microsoft.DBforMariaDB/servers"), - // }, - // { - // DisplayName: to.Ptr("Azure Database for MySQL flexible servers"), - // ID: to.Ptr("Microsoft.DBforMySQL/flexibleServers"), - // }, - // { - // DisplayName: to.Ptr("Azure Database for MySQL servers"), - // ID: to.Ptr("Microsoft.DBforMySQL/servers"), - // }, - // { - // DisplayName: to.Ptr("Azure Database for PostgreSQL Flexible Server"), - // ID: to.Ptr("Microsoft.DBforPostgreSQL/flexibleservers"), - // }, - // { - // DisplayName: to.Ptr("Azure Database for PostgreSQL servers"), - // ID: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // }, - // { - // DisplayName: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2"), - // ID: to.Ptr("Microsoft.DBforPostgreSQL/serverGroupsv2"), - // }, - // { - // DisplayName: to.Ptr("IoT Hub"), - // ID: to.Ptr("Microsoft.Devices/IotHubs"), - // }, - // { - // DisplayName: to.Ptr("Azure Digital Twins"), - // ID: to.Ptr("Microsoft.DigitalTwins/DigitalTwinsInstances"), - // }, - // { - // DisplayName: to.Ptr("Cosmos DB"), - // ID: to.Ptr("Microsoft.Documentdb/databaseaccounts"), - // }, - // { - // DisplayName: to.Ptr("Event Hub"), - // ID: to.Ptr("Microsoft.EventHub/namespaces"), - // }, - // { - // DisplayName: to.Ptr("Microsoft.ExtendedLocation/customLocations"), - // ID: to.Ptr("Microsoft.ExtendedLocation/customLocations"), - // }, - // { - // DisplayName: to.Ptr("HDInsight clusters"), - // ID: to.Ptr("Microsoft.HdInsight/clusters"), - // }, - // { - // DisplayName: to.Ptr("Azure Arc enabled servers"), - // ID: to.Ptr("Microsoft.HybridCompute/machines"), - // }, - // { - // DisplayName: to.Ptr("Microsoft.HybridNetwork/devices"), - // ID: to.Ptr("Microsoft.HybridNetwork/devices"), - // }, - // { - // DisplayName: to.Ptr("Microsoft.HybridNetwork/networkFunctions"), - // ID: to.Ptr("Microsoft.HybridNetwork/networkFunctions"), - // }, - // { - // DisplayName: to.Ptr("IoT Central Application"), - // ID: to.Ptr("Microsoft.IoTCentral/IoTApps"), - // }, - // { - // DisplayName: to.Ptr("Key vault"), - // ID: to.Ptr("Microsoft.KeyVault/vaults"), - // }, - // { - // DisplayName: to.Ptr("Azure Arc enabled Kubernetes"), - // ID: to.Ptr("Microsoft.Kubernetes/connectedClusters"), - // }, - // { - // DisplayName: to.Ptr("Machine Learning Studio web services"), - // ID: to.Ptr("Microsoft.MachineLearning/webServices"), - // }, - // { - // DisplayName: to.Ptr("Media service"), - // ID: to.Ptr("Microsoft.media/mediaservices"), - // }, - // { - // DisplayName: to.Ptr("Application Gateway"), - // ID: to.Ptr("Microsoft.Network/applicationGateways"), - // }, - // { - // DisplayName: to.Ptr("Microsoft.Network/bastionHosts"), - // ID: to.Ptr("Microsoft.Network/bastionHosts"), - // }, - // { - // DisplayName: to.Ptr("VPN Connection"), - // ID: to.Ptr("Microsoft.Network/Connections"), - // }, - // { - // DisplayName: to.Ptr("Microsoft.Network/dnsResolvers/inboundEndpoints"), - // ID: to.Ptr("Microsoft.Network/dnsResolvers/inboundEndpoints"), - // }, - // { - // DisplayName: to.Ptr("Microsoft.Network/dnsResolvers"), - // ID: to.Ptr("Microsoft.Network/dnsResolvers"), - // }, - // { - // DisplayName: to.Ptr("Microsoft.Network/dnsResolvers/outboundEndpoints"), - // ID: to.Ptr("Microsoft.Network/dnsResolvers/outboundEndpoints"), - // }, - // { - // DisplayName: to.Ptr("Microsoft.Network/dnszones"), - // ID: to.Ptr("Microsoft.Network/dnszones"), - // }, - // { - // DisplayName: to.Ptr("ExpressRoute circuit"), - // ID: to.Ptr("Microsoft.Network/expressRouteCircuits"), - // }, - // { - // DisplayName: to.Ptr("Express RouteGateways"), - // ID: to.Ptr("Microsoft.Network/ExpressRouteGateways"), - // }, - // { - // DisplayName: to.Ptr("Front Door"), - // ID: to.Ptr("Microsoft.Network/frontdoors"), - // }, - // { - // DisplayName: to.Ptr("Load balancer"), - // ID: to.Ptr("Microsoft.Network/LoadBalancers"), - // }, - // { - // DisplayName: to.Ptr("Microsoft.Network/NATGateways"), - // ID: to.Ptr("Microsoft.Network/NATGateways"), - // }, - // { - // DisplayName: to.Ptr("Traffic Manager profile"), - // ID: to.Ptr("Microsoft.Network/trafficmanagerprofiles"), - // }, - // { - // DisplayName: to.Ptr("VPN Gateway"), - // ID: to.Ptr("Microsoft.Network/virtualNetworkGateways"), - // }, - // { - // DisplayName: to.Ptr("Notification Hub namespace"), - // ID: to.Ptr("Microsoft.NotificationHubs/Namespaces"), - // }, - // { - // DisplayName: to.Ptr("Log Analytics workspace"), - // ID: to.Ptr("Microsoft.OperationalInsights/workspaces"), - // }, - // { - // DisplayName: to.Ptr("Power BI Embedded"), - // ID: to.Ptr("Microsoft.PowerBIDedicated/capacities"), - // }, - // { - // DisplayName: to.Ptr("Microsoft.RecoveryServices/vaults"), - // ID: to.Ptr("Microsoft.RecoveryServices/vaults"), - // }, - // { - // DisplayName: to.Ptr("Microsoft.ResourceConnector/appliances"), - // ID: to.Ptr("Microsoft.ResourceConnector/appliances"), - // }, - // { - // DisplayName: to.Ptr("Search service"), - // ID: to.Ptr("Microsoft.Search/searchServices"), - // }, - // { - // DisplayName: to.Ptr("Service Bus"), - // ID: to.Ptr("Microsoft.ServiceBus/namespaces"), - // }, - // { - // DisplayName: to.Ptr("Service Fabric cluster"), - // ID: to.Ptr("Microsoft.ServiceFabric/clusters"), - // }, - // { - // DisplayName: to.Ptr("Microsoft.ServiceFabric/managedClusters"), - // ID: to.Ptr("Microsoft.ServiceFabric/managedClusters"), - // }, - // { - // DisplayName: to.Ptr("Managed database"), - // ID: to.Ptr("Microsoft.Sql/managedInstances/databases"), - // }, - // { - // DisplayName: to.Ptr("Managed instance"), - // ID: to.Ptr("Microsoft.Sql/managedInstances"), - // }, - // { - // DisplayName: to.Ptr("SQL database"), - // ID: to.Ptr("Microsoft.Sql/servers/databases"), - // }, - // { - // DisplayName: to.Ptr("Storage account"), - // ID: to.Ptr("Microsoft.Storage/storageAccounts"), - // }, - // { - // DisplayName: to.Ptr("Microsoft.StorageCache/caches"), - // ID: to.Ptr("Microsoft.StorageCache/caches"), - // }, - // { - // DisplayName: to.Ptr("Stream Analytics job"), - // ID: to.Ptr("Microsoft.StreamAnalytics/streamingjobs"), - // }, - // { - // DisplayName: to.Ptr("Microsoft.Synapse/workspaces"), - // ID: to.Ptr("Microsoft.Synapse/workspaces"), - // }, - // { - // DisplayName: to.Ptr("App Service plan"), - // ID: to.Ptr("Microsoft.Web/serverFarms"), - // }, - // { - // DisplayName: to.Ptr("Website"), - // ID: to.Ptr("Microsoft.Web/sites"), - // }}, - // }, - // }, - // { - // Name: to.Ptr("supportedEventTypes"), - // Type: to.Ptr("Microsoft.ResourceHealth/metadata"), - // ID: to.Ptr("/providers/Microsoft.ResourceHealth/metadata/supportedEventTypes"), - // Properties: &armresourcehealth.MetadataEntityProperties{ - // DisplayName: to.Ptr("Supported Service Health Event Types"), - // SupportedValues: []*armresourcehealth.MetadataSupportedValueDetail{ - // { - // DisplayName: to.Ptr("Planned Maintenance"), - // ID: to.Ptr("Maintenance"), - // }, - // { - // DisplayName: to.Ptr("Health Advisories"), - // ID: to.Ptr("Informational"), - // }, - // { - // DisplayName: to.Ptr("Security Advisories"), - // ID: to.Ptr("Security"), - // }, - // { - // DisplayName: to.Ptr("Health Advisories"), - // ID: to.Ptr("ActionRequired"), - // }, - // { - // DisplayName: to.Ptr("Service Issue"), - // ID: to.Ptr("Incident"), - // }}, - // }, - // }, - // { - // Name: to.Ptr("supportedServices"), - // Type: to.Ptr("Microsoft.ResourceHealth/metadata"), - // ID: to.Ptr("/providers/Microsoft.ResourceHealth/metadata/supportedServices"), - // Properties: &armresourcehealth.MetadataEntityProperties{ - // DisplayName: to.Ptr("Supported Service Health Services"), - // SupportedValues: []*armresourcehealth.MetadataSupportedValueDetail{ - // { - // DisplayName: to.Ptr("API Management"), - // ID: to.Ptr("API Management"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.apimanagement/service")}, - // }, - // { - // DisplayName: to.Ptr("Action Groups"), - // ID: to.Ptr("Action Groups"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.insights/actiongroups"), - // to.Ptr("microsoft.alertsmanagement/alerts")}, - // }, - // { - // DisplayName: to.Ptr("Activity Logs & Alerts"), - // ID: to.Ptr("Activity Logs & Alerts"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.insights/alertrules"), - // to.Ptr("microsoft.insights/activitylogalerts"), - // to.Ptr("microsoft.alertsmanagement/alerts")}, - // }, - // { - // DisplayName: to.Ptr("Advisor"), - // ID: to.Ptr("Advisor"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Alerts"), - // ID: to.Ptr("Alerts"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.insights/alertrules"), - // to.Ptr("microsoft.insights/activitylogalerts"), - // to.Ptr("microsoft.insights/metricalerts"), - // to.Ptr("microsoft.insights/scheduledqueryrules"), - // to.Ptr("microsoft.insights/actiongroups"), - // to.Ptr("microsoft.alertsmanagement/alerts"), - // to.Ptr("microsoft.alertsmanagement/actionrules"), - // to.Ptr("microsoft.alertsmanagement/smartdetectoralertrules")}, - // }, - // { - // DisplayName: to.Ptr("Alerts & Metrics"), - // ID: to.Ptr("Alerts & Metrics"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.insights/alertrules"), - // to.Ptr("microsoft.insights/metricalerts"), - // to.Ptr("microsoft.alertsmanagement/alerts")}, - // }, - // { - // DisplayName: to.Ptr("App Service"), - // ID: to.Ptr("App Service"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.web/sites")}, - // }, - // { - // DisplayName: to.Ptr("App Service (Linux)"), - // ID: to.Ptr("App Service (Linux)"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.web/sites")}, - // }, - // { - // DisplayName: to.Ptr("App Service (Linux) \\ Web App for Containers"), - // ID: to.Ptr("App Service (Linux) \\ Web App for Containers"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.web/sites")}, - // }, - // { - // DisplayName: to.Ptr("App Service (Linux) \\ Web Apps"), - // ID: to.Ptr("App Service (Linux) \\ Web Apps"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.web/sites")}, - // }, - // { - // DisplayName: to.Ptr("App Service \\ Web Apps"), - // ID: to.Ptr("App Service \\ Web Apps"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.web/sites")}, - // }, - // { - // DisplayName: to.Ptr("Application Gateway"), - // ID: to.Ptr("Application Gateway"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.network/applicationgateways")}, - // }, - // { - // DisplayName: to.Ptr("Application Insights"), - // ID: to.Ptr("Application Insights"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.insights/components")}, - // }, - // { - // DisplayName: to.Ptr("AutoScale"), - // ID: to.Ptr("AutoScale"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.insights/autoscalesettings")}, - // }, - // { - // DisplayName: to.Ptr("Automation"), - // ID: to.Ptr("Automation"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.automation/automationaccounts"), - // to.Ptr("microsoft.automation/automationaccounts/runbooks"), - // to.Ptr("microsoft.automation/automationaccounts/jobs")}, - // }, - // { - // DisplayName: to.Ptr("Azure Active Directory"), - // ID: to.Ptr("Azure Active Directory"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Azure Active Directory B2C"), - // ID: to.Ptr("Azure Active Directory B2C"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Azure Active Directory Domain Services"), - // ID: to.Ptr("Azure Active Directory Domain Services"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.aad/domainservices")}, - // }, - // { - // DisplayName: to.Ptr("Azure Active Directory \\ Enterprise State Roaming"), - // ID: to.Ptr("Azure Active Directory \\ Enterprise State Roaming"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Azure Analysis Services"), - // ID: to.Ptr("Azure Analysis Services"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.analysisservices/servers")}, - // }, - // { - // DisplayName: to.Ptr("Azure API for FHIR"), - // ID: to.Ptr("Azure API for FHIR"), - // ResourceTypes: []*string{ - // to.Ptr("Microsoft.HealthcareApis/services")}, - // }, - // { - // DisplayName: to.Ptr("Azure App Configuration"), - // ID: to.Ptr("Azure App Configuration"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Azure Applied AI Services"), - // ID: to.Ptr("Azure Applied AI Services"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Azure Arc enabled Kubernetes"), - // ID: to.Ptr("Azure Arc enabled Kubernetes"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.kubernetes/connectedclusters")}, - // }, - // { - // DisplayName: to.Ptr("Azure Arc enabled data services"), - // ID: to.Ptr("Azure Arc enabled data services"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Azure Arc enabled servers"), - // ID: to.Ptr("Azure Arc enabled servers"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.hybridcompute/machines")}, - // }, - // { - // DisplayName: to.Ptr("Azure Bastion"), - // ID: to.Ptr("Azure Bastion"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.network/bastionhosts")}, - // }, - // { - // DisplayName: to.Ptr("Azure Blueprints"), - // ID: to.Ptr("Azure Blueprints"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Azure Bot Service"), - // ID: to.Ptr("Azure Bot Service"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.botservice/botservices")}, - // }, - // { - // DisplayName: to.Ptr("Azure Chaos Studio"), - // ID: to.Ptr("Azure Chaos Studio"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Azure Communication Services"), - // ID: to.Ptr("Azure Communication Services"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.communication/communicationservices")}, - // }, - // { - // DisplayName: to.Ptr("Azure Container Apps"), - // ID: to.Ptr("Azure Container Apps"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Azure Container Registry"), - // ID: to.Ptr("Azure Container Registry"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.containerregistry/registries")}, - // }, - // { - // DisplayName: to.Ptr("Azure Container Service"), - // ID: to.Ptr("Azure Container Service"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.containerservice/managedclusters")}, - // }, - // { - // DisplayName: to.Ptr("Azure Cosmos DB"), - // ID: to.Ptr("Azure Cosmos DB"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.documentdb/databaseaccounts")}, - // }, - // { - // DisplayName: to.Ptr("Azure Cosmos DB for PostgreSQL"), - // ID: to.Ptr("Azure Cosmos DB for PostgreSQL"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.dbforpostgresql/servergroupsv2")}, - // }, - // { - // DisplayName: to.Ptr("Azure DDoS Protection"), - // ID: to.Ptr("Azure DDoS Protection"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Azure DNS"), - // ID: to.Ptr("Azure DNS"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.network/dnszones")}, - // }, - // { - // DisplayName: to.Ptr("Azure Data Explorer"), - // ID: to.Ptr("Azure Data Explorer"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.kusto/clusters"), - // to.Ptr("microsoft.kusto/clusters/databases/dataconnections")}, - // }, - // { - // DisplayName: to.Ptr("Azure Data Lake Storage Gen1"), - // ID: to.Ptr("Azure Data Lake Storage Gen1"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.datalakestore/accounts")}, - // }, - // { - // DisplayName: to.Ptr("Azure Data Lake Storage Gen2"), - // ID: to.Ptr("Azure Data Lake Storage Gen2"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.datalakestore/accounts")}, - // }, - // { - // DisplayName: to.Ptr("Azure Data Share"), - // ID: to.Ptr("Azure Data Share"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.datashare/accounts"), - // to.Ptr("microsoft.datashare/shares"), - // to.Ptr("microsoft.datashare/sharesubscriptions"), - // to.Ptr("microsoft.datashare/datasets"), - // to.Ptr("microsoft.datashare/datasetmappings"), - // to.Ptr("microsoft.datashare/invitations")}, - // }, - // { - // DisplayName: to.Ptr("Azure Database for MySQL"), - // ID: to.Ptr("Azure Database for MySQL"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.dbformysql/servers")}, - // }, - // { - // DisplayName: to.Ptr("Azure Database for MySQL flexible servers"), - // ID: to.Ptr("Azure Database for MySQL flexible servers"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.dbformysql/flexibleservers")}, - // }, - // { - // DisplayName: to.Ptr("Azure Database for PostgreSQL"), - // ID: to.Ptr("Azure Database for PostgreSQL"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.dbforpostgresql/servers")}, - // }, - // { - // DisplayName: to.Ptr("Azure Database for PostgreSQL flexible servers"), - // ID: to.Ptr("Azure Database for PostgreSQL flexible servers"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.dbforpostgresql/flexibleservers")}, - // }, - // { - // DisplayName: to.Ptr("Azure Database Migration Service"), - // ID: to.Ptr("Azure Database Migration Service"), - // ResourceTypes: []*string{ - // to.Ptr("Microsoft.DataMigration/services")}, - // }, - // { - // DisplayName: to.Ptr("Azure Databricks"), - // ID: to.Ptr("Azure Databricks"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.databricks/workspaces")}, - // }, - // { - // DisplayName: to.Ptr("Azure Dedicated Host"), - // ID: to.Ptr("Azure Dedicated Host"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.compute/hostgroups/hosts")}, - // }, - // { - // DisplayName: to.Ptr("Azure DevOps"), - // ID: to.Ptr("Azure DevOps"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Azure DevOps \\ Artifacts"), - // ID: to.Ptr("Azure DevOps \\ Artifacts"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Azure DevOps \\ Boards"), - // ID: to.Ptr("Azure DevOps \\ Boards"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Azure DevOps \\ Pipelines"), - // ID: to.Ptr("Azure DevOps \\ Pipelines"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Azure DevOps \\ Repos"), - // ID: to.Ptr("Azure DevOps \\ Repos"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Azure DevOps \\ Test Plans"), - // ID: to.Ptr("Azure DevOps \\ Test Plans"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Azure DevTest Labs"), - // ID: to.Ptr("Azure DevTest Labs"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.devtestlab/labs")}, - // }, - // { - // DisplayName: to.Ptr("Azure Digital Twins"), - // ID: to.Ptr("Azure Digital Twins"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.digitaltwins/digitaltwinsinstances")}, - // }, - // { - // DisplayName: to.Ptr("Azure FarmBeats"), - // ID: to.Ptr("Azure FarmBeats"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Azure File Sync"), - // ID: to.Ptr("Azure File Sync"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Azure Firewall"), - // ID: to.Ptr("Azure Firewall"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.network/azurefirewalls")}, - // }, - // { - // DisplayName: to.Ptr("Azure Firewall Manager"), - // ID: to.Ptr("Azure Firewall Manager"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.network/firewallpolicies")}, - // }, - // { - // DisplayName: to.Ptr("Azure Fluid Relay"), - // ID: to.Ptr("Azure Fluid Relay"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.fluidrelay/fluidrelayservers")}, - // }, - // { - // DisplayName: to.Ptr("Azure Frontdoor"), - // ID: to.Ptr("Azure Frontdoor"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.network/frontdoors")}, - // }, - // { - // DisplayName: to.Ptr("Azure Health Data Services"), - // ID: to.Ptr("Azure Health Data Services"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Azure HPC Cache"), - // ID: to.Ptr("Azure HPC Cache"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.storagecache/caches")}, - // }, - // { - // DisplayName: to.Ptr("Azure Information Protection"), - // ID: to.Ptr("Azure Information Protection"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Azure Immersive Reader"), - // ID: to.Ptr("Azure Immersive Reader"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Azure IoT Hub"), - // ID: to.Ptr("Azure IoT Hub"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.devices/iothubs")}, - // }, - // { - // DisplayName: to.Ptr("Azure Key Vault Managed HSM"), - // ID: to.Ptr("Azure Key Vault Managed HSM"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Azure Kubernetes Service (AKS)"), - // ID: to.Ptr("Azure Kubernetes Service (AKS)"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.containerservice/managedclusters")}, - // }, - // { - // DisplayName: to.Ptr("Azure Kubernetes Service On Azure Stack HCI"), - // ID: to.Ptr("Azure Kubernetes Service On Azure Stack HCI"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Azure Lab Services"), - // ID: to.Ptr("Azure Lab Services"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Azure Load Testing"), - // ID: to.Ptr("Azure Load Testing"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Azure Managed Applications"), - // ID: to.Ptr("Azure Managed Applications"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Azure Managed Instance for Apache Cassandra"), - // ID: to.Ptr("Azure Managed Instance for Apache Cassandra"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Azure Maps"), - // ID: to.Ptr("Azure Maps"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.maps/accounts")}, - // }, - // { - // DisplayName: to.Ptr("Azure Migrate"), - // ID: to.Ptr("Azure Migrate"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.migrate/migrateprojects")}, - // }, - // { - // DisplayName: to.Ptr("Azure Monitor"), - // ID: to.Ptr("Azure Monitor"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.alertsmanagement/alerts"), - // to.Ptr("microsoft.insights/scheduledqueryrules")}, - // }, - // { - // DisplayName: to.Ptr("Azure Netapp Files"), - // ID: to.Ptr("Azure Netapp Files"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.netapp/netappaccounts")}, - // }, - // { - // DisplayName: to.Ptr("Azure Network Function Manager - Device"), - // ID: to.Ptr("Azure Network Function Manager - Device"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.hybridnetwork/devices")}, - // }, - // { - // DisplayName: to.Ptr("Azure Network Function Manager - Network Function"), - // ID: to.Ptr("Azure Network Function Manager - Network Function"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.hybridnetwork/networkfunctions")}, - // }, - // { - // DisplayName: to.Ptr("Azure OpenAI Service"), - // ID: to.Ptr("Azure OpenAI Service"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Azure Open Datasets"), - // ID: to.Ptr("Azure Open Datasets"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Azure Orbital"), - // ID: to.Ptr("Azure Orbital"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Azure Peering Service"), - // ID: to.Ptr("Azure Peering Service"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.peering/peeringservices")}, - // }, - // { - // DisplayName: to.Ptr("Azure Policy"), - // ID: to.Ptr("Azure Policy"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Azure Private 5G Core"), - // ID: to.Ptr("Azure Private 5G Core"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Azure Private Link"), - // ID: to.Ptr("Azure Private Link"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.network/privateendpoints"), - // to.Ptr("microsoft.network/privatelinkservices")}, - // }, - // { - // DisplayName: to.Ptr("Azure Purview"), - // ID: to.Ptr("Azure Purview"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.purview/accounts")}, - // }, - // { - // DisplayName: to.Ptr("Azure Quantum"), - // ID: to.Ptr("Azure Quantum"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Azure Red Hat OpenShift"), - // ID: to.Ptr("Azure Red Hat OpenShift"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Azure Reservations"), - // ID: to.Ptr("Azure Reservations"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Azure Resource Manager"), - // ID: to.Ptr("Azure Resource Manager"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Azure Resource Mover"), - // ID: to.Ptr("Azure Resource Mover"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.migrate/movecollections")}, - // }, - // { - // DisplayName: to.Ptr("Azure Search"), - // ID: to.Ptr("Azure Search"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.search/searchservices")}, - // }, - // { - // DisplayName: to.Ptr("Azure Sentinel"), - // ID: to.Ptr("Azure Sentinel"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Azure Metrics Advisor"), - // ID: to.Ptr("Azure Metrics Advisor"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Azure SignalR Service"), - // ID: to.Ptr("Azure SignalR Service"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.signalrservice/signalr")}, - // }, - // { - // DisplayName: to.Ptr("Azure Spatial Anchors"), - // ID: to.Ptr("Azure Spatial Anchors"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.mixedreality/spatialanchorsaccounts")}, - // }, - // { - // DisplayName: to.Ptr("Azure Sphere"), - // ID: to.Ptr("Azure Sphere"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Azure Spring Cloud"), - // ID: to.Ptr("Azure Spring Cloud"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.appplatform/spring")}, - // }, - // { - // DisplayName: to.Ptr("Azure SQL Migration extension for Azure Data Studio powered by Azure Database Migration Service"), - // ID: to.Ptr("Azure SQL Migration extension for Azure Data Studio powered by Azure Database Migration Service"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.datamigration/sqlmigrationservices")}, - // }, - // { - // DisplayName: to.Ptr("Azure Stack"), - // ID: to.Ptr("Azure Stack"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Azure Stack Edge"), - // ID: to.Ptr("Azure Stack Edge"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Azure Stack HCI"), - // ID: to.Ptr("Azure Stack HCI"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.azurestackhci/clusters")}, - // }, - // { - // DisplayName: to.Ptr("Azure Static Web Apps"), - // ID: to.Ptr("Azure Static Web Apps"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.web/staticsites")}, - // }, - // { - // DisplayName: to.Ptr("Azure Synapse Analytics"), - // ID: to.Ptr("Azure Synapse Analytics"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.sql/servers"), - // to.Ptr("microsoft.synapse/workspaces")}, - // }, - // { - // DisplayName: to.Ptr("Azure Video Analyzer"), - // ID: to.Ptr("Azure Video Analyzer"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Azure Video Analyzer For Media"), - // ID: to.Ptr("Azure Video Analyzer For Media"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Azure VMware Solution"), - // ID: to.Ptr("Azure VMware Solution"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.avs/privateclouds"), - // to.Ptr("microsoft.avs/privateclouds/clusters")}, - // }, - // { - // DisplayName: to.Ptr("Azure VMware Solution by CloudSimple"), - // ID: to.Ptr("Azure VMware Solution by CloudSimple"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Azure Web PubSub"), - // ID: to.Ptr("Azure Web PubSub"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Recovery Services vault"), - // ID: to.Ptr("Recovery Services vault"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.recoveryservices/vaults")}, - // }, - // { - // DisplayName: to.Ptr("Backup vault"), - // ID: to.Ptr("Backup vault"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.dataprotection/backupvaults")}, - // }, - // { - // DisplayName: to.Ptr("Batch"), - // ID: to.Ptr("Batch"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.batch/batchaccounts")}, - // }, - // { - // DisplayName: to.Ptr("BareMetal Infrastructure"), - // ID: to.Ptr("BareMetal Infrastructure"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.baremetalinfrastructure/baremetalinstances")}, - // }, - // { - // DisplayName: to.Ptr("CDN"), - // ID: to.Ptr("CDN"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.cdn/profiles")}, - // }, - // { - // DisplayName: to.Ptr("Change Analysis"), - // ID: to.Ptr("Change Analysis"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Cloud Services"), - // ID: to.Ptr("Cloud Services"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.classiccompute/domainnames"), - // to.Ptr("microsoft.compute/domainnames")}, - // }, - // { - // DisplayName: to.Ptr("Cloud Shell"), - // ID: to.Ptr("Cloud Shell"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Cognitive Services \\ Anomaly Detector\""), - // ID: to.Ptr("Cognitive Services \\ Anomaly Detector"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Cognitive Services \\ Azure Metrics Advisor"), - // ID: to.Ptr("Cognitive Services \\ Azure Metrics Advisor"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Cognitive Services \\ Bing Autosuggest API"), - // ID: to.Ptr("Cognitive Services \\ Bing Autosuggest API"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.cognitiveservices/accounts")}, - // }, - // { - // DisplayName: to.Ptr("Cognitive Services \\ Bing Search API"), - // ID: to.Ptr("Cognitive Services \\ Bing Search API"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.cognitiveservices/accounts")}, - // }, - // { - // DisplayName: to.Ptr("Cognitive Services \\ Bing Speech API"), - // ID: to.Ptr("Cognitive Services \\ Bing Speech API"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Cognitive Services \\ Bing Spell Check API"), - // ID: to.Ptr("Cognitive Services \\ Bing Spell Check API"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.cognitiveservices/accounts")}, - // }, - // { - // DisplayName: to.Ptr("Cognitive Services \\ Bing Video Search API"), - // ID: to.Ptr("Cognitive Services \\ Bing Video Search API"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Cognitive Services \\ Bing Visual Search API"), - // ID: to.Ptr("Cognitive Services \\ Bing Visual Search API"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Cognitive Services \\ Bing Web Search API"), - // ID: to.Ptr("Cognitive Services \\ Bing Web Search API"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Cognitive Services \\ Computer Vision API"), - // ID: to.Ptr("Cognitive Services \\ Computer Vision API"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Cognitive Services \\ Content Moderator API"), - // ID: to.Ptr("Cognitive Services \\ Content Moderator API"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Cognitive Services \\ Custom Vision API"), - // ID: to.Ptr("Cognitive Services \\ Custom Vision API"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Cognitive Services \\ Face API"), - // ID: to.Ptr("Cognitive Services \\ Face API"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Cognitive Services \\ Form Recognizer API"), - // ID: to.Ptr("Cognitive Services \\ Form Recognizer API"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Cognitive Services \\ Azure Form Recognizer"), - // ID: to.Ptr("Cognitive Services \\ Azure Form Recognizer"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Cognitive Services \\ Image Search API"), - // ID: to.Ptr("Cognitive Services \\ Image Search API"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Cognitive Services \\ Language Understanding (LUIS)"), - // ID: to.Ptr("Cognitive Services \\ Language Understanding (LUIS)"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Cognitive Services \\ News Search API"), - // ID: to.Ptr("Cognitive Services \\ News Search API"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Cognitive Services \\ Personalizer API"), - // ID: to.Ptr("Cognitive Services \\ Personalizer API"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Cognitive Services \\ QnA Maker API"), - // ID: to.Ptr("Cognitive Services \\ QnA Maker API"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Cognitive Services \\ Speech Services API"), - // ID: to.Ptr("Cognitive Services \\ Speech Services API"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Cognitive Services \\ Speaker Recognition API"), - // ID: to.Ptr("Cognitive Services \\ Speaker Recognition API"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Cognitive Services \\ Text Analytics API"), - // ID: to.Ptr("Cognitive Services \\ Text Analytics API"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.cognitiveservices/accounts")}, - // }, - // { - // DisplayName: to.Ptr("Cognitive Services \\ Translator Speech API"), - // ID: to.Ptr("Cognitive Services \\ Translator Speech API"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.cognitiveservices/accounts")}, - // }, - // { - // DisplayName: to.Ptr("Cognitive Services \\ Translator Text API"), - // ID: to.Ptr("Cognitive Services \\ Translator Text API"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.cognitiveservices/accounts")}, - // }, - // { - // DisplayName: to.Ptr("Container Instances"), - // ID: to.Ptr("Container Instances"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.containerinstance/containergroups")}, - // }, - // { - // DisplayName: to.Ptr("Container Registry"), - // ID: to.Ptr("Container Registry"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.containerregistry/registries")}, - // }, - // { - // DisplayName: to.Ptr("Cost Management"), - // ID: to.Ptr("Cost Management"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Data Catalog"), - // ID: to.Ptr("Data Catalog"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.datacatalog/catalogs")}, - // }, - // { - // DisplayName: to.Ptr("Data Factory"), - // ID: to.Ptr("Data Factory"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.datafactory/datafactories")}, - // }, - // { - // DisplayName: to.Ptr("Data Factory V1"), - // ID: to.Ptr("Data Factory V1"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.datafactory/datafactories")}, - // }, - // { - // DisplayName: to.Ptr("Data Factory V2"), - // ID: to.Ptr("Data Factory V2"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.datafactory/factories")}, - // }, - // { - // DisplayName: to.Ptr("Data Factory V2 \\ SSIS Integration Runtime"), - // ID: to.Ptr("Data Factory V2 \\ SSIS Integration Runtime"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.datafactory/factories")}, - // }, - // { - // DisplayName: to.Ptr("Data Factory \\ Azure Integration Runtime"), - // ID: to.Ptr("Data Factory \\ Azure Integration Runtime"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.datafactory/datafactories")}, - // }, - // { - // DisplayName: to.Ptr("Data Lake Analytics"), - // ID: to.Ptr("Data Lake Analytics"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.datalakeanalytics/accounts"), - // to.Ptr("microsoft.datalakeanalytics/accounts/storageaccounts")}, - // }, - // { - // DisplayName: to.Ptr("Diagnostic Logs"), - // ID: to.Ptr("Diagnostic Logs"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Event Grid"), - // ID: to.Ptr("Event Grid"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.eventgrid/topics")}, - // }, - // { - // DisplayName: to.Ptr("Event Hubs"), - // ID: to.Ptr("Event Hubs"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.eventhub/namespaces")}, - // }, - // { - // DisplayName: to.Ptr("ExpressRoute"), - // ID: to.Ptr("ExpressRoute"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.network/expressroutecircuits")}, - // }, - // { - // DisplayName: to.Ptr("ExpressRoute \\ ExpressRoute Circuits"), - // ID: to.Ptr("ExpressRoute \\ ExpressRoute Circuits"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.network/expressroutecircuits")}, - // }, - // { - // DisplayName: to.Ptr("ExpressRoute \\ ExpressRoute Gateways"), - // ID: to.Ptr("ExpressRoute \\ ExpressRoute Gateways"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Functions"), - // ID: to.Ptr("Functions"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.web/sites")}, - // }, - // { - // DisplayName: to.Ptr("HDInsight"), - // ID: to.Ptr("HDInsight"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.hdinsight/clusters")}, - // }, - // { - // DisplayName: to.Ptr("Health Bot"), - // ID: to.Ptr("Health Bot"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("HockeyApp"), - // ID: to.Ptr("HockeyApp"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Internet Analyzer"), - // ID: to.Ptr("Internet Analyzer"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.network/networkexperiment")}, - // }, - // { - // DisplayName: to.Ptr("IoT Central"), - // ID: to.Ptr("IoT Central"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.iotcentral/iotapps")}, - // }, - // { - // DisplayName: to.Ptr("IoT Hub \\ IoT Hub Device Provisioning Service"), - // ID: to.Ptr("IoT Hub \\ IoT Hub Device Provisioning Service"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Key Vault"), - // ID: to.Ptr("Key Vault"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.keyvault/vaults")}, - // }, - // { - // DisplayName: to.Ptr("Load Balancer"), - // ID: to.Ptr("Load Balancer"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.network/loadbalancers")}, - // }, - // { - // DisplayName: to.Ptr("Log Analytics"), - // ID: to.Ptr("Log Analytics"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.operationalinsights/workspaces")}, - // }, - // { - // DisplayName: to.Ptr("Logic Apps"), - // ID: to.Ptr("Logic Apps"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.logic/workflows")}, - // }, - // { - // DisplayName: to.Ptr("Machine Learning Services"), - // ID: to.Ptr("Machine Learning Services"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.machinelearning/workspaces"), - // to.Ptr("microsoft.machinelearning/commitmentplans"), - // to.Ptr("microsoft.machinelearning/webservices")}, - // }, - // { - // DisplayName: to.Ptr("Machine Learning Services \\ Machine Learning Experimentation Service"), - // ID: to.Ptr("Machine Learning Services \\ Machine Learning Experimentation Service"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Machine Learning Services \\ Machine Learning Model Management"), - // ID: to.Ptr("Machine Learning Services \\ Machine Learning Model Management"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Machine Learning Studio"), - // ID: to.Ptr("Machine Learning Studio"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("MariaDB"), - // ID: to.Ptr("MariaDB"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.dbformariadb/servers")}, - // }, - // { - // DisplayName: to.Ptr("Marketplace"), - // ID: to.Ptr("Marketplace"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Media Services \\ Encoding"), - // ID: to.Ptr("Media Services \\ Encoding"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.media/mediaservices")}, - // }, - // { - // DisplayName: to.Ptr("Media Services \\ Streaming"), - // ID: to.Ptr("Media Services \\ Streaming"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.media/mediaservices")}, - // }, - // { - // DisplayName: to.Ptr("Microsoft Azure Attestation"), - // ID: to.Ptr("Microsoft Azure Attestation"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Microsoft Azure portal"), - // ID: to.Ptr("Microsoft Azure portal"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Microsoft Azure portal \\ Marketplace"), - // ID: to.Ptr("Microsoft Azure portal \\ Marketplace"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Microsoft Defender for Cloud"), - // ID: to.Ptr("Microsoft Defender for Cloud"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Microsoft Defender for IoT"), - // ID: to.Ptr("Microsoft Defender for IoT"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Microsoft Entra Permissions Management"), - // ID: to.Ptr("Microsoft Entra Permissions Management"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Microsoft Genomics"), - // ID: to.Ptr("Microsoft Genomics"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Mobile Engagement"), - // ID: to.Ptr("Mobile Engagement"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Multi-Factor Authentication"), - // ID: to.Ptr("Multi-Factor Authentication"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Network Infrastructure"), - // ID: to.Ptr("Network Infrastructure"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Network Watcher"), - // ID: to.Ptr("Network Watcher"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Notification Hubs"), - // ID: to.Ptr("Notification Hubs"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.notificationhubs/namespaces")}, - // }, - // { - // DisplayName: to.Ptr("Power BI Embedded"), - // ID: to.Ptr("Power BI Embedded"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.powerbi/workspacecollections"), - // to.Ptr("microsoft.powerbidedicated/capacities")}, - // }, - // { - // DisplayName: to.Ptr("Redis Cache"), - // ID: to.Ptr("Redis Cache"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.cache/redis")}, - // }, - // { - // DisplayName: to.Ptr("Remote Rendering"), - // ID: to.Ptr("Remote Rendering"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.mixedreality/remoterenderingaccounts")}, - // }, - // { - // DisplayName: to.Ptr("SAP HANA on Azure Large Instances"), - // ID: to.Ptr("SAP HANA on Azure Large Instances"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.hanaonazure/hanainstances")}, - // }, - // { - // DisplayName: to.Ptr("SQL Data Warehouse"), - // ID: to.Ptr("SQL Data Warehouse"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.sql/servers/databases")}, - // }, - // { - // DisplayName: to.Ptr("SQL Database"), - // ID: to.Ptr("SQL Database"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.sql/servers"), - // to.Ptr("microsoft.sql/servers/databases"), - // to.Ptr("microsoft.sql/servers/elasticpools")}, - // }, - // { - // DisplayName: to.Ptr("SQL Managed Instance"), - // ID: to.Ptr("SQL Managed Instance"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.sql/managedinstances/databases"), - // to.Ptr("microsoft.sql/managedinstances")}, - // }, - // { - // DisplayName: to.Ptr("SQL Server on Azure Virtual Machines"), - // ID: to.Ptr("SQL Server on Azure Virtual Machines"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.sqlvirtualmachine/sqlvirtualmachines")}, - // }, - // { - // DisplayName: to.Ptr("SQL Server Stretch Database"), - // ID: to.Ptr("SQL Server Stretch Database"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Scheduler"), - // ID: to.Ptr("Scheduler"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.scheduler/jobcollections")}, - // }, - // { - // DisplayName: to.Ptr("Security Center"), - // ID: to.Ptr("Security Center"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Service Bus"), - // ID: to.Ptr("Service Bus"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.servicebus/namespaces")}, - // }, - // { - // DisplayName: to.Ptr("Service Fabric"), - // ID: to.Ptr("Service Fabric"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.servicefabric/clusters")}, - // }, - // { - // DisplayName: to.Ptr("Site Recovery"), - // ID: to.Ptr("Site Recovery"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.recoveryservices/vaults")}, - // }, - // { - // DisplayName: to.Ptr("StorSimple"), - // ID: to.Ptr("StorSimple"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.storsimple/managers"), - // to.Ptr("microsoft.storsimplebvtd2/managers")}, - // }, - // { - // DisplayName: to.Ptr("Storage"), - // ID: to.Ptr("Storage"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.classicstorage/storageaccounts"), - // to.Ptr("microsoft.storage/storageaccounts")}, - // }, - // { - // DisplayName: to.Ptr("Stream Analytics"), - // ID: to.Ptr("Stream Analytics"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.streamanalytics/streamingjobs")}, - // }, - // { - // DisplayName: to.Ptr("Subscription Management"), - // ID: to.Ptr("Subscription Management"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Time Series Insights"), - // ID: to.Ptr("Time Series Insights"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Traffic Manager"), - // ID: to.Ptr("Traffic Manager"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.network/trafficmanagerprofiles")}, - // }, - // { - // DisplayName: to.Ptr("VPN Gateway"), - // ID: to.Ptr("VPN Gateway"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.network/virtualnetworkgateways"), - // to.Ptr("microsoft.network/connections")}, - // }, - // { - // DisplayName: to.Ptr("VPN Gateway \\ Virtual WAN"), - // ID: to.Ptr("VPN Gateway \\ Virtual WAN"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Virtual Machine Scale Sets"), - // ID: to.Ptr("Virtual Machine Scale Sets"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.compute/virtualmachinescalesets")}, - // }, - // { - // DisplayName: to.Ptr("Virtual Machines"), - // ID: to.Ptr("Virtual Machines"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.classiccompute/virtualmachines"), - // to.Ptr("microsoft.compute/virtualmachines")}, - // }, - // { - // DisplayName: to.Ptr("Virtual Network"), - // ID: to.Ptr("Virtual Network"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.network/virtualnetworks"), - // to.Ptr("microsoft.classicnetwork/virtualnetworks")}, - // }, - // { - // DisplayName: to.Ptr("Windows 10 IoT Core Services"), - // ID: to.Ptr("Windows 10 IoT Core Services"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Windows Virtual Desktop"), - // ID: to.Ptr("Windows Virtual Desktop"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.desktopvirtualization/hostpools")}, - // }, - // { - // DisplayName: to.Ptr("Azure Automanage"), - // ID: to.Ptr("Azure Automanage"), - // ResourceTypes: []*string{ - // to.Ptr("microsoft.automanage/configurationprofiles"), - // to.Ptr("microsoft.compute/virtualmachines/providers/configurationprofileassignments"), - // to.Ptr("microsoft.hybridcompute/machines/providers/configurationprofileassignments"), - // to.Ptr("microsoft.Azurestackhci/clusters/providers/configurationprofileassignments")}, - // }, - // { - // DisplayName: to.Ptr("Microsoft Graph"), - // ID: to.Ptr("Microsoft Graph"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Azure confidential ledger"), - // ID: to.Ptr("Azure confidential ledger"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Azure Managed Grafana"), - // ID: to.Ptr("Azure Managed Grafana"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Universal Print"), - // ID: to.Ptr("Universal Print"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Azure Applied AI Services \\ Azure Video Indexer"), - // ID: to.Ptr("Azure Applied AI Services \\ Azure Video Indexer"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Azure Route Server"), - // ID: to.Ptr("Azure Route Server"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Virtual Network NAT"), - // ID: to.Ptr("Virtual Network NAT"), - // ResourceTypes: []*string{ - // }, - // }, - // { - // DisplayName: to.Ptr("Microsoft Defender External Attack Surface Management"), - // ID: to.Ptr("Microsoft Defender External Attack Surface Management"), - // ResourceTypes: []*string{ - // }, - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/Metadata_GetEntity.json -func ExampleMetadataClient_GetEntity() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresourcehealth.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMetadataClient().GetEntity(ctx, "status", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MetadataEntity = armresourcehealth.MetadataEntity{ - // Name: to.Ptr("status"), - // Type: to.Ptr("Microsoft.ResourceHealth/metadata"), - // ID: to.Ptr("/providers/Microsoft.ResourceHealth/metadata/status"), - // Properties: &armresourcehealth.MetadataEntityProperties{ - // ApplicableScenarios: []*armresourcehealth.Scenario{ - // to.Ptr(armresourcehealth.ScenarioAlerts)}, - // DisplayName: to.Ptr("Status"), - // SupportedValues: []*armresourcehealth.MetadataSupportedValueDetail{ - // { - // DisplayName: to.Ptr("Active"), - // ID: to.Ptr("Active"), - // }, - // { - // DisplayName: to.Ptr("Resolved"), - // ID: to.Ptr("Resolved"), - // }, - // { - // DisplayName: to.Ptr("In Progress"), - // ID: to.Ptr("In Progress"), - // }, - // { - // DisplayName: to.Ptr("Updated"), - // ID: to.Ptr("Updated"), - // }}, - // }, - // } -} diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/models.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/models.go index 6bc8584d1a34..40ec563075ab 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/models.go +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/models.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -223,21 +220,6 @@ type EventImpactedResourceProperties struct { // Additional information. Info []*KeyValueItem - // READ-ONLY; End time of maintenance for the impacted resource. - MaintenanceEndTime *string - - // READ-ONLY; Start time of maintenance for the impacted resource. - MaintenanceStartTime *string - - // READ-ONLY; Resource group name of the impacted resource. - ResourceGroup *string - - // READ-ONLY; Resource name of the impacted resource. - ResourceName *string - - // READ-ONLY; Status of the impacted resource. - Status *string - // READ-ONLY; Impacted resource region name. TargetRegion *string @@ -253,13 +235,11 @@ type EventProperties struct { // Additional information AdditionalInformation *EventPropertiesAdditionalInformation - // Azure Resource Graph query to fetch the affected resources from their existing Azure Resource Graph locations. - ArgQuery *string - // Article of event. Article *EventPropertiesArticle - // 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. Description *string // duration in seconds @@ -277,8 +257,18 @@ type EventProperties struct { // Source of event. EventSource *EventSourceValues - // Sub type of the event. Currently used to determine retirement communications for health advisory events - EventSubType *EventSubTypeValues + // 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. + EventTags []*string // Type of event. EventType *EventTypeValues @@ -307,6 +297,11 @@ type EventProperties struct { // The type of the impact ImpactType *string + // 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 + IsEventSensitive *bool + // It provides information if the event is High incident rate event or not. IsHIR *bool @@ -319,12 +314,6 @@ type EventProperties struct { // Useful links of event. Links []*Link - // Unique identifier for planned maintenance event. - MaintenanceID *string - - // The type of planned maintenance event. - MaintenanceType *string - // Is true if the event is platform initiated. PlatformInitiated *bool @@ -342,7 +331,7 @@ type EventProperties struct { // Current status of event. Status *EventStatusValues - // Summary text of event. + // Summary text of event. Use fetchEventDetails endpoint to get summary of sensitive events. Summary *string // Title text of event. @@ -416,6 +405,9 @@ type Impact struct { // Impacted service name. ImpactedService *string + + // Impacted service guid. This is the permanent identifier for the impacted service. + ImpactedServiceGUID *string } // ImpactedRegion - Object of impacted region. @@ -444,7 +436,7 @@ type ImpactedServiceRegion struct { // Current status of event in the region. Status *EventStatusValues - // List of updates for given service health event. + // List of updates for given service health event. Use fetchEventDetails endpoint to get updates of sensitive events. Updates []*Update } @@ -531,11 +523,17 @@ type MetadataSupportedValueDetail struct { // The display name. DisplayName *string - // The id. + // The id of the metadata value ID *string + // The previous value of the id field incase the data has changed. + PreviousID *string + // The list of associated resource types. ResourceTypes []*string + + // The permanent guid for the service. Used when the id is a service name. + ServiceGUID *string } // Operation available in the Microsoft.ResourceHealth resource provider. @@ -693,6 +691,19 @@ type SystemData struct { // Update for service health event. type Update struct { + // 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. + EventTags []*string + // Summary text for the given update for the service health event. Summary *string diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/models_serde.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/models_serde.go index 86afe2c27b93..86e97f89f345 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/models_serde.go +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/models_serde.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -492,11 +489,6 @@ func (e *EventImpactedResourceListResult) UnmarshalJSON(data []byte) error { func (e EventImpactedResourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "info", e.Info) - populate(objectMap, "maintenanceEndTime", e.MaintenanceEndTime) - populate(objectMap, "maintenanceStartTime", e.MaintenanceStartTime) - populate(objectMap, "resourceGroup", e.ResourceGroup) - populate(objectMap, "resourceName", e.ResourceName) - populate(objectMap, "status", e.Status) populate(objectMap, "targetRegion", e.TargetRegion) populate(objectMap, "targetResourceId", e.TargetResourceID) populate(objectMap, "targetResourceType", e.TargetResourceType) @@ -515,21 +507,6 @@ func (e *EventImpactedResourceProperties) UnmarshalJSON(data []byte) error { case "info": err = unpopulate(val, "Info", &e.Info) delete(rawMsg, key) - case "maintenanceEndTime": - err = unpopulate(val, "MaintenanceEndTime", &e.MaintenanceEndTime) - delete(rawMsg, key) - case "maintenanceStartTime": - err = unpopulate(val, "MaintenanceStartTime", &e.MaintenanceStartTime) - delete(rawMsg, key) - case "resourceGroup": - err = unpopulate(val, "ResourceGroup", &e.ResourceGroup) - delete(rawMsg, key) - case "resourceName": - err = unpopulate(val, "ResourceName", &e.ResourceName) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &e.Status) - delete(rawMsg, key) case "targetRegion": err = unpopulate(val, "TargetRegion", &e.TargetRegion) delete(rawMsg, key) @@ -551,7 +528,6 @@ func (e *EventImpactedResourceProperties) UnmarshalJSON(data []byte) error { func (e EventProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "additionalInformation", e.AdditionalInformation) - populate(objectMap, "argQuery", e.ArgQuery) populate(objectMap, "article", e.Article) populate(objectMap, "description", e.Description) populate(objectMap, "duration", e.Duration) @@ -559,7 +535,7 @@ func (e EventProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "enableMicrosoftSupport", e.EnableMicrosoftSupport) populate(objectMap, "eventLevel", e.EventLevel) populate(objectMap, "eventSource", e.EventSource) - populate(objectMap, "eventSubType", e.EventSubType) + populate(objectMap, "eventTags", e.EventTags) populate(objectMap, "eventType", e.EventType) populate(objectMap, "externalIncidentId", e.ExternalIncidentID) populate(objectMap, "faqs", e.Faqs) @@ -569,12 +545,11 @@ func (e EventProperties) MarshalJSON() ([]byte, error) { populateDateTimeRFC3339(objectMap, "impactMitigationTime", e.ImpactMitigationTime) populateDateTimeRFC3339(objectMap, "impactStartTime", e.ImpactStartTime) populate(objectMap, "impactType", e.ImpactType) + populate(objectMap, "isEventSensitive", e.IsEventSensitive) populate(objectMap, "isHIR", e.IsHIR) populateDateTimeRFC3339(objectMap, "lastUpdateTime", e.LastUpdateTime) populate(objectMap, "level", e.Level) populate(objectMap, "links", e.Links) - populate(objectMap, "maintenanceId", e.MaintenanceID) - populate(objectMap, "maintenanceType", e.MaintenanceType) populate(objectMap, "platformInitiated", e.PlatformInitiated) populate(objectMap, "priority", e.Priority) populate(objectMap, "reason", e.Reason) @@ -597,9 +572,6 @@ func (e *EventProperties) UnmarshalJSON(data []byte) error { case "additionalInformation": err = unpopulate(val, "AdditionalInformation", &e.AdditionalInformation) delete(rawMsg, key) - case "argQuery": - err = unpopulate(val, "ArgQuery", &e.ArgQuery) - delete(rawMsg, key) case "article": err = unpopulate(val, "Article", &e.Article) delete(rawMsg, key) @@ -621,8 +593,8 @@ func (e *EventProperties) UnmarshalJSON(data []byte) error { case "eventSource": err = unpopulate(val, "EventSource", &e.EventSource) delete(rawMsg, key) - case "eventSubType": - err = unpopulate(val, "EventSubType", &e.EventSubType) + case "eventTags": + err = unpopulate(val, "EventTags", &e.EventTags) delete(rawMsg, key) case "eventType": err = unpopulate(val, "EventType", &e.EventType) @@ -651,6 +623,9 @@ func (e *EventProperties) UnmarshalJSON(data []byte) error { case "impactType": err = unpopulate(val, "ImpactType", &e.ImpactType) delete(rawMsg, key) + case "isEventSensitive": + err = unpopulate(val, "IsEventSensitive", &e.IsEventSensitive) + delete(rawMsg, key) case "isHIR": err = unpopulate(val, "IsHIR", &e.IsHIR) delete(rawMsg, key) @@ -663,12 +638,6 @@ func (e *EventProperties) UnmarshalJSON(data []byte) error { case "links": err = unpopulate(val, "Links", &e.Links) delete(rawMsg, key) - case "maintenanceId": - err = unpopulate(val, "MaintenanceID", &e.MaintenanceID) - delete(rawMsg, key) - case "maintenanceType": - err = unpopulate(val, "MaintenanceType", &e.MaintenanceType) - delete(rawMsg, key) case "platformInitiated": err = unpopulate(val, "PlatformInitiated", &e.PlatformInitiated) delete(rawMsg, key) @@ -897,6 +866,7 @@ func (i Impact) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "impactedRegions", i.ImpactedRegions) populate(objectMap, "impactedService", i.ImpactedService) + populate(objectMap, "impactedServiceGuid", i.ImpactedServiceGUID) return json.Marshal(objectMap) } @@ -915,6 +885,9 @@ func (i *Impact) UnmarshalJSON(data []byte) error { case "impactedService": err = unpopulate(val, "ImpactedService", &i.ImpactedService) delete(rawMsg, key) + case "impactedServiceGuid": + err = unpopulate(val, "ImpactedServiceGUID", &i.ImpactedServiceGUID) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", i, err) @@ -1224,7 +1197,9 @@ func (m MetadataSupportedValueDetail) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "displayName", m.DisplayName) populate(objectMap, "id", m.ID) + populate(objectMap, "previousId", m.PreviousID) populate(objectMap, "resourceTypes", m.ResourceTypes) + populate(objectMap, "serviceGuid", m.ServiceGUID) return json.Marshal(objectMap) } @@ -1243,9 +1218,15 @@ func (m *MetadataSupportedValueDetail) UnmarshalJSON(data []byte) error { case "id": err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) + case "previousId": + err = unpopulate(val, "PreviousID", &m.PreviousID) + delete(rawMsg, key) case "resourceTypes": err = unpopulate(val, "ResourceTypes", &m.ResourceTypes) delete(rawMsg, key) + case "serviceGuid": + err = unpopulate(val, "ServiceGUID", &m.ServiceGUID) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -1651,6 +1632,7 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Update. func (u Update) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "eventTags", u.EventTags) populate(objectMap, "summary", u.Summary) populateDateTimeRFC3339(objectMap, "updateDateTime", u.UpdateDateTime) return json.Marshal(objectMap) @@ -1665,6 +1647,9 @@ func (u *Update) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "eventTags": + err = unpopulate(val, "EventTags", &u.EventTags) + delete(rawMsg, key) case "summary": err = unpopulate(val, "Summary", &u.Summary) delete(rawMsg, key) diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/operations_client.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/operations_client.go index 3e87c2944df7..c35b3fe82e34 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/operations_client.go +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/operations_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -40,7 +37,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // List - Lists available operations for the resourcehealth resource provider // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-01-preview +// Generated from API version 2025-05-01 // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. func (client *OperationsClient) List(ctx context.Context, options *OperationsClientListOptions) (OperationsClientListResponse, error) { var err error @@ -65,14 +62,14 @@ func (client *OperationsClient) List(ctx context.Context, options *OperationsCli } // listCreateRequest creates the List request. -func (client *OperationsClient) listCreateRequest(ctx context.Context, options *OperationsClientListOptions) (*policy.Request, error) { +func (client *OperationsClient) listCreateRequest(ctx context.Context, _ *OperationsClientListOptions) (*policy.Request, error) { urlPath := "/providers/Microsoft.ResourceHealth/operations" req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-01-preview") + reqQP.Set("api-version", "2025-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/operations_client_example_test.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/operations_client_example_test.go deleted file mode 100644 index fd8a89045e76..000000000000 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/operations_client_example_test.go +++ /dev/null @@ -1,191 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armresourcehealth_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resourcehealth/armresourcehealth" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/Operations_List.json -func ExampleOperationsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresourcehealth.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOperationsClient().List(ctx, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperationListResult = armresourcehealth.OperationListResult{ - // Value: []*armresourcehealth.Operation{ - // { - // Name: to.Ptr("Microsoft.ResourceHealth/Operations/read"), - // Display: &armresourcehealth.OperationDisplay{ - // Description: to.Ptr("Get the operations available for the Microsoft ResourceHealth"), - // Operation: to.Ptr("Get Operations"), - // Provider: to.Ptr("Microsoft ResourceHealth"), - // Resource: to.Ptr("Availability Status"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.ResourceHealth/Notifications/read"), - // Display: &armresourcehealth.OperationDisplay{ - // Description: to.Ptr("Receives ARM notifications"), - // Operation: to.Ptr("Receive notification"), - // Provider: to.Ptr("Microsoft ResourceHealth"), - // Resource: to.Ptr("Notification"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.ResourceHealth/AvailabilityStatuses/read"), - // Display: &armresourcehealth.OperationDisplay{ - // Description: to.Ptr("Gets the availability statuses for all resources in the specified scope"), - // Operation: to.Ptr("Get Availability Statuses"), - // Provider: to.Ptr("Microsoft ResourceHealth"), - // Resource: to.Ptr("Availability Status"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.ResourceHealth/AvailabilityStatuses/current/read"), - // Display: &armresourcehealth.OperationDisplay{ - // Description: to.Ptr("Gets the availability status for the specified resource"), - // Operation: to.Ptr("Get Availability Status"), - // Provider: to.Ptr("Microsoft ResourceHealth"), - // Resource: to.Ptr("Availability Status"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.ResourceHealth/events/read"), - // Display: &armresourcehealth.OperationDisplay{ - // Description: to.Ptr("Get Service Health Events for given subscription"), - // Operation: to.Ptr("Get Service Health Events"), - // Provider: to.Ptr("Microsoft ResourceHealth"), - // Resource: to.Ptr("Events"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.ResourceHealth/emergingissues/read"), - // Display: &armresourcehealth.OperationDisplay{ - // Description: to.Ptr("Get Azure services' emerging issues"), - // Operation: to.Ptr("Get Azure Emerging Issues"), - // Provider: to.Ptr("Microsoft ResourceHealth"), - // Resource: to.Ptr("Emerging Issues"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.ResourceHealth/potentialoutages/read"), - // Display: &armresourcehealth.OperationDisplay{ - // Provider: to.Ptr("Microsoft ResourceHealth"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.ResourceHealth/impactedResources/read"), - // Display: &armresourcehealth.OperationDisplay{ - // Description: to.Ptr("Get Impacted Resources for given subscription"), - // Operation: to.Ptr("Get Impacted Resources"), - // Provider: to.Ptr("Microsoft ResourceHealth"), - // Resource: to.Ptr("Impacted Resources"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.ResourceHealth/register/action"), - // Display: &armresourcehealth.OperationDisplay{ - // Description: to.Ptr("Registers the subscription for the Microsoft ResourceHealth"), - // Operation: to.Ptr("Register with the Provider"), - // Provider: to.Ptr("Microsoft ResourceHealth"), - // Resource: to.Ptr("Registration"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.ResourceHealth/unregister/action"), - // Display: &armresourcehealth.OperationDisplay{ - // Description: to.Ptr("Unregisters the subscription for the Microsoft ResourceHealth"), - // Operation: to.Ptr("Unregister with the Provider"), - // Provider: to.Ptr("Microsoft ResourceHealth"), - // Resource: to.Ptr("Unregistration"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Resourcehealth/healthevent/action"), - // Display: &armresourcehealth.OperationDisplay{ - // Description: to.Ptr("Denotes the change in health state for the specified resource"), - // Operation: to.Ptr("HealthEvent Change"), - // Provider: to.Ptr("Microsoft ResourceHealth"), - // Resource: to.Ptr("Availability Status"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Resourcehealth/healthevent/Activated/action"), - // Display: &armresourcehealth.OperationDisplay{ - // Description: to.Ptr("Denotes the change in health state for the specified resource"), - // Operation: to.Ptr("Health Event Activated"), - // Provider: to.Ptr("Microsoft ResourceHealth"), - // Resource: to.Ptr("Health Event"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Resourcehealth/healthevent/Updated/action"), - // Display: &armresourcehealth.OperationDisplay{ - // Description: to.Ptr("Denotes the change in health state for the specified resource"), - // Operation: to.Ptr("Health Event Updated"), - // Provider: to.Ptr("Microsoft ResourceHealth"), - // Resource: to.Ptr("Health Event"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Resourcehealth/healthevent/Resolved/action"), - // Display: &armresourcehealth.OperationDisplay{ - // Description: to.Ptr("Denotes the change in health state for the specified resource"), - // Operation: to.Ptr("Health Event Resolved"), - // Provider: to.Ptr("Microsoft ResourceHealth"), - // Resource: to.Ptr("Health Event"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Resourcehealth/healthevent/InProgress/action"), - // Display: &armresourcehealth.OperationDisplay{ - // Description: to.Ptr("Denotes the change in health state for the specified resource"), - // Operation: to.Ptr("Health Event InProgress"), - // Provider: to.Ptr("Microsoft ResourceHealth"), - // Resource: to.Ptr("Health Event"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Resourcehealth/healthevent/Pending/action"), - // Display: &armresourcehealth.OperationDisplay{ - // Description: to.Ptr("Denotes the change in health state for the specified resource"), - // Operation: to.Ptr("Health Event Pending"), - // Provider: to.Ptr("Microsoft ResourceHealth"), - // Resource: to.Ptr("Health Event"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.ResourceHealth/metadata/read"), - // Display: &armresourcehealth.OperationDisplay{ - // Description: to.Ptr("Gets Metadata"), - // Operation: to.Ptr("Read Metadata"), - // Provider: to.Ptr("Microsoft ResourceHealth"), - // Resource: to.Ptr("Metadata"), - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/options.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/options.go index 246958c2a28f..51a55d4f46a2 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/options.go +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/options.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -105,8 +102,8 @@ type EventClientGetBySubscriptionIDAndTrackingIDOptions struct { // The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN Filter *string - // Specifies from when to return events, based on the lastUpdateTime property. For example, queryStartTime = 7/24/2020 OR - // queryStartTime=7%2F24%2F2020 + // 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 QueryStartTime *string } @@ -116,8 +113,8 @@ type EventClientGetByTenantIDAndTrackingIDOptions struct { // The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN Filter *string - // Specifies from when to return events, based on the lastUpdateTime property. For example, queryStartTime = 7/24/2020 OR - // queryStartTime=7%2F24%2F2020 + // 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 QueryStartTime *string } @@ -134,8 +131,8 @@ type EventsClientListBySubscriptionIDOptions struct { // The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN Filter *string - // Specifies from when to return events, based on the lastUpdateTime property. For example, queryStartTime = 7/24/2020 OR - // queryStartTime=7%2F24%2F2020 + // 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 QueryStartTime *string } @@ -144,8 +141,8 @@ type EventsClientListByTenantIDOptions struct { // The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN Filter *string - // Specifies from when to return events, based on the lastUpdateTime property. For example, queryStartTime = 7/24/2020 OR - // queryStartTime=7%2F24%2F2020 + // 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 QueryStartTime *string } diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/responses.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/responses.go index 40c442f38381..846721dfc2f4 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/responses.go +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/responses.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/securityadvisoryimpactedresources_client.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/securityadvisoryimpactedresources_client.go index 30be6328a7da..a8c3fc5e0d73 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/securityadvisoryimpactedresources_client.go +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/securityadvisoryimpactedresources_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -45,7 +42,7 @@ func NewSecurityAdvisoryImpactedResourcesClient(subscriptionID string, credentia // NewListBySubscriptionIDAndEventIDPager - Lists impacted resources in the subscription by an event (Security Advisory). // -// Generated from API version 2023-10-01-preview +// Generated from API version 2025-05-01 // - eventTrackingID - Event Id which uniquely identifies ServiceHealth event. // - options - SecurityAdvisoryImpactedResourcesClientListBySubscriptionIDAndEventIDOptions contains the optional parameters // for the SecurityAdvisoryImpactedResourcesClient.NewListBySubscriptionIDAndEventIDPager method. @@ -91,7 +88,7 @@ func (client *SecurityAdvisoryImpactedResourcesClient) listBySubscriptionIDAndEv if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2023-10-01-preview") + reqQP.Set("api-version", "2025-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -108,7 +105,7 @@ func (client *SecurityAdvisoryImpactedResourcesClient) listBySubscriptionIDAndEv // NewListByTenantIDAndEventIDPager - Lists impacted resources in the tenant by an event (Security Advisory). // -// Generated from API version 2023-10-01-preview +// Generated from API version 2025-05-01 // - eventTrackingID - Event Id which uniquely identifies ServiceHealth event. // - options - SecurityAdvisoryImpactedResourcesClientListByTenantIDAndEventIDOptions contains the optional parameters for the // SecurityAdvisoryImpactedResourcesClient.NewListByTenantIDAndEventIDPager method. @@ -150,7 +147,7 @@ func (client *SecurityAdvisoryImpactedResourcesClient) listByTenantIDAndEventIDC if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2023-10-01-preview") + reqQP.Set("api-version", "2025-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/securityadvisoryimpactedresources_client_example_test.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/securityadvisoryimpactedresources_client_example_test.go deleted file mode 100644 index 981b6c7e9d69..000000000000 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/securityadvisoryimpactedresources_client_example_test.go +++ /dev/null @@ -1,170 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armresourcehealth_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resourcehealth/armresourcehealth" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/SecurityAdvisoryImpactedResources_ListBySubscriptionId_ListByEventId.json -func ExampleSecurityAdvisoryImpactedResourcesClient_NewListBySubscriptionIDAndEventIDPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresourcehealth.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSecurityAdvisoryImpactedResourcesClient().NewListBySubscriptionIDAndEventIDPager("BC_1-FXZ", &armresourcehealth.SecurityAdvisoryImpactedResourcesClientListBySubscriptionIDAndEventIDOptions{Filter: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.EventImpactedResourceListResult = armresourcehealth.EventImpactedResourceListResult{ - // Value: []*armresourcehealth.EventImpactedResource{ - // { - // Name: to.Ptr("jkl-901-hgy-445"), - // Type: to.Ptr("Microsoft.ResourceHealth/events/impactedResources"), - // ID: to.Ptr("/subscriptions/{subscripitionId}/providers/Microsoft.ResourceHealth/events/BC_1-FXZ/impactedResources/jkl-901-hgy-445"), - // Properties: &armresourcehealth.EventImpactedResourceProperties{ - // Info: []*armresourcehealth.KeyValueItem{ - // { - // Key: to.Ptr("key-A"), - // Value: to.Ptr("sample-1"), - // }, - // { - // Key: to.Ptr("key-B"), - // Value: to.Ptr("sample-2"), - // }, - // { - // Key: to.Ptr("key-C"), - // Value: to.Ptr("sample-3"), - // }, - // { - // Key: to.Ptr("key-D"), - // Value: to.Ptr("sample-4"), - // }}, - // }, - // }, - // { - // Name: to.Ptr("wer-345-tyu-789"), - // Type: to.Ptr("Microsoft.ResourceHealth/events/impactedResources"), - // ID: to.Ptr("/subscriptions/{subscripitionId}/providers/Microsoft.ResourceHealth/events/BC_1-FXZ/impactedResources/wer-345-tyu-789"), - // Properties: &armresourcehealth.EventImpactedResourceProperties{ - // Info: []*armresourcehealth.KeyValueItem{ - // { - // Key: to.Ptr("key-E"), - // Value: to.Ptr("sample-5"), - // }, - // { - // Key: to.Ptr("key-F"), - // Value: to.Ptr("sample-6"), - // }, - // { - // Key: to.Ptr("key-G"), - // Value: to.Ptr("sample-7"), - // }, - // { - // Key: to.Ptr("key-H"), - // Value: to.Ptr("sample-8"), - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2023-10-01-preview/examples/SecurityAdvisoryImpactedResources_ListByTenantId_ListByEventId.json -func ExampleSecurityAdvisoryImpactedResourcesClient_NewListByTenantIDAndEventIDPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresourcehealth.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSecurityAdvisoryImpactedResourcesClient().NewListByTenantIDAndEventIDPager("BC_1-FXZ", &armresourcehealth.SecurityAdvisoryImpactedResourcesClientListByTenantIDAndEventIDOptions{Filter: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.EventImpactedResourceListResult = armresourcehealth.EventImpactedResourceListResult{ - // Value: []*armresourcehealth.EventImpactedResource{ - // { - // Name: to.Ptr("jkl-901-hgy-445"), - // Type: to.Ptr("Microsoft.ResourceHealth/events/impactedResources"), - // ID: to.Ptr("/providers/Microsoft.ResourceHealth/events/BC_1-FXZ/impactedResources/jkl-901-hgy-445"), - // Properties: &armresourcehealth.EventImpactedResourceProperties{ - // Info: []*armresourcehealth.KeyValueItem{ - // { - // Key: to.Ptr("key-A"), - // Value: to.Ptr("sample-1"), - // }, - // { - // Key: to.Ptr("key-B"), - // Value: to.Ptr("sample-2"), - // }, - // { - // Key: to.Ptr("key-C"), - // Value: to.Ptr("sample-3"), - // }, - // { - // Key: to.Ptr("key-D"), - // Value: to.Ptr("sample-4"), - // }}, - // }, - // }, - // { - // Name: to.Ptr("wer-345-tyu-789"), - // Type: to.Ptr("Microsoft.ResourceHealth/events/impactedResources"), - // ID: to.Ptr("/providers/Microsoft.ResourceHealth/events/BC_1-FXZ/impactedResources/wer-345-tyu-789"), - // Properties: &armresourcehealth.EventImpactedResourceProperties{ - // Info: []*armresourcehealth.KeyValueItem{ - // { - // Key: to.Ptr("key-E"), - // Value: to.Ptr("sample-5"), - // }, - // { - // Key: to.Ptr("key-F"), - // Value: to.Ptr("sample-6"), - // }, - // { - // Key: to.Ptr("key-G"), - // Value: to.Ptr("sample-7"), - // }, - // { - // Key: to.Ptr("key-H"), - // Value: to.Ptr("sample-8"), - // }}, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/time_rfc3339.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/time_rfc3339.go index c8b0143c3265..73eaf0d7fa6e 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/time_rfc3339.go +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/time_rfc3339.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -60,6 +57,9 @@ func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { } func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { + if len(data) == 0 { + return nil + } tzOffset := tzOffsetRegex.Match(data) hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") var layout string