From 39b0bdaf50aaf23ee528bb7fcb4e0a6912438795 Mon Sep 17 00:00:00 2001 From: Jiahui Peng <46921893+Alancere@users.noreply.github.com> Date: Wed, 18 May 2022 16:35:24 +0800 Subject: [PATCH] [Release] sdk/resourcemanager/resourcehealth/armresourcehealth/1.0.0 generation from spec commit: d55b8005f05b040b852c15e74a0f3e36494a15e1 (#18148) --- .../armresourcehealth/CHANGELOG.md | 12 ++ .../armresourcehealth/autorest.md | 6 +- .../resourcehealth/armresourcehealth/go.mod | 12 +- .../resourcehealth/armresourcehealth/go.sum | 44 ++--- ...xample_availabilitystatuses_client_test.go | 14 +- ...z_generated_availabilitystatuses_client.go | 20 +- .../zz_generated_constants.go | 2 +- .../zz_generated_models_serde.go | 187 +++++------------- .../zz_generated_operations_client.go | 5 +- .../zz_generated_time_rfc3339.go | 5 +- 10 files changed, 108 insertions(+), 199 deletions(-) diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/CHANGELOG.md b/sdk/resourcemanager/resourcehealth/armresourcehealth/CHANGELOG.md index 7e61f42ebc96..d014e38210e2 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/CHANGELOG.md +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/CHANGELOG.md @@ -1,5 +1,17 @@ # Release History +## 1.0.0 (2022-05-18) +### Breaking Changes + +- Function `OperationListResult.MarshalJSON` has been removed +- Function `AvailabilityStatusListResult.MarshalJSON` has been removed +- Function `ImpactedResourceStatusProperties.MarshalJSON` has been removed +- Function `AvailabilityStatusPropertiesRecentlyResolved.MarshalJSON` has been removed +- Function `ServiceImpactingEvent.MarshalJSON` has been removed +- Function `StatusBanner.MarshalJSON` has been removed +- Function `AvailabilityStatusProperties.MarshalJSON` has been removed + + ## 0.6.0 (2022-04-18) ### Breaking Changes diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/autorest.md b/sdk/resourcemanager/resourcehealth/armresourcehealth/autorest.md index 95d13230d180..a8f55772a85d 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/autorest.md +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/autorest.md @@ -5,8 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/f92aaf88f4c9d1ffb9a014eba196d887a9288c3a/specification/resourcehealth/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/f92aaf88f4c9d1ffb9a014eba196d887a9288c3a/specification/resourcehealth/resource-manager/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/resourcehealth/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/resourcehealth/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.6.0 +module-version: 1.0.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/go.mod b/sdk/resourcemanager/resourcehealth/armresourcehealth/go.mod index 203446b38850..46c7a9f8484b 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/go.mod +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/go.mod @@ -3,19 +3,19 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resourcehealth/armr go 1.18 require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0 + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 ) require ( - github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1 // indirect + github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 // indirect github.com/golang-jwt/jwt v3.2.1+incompatible // indirect github.com/google/uuid v1.1.1 // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect - golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 // indirect - golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f // indirect - golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 // indirect + golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 // indirect + golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect + golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect golang.org/x/text v0.3.7 // indirect ) diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/go.sum b/sdk/resourcemanager/resourcehealth/armresourcehealth/go.sum index 56d1c32628ae..ed5b814680ee 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/go.sum +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/go.sum @@ -1,15 +1,13 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0 h1:D7l5jspkc4kwBYRWoZE4DQnu6LVpLwDsMZjBKS4wZLQ= -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0/go.mod h1:w5pDIZuawUmY3Bj4tVx3Xb8KS96ToB0j315w9rqpAg0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0 h1:NVS/4LOQfkBpk+B1VopIzv1ptmYeEskA8w/3K/w7vjo= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0/go.mod h1:RG0cZndeZM17StwohYclmcXSr4oOJ8b1I5hB8llIc6Y= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1 h1:sLZ/Y+P/5RRtsXWylBjB5lkgixYfm0MQPiwrSX//JSo= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 h1:sVPhtT2qjO86rTUaWMr4WoES4TkjGnzcioXcnHV9s5k= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 h1:Yoicul8bnVdQrhDMTHxdEckRGX01XvwXDHUT9zYZ3k0= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0/go.mod h1:+6sju8gk8FRmSajX3Oz4G5Gm7P+mbqE9FVaXXFYTkCM= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c= github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= @@ -17,37 +15,19 @@ github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 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/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= 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/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNmw2api+jEfxLoykJVice/E= -golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f h1:OfiFi4JbukWwe3lzw+xunroH1mnC1e2Gy5cxNJApiSY= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 h1:Tgea0cVUD0ivh5ADBX4WwuI12DUd2to3nCYe2eayMIw= +golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= +golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 h1:id054HUawV2/6IGm2IV8KZQjqtwAOo2CYlOToYqa0d0= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/ze_generated_example_availabilitystatuses_client_test.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/ze_generated_example_availabilitystatuses_client_test.go index a2ccf80fce9c..a64a4fece520 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/ze_generated_example_availabilitystatuses_client_test.go +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/ze_generated_example_availabilitystatuses_client_test.go @@ -24,19 +24,18 @@ func ExampleAvailabilityStatusesClient_NewListByResourceGroupPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armresourcehealth.NewAvailabilityStatusesClient("", cred, nil) + client, err := armresourcehealth.NewAvailabilityStatusesClient("subscriptionId", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListByResourceGroupPager("", + pager := client.NewListByResourceGroupPager("resourceGroupName", &armresourcehealth.AvailabilityStatusesClientListByResourceGroupOptions{Filter: nil, - Expand: to.Ptr(""), + Expand: to.Ptr("recommendedactions"), }) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) - return } for _, v := range nextResult.Value { // TODO: use page item @@ -57,9 +56,9 @@ func ExampleAvailabilityStatusesClient_GetByResource() { log.Fatalf("failed to create client: %v", err) } res, err := client.GetByResource(ctx, - "", + "resourceUri", &armresourcehealth.AvailabilityStatusesClientGetByResourceOptions{Filter: nil, - Expand: to.Ptr(""), + Expand: to.Ptr("recommendedactions"), }) if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -79,7 +78,7 @@ func ExampleAvailabilityStatusesClient_NewListPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("", + pager := client.NewListPager("resourceUri", &armresourcehealth.AvailabilityStatusesClientListOptions{Filter: nil, Expand: nil, }) @@ -87,7 +86,6 @@ func ExampleAvailabilityStatusesClient_NewListPager() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) - return } for _, v := range nextResult.Value { // TODO: use page item diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_availabilitystatuses_client.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_availabilitystatuses_client.go index d4f21241893b..c47731e5702b 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_availabilitystatuses_client.go +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_availabilitystatuses_client.go @@ -39,7 +39,7 @@ func NewAvailabilityStatusesClient(subscriptionID string, credential azcore.Toke if options == nil { options = &arm.ClientOptions{} } - ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { ep = c.Endpoint } @@ -57,6 +57,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 2020-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} @@ -96,7 +97,7 @@ func (client *AvailabilityStatusesClient) getByResourceCreateRequest(ctx context reqQP.Set("$expand", *options.Expand) } req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -111,6 +112,7 @@ func (client *AvailabilityStatusesClient) getByResourceHandleResponse(resp *http // NewListPager - Lists all historical availability transitions and impacting events for a single resource. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-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} @@ -119,7 +121,7 @@ func (client *AvailabilityStatusesClient) getByResourceHandleResponse(resp *http // options - AvailabilityStatusesClientListOptions contains the optional parameters for the AvailabilityStatusesClient.List // method. func (client *AvailabilityStatusesClient) NewListPager(resourceURI string, options *AvailabilityStatusesClientListOptions) *runtime.Pager[AvailabilityStatusesClientListResponse] { - return runtime.NewPager(runtime.PageProcessor[AvailabilityStatusesClientListResponse]{ + return runtime.NewPager(runtime.PagingHandler[AvailabilityStatusesClientListResponse]{ More: func(page AvailabilityStatusesClientListResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, @@ -163,7 +165,7 @@ func (client *AvailabilityStatusesClient) listCreateRequest(ctx context.Context, reqQP.Set("$expand", *options.Expand) } req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -178,11 +180,12 @@ func (client *AvailabilityStatusesClient) listHandleResponse(resp *http.Response // NewListByResourceGroupPager - Lists the current availability status for all the resources in the resource group. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-05-01 // resourceGroupName - The name of the resource group. // options - AvailabilityStatusesClientListByResourceGroupOptions contains the optional parameters for the AvailabilityStatusesClient.ListByResourceGroup // method. func (client *AvailabilityStatusesClient) NewListByResourceGroupPager(resourceGroupName string, options *AvailabilityStatusesClientListByResourceGroupOptions) *runtime.Pager[AvailabilityStatusesClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PageProcessor[AvailabilityStatusesClientListByResourceGroupResponse]{ + return runtime.NewPager(runtime.PagingHandler[AvailabilityStatusesClientListByResourceGroupResponse]{ More: func(page AvailabilityStatusesClientListByResourceGroupResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, @@ -233,7 +236,7 @@ func (client *AvailabilityStatusesClient) listByResourceGroupCreateRequest(ctx c reqQP.Set("$expand", *options.Expand) } req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -248,10 +251,11 @@ func (client *AvailabilityStatusesClient) listByResourceGroupHandleResponse(resp // NewListBySubscriptionIDPager - Lists the current availability status for all the resources in the subscription. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-05-01 // options - AvailabilityStatusesClientListBySubscriptionIDOptions contains the optional parameters for the AvailabilityStatusesClient.ListBySubscriptionID // method. func (client *AvailabilityStatusesClient) NewListBySubscriptionIDPager(options *AvailabilityStatusesClientListBySubscriptionIDOptions) *runtime.Pager[AvailabilityStatusesClientListBySubscriptionIDResponse] { - return runtime.NewPager(runtime.PageProcessor[AvailabilityStatusesClientListBySubscriptionIDResponse]{ + return runtime.NewPager(runtime.PagingHandler[AvailabilityStatusesClientListBySubscriptionIDResponse]{ More: func(page AvailabilityStatusesClientListBySubscriptionIDResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, @@ -298,7 +302,7 @@ func (client *AvailabilityStatusesClient) listBySubscriptionIDCreateRequest(ctx reqQP.Set("$expand", *options.Expand) } req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_constants.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_constants.go index 2d105835ca40..840fb1a1656c 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_constants.go +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_constants.go @@ -10,7 +10,7 @@ package armresourcehealth const ( moduleName = "armresourcehealth" - moduleVersion = "v0.6.0" + moduleVersion = "v1.0.0" ) // AvailabilityStateValues - Impacted resource status of the resource. diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_models_serde.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_models_serde.go index 25971a5201e1..5eabfd5e0aa4 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_models_serde.go +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_models_serde.go @@ -10,289 +10,202 @@ package armresourcehealth import ( "encoding/json" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" + "fmt" ) -// MarshalJSON implements the json.Marshaller interface for type AvailabilityStatusListResult. -func (a AvailabilityStatusListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", a.NextLink) - populate(objectMap, "value", a.Value) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type AvailabilityStatusProperties. -func (a AvailabilityStatusProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "availabilityState", a.AvailabilityState) - populate(objectMap, "detailedStatus", a.DetailedStatus) - populate(objectMap, "healthEventCategory", a.HealthEventCategory) - populate(objectMap, "healthEventCause", a.HealthEventCause) - populate(objectMap, "healthEventId", a.HealthEventID) - populate(objectMap, "healthEventType", a.HealthEventType) - populateTimeRFC3339(objectMap, "occurredTime", a.OccurredTime) - populate(objectMap, "reasonChronicity", a.ReasonChronicity) - populate(objectMap, "reasonType", a.ReasonType) - populate(objectMap, "recentlyResolved", a.RecentlyResolved) - populate(objectMap, "recommendedActions", a.RecommendedActions) - populateTimeRFC3339(objectMap, "reportedTime", a.ReportedTime) - populateTimeRFC3339(objectMap, "resolutionETA", a.ResolutionETA) - populateTimeRFC3339(objectMap, "rootCauseAttributionTime", a.RootCauseAttributionTime) - populate(objectMap, "serviceImpactingEvents", a.ServiceImpactingEvents) - populate(objectMap, "summary", a.Summary) - populate(objectMap, "title", a.Title) - return json.Marshal(objectMap) -} - // UnmarshalJSON implements the json.Unmarshaller interface for type AvailabilityStatusProperties. func (a *AvailabilityStatusProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { case "availabilityState": - err = unpopulate(val, &a.AvailabilityState) + err = unpopulate(val, "AvailabilityState", &a.AvailabilityState) delete(rawMsg, key) case "detailedStatus": - err = unpopulate(val, &a.DetailedStatus) + err = unpopulate(val, "DetailedStatus", &a.DetailedStatus) delete(rawMsg, key) case "healthEventCategory": - err = unpopulate(val, &a.HealthEventCategory) + err = unpopulate(val, "HealthEventCategory", &a.HealthEventCategory) delete(rawMsg, key) case "healthEventCause": - err = unpopulate(val, &a.HealthEventCause) + err = unpopulate(val, "HealthEventCause", &a.HealthEventCause) delete(rawMsg, key) case "healthEventId": - err = unpopulate(val, &a.HealthEventID) + err = unpopulate(val, "HealthEventID", &a.HealthEventID) delete(rawMsg, key) case "healthEventType": - err = unpopulate(val, &a.HealthEventType) + err = unpopulate(val, "HealthEventType", &a.HealthEventType) delete(rawMsg, key) case "occurredTime": - err = unpopulateTimeRFC3339(val, &a.OccurredTime) + err = unpopulateTimeRFC3339(val, "OccurredTime", &a.OccurredTime) delete(rawMsg, key) case "reasonChronicity": - err = unpopulate(val, &a.ReasonChronicity) + err = unpopulate(val, "ReasonChronicity", &a.ReasonChronicity) delete(rawMsg, key) case "reasonType": - err = unpopulate(val, &a.ReasonType) + err = unpopulate(val, "ReasonType", &a.ReasonType) delete(rawMsg, key) case "recentlyResolved": - err = unpopulate(val, &a.RecentlyResolved) + err = unpopulate(val, "RecentlyResolved", &a.RecentlyResolved) delete(rawMsg, key) case "recommendedActions": - err = unpopulate(val, &a.RecommendedActions) + err = unpopulate(val, "RecommendedActions", &a.RecommendedActions) delete(rawMsg, key) case "reportedTime": - err = unpopulateTimeRFC3339(val, &a.ReportedTime) + err = unpopulateTimeRFC3339(val, "ReportedTime", &a.ReportedTime) delete(rawMsg, key) case "resolutionETA": - err = unpopulateTimeRFC3339(val, &a.ResolutionETA) + err = unpopulateTimeRFC3339(val, "ResolutionETA", &a.ResolutionETA) delete(rawMsg, key) case "rootCauseAttributionTime": - err = unpopulateTimeRFC3339(val, &a.RootCauseAttributionTime) + err = unpopulateTimeRFC3339(val, "RootCauseAttributionTime", &a.RootCauseAttributionTime) delete(rawMsg, key) case "serviceImpactingEvents": - err = unpopulate(val, &a.ServiceImpactingEvents) + err = unpopulate(val, "ServiceImpactingEvents", &a.ServiceImpactingEvents) delete(rawMsg, key) case "summary": - err = unpopulate(val, &a.Summary) + err = unpopulate(val, "Summary", &a.Summary) delete(rawMsg, key) case "title": - err = unpopulate(val, &a.Title) + err = unpopulate(val, "Title", &a.Title) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type AvailabilityStatusPropertiesRecentlyResolved. -func (a AvailabilityStatusPropertiesRecentlyResolved) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "resolvedTime", a.ResolvedTime) - populate(objectMap, "unavailabilitySummary", a.UnavailabilitySummary) - populateTimeRFC3339(objectMap, "unavailableOccurredTime", a.UnavailableOccurredTime) - return json.Marshal(objectMap) -} - // UnmarshalJSON implements the json.Unmarshaller interface for type AvailabilityStatusPropertiesRecentlyResolved. func (a *AvailabilityStatusPropertiesRecentlyResolved) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { case "resolvedTime": - err = unpopulateTimeRFC3339(val, &a.ResolvedTime) + err = unpopulateTimeRFC3339(val, "ResolvedTime", &a.ResolvedTime) delete(rawMsg, key) case "unavailabilitySummary": - err = unpopulate(val, &a.UnavailabilitySummary) + err = unpopulate(val, "UnavailabilitySummary", &a.UnavailabilitySummary) delete(rawMsg, key) case "unavailableOccurredTime": - err = unpopulateTimeRFC3339(val, &a.UnavailableOccurredTime) + err = unpopulateTimeRFC3339(val, "UnavailableOccurredTime", &a.UnavailableOccurredTime) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ImpactedResourceStatusProperties. -func (i ImpactedResourceStatusProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "availabilityState", i.AvailabilityState) - populateTimeRFC3339(objectMap, "occurredTime", i.OccurredTime) - populate(objectMap, "reasonType", i.ReasonType) - populate(objectMap, "summary", i.Summary) - populate(objectMap, "title", i.Title) - return json.Marshal(objectMap) -} - // UnmarshalJSON implements the json.Unmarshaller interface for type ImpactedResourceStatusProperties. func (i *ImpactedResourceStatusProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { case "availabilityState": - err = unpopulate(val, &i.AvailabilityState) + err = unpopulate(val, "AvailabilityState", &i.AvailabilityState) delete(rawMsg, key) case "occurredTime": - err = unpopulateTimeRFC3339(val, &i.OccurredTime) + err = unpopulateTimeRFC3339(val, "OccurredTime", &i.OccurredTime) delete(rawMsg, key) case "reasonType": - err = unpopulate(val, &i.ReasonType) + err = unpopulate(val, "ReasonType", &i.ReasonType) delete(rawMsg, key) case "summary": - err = unpopulate(val, &i.Summary) + err = unpopulate(val, "Summary", &i.Summary) delete(rawMsg, key) case "title": - err = unpopulate(val, &i.Title) + err = unpopulate(val, "Title", &i.Title) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationListResult. -func (o OperationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "value", o.Value) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ServiceImpactingEvent. -func (s ServiceImpactingEvent) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "correlationId", s.CorrelationID) - populateTimeRFC3339(objectMap, "eventStartTime", s.EventStartTime) - populateTimeRFC3339(objectMap, "eventStatusLastModifiedTime", s.EventStatusLastModifiedTime) - populate(objectMap, "incidentProperties", s.IncidentProperties) - populate(objectMap, "status", s.Status) - return json.Marshal(objectMap) -} - // UnmarshalJSON implements the json.Unmarshaller interface for type ServiceImpactingEvent. func (s *ServiceImpactingEvent) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { case "correlationId": - err = unpopulate(val, &s.CorrelationID) + err = unpopulate(val, "CorrelationID", &s.CorrelationID) delete(rawMsg, key) case "eventStartTime": - err = unpopulateTimeRFC3339(val, &s.EventStartTime) + err = unpopulateTimeRFC3339(val, "EventStartTime", &s.EventStartTime) delete(rawMsg, key) case "eventStatusLastModifiedTime": - err = unpopulateTimeRFC3339(val, &s.EventStatusLastModifiedTime) + err = unpopulateTimeRFC3339(val, "EventStatusLastModifiedTime", &s.EventStatusLastModifiedTime) delete(rawMsg, key) case "incidentProperties": - err = unpopulate(val, &s.IncidentProperties) + err = unpopulate(val, "IncidentProperties", &s.IncidentProperties) delete(rawMsg, key) case "status": - err = unpopulate(val, &s.Status) + err = unpopulate(val, "Status", &s.Status) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type StatusBanner. -func (s StatusBanner) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "cloud", s.Cloud) - populateTimeRFC3339(objectMap, "lastModifiedTime", s.LastModifiedTime) - populate(objectMap, "message", s.Message) - populate(objectMap, "title", s.Title) - return json.Marshal(objectMap) -} - // UnmarshalJSON implements the json.Unmarshaller interface for type StatusBanner. func (s *StatusBanner) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { case "cloud": - err = unpopulate(val, &s.Cloud) + err = unpopulate(val, "Cloud", &s.Cloud) delete(rawMsg, key) case "lastModifiedTime": - err = unpopulateTimeRFC3339(val, &s.LastModifiedTime) + err = unpopulateTimeRFC3339(val, "LastModifiedTime", &s.LastModifiedTime) delete(rawMsg, key) case "message": - err = unpopulate(val, &s.Message) + err = unpopulate(val, "Message", &s.Message) delete(rawMsg, key) case "title": - err = unpopulate(val, &s.Title) + err = unpopulate(val, "Title", &s.Title) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -func populate(m map[string]interface{}, k string, v interface{}) { - if v == nil { - return - } else if azcore.IsNullValue(v) { - m[k] = nil - } else if !reflect.ValueOf(v).IsNil() { - m[k] = v - } -} - -func unpopulate(data json.RawMessage, v interface{}) error { +func unpopulate(data json.RawMessage, fn string, v interface{}) error { if data == nil { return nil } - return json.Unmarshal(data, v) + if err := json.Unmarshal(data, v); err != nil { + return fmt.Errorf("struct field %s: %v", fn, err) + } + return nil } diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_operations_client.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_operations_client.go index 12dcf1ba628d..0510bd4c2660 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_operations_client.go +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_operations_client.go @@ -33,7 +33,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO if options == nil { options = &arm.ClientOptions{} } - ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { ep = c.Endpoint } @@ -50,6 +50,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 2020-05-01 // options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. func (client *OperationsClient) List(ctx context.Context, options *OperationsClientListOptions) (OperationsClientListResponse, error) { req, err := client.listCreateRequest(ctx, options) @@ -76,7 +77,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_time_rfc3339.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_time_rfc3339.go index 310920537501..f91b092d0d2d 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_time_rfc3339.go @@ -10,6 +10,7 @@ package armresourcehealth import ( "encoding/json" + "fmt" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "reflect" "regexp" @@ -72,13 +73,13 @@ func populateTimeRFC3339(m map[string]interface{}, k string, t *time.Time) { m[k] = (*timeRFC3339)(t) } -func unpopulateTimeRFC3339(data json.RawMessage, t **time.Time) error { +func unpopulateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { if data == nil || strings.EqualFold(string(data), "null") { return nil } var aux timeRFC3339 if err := json.Unmarshal(data, &aux); err != nil { - return err + return fmt.Errorf("struct field %s: %v", fn, err) } *t = (*time.Time)(&aux) return nil