diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/CHANGELOG.md b/sdk/resourcemanager/resourcehealth/armresourcehealth/CHANGELOG.md index 667d627c9140..fc9c009ff4ad 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/CHANGELOG.md +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/CHANGELOG.md @@ -1,5 +1,133 @@ # Release History +## 0.5.0 (2022-04-11) +### Breaking Changes + +- Function `NewOperationsClient` return value(s) have been changed from `(*OperationsClient)` to `(*OperationsClient, error)` +- Function `*AvailabilityStatusesClient.List` return value(s) have been changed from `(*AvailabilityStatusesClientListPager)` to `(*runtime.Pager[AvailabilityStatusesClientListResponse])` +- Function `*AvailabilityStatusesClient.ListBySubscriptionID` return value(s) have been changed from `(*AvailabilityStatusesClientListBySubscriptionIDPager)` to `(*runtime.Pager[AvailabilityStatusesClientListBySubscriptionIDResponse])` +- Function `*AvailabilityStatusesClient.ListByResourceGroup` return value(s) have been changed from `(*AvailabilityStatusesClientListByResourceGroupPager)` to `(*runtime.Pager[AvailabilityStatusesClientListByResourceGroupResponse])` +- Function `NewAvailabilityStatusesClient` return value(s) have been changed from `(*AvailabilityStatusesClient)` to `(*AvailabilityStatusesClient, error)` +- Const `SeverityValuesError` has been removed +- Const `SeverityValuesInformation` has been removed +- Const `StageValuesArchived` has been removed +- Const `SeverityValuesWarning` has been removed +- Const `StageValuesActive` has been removed +- Const `StageValuesResolve` has been removed +- Function `*ChildResourcesClientListPager.PageResponse` has been removed +- Function `*AvailabilityStatusesClientListByResourceGroupPager.PageResponse` has been removed +- Function `*AvailabilityStatusesClientListPager.Err` has been removed +- Function `AvailabilityStateValues.ToPtr` has been removed +- Function `*EmergingIssuesClient.Get` has been removed +- Function `EmergingIssue.MarshalJSON` has been removed +- Function `*EmergingIssue.UnmarshalJSON` has been removed +- Function `PossibleSeverityValuesValues` has been removed +- Function `*AvailabilityStatusesClientListByResourceGroupPager.NextPage` has been removed +- Function `*ChildResourcesClient.List` has been removed +- Function `*EmergingIssuesClientListPager.Err` has been removed +- Function `*EmergingIssuesClient.List` has been removed +- Function `PossibleStageValuesValues` has been removed +- Function `*ChildResourcesClientListPager.Err` has been removed +- Function `*StatusActiveEvent.UnmarshalJSON` has been removed +- Function `EmergingIssueListResult.MarshalJSON` has been removed +- Function `NewEmergingIssuesClient` has been removed +- Function `*AvailabilityStatusPropertiesRecentlyResolvedState.UnmarshalJSON` has been removed +- Function `NewChildResourcesClient` has been removed +- Function `*ChildAvailabilityStatusesClientListPager.PageResponse` has been removed +- Function `*AvailabilityStatusesClientListBySubscriptionIDPager.NextPage` has been removed +- Function `StatusActiveEvent.MarshalJSON` has been removed +- Function `*AvailabilityStatusesClientListBySubscriptionIDPager.PageResponse` has been removed +- Function `*EmergingIssuesClientListPager.PageResponse` has been removed +- Function `AvailabilityStatusPropertiesRecentlyResolvedState.MarshalJSON` has been removed +- Function `*AvailabilityStatusesClientListByResourceGroupPager.Err` has been removed +- Function `NewChildAvailabilityStatusesClient` has been removed +- Function `*ChildAvailabilityStatusesClient.GetByResource` has been removed +- Function `StageValues.ToPtr` has been removed +- Function `ReasonChronicityTypes.ToPtr` has been removed +- Function `*EmergingIssuesClientListPager.NextPage` has been removed +- Function `*AvailabilityStatusesClientListPager.NextPage` has been removed +- Function `*AvailabilityStatusesClientListBySubscriptionIDPager.Err` has been removed +- Function `*AvailabilityStatusesClientListPager.PageResponse` has been removed +- Function `*ChildAvailabilityStatusesClientListPager.Err` has been removed +- Function `SeverityValues.ToPtr` has been removed +- Function `EmergingIssueImpact.MarshalJSON` has been removed +- Function `*ChildAvailabilityStatusesClientListPager.NextPage` has been removed +- Function `*ChildResourcesClientListPager.NextPage` has been removed +- Function `*ChildAvailabilityStatusesClient.List` has been removed +- Struct `AvailabilityStatusPropertiesRecentlyResolvedState` has been removed +- Struct `AvailabilityStatusesClientGetByResourceResult` has been removed +- Struct `AvailabilityStatusesClientListByResourceGroupPager` has been removed +- Struct `AvailabilityStatusesClientListByResourceGroupResult` has been removed +- Struct `AvailabilityStatusesClientListBySubscriptionIDPager` has been removed +- Struct `AvailabilityStatusesClientListBySubscriptionIDResult` has been removed +- Struct `AvailabilityStatusesClientListPager` has been removed +- Struct `AvailabilityStatusesClientListResult` has been removed +- Struct `ChildAvailabilityStatusesClient` has been removed +- Struct `ChildAvailabilityStatusesClientGetByResourceOptions` has been removed +- Struct `ChildAvailabilityStatusesClientGetByResourceResponse` has been removed +- Struct `ChildAvailabilityStatusesClientGetByResourceResult` has been removed +- Struct `ChildAvailabilityStatusesClientListOptions` has been removed +- Struct `ChildAvailabilityStatusesClientListPager` has been removed +- Struct `ChildAvailabilityStatusesClientListResponse` has been removed +- Struct `ChildAvailabilityStatusesClientListResult` has been removed +- Struct `ChildResourcesClient` has been removed +- Struct `ChildResourcesClientListOptions` has been removed +- Struct `ChildResourcesClientListPager` has been removed +- Struct `ChildResourcesClientListResponse` has been removed +- Struct `ChildResourcesClientListResult` has been removed +- Struct `EmergingIssue` has been removed +- Struct `EmergingIssueImpact` has been removed +- Struct `EmergingIssueListResult` has been removed +- Struct `EmergingIssuesClient` has been removed +- Struct `EmergingIssuesClientGetOptions` has been removed +- Struct `EmergingIssuesClientGetResponse` has been removed +- Struct `EmergingIssuesClientGetResult` has been removed +- Struct `EmergingIssuesClientListOptions` has been removed +- Struct `EmergingIssuesClientListPager` has been removed +- Struct `EmergingIssuesClientListResponse` has been removed +- Struct `EmergingIssuesClientListResult` has been removed +- Struct `EmergingIssuesGetResult` has been removed +- Struct `OperationsClientListResult` has been removed +- Struct `StatusActiveEvent` has been removed +- Field `OccuredTime` of struct `AvailabilityStatusProperties` has been removed +- Field `RecentlyResolvedState` of struct `AvailabilityStatusProperties` has been removed +- Field `AvailabilityStatusesClientListBySubscriptionIDResult` of struct `AvailabilityStatusesClientListBySubscriptionIDResponse` has been removed +- Field `RawResponse` of struct `AvailabilityStatusesClientListBySubscriptionIDResponse` has been removed +- Field `AvailabilityStatusesClientGetByResourceResult` of struct `AvailabilityStatusesClientGetByResourceResponse` has been removed +- Field `RawResponse` of struct `AvailabilityStatusesClientGetByResourceResponse` has been removed +- Field `AvailabilityStatusesClientListByResourceGroupResult` of struct `AvailabilityStatusesClientListByResourceGroupResponse` has been removed +- Field `RawResponse` of struct `AvailabilityStatusesClientListByResourceGroupResponse` has been removed +- Field `OperationsClientListResult` of struct `OperationsClientListResponse` has been removed +- Field `RawResponse` of struct `OperationsClientListResponse` has been removed +- Field `AvailabilityStatusesClientListResult` of struct `AvailabilityStatusesClientListResponse` has been removed +- Field `RawResponse` of struct `AvailabilityStatusesClientListResponse` has been removed + +### Features Added + +- New const `ReasonTypeValuesPlanned` +- New const `ReasonTypeValuesUnplanned` +- New const `ReasonTypeValuesUserInitiated` +- New const `AvailabilityStateValuesDegraded` +- New function `*AvailabilityStatusPropertiesRecentlyResolved.UnmarshalJSON([]byte) error` +- New function `AvailabilityStatusPropertiesRecentlyResolved.MarshalJSON() ([]byte, error)` +- New function `ImpactedResourceStatusProperties.MarshalJSON() ([]byte, error)` +- New function `*ImpactedResourceStatusProperties.UnmarshalJSON([]byte) error` +- New function `PossibleReasonTypeValuesValues() []ReasonTypeValues` +- New struct `AvailabilityStatusPropertiesRecentlyResolved` +- New struct `ErrorResponse` +- New struct `ErrorResponseError` +- New struct `ImpactedResourceStatus` +- New struct `ImpactedResourceStatusProperties` +- New anonymous field `AvailabilityStatusListResult` in struct `AvailabilityStatusesClientListResponse` +- New anonymous field `AvailabilityStatusListResult` in struct `AvailabilityStatusesClientListByResourceGroupResponse` +- New anonymous field `AvailabilityStatusListResult` in struct `AvailabilityStatusesClientListBySubscriptionIDResponse` +- New anonymous field `OperationListResult` in struct `OperationsClientListResponse` +- New anonymous field `AvailabilityStatus` in struct `AvailabilityStatusesClientGetByResourceResponse` +- New field `RecentlyResolved` in struct `AvailabilityStatusProperties` +- New field `OccurredTime` in struct `AvailabilityStatusProperties` +- New field `Title` in struct `AvailabilityStatusProperties` + + ## 0.4.0 (2022-02-22) ### Breaking Changes diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/autorest.md b/sdk/resourcemanager/resourcehealth/armresourcehealth/autorest.md index f0dbf9c81c5f..0cd6a578e922 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/12573bd124f45f2fe8f7cd95af6374ff812e8cce/specification/resourcehealth/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/12573bd124f45f2fe8f7cd95af6374ff812e8cce/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: 0.4.0 +module-version: 0.5.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/go.mod b/sdk/resourcemanager/resourcehealth/armresourcehealth/go.mod index cedcffc61d45..f297e377a40c 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/go.mod +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/go.mod @@ -1,8 +1,11 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resourcehealth/armresourcehealth -go 1.16 +go 1.18 + +require github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0 require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.1 + github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1 // indirect + golang.org/x/net v0.0.0-20210610132358-84b48f89b13b // indirect + golang.org/x/text v0.3.6 // indirect ) diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/go.sum b/sdk/resourcemanager/resourcehealth/armresourcehealth/go.sum index 27c9bd79d559..a7eaa30576c1 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/go.sum +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/go.sum @@ -1,29 +1,11 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0 h1:8wVJL0HUP5yDFXvotdewORTw7Yu88JbreWN/mobSvsQ= -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.1 h1:RxemzI2cHD0A8WyMqHu/UnDjfpGES/cmjtPbQoktWqs= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.1/go.mod h1:+nVKciyKD2J9TyVcEQ82Bo9b+3F92PiQfHrIE/zqLqM= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= +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/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/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 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= 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/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -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= -github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= -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= @@ -31,32 +13,20 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc 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-20210610132358-84b48f89b13b h1:k+E048sYJHyVnsr1GDrRZWQ32D2C7lWs9JRc0bel53A= golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -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/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/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/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= 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/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -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 h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= 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= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 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 deleted file mode 100644 index fd4c0b88b75a..000000000000 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/ze_generated_example_availabilitystatuses_client_test.go +++ /dev/null @@ -1,89 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// 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. - -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" -) - -// x-ms-original-file: specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2017-07-01/examples/AvailabilityStatuses_ListByResourceGroup.json -func ExampleAvailabilityStatusesClient_ListByResourceGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armresourcehealth.NewAvailabilityStatusesClient("", cred, nil) - pager := client.ListByResourceGroup("", - &armresourcehealth.AvailabilityStatusesClientListByResourceGroupOptions{Filter: nil, - Expand: to.StringPtr(""), - }) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} - -// x-ms-original-file: specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2017-07-01/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() - client := armresourcehealth.NewAvailabilityStatusesClient("", cred, nil) - res, err := client.GetByResource(ctx, - "", - &armresourcehealth.AvailabilityStatusesClientGetByResourceOptions{Filter: nil, - Expand: to.StringPtr(""), - }) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.AvailabilityStatusesClientGetByResourceResult) -} - -// x-ms-original-file: specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2017-07-01/examples/AvailabilityStatuses_List.json -func ExampleAvailabilityStatusesClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armresourcehealth.NewAvailabilityStatusesClient("", cred, nil) - pager := client.List("", - &armresourcehealth.AvailabilityStatusesClientListOptions{Filter: nil, - Expand: nil, - }) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/ze_generated_example_childavailabilitystatuses_client_test.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/ze_generated_example_childavailabilitystatuses_client_test.go deleted file mode 100644 index 96956595414e..000000000000 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/ze_generated_example_childavailabilitystatuses_client_test.go +++ /dev/null @@ -1,63 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// 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. - -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" -) - -// x-ms-original-file: specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2017-07-01/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() - client := armresourcehealth.NewChildAvailabilityStatusesClient(cred, nil) - res, err := client.GetByResource(ctx, - "", - &armresourcehealth.ChildAvailabilityStatusesClientGetByResourceOptions{Filter: nil, - Expand: to.StringPtr(""), - }) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ChildAvailabilityStatusesClientGetByResourceResult) -} - -// x-ms-original-file: specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2017-07-01/examples/ChildAvailabilityStatuses_List.json -func ExampleChildAvailabilityStatusesClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armresourcehealth.NewChildAvailabilityStatusesClient(cred, nil) - pager := client.List("", - &armresourcehealth.ChildAvailabilityStatusesClientListOptions{Filter: nil, - Expand: nil, - }) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/ze_generated_example_childresources_client_test.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/ze_generated_example_childresources_client_test.go deleted file mode 100644 index 3eeda7d0a7b1..000000000000 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/ze_generated_example_childresources_client_test.go +++ /dev/null @@ -1,43 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// 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. - -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" -) - -// x-ms-original-file: specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2017-07-01/examples/ChildResources_List.json -func ExampleChildResourcesClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armresourcehealth.NewChildResourcesClient(cred, nil) - pager := client.List("", - &armresourcehealth.ChildResourcesClientListOptions{Filter: nil, - Expand: nil, - }) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/ze_generated_example_emergingissues_client_test.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/ze_generated_example_emergingissues_client_test.go deleted file mode 100644 index 3e5397a13a3d..000000000000 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/ze_generated_example_emergingissues_client_test.go +++ /dev/null @@ -1,56 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// 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. - -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" -) - -// x-ms-original-file: specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2017-07-01/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() - client := armresourcehealth.NewEmergingIssuesClient(cred, nil) - res, err := client.Get(ctx, - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.EmergingIssuesClientGetResult) -} - -// x-ms-original-file: specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2017-07-01/examples/EmergingIssues_List.json -func ExampleEmergingIssuesClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armresourcehealth.NewEmergingIssuesClient(cred, nil) - pager := client.List(nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_availabilitystatuses_client.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_availabilitystatuses_client.go index 619fd5089261..61373df82135 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_availabilitystatuses_client.go +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_availabilitystatuses_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -34,20 +35,24 @@ type AvailabilityStatusesClient struct { // part of the URI for every service call. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewAvailabilityStatusesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *AvailabilityStatusesClient { +func NewAvailabilityStatusesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AvailabilityStatusesClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &AvailabilityStatusesClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // GetByResource - Gets current availability status for a single resource @@ -83,7 +88,7 @@ func (client *AvailabilityStatusesClient) getByResourceCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2017-07-01") + reqQP.Set("api-version", "2020-05-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -97,15 +102,14 @@ func (client *AvailabilityStatusesClient) getByResourceCreateRequest(ctx context // getByResourceHandleResponse handles the GetByResource response. func (client *AvailabilityStatusesClient) getByResourceHandleResponse(resp *http.Response) (AvailabilityStatusesClientGetByResourceResponse, error) { - result := AvailabilityStatusesClientGetByResourceResponse{RawResponse: resp} + result := AvailabilityStatusesClientGetByResourceResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.AvailabilityStatus); err != nil { return AvailabilityStatusesClientGetByResourceResponse{}, err } return result, nil } -// List - Lists all historical availability transitions and impacting events for a single resource. Use the nextLink property -// in the response to get the next page of availability status +// List - Lists all historical availability transitions and impacting events for a single resource. // If the operation fails it returns an *azcore.ResponseError type. // 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 : @@ -114,16 +118,32 @@ func (client *AvailabilityStatusesClient) getByResourceHandleResponse(resp *http // /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} // options - AvailabilityStatusesClientListOptions contains the optional parameters for the AvailabilityStatusesClient.List // method. -func (client *AvailabilityStatusesClient) List(resourceURI string, options *AvailabilityStatusesClientListOptions) *AvailabilityStatusesClientListPager { - return &AvailabilityStatusesClientListPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceURI, options) +func (client *AvailabilityStatusesClient) List(resourceURI string, options *AvailabilityStatusesClientListOptions) *runtime.Pager[AvailabilityStatusesClientListResponse] { + return runtime.NewPager(runtime.PageProcessor[AvailabilityStatusesClientListResponse]{ + More: func(page AvailabilityStatusesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp AvailabilityStatusesClientListResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.AvailabilityStatusListResult.NextLink) + Fetcher: func(ctx context.Context, page *AvailabilityStatusesClientListResponse) (AvailabilityStatusesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceURI, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return AvailabilityStatusesClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AvailabilityStatusesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AvailabilityStatusesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) }, - } + }) } // listCreateRequest creates the List request. @@ -135,7 +155,7 @@ func (client *AvailabilityStatusesClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2017-07-01") + reqQP.Set("api-version", "2020-05-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -149,29 +169,44 @@ func (client *AvailabilityStatusesClient) listCreateRequest(ctx context.Context, // listHandleResponse handles the List response. func (client *AvailabilityStatusesClient) listHandleResponse(resp *http.Response) (AvailabilityStatusesClientListResponse, error) { - result := AvailabilityStatusesClientListResponse{RawResponse: resp} + result := AvailabilityStatusesClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.AvailabilityStatusListResult); err != nil { return AvailabilityStatusesClientListResponse{}, err } return result, nil } -// ListByResourceGroup - Lists the current availability status for all the resources in the resource group. Use the nextLink -// property in the response to get the next page of availability statuses. +// ListByResourceGroup - Lists the current availability status for all the resources in the resource group. // If the operation fails it returns an *azcore.ResponseError type. // resourceGroupName - The name of the resource group. // options - AvailabilityStatusesClientListByResourceGroupOptions contains the optional parameters for the AvailabilityStatusesClient.ListByResourceGroup // method. -func (client *AvailabilityStatusesClient) ListByResourceGroup(resourceGroupName string, options *AvailabilityStatusesClientListByResourceGroupOptions) *AvailabilityStatusesClientListByResourceGroupPager { - return &AvailabilityStatusesClientListByResourceGroupPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) +func (client *AvailabilityStatusesClient) ListByResourceGroup(resourceGroupName string, options *AvailabilityStatusesClientListByResourceGroupOptions) *runtime.Pager[AvailabilityStatusesClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PageProcessor[AvailabilityStatusesClientListByResourceGroupResponse]{ + More: func(page AvailabilityStatusesClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp AvailabilityStatusesClientListByResourceGroupResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.AvailabilityStatusListResult.NextLink) + Fetcher: func(ctx context.Context, page *AvailabilityStatusesClientListByResourceGroupResponse) (AvailabilityStatusesClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return AvailabilityStatusesClientListByResourceGroupResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AvailabilityStatusesClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AvailabilityStatusesClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) }, - } + }) } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. @@ -190,7 +225,7 @@ func (client *AvailabilityStatusesClient) listByResourceGroupCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2017-07-01") + reqQP.Set("api-version", "2020-05-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -204,28 +239,43 @@ func (client *AvailabilityStatusesClient) listByResourceGroupCreateRequest(ctx c // listByResourceGroupHandleResponse handles the ListByResourceGroup response. func (client *AvailabilityStatusesClient) listByResourceGroupHandleResponse(resp *http.Response) (AvailabilityStatusesClientListByResourceGroupResponse, error) { - result := AvailabilityStatusesClientListByResourceGroupResponse{RawResponse: resp} + result := AvailabilityStatusesClientListByResourceGroupResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.AvailabilityStatusListResult); err != nil { return AvailabilityStatusesClientListByResourceGroupResponse{}, err } return result, nil } -// ListBySubscriptionID - Lists the current availability status for all the resources in the subscription. Use the nextLink -// property in the response to get the next page of availability statuses. +// ListBySubscriptionID - Lists the current availability status for all the resources in the subscription. // If the operation fails it returns an *azcore.ResponseError type. // options - AvailabilityStatusesClientListBySubscriptionIDOptions contains the optional parameters for the AvailabilityStatusesClient.ListBySubscriptionID // method. -func (client *AvailabilityStatusesClient) ListBySubscriptionID(options *AvailabilityStatusesClientListBySubscriptionIDOptions) *AvailabilityStatusesClientListBySubscriptionIDPager { - return &AvailabilityStatusesClientListBySubscriptionIDPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listBySubscriptionIDCreateRequest(ctx, options) +func (client *AvailabilityStatusesClient) ListBySubscriptionID(options *AvailabilityStatusesClientListBySubscriptionIDOptions) *runtime.Pager[AvailabilityStatusesClientListBySubscriptionIDResponse] { + return runtime.NewPager(runtime.PageProcessor[AvailabilityStatusesClientListBySubscriptionIDResponse]{ + More: func(page AvailabilityStatusesClientListBySubscriptionIDResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp AvailabilityStatusesClientListBySubscriptionIDResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.AvailabilityStatusListResult.NextLink) + Fetcher: func(ctx context.Context, page *AvailabilityStatusesClientListBySubscriptionIDResponse) (AvailabilityStatusesClientListBySubscriptionIDResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listBySubscriptionIDCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return AvailabilityStatusesClientListBySubscriptionIDResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AvailabilityStatusesClientListBySubscriptionIDResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AvailabilityStatusesClientListBySubscriptionIDResponse{}, runtime.NewResponseError(resp) + } + return client.listBySubscriptionIDHandleResponse(resp) }, - } + }) } // listBySubscriptionIDCreateRequest creates the ListBySubscriptionID request. @@ -240,7 +290,7 @@ func (client *AvailabilityStatusesClient) listBySubscriptionIDCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2017-07-01") + reqQP.Set("api-version", "2020-05-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -254,7 +304,7 @@ func (client *AvailabilityStatusesClient) listBySubscriptionIDCreateRequest(ctx // listBySubscriptionIDHandleResponse handles the ListBySubscriptionID response. func (client *AvailabilityStatusesClient) listBySubscriptionIDHandleResponse(resp *http.Response) (AvailabilityStatusesClientListBySubscriptionIDResponse, error) { - result := AvailabilityStatusesClientListBySubscriptionIDResponse{RawResponse: resp} + result := AvailabilityStatusesClientListBySubscriptionIDResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.AvailabilityStatusListResult); err != nil { return AvailabilityStatusesClientListBySubscriptionIDResponse{}, err } diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_childavailabilitystatuses_client.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_childavailabilitystatuses_client.go deleted file mode 100644 index ee686c6633a4..000000000000 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_childavailabilitystatuses_client.go +++ /dev/null @@ -1,147 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// 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. - -package armresourcehealth - -import ( - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "strings" -) - -// ChildAvailabilityStatusesClient contains the methods for the ChildAvailabilityStatuses group. -// Don't use this type directly, use NewChildAvailabilityStatusesClient() instead. -type ChildAvailabilityStatusesClient struct { - host string - pl runtime.Pipeline -} - -// NewChildAvailabilityStatusesClient creates a new instance of ChildAvailabilityStatusesClient with the specified values. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewChildAvailabilityStatusesClient(credential azcore.TokenCredential, options *arm.ClientOptions) *ChildAvailabilityStatusesClient { - if options == nil { - options = &arm.ClientOptions{} - } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud - } - client := &ChildAvailabilityStatusesClient{ - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), - } - return client -} - -// GetByResource - Gets current availability status for a single resource -// If the operation fails it returns an *azcore.ResponseError type. -// 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} -// options - ChildAvailabilityStatusesClientGetByResourceOptions contains the optional parameters for the ChildAvailabilityStatusesClient.GetByResource -// method. -func (client *ChildAvailabilityStatusesClient) GetByResource(ctx context.Context, resourceURI string, options *ChildAvailabilityStatusesClientGetByResourceOptions) (ChildAvailabilityStatusesClientGetByResourceResponse, error) { - req, err := client.getByResourceCreateRequest(ctx, resourceURI, options) - if err != nil { - return ChildAvailabilityStatusesClientGetByResourceResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ChildAvailabilityStatusesClientGetByResourceResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ChildAvailabilityStatusesClientGetByResourceResponse{}, runtime.NewResponseError(resp) - } - return client.getByResourceHandleResponse(resp) -} - -// getByResourceCreateRequest creates the GetByResource request. -func (client *ChildAvailabilityStatusesClient) getByResourceCreateRequest(ctx context.Context, resourceURI string, options *ChildAvailabilityStatusesClientGetByResourceOptions) (*policy.Request, error) { - urlPath := "/{resourceUri}/providers/Microsoft.ResourceHealth/childAvailabilityStatuses/current" - urlPath = strings.ReplaceAll(urlPath, "{resourceUri}", resourceURI) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2017-07-01") - if options != nil && options.Filter != nil { - reqQP.Set("$filter", *options.Filter) - } - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") - return req, nil -} - -// getByResourceHandleResponse handles the GetByResource response. -func (client *ChildAvailabilityStatusesClient) getByResourceHandleResponse(resp *http.Response) (ChildAvailabilityStatusesClientGetByResourceResponse, error) { - result := ChildAvailabilityStatusesClientGetByResourceResponse{RawResponse: resp} - if err := runtime.UnmarshalAsJSON(resp, &result.AvailabilityStatus); err != nil { - return ChildAvailabilityStatusesClientGetByResourceResponse{}, err - } - return result, nil -} - -// List - 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 -// If the operation fails it returns an *azcore.ResponseError type. -// 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} -// options - ChildAvailabilityStatusesClientListOptions contains the optional parameters for the ChildAvailabilityStatusesClient.List -// method. -func (client *ChildAvailabilityStatusesClient) List(resourceURI string, options *ChildAvailabilityStatusesClientListOptions) *ChildAvailabilityStatusesClientListPager { - return &ChildAvailabilityStatusesClientListPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceURI, options) - }, - advancer: func(ctx context.Context, resp ChildAvailabilityStatusesClientListResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.AvailabilityStatusListResult.NextLink) - }, - } -} - -// listCreateRequest creates the List request. -func (client *ChildAvailabilityStatusesClient) listCreateRequest(ctx context.Context, resourceURI string, options *ChildAvailabilityStatusesClientListOptions) (*policy.Request, error) { - urlPath := "/{resourceUri}/providers/Microsoft.ResourceHealth/childAvailabilityStatuses" - urlPath = strings.ReplaceAll(urlPath, "{resourceUri}", resourceURI) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2017-07-01") - if options != nil && options.Filter != nil { - reqQP.Set("$filter", *options.Filter) - } - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") - return req, nil -} - -// listHandleResponse handles the List response. -func (client *ChildAvailabilityStatusesClient) listHandleResponse(resp *http.Response) (ChildAvailabilityStatusesClientListResponse, error) { - result := ChildAvailabilityStatusesClientListResponse{RawResponse: resp} - if err := runtime.UnmarshalAsJSON(resp, &result.AvailabilityStatusListResult); err != nil { - return ChildAvailabilityStatusesClientListResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_childresources_client.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_childresources_client.go deleted file mode 100644 index 41f251acf238..000000000000 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_childresources_client.go +++ /dev/null @@ -1,94 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// 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. - -package armresourcehealth - -import ( - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "strings" -) - -// ChildResourcesClient contains the methods for the ChildResources group. -// Don't use this type directly, use NewChildResourcesClient() instead. -type ChildResourcesClient struct { - host string - pl runtime.Pipeline -} - -// NewChildResourcesClient creates a new instance of ChildResourcesClient with the specified values. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewChildResourcesClient(credential azcore.TokenCredential, options *arm.ClientOptions) *ChildResourcesClient { - if options == nil { - options = &arm.ClientOptions{} - } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud - } - client := &ChildResourcesClient{ - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), - } - return client -} - -// List - 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 -// If the operation fails it returns an *azcore.ResponseError type. -// 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} -// options - ChildResourcesClientListOptions contains the optional parameters for the ChildResourcesClient.List method. -func (client *ChildResourcesClient) List(resourceURI string, options *ChildResourcesClientListOptions) *ChildResourcesClientListPager { - return &ChildResourcesClientListPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceURI, options) - }, - advancer: func(ctx context.Context, resp ChildResourcesClientListResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.AvailabilityStatusListResult.NextLink) - }, - } -} - -// listCreateRequest creates the List request. -func (client *ChildResourcesClient) listCreateRequest(ctx context.Context, resourceURI string, options *ChildResourcesClientListOptions) (*policy.Request, error) { - urlPath := "/{resourceUri}/providers/Microsoft.ResourceHealth/childResources" - urlPath = strings.ReplaceAll(urlPath, "{resourceUri}", resourceURI) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2017-07-01") - if options != nil && options.Filter != nil { - reqQP.Set("$filter", *options.Filter) - } - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") - return req, nil -} - -// listHandleResponse handles the List response. -func (client *ChildResourcesClient) listHandleResponse(resp *http.Response) (ChildResourcesClientListResponse, error) { - result := ChildResourcesClientListResponse{RawResponse: resp} - if err := runtime.UnmarshalAsJSON(resp, &result.AvailabilityStatusListResult); err != nil { - return ChildResourcesClientListResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_constants.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_constants.go index 7c7dbc14ef87..145c7dbe3a78 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_constants.go +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_constants.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -10,15 +10,15 @@ package armresourcehealth const ( moduleName = "armresourcehealth" - moduleVersion = "v0.4.0" + moduleVersion = "v0.5.0" ) -// AvailabilityStateValues - Availability status of the resource. When it is null, this availabilityStatus object represents -// an availability impacting event +// AvailabilityStateValues - Impacted resource status of the resource. type AvailabilityStateValues string const ( AvailabilityStateValuesAvailable AvailabilityStateValues = "Available" + AvailabilityStateValuesDegraded AvailabilityStateValues = "Degraded" AvailabilityStateValuesUnavailable AvailabilityStateValues = "Unavailable" AvailabilityStateValuesUnknown AvailabilityStateValues = "Unknown" ) @@ -27,79 +27,43 @@ const ( func PossibleAvailabilityStateValuesValues() []AvailabilityStateValues { return []AvailabilityStateValues{ AvailabilityStateValuesAvailable, + AvailabilityStateValuesDegraded, AvailabilityStateValuesUnavailable, AvailabilityStateValuesUnknown, } } -// ToPtr returns a *AvailabilityStateValues pointing to the current value. -func (c AvailabilityStateValues) ToPtr() *AvailabilityStateValues { - return &c -} - // ReasonChronicityTypes - Chronicity of the availability transition. type ReasonChronicityTypes string const ( - ReasonChronicityTypesTransient ReasonChronicityTypes = "Transient" ReasonChronicityTypesPersistent ReasonChronicityTypes = "Persistent" + ReasonChronicityTypesTransient ReasonChronicityTypes = "Transient" ) // PossibleReasonChronicityTypesValues returns the possible values for the ReasonChronicityTypes const type. func PossibleReasonChronicityTypesValues() []ReasonChronicityTypes { return []ReasonChronicityTypes{ - ReasonChronicityTypesTransient, ReasonChronicityTypesPersistent, + ReasonChronicityTypesTransient, } } -// ToPtr returns a *ReasonChronicityTypes pointing to the current value. -func (c ReasonChronicityTypes) ToPtr() *ReasonChronicityTypes { - return &c -} - -// SeverityValues - The severity level of this active event. -type SeverityValues string - -const ( - SeverityValuesError SeverityValues = "Error" - SeverityValuesInformation SeverityValues = "Information" - SeverityValuesWarning SeverityValues = "Warning" -) - -// PossibleSeverityValuesValues returns the possible values for the SeverityValues const type. -func PossibleSeverityValuesValues() []SeverityValues { - return []SeverityValues{ - SeverityValuesError, - SeverityValuesInformation, - SeverityValuesWarning, - } -} - -// ToPtr returns a *SeverityValues pointing to the current value. -func (c SeverityValues) ToPtr() *SeverityValues { - return &c -} - -// StageValues - The stage of this active event. -type StageValues string +// ReasonTypeValues - When the resource's availabilityState is Unavailable, it describes where the health impacting event +// was originated. +type ReasonTypeValues string const ( - StageValuesActive StageValues = "Active" - StageValuesArchived StageValues = "Archived" - StageValuesResolve StageValues = "Resolve" + ReasonTypeValuesPlanned ReasonTypeValues = "Planned" + ReasonTypeValuesUnplanned ReasonTypeValues = "Unplanned" + ReasonTypeValuesUserInitiated ReasonTypeValues = "UserInitiated" ) -// PossibleStageValuesValues returns the possible values for the StageValues const type. -func PossibleStageValuesValues() []StageValues { - return []StageValues{ - StageValuesActive, - StageValuesArchived, - StageValuesResolve, +// PossibleReasonTypeValuesValues returns the possible values for the ReasonTypeValues const type. +func PossibleReasonTypeValuesValues() []ReasonTypeValues { + return []ReasonTypeValues{ + ReasonTypeValuesPlanned, + ReasonTypeValuesUnplanned, + ReasonTypeValuesUserInitiated, } } - -// ToPtr returns a *StageValues pointing to the current value. -func (c StageValues) ToPtr() *StageValues { - return &c -} diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_emergingissues_client.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_emergingissues_client.go deleted file mode 100644 index cd5d299100c0..000000000000 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_emergingissues_client.go +++ /dev/null @@ -1,126 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// 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. - -package armresourcehealth - -import ( - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// EmergingIssuesClient contains the methods for the EmergingIssues group. -// Don't use this type directly, use NewEmergingIssuesClient() instead. -type EmergingIssuesClient struct { - host string - pl runtime.Pipeline -} - -// NewEmergingIssuesClient creates a new instance of EmergingIssuesClient with the specified values. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewEmergingIssuesClient(credential azcore.TokenCredential, options *arm.ClientOptions) *EmergingIssuesClient { - if options == nil { - options = &arm.ClientOptions{} - } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud - } - client := &EmergingIssuesClient{ - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), - } - return client -} - -// Get - Gets Azure services' emerging issues. -// If the operation fails it returns an *azcore.ResponseError type. -// options - EmergingIssuesClientGetOptions contains the optional parameters for the EmergingIssuesClient.Get method. -func (client *EmergingIssuesClient) Get(ctx context.Context, options *EmergingIssuesClientGetOptions) (EmergingIssuesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, options) - if err != nil { - return EmergingIssuesClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return EmergingIssuesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return EmergingIssuesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *EmergingIssuesClient) getCreateRequest(ctx context.Context, options *EmergingIssuesClientGetOptions) (*policy.Request, error) { - urlPath := "/providers/Microsoft.ResourceHealth/emergingIssues/{issueName}" - urlPath = strings.ReplaceAll(urlPath, "{issueName}", url.PathEscape("default")) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2017-07-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *EmergingIssuesClient) getHandleResponse(resp *http.Response) (EmergingIssuesClientGetResponse, error) { - result := EmergingIssuesClientGetResponse{RawResponse: resp} - if err := runtime.UnmarshalAsJSON(resp, &result.EmergingIssuesGetResult); err != nil { - return EmergingIssuesClientGetResponse{}, err - } - return result, nil -} - -// List - Lists Azure services' emerging issues. -// If the operation fails it returns an *azcore.ResponseError type. -// options - EmergingIssuesClientListOptions contains the optional parameters for the EmergingIssuesClient.List method. -func (client *EmergingIssuesClient) List(options *EmergingIssuesClientListOptions) *EmergingIssuesClientListPager { - return &EmergingIssuesClientListPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, options) - }, - advancer: func(ctx context.Context, resp EmergingIssuesClientListResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.EmergingIssueListResult.NextLink) - }, - } -} - -// listCreateRequest creates the List request. -func (client *EmergingIssuesClient) listCreateRequest(ctx context.Context, options *EmergingIssuesClientListOptions) (*policy.Request, error) { - urlPath := "/providers/Microsoft.ResourceHealth/emergingIssues" - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2017-07-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") - return req, nil -} - -// listHandleResponse handles the List response. -func (client *EmergingIssuesClient) listHandleResponse(resp *http.Response) (EmergingIssuesClientListResponse, error) { - result := EmergingIssuesClientListResponse{RawResponse: resp} - if err := runtime.UnmarshalAsJSON(resp, &result.EmergingIssueListResult); err != nil { - return EmergingIssuesClientListResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_models.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_models.go index 258448887786..fb6d2706168c 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_models.go +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_models.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -8,12 +8,7 @@ package armresourcehealth -import ( - "encoding/json" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" - "time" -) +import "time" // AvailabilityStatus - availabilityStatus of a resource. type AvailabilityStatus struct { @@ -42,14 +37,6 @@ type AvailabilityStatusListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// 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) -} - // AvailabilityStatusProperties - Properties of availability state. type AvailabilityStatusProperties struct { // Availability status of the resource. When it is null, this availabilityStatus object represents an availability impacting @@ -75,7 +62,7 @@ type AvailabilityStatusProperties struct { HealthEventType *string `json:"healthEventType,omitempty"` // Timestamp for when last change in health status occurred. - OccuredTime *time.Time `json:"occuredTime,omitempty"` + OccurredTime *time.Time `json:"occurredTime,omitempty"` // Chronicity of the availability transition. ReasonChronicity *ReasonChronicityTypes `json:"reasonChronicity,omitempty"` @@ -85,7 +72,7 @@ type AvailabilityStatusProperties struct { ReasonType *string `json:"reasonType,omitempty"` // An annotation describing a change in the availabilityState to Available from Unavailable with a reasonType of type Unplanned - RecentlyResolvedState *AvailabilityStatusPropertiesRecentlyResolvedState `json:"recentlyResolvedState,omitempty"` + RecentlyResolved *AvailabilityStatusPropertiesRecentlyResolved `json:"recentlyResolved,omitempty"` // Lists actions the user can take based on the current availabilityState of the resource. RecommendedActions []*RecommendedAction `json:"recommendedActions,omitempty"` @@ -106,98 +93,14 @@ type AvailabilityStatusProperties struct { // Summary description of the availability status. Summary *string `json:"summary,omitempty"` -} -// 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, "occuredTime", a.OccuredTime) - populate(objectMap, "reasonChronicity", a.ReasonChronicity) - populate(objectMap, "reasonType", a.ReasonType) - populate(objectMap, "recentlyResolvedState", a.RecentlyResolvedState) - 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) - 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 - } - for key, val := range rawMsg { - var err error - switch key { - case "availabilityState": - err = unpopulate(val, &a.AvailabilityState) - delete(rawMsg, key) - case "detailedStatus": - err = unpopulate(val, &a.DetailedStatus) - delete(rawMsg, key) - case "healthEventCategory": - err = unpopulate(val, &a.HealthEventCategory) - delete(rawMsg, key) - case "healthEventCause": - err = unpopulate(val, &a.HealthEventCause) - delete(rawMsg, key) - case "healthEventId": - err = unpopulate(val, &a.HealthEventID) - delete(rawMsg, key) - case "healthEventType": - err = unpopulate(val, &a.HealthEventType) - delete(rawMsg, key) - case "occuredTime": - err = unpopulateTimeRFC3339(val, &a.OccuredTime) - delete(rawMsg, key) - case "reasonChronicity": - err = unpopulate(val, &a.ReasonChronicity) - delete(rawMsg, key) - case "reasonType": - err = unpopulate(val, &a.ReasonType) - delete(rawMsg, key) - case "recentlyResolvedState": - err = unpopulate(val, &a.RecentlyResolvedState) - delete(rawMsg, key) - case "recommendedActions": - err = unpopulate(val, &a.RecommendedActions) - delete(rawMsg, key) - case "reportedTime": - err = unpopulateTimeRFC3339(val, &a.ReportedTime) - delete(rawMsg, key) - case "resolutionETA": - err = unpopulateTimeRFC3339(val, &a.ResolutionETA) - delete(rawMsg, key) - case "rootCauseAttributionTime": - err = unpopulateTimeRFC3339(val, &a.RootCauseAttributionTime) - delete(rawMsg, key) - case "serviceImpactingEvents": - err = unpopulate(val, &a.ServiceImpactingEvents) - delete(rawMsg, key) - case "summary": - err = unpopulate(val, &a.Summary) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil + // Title description of the availability status. + Title *string `json:"title,omitempty"` } -// AvailabilityStatusPropertiesRecentlyResolvedState - An annotation describing a change in the availabilityState to Available +// AvailabilityStatusPropertiesRecentlyResolved - An annotation describing a change in the availabilityState to Available // from Unavailable with a reasonType of type Unplanned -type AvailabilityStatusPropertiesRecentlyResolvedState struct { +type AvailabilityStatusPropertiesRecentlyResolved struct { // Timestamp when the availabilityState changes to Available. ResolvedTime *time.Time `json:"resolvedTime,omitempty"` @@ -208,41 +111,6 @@ type AvailabilityStatusPropertiesRecentlyResolvedState struct { UnavailableOccurredTime *time.Time `json:"unavailableOccurredTime,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type AvailabilityStatusPropertiesRecentlyResolvedState. -func (a AvailabilityStatusPropertiesRecentlyResolvedState) 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 AvailabilityStatusPropertiesRecentlyResolvedState. -func (a *AvailabilityStatusPropertiesRecentlyResolvedState) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "resolvedTime": - err = unpopulateTimeRFC3339(val, &a.ResolvedTime) - delete(rawMsg, key) - case "unavailabilitySummary": - err = unpopulate(val, &a.UnavailabilitySummary) - delete(rawMsg, key) - case "unavailableOccurredTime": - err = unpopulateTimeRFC3339(val, &a.UnavailableOccurredTime) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // AvailabilityStatusesClientGetByResourceOptions contains the optional parameters for the AvailabilityStatusesClient.GetByResource // method. type AvailabilityStatusesClientGetByResourceOptions struct { @@ -278,131 +146,37 @@ type AvailabilityStatusesClientListOptions struct { Filter *string } -// ChildAvailabilityStatusesClientGetByResourceOptions contains the optional parameters for the ChildAvailabilityStatusesClient.GetByResource -// method. -type ChildAvailabilityStatusesClientGetByResourceOptions struct { - // Setting $expand=recommendedactions in url query expands the recommendedactions in the response. - Expand *string - // 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 +// ErrorResponse - Error details. +type ErrorResponse struct { + // The error object. + Error *ErrorResponseError `json:"error,omitempty"` } -// ChildAvailabilityStatusesClientListOptions contains the optional parameters for the ChildAvailabilityStatusesClient.List -// method. -type ChildAvailabilityStatusesClientListOptions struct { - // Setting $expand=recommendedactions in url query expands the recommendedactions in the response. - Expand *string - // 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 -} +// ErrorResponseError - The error object. +type ErrorResponseError struct { + // READ-ONLY; The error code. + Code *string `json:"code,omitempty" azure:"ro"` -// ChildResourcesClientListOptions contains the optional parameters for the ChildResourcesClient.List method. -type ChildResourcesClientListOptions struct { - // Setting $expand=recommendedactions in url query expands the recommendedactions in the response. - Expand *string - // 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 -} - -// EmergingIssue - On-going emerging issue from azure status. -type EmergingIssue struct { - // Timestamp for when last time refreshed for ongoing emerging issue. - RefreshTimestamp *time.Time `json:"refreshTimestamp,omitempty"` - - // The list of emerging issues of active event type. - StatusActiveEvents []*StatusActiveEvent `json:"statusActiveEvents,omitempty"` - - // The list of emerging issues of banner type. - StatusBanners []*StatusBanner `json:"statusBanners,omitempty"` -} - -// MarshalJSON implements the json.Marshaller interface for type EmergingIssue. -func (e EmergingIssue) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "refreshTimestamp", e.RefreshTimestamp) - populate(objectMap, "statusActiveEvents", e.StatusActiveEvents) - populate(objectMap, "statusBanners", e.StatusBanners) - return json.Marshal(objectMap) -} + // READ-ONLY; The error details. + Details *string `json:"details,omitempty" azure:"ro"` -// UnmarshalJSON implements the json.Unmarshaller interface for type EmergingIssue. -func (e *EmergingIssue) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "refreshTimestamp": - err = unpopulateTimeRFC3339(val, &e.RefreshTimestamp) - delete(rawMsg, key) - case "statusActiveEvents": - err = unpopulate(val, &e.StatusActiveEvents) - delete(rawMsg, key) - case "statusBanners": - err = unpopulate(val, &e.StatusBanners) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil + // READ-ONLY; The error message. + Message *string `json:"message,omitempty" azure:"ro"` } -// EmergingIssueImpact - Object of the emerging issue impact on services and regions. -type EmergingIssueImpact struct { - // The impacted service id. +// ImpactedRegion - Object of impacted region. +type ImpactedRegion struct { + // The impacted region id. ID *string `json:"id,omitempty"` - // The impacted service name. + // The impacted region name. Name *string `json:"name,omitempty"` - - // The list of impacted regions for corresponding emerging issues. - Regions []*ImpactedRegion `json:"regions,omitempty"` -} - -// MarshalJSON implements the json.Marshaller interface for type EmergingIssueImpact. -func (e EmergingIssueImpact) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", e.ID) - populate(objectMap, "name", e.Name) - populate(objectMap, "regions", e.Regions) - return json.Marshal(objectMap) -} - -// EmergingIssueListResult - The list of emerging issues. -type EmergingIssueListResult struct { - // The link used to get the next page of emerging issues. - NextLink *string `json:"nextLink,omitempty"` - - // The list of emerging issues. - Value []*EmergingIssuesGetResult `json:"value,omitempty"` -} - -// MarshalJSON implements the json.Marshaller interface for type EmergingIssueListResult. -func (e EmergingIssueListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", e.NextLink) - populate(objectMap, "value", e.Value) - return json.Marshal(objectMap) -} - -// EmergingIssuesClientGetOptions contains the optional parameters for the EmergingIssuesClient.Get method. -type EmergingIssuesClientGetOptions struct { - // placeholder for future optional parameters -} - -// EmergingIssuesClientListOptions contains the optional parameters for the EmergingIssuesClient.List method. -type EmergingIssuesClientListOptions struct { - // placeholder for future optional parameters } -// EmergingIssuesGetResult - The Get EmergingIssues operation response. -type EmergingIssuesGetResult struct { - // The emerging issue entity properties. - Properties *EmergingIssue `json:"properties,omitempty"` +// ImpactedResourceStatus - impactedResource with health status +type ImpactedResourceStatus struct { + // Properties of impacted resource status. + Properties *ImpactedResourceStatusProperties `json:"properties,omitempty"` // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` @@ -414,13 +188,22 @@ type EmergingIssuesGetResult struct { Type *string `json:"type,omitempty" azure:"ro"` } -// ImpactedRegion - Object of impacted region. -type ImpactedRegion struct { - // The impacted region id. - ID *string `json:"id,omitempty"` +// ImpactedResourceStatusProperties - Properties of impacted resource status. +type ImpactedResourceStatusProperties struct { + // Impacted resource status of the resource. + AvailabilityState *AvailabilityStateValues `json:"availabilityState,omitempty"` - // The impacted region name. - Name *string `json:"name,omitempty"` + // Timestamp for when last change in health status occurred. + OccurredTime *time.Time `json:"occurredTime,omitempty"` + + // When the resource's availabilityState is Unavailable, it describes where the health impacting event was originated. + ReasonType *ReasonTypeValues `json:"reasonType,omitempty"` + + // Summary description of the impacted resource status. + Summary *string `json:"summary,omitempty"` + + // Title description of the impacted resource status. + Title *string `json:"title,omitempty"` } // Operation available in the resourcehealth resource provider. @@ -453,13 +236,6 @@ type OperationListResult struct { Value []*Operation `json:"value,omitempty"` } -// 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) -} - // OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. type OperationsClientListOptions struct { // placeholder for future optional parameters @@ -507,49 +283,6 @@ type ServiceImpactingEvent struct { Status *ServiceImpactingEventStatus `json:"status,omitempty"` } -// 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 - } - for key, val := range rawMsg { - var err error - switch key { - case "correlationId": - err = unpopulate(val, &s.CorrelationID) - delete(rawMsg, key) - case "eventStartTime": - err = unpopulateTimeRFC3339(val, &s.EventStartTime) - delete(rawMsg, key) - case "eventStatusLastModifiedTime": - err = unpopulateTimeRFC3339(val, &s.EventStatusLastModifiedTime) - delete(rawMsg, key) - case "incidentProperties": - err = unpopulate(val, &s.IncidentProperties) - delete(rawMsg, key) - case "status": - err = unpopulate(val, &s.Status) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // ServiceImpactingEventIncidentProperties - Properties of the service impacting event. type ServiceImpactingEventIncidentProperties struct { // Type of Event. @@ -571,102 +304,6 @@ type ServiceImpactingEventStatus struct { Value *string `json:"value,omitempty"` } -// StatusActiveEvent - Active event type of emerging issue. -type StatusActiveEvent struct { - // The cloud type of this active event. - Cloud *string `json:"cloud,omitempty"` - - // The details of active event. - Description *string `json:"description,omitempty"` - - // The list of emerging issues impacts. - Impacts []*EmergingIssueImpact `json:"impacts,omitempty"` - - // The last time modified on this banner. - LastModifiedTime *time.Time `json:"lastModifiedTime,omitempty"` - - // The boolean value of this active event if published or not. - Published *bool `json:"published,omitempty"` - - // The severity level of this active event. - Severity *SeverityValues `json:"severity,omitempty"` - - // The stage of this active event. - Stage *StageValues `json:"stage,omitempty"` - - // The impact start time on this active event. - StartTime *time.Time `json:"startTime,omitempty"` - - // The active event title. - Title *string `json:"title,omitempty"` - - // The tracking id of this active event. - TrackingID *string `json:"trackingId,omitempty"` -} - -// MarshalJSON implements the json.Marshaller interface for type StatusActiveEvent. -func (s StatusActiveEvent) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "cloud", s.Cloud) - populate(objectMap, "description", s.Description) - populate(objectMap, "impacts", s.Impacts) - populateTimeRFC3339(objectMap, "lastModifiedTime", s.LastModifiedTime) - populate(objectMap, "published", s.Published) - populate(objectMap, "severity", s.Severity) - populate(objectMap, "stage", s.Stage) - populateTimeRFC3339(objectMap, "startTime", s.StartTime) - populate(objectMap, "title", s.Title) - populate(objectMap, "trackingId", s.TrackingID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type StatusActiveEvent. -func (s *StatusActiveEvent) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "cloud": - err = unpopulate(val, &s.Cloud) - delete(rawMsg, key) - case "description": - err = unpopulate(val, &s.Description) - delete(rawMsg, key) - case "impacts": - err = unpopulate(val, &s.Impacts) - delete(rawMsg, key) - case "lastModifiedTime": - err = unpopulateTimeRFC3339(val, &s.LastModifiedTime) - delete(rawMsg, key) - case "published": - err = unpopulate(val, &s.Published) - delete(rawMsg, key) - case "severity": - err = unpopulate(val, &s.Severity) - delete(rawMsg, key) - case "stage": - err = unpopulate(val, &s.Stage) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, &s.StartTime) - delete(rawMsg, key) - case "title": - err = unpopulate(val, &s.Title) - delete(rawMsg, key) - case "trackingId": - err = unpopulate(val, &s.TrackingID) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // StatusBanner - Banner type of emerging issue. type StatusBanner struct { // The cloud type of this banner. @@ -681,59 +318,3 @@ type StatusBanner struct { // The banner title. Title *string `json:"title,omitempty"` } - -// 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 - } - for key, val := range rawMsg { - var err error - switch key { - case "cloud": - err = unpopulate(val, &s.Cloud) - delete(rawMsg, key) - case "lastModifiedTime": - err = unpopulateTimeRFC3339(val, &s.LastModifiedTime) - delete(rawMsg, key) - case "message": - err = unpopulate(val, &s.Message) - delete(rawMsg, key) - case "title": - err = unpopulate(val, &s.Title) - delete(rawMsg, key) - } - if err != nil { - return 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 { - if data == nil { - return nil - } - return json.Unmarshal(data, v) -} diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_models_serde.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_models_serde.go new file mode 100644 index 000000000000..25971a5201e1 --- /dev/null +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_models_serde.go @@ -0,0 +1,298 @@ +//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. + +package armresourcehealth + +import ( + "encoding/json" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" +) + +// 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 + } + for key, val := range rawMsg { + var err error + switch key { + case "availabilityState": + err = unpopulate(val, &a.AvailabilityState) + delete(rawMsg, key) + case "detailedStatus": + err = unpopulate(val, &a.DetailedStatus) + delete(rawMsg, key) + case "healthEventCategory": + err = unpopulate(val, &a.HealthEventCategory) + delete(rawMsg, key) + case "healthEventCause": + err = unpopulate(val, &a.HealthEventCause) + delete(rawMsg, key) + case "healthEventId": + err = unpopulate(val, &a.HealthEventID) + delete(rawMsg, key) + case "healthEventType": + err = unpopulate(val, &a.HealthEventType) + delete(rawMsg, key) + case "occurredTime": + err = unpopulateTimeRFC3339(val, &a.OccurredTime) + delete(rawMsg, key) + case "reasonChronicity": + err = unpopulate(val, &a.ReasonChronicity) + delete(rawMsg, key) + case "reasonType": + err = unpopulate(val, &a.ReasonType) + delete(rawMsg, key) + case "recentlyResolved": + err = unpopulate(val, &a.RecentlyResolved) + delete(rawMsg, key) + case "recommendedActions": + err = unpopulate(val, &a.RecommendedActions) + delete(rawMsg, key) + case "reportedTime": + err = unpopulateTimeRFC3339(val, &a.ReportedTime) + delete(rawMsg, key) + case "resolutionETA": + err = unpopulateTimeRFC3339(val, &a.ResolutionETA) + delete(rawMsg, key) + case "rootCauseAttributionTime": + err = unpopulateTimeRFC3339(val, &a.RootCauseAttributionTime) + delete(rawMsg, key) + case "serviceImpactingEvents": + err = unpopulate(val, &a.ServiceImpactingEvents) + delete(rawMsg, key) + case "summary": + err = unpopulate(val, &a.Summary) + delete(rawMsg, key) + case "title": + err = unpopulate(val, &a.Title) + delete(rawMsg, key) + } + if err != nil { + return 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 + } + for key, val := range rawMsg { + var err error + switch key { + case "resolvedTime": + err = unpopulateTimeRFC3339(val, &a.ResolvedTime) + delete(rawMsg, key) + case "unavailabilitySummary": + err = unpopulate(val, &a.UnavailabilitySummary) + delete(rawMsg, key) + case "unavailableOccurredTime": + err = unpopulateTimeRFC3339(val, &a.UnavailableOccurredTime) + delete(rawMsg, key) + } + if err != nil { + return 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 + } + for key, val := range rawMsg { + var err error + switch key { + case "availabilityState": + err = unpopulate(val, &i.AvailabilityState) + delete(rawMsg, key) + case "occurredTime": + err = unpopulateTimeRFC3339(val, &i.OccurredTime) + delete(rawMsg, key) + case "reasonType": + err = unpopulate(val, &i.ReasonType) + delete(rawMsg, key) + case "summary": + err = unpopulate(val, &i.Summary) + delete(rawMsg, key) + case "title": + err = unpopulate(val, &i.Title) + delete(rawMsg, key) + } + if err != nil { + return 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 + } + for key, val := range rawMsg { + var err error + switch key { + case "correlationId": + err = unpopulate(val, &s.CorrelationID) + delete(rawMsg, key) + case "eventStartTime": + err = unpopulateTimeRFC3339(val, &s.EventStartTime) + delete(rawMsg, key) + case "eventStatusLastModifiedTime": + err = unpopulateTimeRFC3339(val, &s.EventStatusLastModifiedTime) + delete(rawMsg, key) + case "incidentProperties": + err = unpopulate(val, &s.IncidentProperties) + delete(rawMsg, key) + case "status": + err = unpopulate(val, &s.Status) + delete(rawMsg, key) + } + if err != nil { + return 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 + } + for key, val := range rawMsg { + var err error + switch key { + case "cloud": + err = unpopulate(val, &s.Cloud) + delete(rawMsg, key) + case "lastModifiedTime": + err = unpopulateTimeRFC3339(val, &s.LastModifiedTime) + delete(rawMsg, key) + case "message": + err = unpopulate(val, &s.Message) + delete(rawMsg, key) + case "title": + err = unpopulate(val, &s.Title) + delete(rawMsg, key) + } + if err != nil { + return 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 { + if data == nil { + return nil + } + return json.Unmarshal(data, v) +} diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_operations_client.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_operations_client.go index 0caaf3080030..12dcf1ba628d 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_operations_client.go +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_operations_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -13,6 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -28,19 +29,23 @@ type OperationsClient struct { // NewOperationsClient creates a new instance of OperationsClient with the specified values. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) *OperationsClient { +func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &OperationsClient{ - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // List - Lists available operations for the resourcehealth resource provider @@ -69,7 +74,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2017-07-01") + reqQP.Set("api-version", "2020-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -77,7 +82,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * // listHandleResponse handles the List response. func (client *OperationsClient) listHandleResponse(resp *http.Response) (OperationsClientListResponse, error) { - result := OperationsClientListResponse{RawResponse: resp} + result := OperationsClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.OperationListResult); err != nil { return OperationsClientListResponse{}, err } diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_pagers.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_pagers.go deleted file mode 100644 index bff281431724..000000000000 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_pagers.go +++ /dev/null @@ -1,341 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// 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. - -package armresourcehealth - -import ( - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "reflect" -) - -// AvailabilityStatusesClientListByResourceGroupPager provides operations for iterating over paged responses. -type AvailabilityStatusesClientListByResourceGroupPager struct { - client *AvailabilityStatusesClient - current AvailabilityStatusesClientListByResourceGroupResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, AvailabilityStatusesClientListByResourceGroupResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *AvailabilityStatusesClientListByResourceGroupPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *AvailabilityStatusesClientListByResourceGroupPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.AvailabilityStatusListResult.NextLink == nil || len(*p.current.AvailabilityStatusListResult.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listByResourceGroupHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current AvailabilityStatusesClientListByResourceGroupResponse page. -func (p *AvailabilityStatusesClientListByResourceGroupPager) PageResponse() AvailabilityStatusesClientListByResourceGroupResponse { - return p.current -} - -// AvailabilityStatusesClientListBySubscriptionIDPager provides operations for iterating over paged responses. -type AvailabilityStatusesClientListBySubscriptionIDPager struct { - client *AvailabilityStatusesClient - current AvailabilityStatusesClientListBySubscriptionIDResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, AvailabilityStatusesClientListBySubscriptionIDResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *AvailabilityStatusesClientListBySubscriptionIDPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *AvailabilityStatusesClientListBySubscriptionIDPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.AvailabilityStatusListResult.NextLink == nil || len(*p.current.AvailabilityStatusListResult.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listBySubscriptionIDHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current AvailabilityStatusesClientListBySubscriptionIDResponse page. -func (p *AvailabilityStatusesClientListBySubscriptionIDPager) PageResponse() AvailabilityStatusesClientListBySubscriptionIDResponse { - return p.current -} - -// AvailabilityStatusesClientListPager provides operations for iterating over paged responses. -type AvailabilityStatusesClientListPager struct { - client *AvailabilityStatusesClient - current AvailabilityStatusesClientListResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, AvailabilityStatusesClientListResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *AvailabilityStatusesClientListPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *AvailabilityStatusesClientListPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.AvailabilityStatusListResult.NextLink == nil || len(*p.current.AvailabilityStatusListResult.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current AvailabilityStatusesClientListResponse page. -func (p *AvailabilityStatusesClientListPager) PageResponse() AvailabilityStatusesClientListResponse { - return p.current -} - -// ChildAvailabilityStatusesClientListPager provides operations for iterating over paged responses. -type ChildAvailabilityStatusesClientListPager struct { - client *ChildAvailabilityStatusesClient - current ChildAvailabilityStatusesClientListResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, ChildAvailabilityStatusesClientListResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *ChildAvailabilityStatusesClientListPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *ChildAvailabilityStatusesClientListPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.AvailabilityStatusListResult.NextLink == nil || len(*p.current.AvailabilityStatusListResult.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current ChildAvailabilityStatusesClientListResponse page. -func (p *ChildAvailabilityStatusesClientListPager) PageResponse() ChildAvailabilityStatusesClientListResponse { - return p.current -} - -// ChildResourcesClientListPager provides operations for iterating over paged responses. -type ChildResourcesClientListPager struct { - client *ChildResourcesClient - current ChildResourcesClientListResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, ChildResourcesClientListResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *ChildResourcesClientListPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *ChildResourcesClientListPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.AvailabilityStatusListResult.NextLink == nil || len(*p.current.AvailabilityStatusListResult.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current ChildResourcesClientListResponse page. -func (p *ChildResourcesClientListPager) PageResponse() ChildResourcesClientListResponse { - return p.current -} - -// EmergingIssuesClientListPager provides operations for iterating over paged responses. -type EmergingIssuesClientListPager struct { - client *EmergingIssuesClient - current EmergingIssuesClientListResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, EmergingIssuesClientListResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *EmergingIssuesClientListPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *EmergingIssuesClientListPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.EmergingIssueListResult.NextLink == nil || len(*p.current.EmergingIssueListResult.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current EmergingIssuesClientListResponse page. -func (p *EmergingIssuesClientListPager) PageResponse() EmergingIssuesClientListResponse { - return p.current -} diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_response_types.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_response_types.go index cfac33cd1c52..cb0914110abb 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_response_types.go +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_response_types.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -8,124 +8,27 @@ package armresourcehealth -import "net/http" - // AvailabilityStatusesClientGetByResourceResponse contains the response from method AvailabilityStatusesClient.GetByResource. type AvailabilityStatusesClientGetByResourceResponse struct { - AvailabilityStatusesClientGetByResourceResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// AvailabilityStatusesClientGetByResourceResult contains the result from method AvailabilityStatusesClient.GetByResource. -type AvailabilityStatusesClientGetByResourceResult struct { AvailabilityStatus } // AvailabilityStatusesClientListByResourceGroupResponse contains the response from method AvailabilityStatusesClient.ListByResourceGroup. type AvailabilityStatusesClientListByResourceGroupResponse struct { - AvailabilityStatusesClientListByResourceGroupResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// AvailabilityStatusesClientListByResourceGroupResult contains the result from method AvailabilityStatusesClient.ListByResourceGroup. -type AvailabilityStatusesClientListByResourceGroupResult struct { AvailabilityStatusListResult } // AvailabilityStatusesClientListBySubscriptionIDResponse contains the response from method AvailabilityStatusesClient.ListBySubscriptionID. type AvailabilityStatusesClientListBySubscriptionIDResponse struct { - AvailabilityStatusesClientListBySubscriptionIDResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// AvailabilityStatusesClientListBySubscriptionIDResult contains the result from method AvailabilityStatusesClient.ListBySubscriptionID. -type AvailabilityStatusesClientListBySubscriptionIDResult struct { AvailabilityStatusListResult } // AvailabilityStatusesClientListResponse contains the response from method AvailabilityStatusesClient.List. type AvailabilityStatusesClientListResponse struct { - AvailabilityStatusesClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// AvailabilityStatusesClientListResult contains the result from method AvailabilityStatusesClient.List. -type AvailabilityStatusesClientListResult struct { - AvailabilityStatusListResult -} - -// ChildAvailabilityStatusesClientGetByResourceResponse contains the response from method ChildAvailabilityStatusesClient.GetByResource. -type ChildAvailabilityStatusesClientGetByResourceResponse struct { - ChildAvailabilityStatusesClientGetByResourceResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ChildAvailabilityStatusesClientGetByResourceResult contains the result from method ChildAvailabilityStatusesClient.GetByResource. -type ChildAvailabilityStatusesClientGetByResourceResult struct { - AvailabilityStatus -} - -// ChildAvailabilityStatusesClientListResponse contains the response from method ChildAvailabilityStatusesClient.List. -type ChildAvailabilityStatusesClientListResponse struct { - ChildAvailabilityStatusesClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ChildAvailabilityStatusesClientListResult contains the result from method ChildAvailabilityStatusesClient.List. -type ChildAvailabilityStatusesClientListResult struct { AvailabilityStatusListResult } -// ChildResourcesClientListResponse contains the response from method ChildResourcesClient.List. -type ChildResourcesClientListResponse struct { - ChildResourcesClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ChildResourcesClientListResult contains the result from method ChildResourcesClient.List. -type ChildResourcesClientListResult struct { - AvailabilityStatusListResult -} - -// EmergingIssuesClientGetResponse contains the response from method EmergingIssuesClient.Get. -type EmergingIssuesClientGetResponse struct { - EmergingIssuesClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// EmergingIssuesClientGetResult contains the result from method EmergingIssuesClient.Get. -type EmergingIssuesClientGetResult struct { - EmergingIssuesGetResult -} - -// EmergingIssuesClientListResponse contains the response from method EmergingIssuesClient.List. -type EmergingIssuesClientListResponse struct { - EmergingIssuesClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// EmergingIssuesClientListResult contains the result from method EmergingIssuesClient.List. -type EmergingIssuesClientListResult struct { - EmergingIssueListResult -} - // OperationsClientListResponse contains the response from method OperationsClient.List. type OperationsClientListResponse struct { - OperationsClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// OperationsClientListResult contains the result from method OperationsClient.List. -type OperationsClientListResult struct { OperationListResult } diff --git a/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_time_rfc3339.go b/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_time_rfc3339.go index 6adc4e9b08da..310920537501 100644 --- a/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/resourcehealth/armresourcehealth/zz_generated_time_rfc3339.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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.