From a8a3300f45b57b3292df6af1e6d026ef383bb630 Mon Sep 17 00:00:00 2001 From: Jiahui Peng <46921893+Alancere@users.noreply.github.com> Date: Wed, 18 May 2022 17:19:02 +0800 Subject: [PATCH] [Release] sdk/resourcemanager/testbase/armtestbase/0.5.0 generation from spec commit: d55b8005f05b040b852c15e74a0f3e36494a15e1 (#18158) --- .../testbase/armtestbase/CHANGELOG.md | 32 ++ .../testbase/armtestbase/autorest.md | 6 +- .../testbase/armtestbase/go.mod | 12 +- .../testbase/armtestbase/go.sum | 44 +- ...ted_example_analysisresults_client_test.go | 21 +- ...nerated_example_availableos_client_test.go | 15 +- ...ated_example_customerevents_client_test.go | 47 +- ...nerated_example_emailevents_client_test.go | 15 +- ...d_example_favoriteprocesses_client_test.go | 41 +- ...ated_example_flightingrings_client_test.go | 15 +- ...enerated_example_operations_client_test.go | 1 - ...generated_example_osupdates_client_test.go | 19 +- ..._generated_example_packages_client_test.go | 123 +++-- .../ze_generated_example_skus_client_test.go | 3 +- ...ed_example_testbaseaccounts_client_test.go | 78 ++- ...nerated_example_testresults_client_test.go | 41 +- ...rated_example_testsummaries_client_test.go | 15 +- ...generated_example_testtypes_client_test.go | 15 +- .../ze_generated_example_usage_client_test.go | 7 +- .../zz_generated_accounts_client.go | 69 +-- .../zz_generated_analysisresults_client.go | 10 +- .../zz_generated_availableos_client.go | 10 +- .../armtestbase/zz_generated_constants.go | 2 +- .../zz_generated_customerevents_client.go | 34 +- .../zz_generated_emailevents_client.go | 10 +- .../zz_generated_favoriteprocesses_client.go | 16 +- .../zz_generated_flightingrings_client.go | 10 +- .../armtestbase/zz_generated_models.go | 69 +++ .../armtestbase/zz_generated_models_serde.go | 459 +++++------------- .../zz_generated_operations_client.go | 7 +- .../zz_generated_osupdates_client.go | 10 +- .../zz_generated_packages_client.go | 61 ++- .../armtestbase/zz_generated_skus_client.go | 7 +- .../zz_generated_testresults_client.go | 16 +- .../zz_generated_testsummaries_client.go | 10 +- .../zz_generated_testtypes_client.go | 10 +- .../armtestbase/zz_generated_time_rfc3339.go | 5 +- .../armtestbase/zz_generated_usage_client.go | 7 +- 38 files changed, 641 insertions(+), 731 deletions(-) diff --git a/sdk/resourcemanager/testbase/armtestbase/CHANGELOG.md b/sdk/resourcemanager/testbase/armtestbase/CHANGELOG.md index bc93f288f6a8..ec78638aca0f 100644 --- a/sdk/resourcemanager/testbase/armtestbase/CHANGELOG.md +++ b/sdk/resourcemanager/testbase/armtestbase/CHANGELOG.md @@ -1,5 +1,37 @@ # Release History +## 0.5.0 (2022-05-18) +### Breaking Changes + +- Function `*PackagesClient.BeginHardDelete` return value(s) have been changed from `(*armruntime.Poller[PackagesClientHardDeleteResponse], error)` to `(*runtime.Poller[PackagesClientHardDeleteResponse], error)` +- Function `*PackagesClient.BeginDelete` return value(s) have been changed from `(*armruntime.Poller[PackagesClientDeleteResponse], error)` to `(*runtime.Poller[PackagesClientDeleteResponse], error)` +- Function `*AccountsClient.BeginUpdate` return value(s) have been changed from `(*armruntime.Poller[AccountsClientUpdateResponse], error)` to `(*runtime.Poller[AccountsClientUpdateResponse], error)` +- Function `*AccountsClient.BeginCreate` return value(s) have been changed from `(*armruntime.Poller[AccountsClientCreateResponse], error)` to `(*runtime.Poller[AccountsClientCreateResponse], error)` +- Function `*PackagesClient.BeginUpdate` return value(s) have been changed from `(*armruntime.Poller[PackagesClientUpdateResponse], error)` to `(*runtime.Poller[PackagesClientUpdateResponse], error)` +- Function `*AccountsClient.BeginDelete` return value(s) have been changed from `(*armruntime.Poller[AccountsClientDeleteResponse], error)` to `(*runtime.Poller[AccountsClientDeleteResponse], error)` +- Function `*PackagesClient.BeginCreate` return value(s) have been changed from `(*armruntime.Poller[PackagesClientCreateResponse], error)` to `(*runtime.Poller[PackagesClientCreateResponse], error)` +- Function `*CustomerEventsClient.BeginCreate` return value(s) have been changed from `(*armruntime.Poller[CustomerEventsClientCreateResponse], error)` to `(*runtime.Poller[CustomerEventsClientCreateResponse], error)` +- Function `*AccountsClient.BeginOffboard` return value(s) have been changed from `(*armruntime.Poller[AccountsClientOffboardResponse], error)` to `(*runtime.Poller[AccountsClientOffboardResponse], error)` +- Function `*CustomerEventsClient.BeginDelete` return value(s) have been changed from `(*armruntime.Poller[CustomerEventsClientDeleteResponse], error)` to `(*runtime.Poller[CustomerEventsClientDeleteResponse], error)` +- Function `AccountSKUListResult.MarshalJSON` has been removed +- Function `AccountUsageDataList.MarshalJSON` has been removed +- Function `DownloadURLResponse.MarshalJSON` has been removed +- Function `AvailableOSListResult.MarshalJSON` has been removed +- Function `TestTypeListResult.MarshalJSON` has been removed +- Function `EmailEventListResult.MarshalJSON` has been removed +- Function `ErrorDefinition.MarshalJSON` has been removed +- Function `TestSummaryListResult.MarshalJSON` has been removed +- Function `PackageListResult.MarshalJSON` has been removed +- Function `AnalysisResultListResult.MarshalJSON` has been removed +- Function `FavoriteProcessListResult.MarshalJSON` has been removed +- Function `OSUpdateListResult.MarshalJSON` has been removed +- Function `TestResultListResult.MarshalJSON` has been removed +- Function `CustomerEventListResult.MarshalJSON` has been removed +- Function `FlightingRingListResult.MarshalJSON` has been removed +- Function `AccountListResult.MarshalJSON` has been removed +- Function `OperationListResult.MarshalJSON` has been removed + + ## 0.4.0 (2022-04-18) ### Breaking Changes diff --git a/sdk/resourcemanager/testbase/armtestbase/autorest.md b/sdk/resourcemanager/testbase/armtestbase/autorest.md index a968a2453365..8bcc4d588079 100644 --- a/sdk/resourcemanager/testbase/armtestbase/autorest.md +++ b/sdk/resourcemanager/testbase/armtestbase/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/f92aaf88f4c9d1ffb9a014eba196d887a9288c3a/specification/testbase/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/f92aaf88f4c9d1ffb9a014eba196d887a9288c3a/specification/testbase/resource-manager/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/testbase/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/testbase/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/testbase/armtestbase/go.mod b/sdk/resourcemanager/testbase/armtestbase/go.mod index 7d2bc059c7ff..f8d1d2ce41a9 100644 --- a/sdk/resourcemanager/testbase/armtestbase/go.mod +++ b/sdk/resourcemanager/testbase/armtestbase/go.mod @@ -3,19 +3,19 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/testbase/armtestbas go 1.18 require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0 + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 ) require ( - github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1 // indirect + github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 // indirect github.com/golang-jwt/jwt v3.2.1+incompatible // indirect github.com/google/uuid v1.1.1 // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect - golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 // indirect - golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f // indirect - golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 // indirect + golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 // indirect + golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect + golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect golang.org/x/text v0.3.7 // indirect ) diff --git a/sdk/resourcemanager/testbase/armtestbase/go.sum b/sdk/resourcemanager/testbase/armtestbase/go.sum index 56d1c32628ae..ed5b814680ee 100644 --- a/sdk/resourcemanager/testbase/armtestbase/go.sum +++ b/sdk/resourcemanager/testbase/armtestbase/go.sum @@ -1,15 +1,13 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0 h1:D7l5jspkc4kwBYRWoZE4DQnu6LVpLwDsMZjBKS4wZLQ= -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0/go.mod h1:w5pDIZuawUmY3Bj4tVx3Xb8KS96ToB0j315w9rqpAg0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0 h1:NVS/4LOQfkBpk+B1VopIzv1ptmYeEskA8w/3K/w7vjo= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0/go.mod h1:RG0cZndeZM17StwohYclmcXSr4oOJ8b1I5hB8llIc6Y= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1 h1:sLZ/Y+P/5RRtsXWylBjB5lkgixYfm0MQPiwrSX//JSo= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 h1:sVPhtT2qjO86rTUaWMr4WoES4TkjGnzcioXcnHV9s5k= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 h1:Yoicul8bnVdQrhDMTHxdEckRGX01XvwXDHUT9zYZ3k0= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0/go.mod h1:+6sju8gk8FRmSajX3Oz4G5Gm7P+mbqE9FVaXXFYTkCM= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c= github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= @@ -17,37 +15,19 @@ github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNmw2api+jEfxLoykJVice/E= -golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f h1:OfiFi4JbukWwe3lzw+xunroH1mnC1e2Gy5cxNJApiSY= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 h1:Tgea0cVUD0ivh5ADBX4WwuI12DUd2to3nCYe2eayMIw= +golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= +golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 h1:id054HUawV2/6IGm2IV8KZQjqtwAOo2CYlOToYqa0d0= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= diff --git a/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_analysisresults_client_test.go b/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_analysisresults_client_test.go index 20e6795fa991..018d1eccc0cd 100644 --- a/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_analysisresults_client_test.go +++ b/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_analysisresults_client_test.go @@ -23,21 +23,20 @@ func ExampleAnalysisResultsClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armtestbase.NewAnalysisResultsClient("", cred, nil) + client, err := armtestbase.NewAnalysisResultsClient("476f61a4-952c-422a-b4db-568a828f35df", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("", - "", - "", - "", + pager := client.NewListPager("contoso-rg1", + "contoso-testBaseAccount1", + "contoso-package2", + "Windows-10-1909-Test-Id", armtestbase.AnalysisResultTypeCPURegression, nil) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) - return } for _, v := range nextResult.Value { // TODO: use page item @@ -53,15 +52,15 @@ func ExampleAnalysisResultsClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armtestbase.NewAnalysisResultsClient("", cred, nil) + client, err := armtestbase.NewAnalysisResultsClient("476f61a4-952c-422a-b4db-568a828f35df", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.Get(ctx, - "", - "", - "", - "", + "contoso-rg1", + "contoso-testBaseAccount1", + "contoso-package2", + "Windows-10-1909-Test-Id", armtestbase.AnalysisResultNameCPURegression, nil) if err != nil { diff --git a/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_availableos_client_test.go b/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_availableos_client_test.go index ebffe0f8faaf..bc6ce5e10242 100644 --- a/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_availableos_client_test.go +++ b/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_availableos_client_test.go @@ -23,19 +23,18 @@ func ExampleAvailableOSClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armtestbase.NewAvailableOSClient("", cred, nil) + client, err := armtestbase.NewAvailableOSClient("476f61a4-952c-422a-b4db-568a828f35df", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("", - "", + pager := client.NewListPager("contoso-rg", + "contoso-testBaseAccount", armtestbase.OsUpdateTypeSecurityUpdate, nil) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) - return } for _, v := range nextResult.Value { // TODO: use page item @@ -51,14 +50,14 @@ func ExampleAvailableOSClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armtestbase.NewAvailableOSClient("", cred, nil) + client, err := armtestbase.NewAvailableOSClient("476f61a4-952c-422a-b4db-568a828f35df", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.Get(ctx, - "", - "", - "", + "contoso-rg", + "contoso-testBaseAccount", + "Windows-10-2004", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) diff --git a/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_customerevents_client_test.go b/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_customerevents_client_test.go index 5bdb7b4b4fc7..96c49f1c5d1f 100644 --- a/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_customerevents_client_test.go +++ b/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_customerevents_client_test.go @@ -12,8 +12,6 @@ import ( "context" "log" - "time" - "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/testbase/armtestbase" @@ -26,18 +24,17 @@ func ExampleCustomerEventsClient_NewListByTestBaseAccountPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armtestbase.NewCustomerEventsClient("", cred, nil) + client, err := armtestbase.NewCustomerEventsClient("476f61a4-952c-422a-b4db-568a828f35df", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListByTestBaseAccountPager("", - "", + pager := client.NewListByTestBaseAccountPager("contoso-rg1", + "contoso-testBaseAccount1", nil) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) - return } for _, v := range nextResult.Value { // TODO: use page item @@ -53,20 +50,20 @@ func ExampleCustomerEventsClient_BeginCreate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armtestbase.NewCustomerEventsClient("", cred, nil) + client, err := armtestbase.NewCustomerEventsClient("476f61a4-952c-422a-b4db-568a828f35df", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := client.BeginCreate(ctx, - "", - "", - "", + "contoso-rg1", + "contoso-testBaseAccount1", + "WeeklySummary", armtestbase.CustomerEventResource{ Properties: &armtestbase.CustomerEventProperties{ - EventName: to.Ptr(""), + EventName: to.Ptr("WeeklySummary"), Receivers: []*armtestbase.NotificationEventReceiver{ { - ReceiverType: to.Ptr(""), + ReceiverType: to.Ptr("UserObjects"), ReceiverValue: &armtestbase.NotificationReceiverValue{ UserObjectReceiverValue: &armtestbase.UserObjectReceiverValue{ UserObjectIDs: []*string{ @@ -76,7 +73,7 @@ func ExampleCustomerEventsClient_BeginCreate() { }, }, { - ReceiverType: to.Ptr(""), + ReceiverType: to.Ptr("DistributionGroup"), ReceiverValue: &armtestbase.NotificationReceiverValue{ DistributionGroupListReceiverValue: &armtestbase.DistributionGroupListReceiverValue{ DistributionGroups: []*string{ @@ -86,11 +83,11 @@ func ExampleCustomerEventsClient_BeginCreate() { }}, }, }, - &armtestbase.CustomerEventsClientBeginCreateOptions{ResumeToken: ""}) + nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, 30*time.Second) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } @@ -105,19 +102,19 @@ func ExampleCustomerEventsClient_BeginDelete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armtestbase.NewCustomerEventsClient("", cred, nil) + client, err := armtestbase.NewCustomerEventsClient("476f61a4-952c-422a-b4db-568a828f35df", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := client.BeginDelete(ctx, - "", - "", - "", - &armtestbase.CustomerEventsClientBeginDeleteOptions{ResumeToken: ""}) + "contoso-rg1", + "contoso-testBaseAccount1", + "WeeklySummary", + nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, 30*time.Second) + _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } @@ -130,14 +127,14 @@ func ExampleCustomerEventsClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armtestbase.NewCustomerEventsClient("", cred, nil) + client, err := armtestbase.NewCustomerEventsClient("476f61a4-952c-422a-b4db-568a828f35df", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.Get(ctx, - "", - "", - "", + "contoso-rg1", + "contoso-testBaseAccount1", + "WeeklySummary", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) diff --git a/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_emailevents_client_test.go b/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_emailevents_client_test.go index fc600089b97b..dbd6e743924a 100644 --- a/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_emailevents_client_test.go +++ b/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_emailevents_client_test.go @@ -23,18 +23,17 @@ func ExampleEmailEventsClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armtestbase.NewEmailEventsClient("", cred, nil) + client, err := armtestbase.NewEmailEventsClient("476f61a4-952c-422a-b4db-568a828f35df", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("", - "", + pager := client.NewListPager("contoso-rg", + "contoso-testBaseAccount", nil) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) - return } for _, v := range nextResult.Value { // TODO: use page item @@ -50,14 +49,14 @@ func ExampleEmailEventsClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armtestbase.NewEmailEventsClient("", cred, nil) + client, err := armtestbase.NewEmailEventsClient("476f61a4-952c-422a-b4db-568a828f35df", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.Get(ctx, - "", - "", - "", + "contoso-rg", + "contoso-testBaseAccount", + "weekly-summary", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) diff --git a/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_favoriteprocesses_client_test.go b/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_favoriteprocesses_client_test.go index 43c8e4270279..e6e42f5ed704 100644 --- a/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_favoriteprocesses_client_test.go +++ b/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_favoriteprocesses_client_test.go @@ -24,19 +24,18 @@ func ExampleFavoriteProcessesClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armtestbase.NewFavoriteProcessesClient("", cred, nil) + client, err := armtestbase.NewFavoriteProcessesClient("476f61a4-952c-422a-b4db-568a828f35df", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("", - "", - "", + pager := client.NewListPager("contoso-rg1", + "contoso-testBaseAccount1", + "contoso-package2", nil) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) - return } for _, v := range nextResult.Value { // TODO: use page item @@ -52,18 +51,18 @@ func ExampleFavoriteProcessesClient_Create() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armtestbase.NewFavoriteProcessesClient("", cred, nil) + client, err := armtestbase.NewFavoriteProcessesClient("476f61a4-952c-422a-b4db-568a828f35df", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.Create(ctx, - "", - "", - "", - "", + "contoso-rg1", + "contoso-testBaseAccount1", + "contoso-package2", + "testAppProcess", armtestbase.FavoriteProcessResource{ Properties: &armtestbase.FavoriteProcessProperties{ - ActualProcessName: to.Ptr(""), + ActualProcessName: to.Ptr("testApp&.exe"), }, }, nil) @@ -81,15 +80,15 @@ func ExampleFavoriteProcessesClient_Delete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armtestbase.NewFavoriteProcessesClient("", cred, nil) + client, err := armtestbase.NewFavoriteProcessesClient("476f61a4-952c-422a-b4db-568a828f35df", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = client.Delete(ctx, - "", - "", - "", - "", + "contoso-rg1", + "contoso-testBaseAccount1", + "contoso-package2", + "testAppProcess", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -103,15 +102,15 @@ func ExampleFavoriteProcessesClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armtestbase.NewFavoriteProcessesClient("", cred, nil) + client, err := armtestbase.NewFavoriteProcessesClient("476f61a4-952c-422a-b4db-568a828f35df", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.Get(ctx, - "", - "", - "", - "", + "contoso-rg1", + "contoso-testBaseAccount1", + "contoso-package2", + "testAppProcess", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) diff --git a/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_flightingrings_client_test.go b/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_flightingrings_client_test.go index 3569827352d3..78bd2e612882 100644 --- a/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_flightingrings_client_test.go +++ b/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_flightingrings_client_test.go @@ -23,18 +23,17 @@ func ExampleFlightingRingsClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armtestbase.NewFlightingRingsClient("", cred, nil) + client, err := armtestbase.NewFlightingRingsClient("476f61a4-952c-422a-b4db-568a828f35df", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("", - "", + pager := client.NewListPager("contoso-rg", + "contoso-testBaseAccount", nil) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) - return } for _, v := range nextResult.Value { // TODO: use page item @@ -50,14 +49,14 @@ func ExampleFlightingRingsClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armtestbase.NewFlightingRingsClient("", cred, nil) + client, err := armtestbase.NewFlightingRingsClient("476f61a4-952c-422a-b4db-568a828f35df", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.Get(ctx, - "", - "", - "", + "contoso-rg", + "contoso-testBaseAccount", + "Insider-Beta-Channel", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) diff --git a/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_operations_client_test.go index db3d24aa6f3b..452bf04e4d08 100644 --- a/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_operations_client_test.go +++ b/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_operations_client_test.go @@ -32,7 +32,6 @@ func ExampleOperationsClient_NewListPager() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) - return } for _, v := range nextResult.Value { // TODO: use page item diff --git a/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_osupdates_client_test.go b/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_osupdates_client_test.go index 8b1552a381f5..9fbd9620dd51 100644 --- a/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_osupdates_client_test.go +++ b/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_osupdates_client_test.go @@ -23,20 +23,19 @@ func ExampleOSUpdatesClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armtestbase.NewOSUpdatesClient("", cred, nil) + client, err := armtestbase.NewOSUpdatesClient("476f61a4-952c-422a-b4db-568a828f35df", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("", - "", - "", + pager := client.NewListPager("contoso-rg1", + "contoso-testBaseAccount1", + "contoso-package2", armtestbase.OsUpdateTypeSecurityUpdate, nil) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) - return } for _, v := range nextResult.Value { // TODO: use page item @@ -52,15 +51,15 @@ func ExampleOSUpdatesClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armtestbase.NewOSUpdatesClient("", cred, nil) + client, err := armtestbase.NewOSUpdatesClient("476f61a4-952c-422a-b4db-568a828f35df", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.Get(ctx, - "", - "", - "", - "", + "contoso-rg1", + "contoso-testBaseAccount1", + "contoso-package2", + "Windows-10-2004-2020-12-B-505", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) diff --git a/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_packages_client_test.go b/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_packages_client_test.go index 815a4916b701..1101df0c3bd8 100644 --- a/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_packages_client_test.go +++ b/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_packages_client_test.go @@ -12,8 +12,6 @@ import ( "context" "log" - "time" - "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/testbase/armtestbase" @@ -26,18 +24,17 @@ func ExamplePackagesClient_NewListByTestBaseAccountPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armtestbase.NewPackagesClient("", cred, nil) + client, err := armtestbase.NewPackagesClient("476f61a4-952c-422a-b4db-568a828f35df", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListByTestBaseAccountPager("", - "", + pager := client.NewListByTestBaseAccountPager("contoso-rg1", + "contoso-testBaseAccount1", nil) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) - return } for _, v := range nextResult.Value { // TODO: use page item @@ -53,24 +50,24 @@ func ExamplePackagesClient_BeginCreate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armtestbase.NewPackagesClient("", cred, nil) + client, err := armtestbase.NewPackagesClient("476f61a4-952c-422a-b4db-568a828f35df", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := client.BeginCreate(ctx, - "", - "", - "", + "contoso-rg1", + "contoso-testBaseAccount1", + "contoso-package2", armtestbase.PackageResource{ - Location: to.Ptr(""), + Location: to.Ptr("westus"), Tags: map[string]*string{}, Properties: &armtestbase.PackageProperties{ - ApplicationName: to.Ptr(""), - BlobPath: to.Ptr(""), - FlightingRing: to.Ptr(""), + ApplicationName: to.Ptr("contoso-package2"), + BlobPath: to.Ptr("storageAccountPath/package.zip"), + FlightingRing: to.Ptr("Insider Beta Channel"), TargetOSList: []*armtestbase.TargetOSInfo{ { - OSUpdateType: to.Ptr(""), + OSUpdateType: to.Ptr("Security updates"), TargetOSs: []*string{ to.Ptr("Windows 10 2004"), to.Ptr("Windows 10 1903")}, @@ -81,11 +78,11 @@ func ExamplePackagesClient_BeginCreate() { TestType: to.Ptr(armtestbase.TestTypeOutOfBoxTest), Commands: []*armtestbase.Command{ { - Name: to.Ptr(""), + Name: to.Ptr("Install"), Action: to.Ptr(armtestbase.ActionInstall), AlwaysRun: to.Ptr(true), ApplyUpdateBefore: to.Ptr(false), - Content: to.Ptr(""), + Content: to.Ptr("app/scripts/install/job.ps1"), ContentType: to.Ptr(armtestbase.ContentTypePath), MaxRunTime: to.Ptr[int32](1800), RestartAfter: to.Ptr(true), @@ -93,11 +90,11 @@ func ExamplePackagesClient_BeginCreate() { RunElevated: to.Ptr(true), }, { - Name: to.Ptr(""), + Name: to.Ptr("Launch"), Action: to.Ptr(armtestbase.ActionLaunch), AlwaysRun: to.Ptr(false), ApplyUpdateBefore: to.Ptr(true), - Content: to.Ptr(""), + Content: to.Ptr("app/scripts/launch/job.ps1"), ContentType: to.Ptr(armtestbase.ContentTypePath), MaxRunTime: to.Ptr[int32](1800), RestartAfter: to.Ptr(false), @@ -105,11 +102,11 @@ func ExamplePackagesClient_BeginCreate() { RunElevated: to.Ptr(true), }, { - Name: to.Ptr(""), + Name: to.Ptr("Close"), Action: to.Ptr(armtestbase.ActionClose), AlwaysRun: to.Ptr(false), ApplyUpdateBefore: to.Ptr(false), - Content: to.Ptr(""), + Content: to.Ptr("app/scripts/close/job.ps1"), ContentType: to.Ptr(armtestbase.ContentTypePath), MaxRunTime: to.Ptr[int32](1800), RestartAfter: to.Ptr(false), @@ -117,11 +114,11 @@ func ExamplePackagesClient_BeginCreate() { RunElevated: to.Ptr(true), }, { - Name: to.Ptr(""), + Name: to.Ptr("Uninstall"), Action: to.Ptr(armtestbase.ActionUninstall), AlwaysRun: to.Ptr(true), ApplyUpdateBefore: to.Ptr(false), - Content: to.Ptr(""), + Content: to.Ptr("app/scripts/uninstall/job.ps1"), ContentType: to.Ptr(armtestbase.ContentTypePath), MaxRunTime: to.Ptr[int32](1800), RestartAfter: to.Ptr(false), @@ -129,14 +126,14 @@ func ExamplePackagesClient_BeginCreate() { RunElevated: to.Ptr(true), }}, }}, - Version: to.Ptr(""), + Version: to.Ptr("1.0.0"), }, }, - &armtestbase.PackagesClientBeginCreateOptions{ResumeToken: ""}) + nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, 30*time.Second) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } @@ -151,22 +148,22 @@ func ExamplePackagesClient_BeginUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armtestbase.NewPackagesClient("", cred, nil) + client, err := armtestbase.NewPackagesClient("476f61a4-952c-422a-b4db-568a828f35df", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := client.BeginUpdate(ctx, - "", - "", - "", + "contoso-rg1", + "contoso-testBaseAccount1", + "contoso-package2", armtestbase.PackageUpdateParameters{ Properties: &armtestbase.PackageUpdateParameterProperties{ - BlobPath: to.Ptr(""), - FlightingRing: to.Ptr(""), + BlobPath: to.Ptr("storageAccountPath/package.zip"), + FlightingRing: to.Ptr("Insider Beta Channel"), IsEnabled: to.Ptr(false), TargetOSList: []*armtestbase.TargetOSInfo{ { - OSUpdateType: to.Ptr(""), + OSUpdateType: to.Ptr("Security updates"), TargetOSs: []*string{ to.Ptr("Windows 10 2004"), to.Ptr("Windows 10 1903")}, @@ -177,11 +174,11 @@ func ExamplePackagesClient_BeginUpdate() { TestType: to.Ptr(armtestbase.TestTypeOutOfBoxTest), Commands: []*armtestbase.Command{ { - Name: to.Ptr(""), + Name: to.Ptr("Install"), Action: to.Ptr(armtestbase.ActionInstall), AlwaysRun: to.Ptr(true), ApplyUpdateBefore: to.Ptr(false), - Content: to.Ptr(""), + Content: to.Ptr("app/scripts/install/job.ps1"), ContentType: to.Ptr(armtestbase.ContentTypePath), MaxRunTime: to.Ptr[int32](1800), RestartAfter: to.Ptr(true), @@ -189,11 +186,11 @@ func ExamplePackagesClient_BeginUpdate() { RunElevated: to.Ptr(true), }, { - Name: to.Ptr(""), + Name: to.Ptr("Launch"), Action: to.Ptr(armtestbase.ActionLaunch), AlwaysRun: to.Ptr(false), ApplyUpdateBefore: to.Ptr(true), - Content: to.Ptr(""), + Content: to.Ptr("app/scripts/launch/job.ps1"), ContentType: to.Ptr(armtestbase.ContentTypePath), MaxRunTime: to.Ptr[int32](1800), RestartAfter: to.Ptr(false), @@ -201,11 +198,11 @@ func ExamplePackagesClient_BeginUpdate() { RunElevated: to.Ptr(true), }, { - Name: to.Ptr(""), + Name: to.Ptr("Close"), Action: to.Ptr(armtestbase.ActionClose), AlwaysRun: to.Ptr(false), ApplyUpdateBefore: to.Ptr(false), - Content: to.Ptr(""), + Content: to.Ptr("app/scripts/close/job.ps1"), ContentType: to.Ptr(armtestbase.ContentTypePath), MaxRunTime: to.Ptr[int32](1800), RestartAfter: to.Ptr(false), @@ -213,11 +210,11 @@ func ExamplePackagesClient_BeginUpdate() { RunElevated: to.Ptr(true), }, { - Name: to.Ptr(""), + Name: to.Ptr("Uninstall"), Action: to.Ptr(armtestbase.ActionUninstall), AlwaysRun: to.Ptr(true), ApplyUpdateBefore: to.Ptr(false), - Content: to.Ptr(""), + Content: to.Ptr("app/scripts/uninstall/job.ps1"), ContentType: to.Ptr(armtestbase.ContentTypePath), MaxRunTime: to.Ptr[int32](1800), RestartAfter: to.Ptr(false), @@ -228,11 +225,11 @@ func ExamplePackagesClient_BeginUpdate() { }, Tags: map[string]*string{}, }, - &armtestbase.PackagesClientBeginUpdateOptions{ResumeToken: ""}) + nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, 30*time.Second) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } @@ -247,19 +244,19 @@ func ExamplePackagesClient_BeginDelete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armtestbase.NewPackagesClient("", cred, nil) + client, err := armtestbase.NewPackagesClient("476f61a4-952c-422a-b4db-568a828f35df", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := client.BeginDelete(ctx, - "", - "", - "", - &armtestbase.PackagesClientBeginDeleteOptions{ResumeToken: ""}) + "contoso-rg1", + "contoso-testBaseAccount1", + "contoso-package2", + nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, 30*time.Second) + _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } @@ -272,14 +269,14 @@ func ExamplePackagesClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armtestbase.NewPackagesClient("", cred, nil) + client, err := armtestbase.NewPackagesClient("476f61a4-952c-422a-b4db-568a828f35df", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.Get(ctx, - "", - "", - "", + "contoso-rg1", + "contoso-testBaseAccount1", + "contoso-package2", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -295,19 +292,19 @@ func ExamplePackagesClient_BeginHardDelete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armtestbase.NewPackagesClient("", cred, nil) + client, err := armtestbase.NewPackagesClient("476f61a4-952c-422a-b4db-568a828f35df", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := client.BeginHardDelete(ctx, - "", - "", - "", - &armtestbase.PackagesClientBeginHardDeleteOptions{ResumeToken: ""}) + "contoso-rg1", + "contoso-testBaseAccount1", + "contoso-package2", + nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, 30*time.Second) + _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } @@ -320,14 +317,14 @@ func ExamplePackagesClient_GetDownloadURL() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armtestbase.NewPackagesClient("", cred, nil) + client, err := armtestbase.NewPackagesClient("476f61a4-952c-422a-b4db-568a828f35df", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.GetDownloadURL(ctx, - "", - "", - "", + "contoso-rg1", + "contoso-testBaseAccount1", + "contoso-package2", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) diff --git a/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_skus_client_test.go b/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_skus_client_test.go index 05871719dd2c..4b66a2651cfd 100644 --- a/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_skus_client_test.go +++ b/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_skus_client_test.go @@ -23,7 +23,7 @@ func ExampleSKUsClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armtestbase.NewSKUsClient("", cred, nil) + client, err := armtestbase.NewSKUsClient("476f61a4-952c-422a-b4db-568a828f35df", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -32,7 +32,6 @@ func ExampleSKUsClient_NewListPager() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) - return } for _, v := range nextResult.Value { // TODO: use page item diff --git a/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_testbaseaccounts_client_test.go b/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_testbaseaccounts_client_test.go index 40cd3c7147d1..7df140b10c53 100644 --- a/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_testbaseaccounts_client_test.go +++ b/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_testbaseaccounts_client_test.go @@ -12,8 +12,6 @@ import ( "context" "log" - "time" - "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/testbase/armtestbase" @@ -26,7 +24,7 @@ func ExampleAccountsClient_NewListBySubscriptionPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armtestbase.NewAccountsClient("", cred, nil) + client, err := armtestbase.NewAccountsClient("476f61a4-952c-422a-b4db-568a828f35df", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -35,7 +33,6 @@ func ExampleAccountsClient_NewListBySubscriptionPager() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) - return } for _, v := range nextResult.Value { // TODO: use page item @@ -51,17 +48,16 @@ func ExampleAccountsClient_NewListByResourceGroupPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armtestbase.NewAccountsClient("", cred, nil) + client, err := armtestbase.NewAccountsClient("476f61a4-952c-422a-b4db-568a828f35df", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListByResourceGroupPager("", + pager := client.NewListByResourceGroupPager("contoso-rg1", &armtestbase.AccountsClientListByResourceGroupOptions{GetDeleted: nil}) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) - return } for _, v := range nextResult.Value { // TODO: use page item @@ -77,29 +73,27 @@ func ExampleAccountsClient_BeginCreate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armtestbase.NewAccountsClient("", cred, nil) + client, err := armtestbase.NewAccountsClient("476f61a4-952c-422a-b4db-568a828f35df", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := client.BeginCreate(ctx, - "", - "", + "contoso-rg1", + "contoso-testBaseAccount1", armtestbase.AccountResource{ - Location: to.Ptr(""), + Location: to.Ptr("westus"), Properties: &armtestbase.AccountResourceProperties{ SKU: &armtestbase.AccountSKU{ - Name: to.Ptr(""), + Name: to.Ptr("S0"), Tier: to.Ptr(armtestbase.TierStandard), }, }, }, - &armtestbase.AccountsClientBeginCreateOptions{Restore: nil, - ResumeToken: "", - }) + &armtestbase.AccountsClientBeginCreateOptions{Restore: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, 30*time.Second) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } @@ -114,26 +108,26 @@ func ExampleAccountsClient_BeginUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armtestbase.NewAccountsClient("", cred, nil) + client, err := armtestbase.NewAccountsClient("476f61a4-952c-422a-b4db-568a828f35df", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := client.BeginUpdate(ctx, - "", - "", + "contoso-rg1", + "contoso-testBaseAccount1", armtestbase.AccountUpdateParameters{ Properties: &armtestbase.AccountUpdateParameterProperties{ SKU: &armtestbase.AccountSKU{ - Name: to.Ptr(""), + Name: to.Ptr("S0"), Tier: to.Ptr(armtestbase.TierStandard), }, }, }, - &armtestbase.AccountsClientBeginUpdateOptions{ResumeToken: ""}) + nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, 30*time.Second) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } @@ -148,18 +142,18 @@ func ExampleAccountsClient_BeginDelete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armtestbase.NewAccountsClient("", cred, nil) + client, err := armtestbase.NewAccountsClient("476f61a4-952c-422a-b4db-568a828f35df", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := client.BeginDelete(ctx, - "", - "", - &armtestbase.AccountsClientBeginDeleteOptions{ResumeToken: ""}) + "contoso-rg1", + "contoso-testBaseAccount1", + nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, 30*time.Second) + _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } @@ -172,13 +166,13 @@ func ExampleAccountsClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armtestbase.NewAccountsClient("", cred, nil) + client, err := armtestbase.NewAccountsClient("476f61a4-952c-422a-b4db-568a828f35df", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.Get(ctx, - "", - "", + "contoso-rg1", + "contoso-testBaseAccount1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -194,18 +188,18 @@ func ExampleAccountsClient_BeginOffboard() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armtestbase.NewAccountsClient("", cred, nil) + client, err := armtestbase.NewAccountsClient("476f61a4-952c-422a-b4db-568a828f35df", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := client.BeginOffboard(ctx, - "", - "", - &armtestbase.AccountsClientBeginOffboardOptions{ResumeToken: ""}) + "contoso-rg1", + "contoso-testBaseAccount1", + nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, 30*time.Second) + _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } @@ -218,18 +212,18 @@ func ExampleAccountsClient_CheckPackageNameAvailability() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armtestbase.NewAccountsClient("", cred, nil) + client, err := armtestbase.NewAccountsClient("476f61a4-952c-422a-b4db-568a828f35df", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.CheckPackageNameAvailability(ctx, - "", - "", + "contoso-rg1", + "contoso-testBaseAccount1", armtestbase.PackageCheckNameAvailabilityParameters{ - Name: to.Ptr(""), - Type: to.Ptr(""), - ApplicationName: to.Ptr(""), - Version: to.Ptr(""), + Name: to.Ptr("testApp"), + Type: to.Ptr("Microsoft.TestBase/testBaseAccounts/packages"), + ApplicationName: to.Ptr("testApp"), + Version: to.Ptr("1.0.0"), }, nil) if err != nil { diff --git a/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_testresults_client_test.go b/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_testresults_client_test.go index 081eb37c0c08..96e6fe97e25d 100644 --- a/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_testresults_client_test.go +++ b/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_testresults_client_test.go @@ -24,20 +24,19 @@ func ExampleTestResultsClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armtestbase.NewTestResultsClient("", cred, nil) + client, err := armtestbase.NewTestResultsClient("476f61a4-952c-422a-b4db-568a828f35df", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("", - "", - "", + pager := client.NewListPager("contoso-rg1", + "contoso-testBaseAccount1", + "contoso-package2", armtestbase.OsUpdateTypeSecurityUpdate, - &armtestbase.TestResultsClientListOptions{Filter: to.Ptr("")}) + &armtestbase.TestResultsClientListOptions{Filter: to.Ptr("osName eq 'Windows 10 2004' and releaseName eq '2020.11B'")}) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) - return } for _, v := range nextResult.Value { // TODO: use page item @@ -53,15 +52,15 @@ func ExampleTestResultsClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armtestbase.NewTestResultsClient("", cred, nil) + client, err := armtestbase.NewTestResultsClient("476f61a4-952c-422a-b4db-568a828f35df", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.Get(ctx, - "", - "", - "", - "", + "contoso-rg1", + "contoso-testBaseAccount1", + "contoso-package2", + "Windows-10-1909-99b1f80d-03a9-4148-997f-806ba5bac8e0", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -77,15 +76,15 @@ func ExampleTestResultsClient_GetDownloadURL() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armtestbase.NewTestResultsClient("", cred, nil) + client, err := armtestbase.NewTestResultsClient("476f61a4-952c-422a-b4db-568a828f35df", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.GetDownloadURL(ctx, - "", - "", - "", - "", + "contoso-rg1", + "contoso-testBaseAccount1", + "contoso-package2", + "Windows-10-1909-99b1f80d-03a9-4148-997f-806ba5bac8e0", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -101,15 +100,15 @@ func ExampleTestResultsClient_GetVideoDownloadURL() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armtestbase.NewTestResultsClient("", cred, nil) + client, err := armtestbase.NewTestResultsClient("476f61a4-952c-422a-b4db-568a828f35df", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.GetVideoDownloadURL(ctx, - "", - "", - "", - "", + "contoso-rg1", + "contoso-testBaseAccount1", + "contoso-package2", + "Windows-10-1909-99b1f80d-03a9-4148-997f-806ba5bac8e0", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) diff --git a/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_testsummaries_client_test.go b/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_testsummaries_client_test.go index 9cabcf545b39..30c55eac21e3 100644 --- a/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_testsummaries_client_test.go +++ b/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_testsummaries_client_test.go @@ -23,18 +23,17 @@ func ExampleTestSummariesClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armtestbase.NewTestSummariesClient("", cred, nil) + client, err := armtestbase.NewTestSummariesClient("476f61a4-952c-422a-b4db-568a828f35df", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("", - "", + pager := client.NewListPager("contoso-rg1", + "contoso-testBaseAccount1", nil) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) - return } for _, v := range nextResult.Value { // TODO: use page item @@ -50,14 +49,14 @@ func ExampleTestSummariesClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armtestbase.NewTestSummariesClient("", cred, nil) + client, err := armtestbase.NewTestSummariesClient("476f61a4-952c-422a-b4db-568a828f35df", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.Get(ctx, - "", - "", - "", + "contoso-rg1", + "contoso-testBaseAccount1", + "contoso-package2-096bffb5-5d3d-4305-a66a-953372ed6e88", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) diff --git a/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_testtypes_client_test.go b/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_testtypes_client_test.go index f5bf8b5ba9ea..193c3dfee1cf 100644 --- a/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_testtypes_client_test.go +++ b/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_testtypes_client_test.go @@ -23,18 +23,17 @@ func ExampleTestTypesClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armtestbase.NewTestTypesClient("", cred, nil) + client, err := armtestbase.NewTestTypesClient("476f61a4-952c-422a-b4db-568a828f35df", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("", - "", + pager := client.NewListPager("contoso-rg", + "contoso-testBaseAccount", nil) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) - return } for _, v := range nextResult.Value { // TODO: use page item @@ -50,14 +49,14 @@ func ExampleTestTypesClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armtestbase.NewTestTypesClient("", cred, nil) + client, err := armtestbase.NewTestTypesClient("476f61a4-952c-422a-b4db-568a828f35df", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.Get(ctx, - "", - "", - "", + "contoso-rg", + "contoso-testBaseAccount", + "Functional-Test", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) diff --git a/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_usage_client_test.go b/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_usage_client_test.go index d608689494c3..48648f2ef79f 100644 --- a/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_usage_client_test.go +++ b/sdk/resourcemanager/testbase/armtestbase/ze_generated_example_usage_client_test.go @@ -23,18 +23,17 @@ func ExampleUsageClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armtestbase.NewUsageClient("", cred, nil) + client, err := armtestbase.NewUsageClient("476f61a4-952c-422a-b4db-568a828f35df", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("", - "", + pager := client.NewListPager("contoso-rg1", + "contoso-testBaseAccount1", &armtestbase.UsageClientListOptions{Filter: nil}) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) - return } for _, v := range nextResult.Value { // TODO: use page item diff --git a/sdk/resourcemanager/testbase/armtestbase/zz_generated_accounts_client.go b/sdk/resourcemanager/testbase/armtestbase/zz_generated_accounts_client.go index ea0e9f481b32..682e6f3478e9 100644 --- a/sdk/resourcemanager/testbase/armtestbase/zz_generated_accounts_client.go +++ b/sdk/resourcemanager/testbase/armtestbase/zz_generated_accounts_client.go @@ -39,7 +39,7 @@ func NewAccountsClient(subscriptionID string, credential azcore.TokenCredential, if options == nil { options = &arm.ClientOptions{} } - ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { ep = c.Endpoint } @@ -57,6 +57,7 @@ func NewAccountsClient(subscriptionID string, credential azcore.TokenCredential, // CheckPackageNameAvailability - Checks that the Test Base Package name and version is valid and is not already in use. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview // resourceGroupName - The name of the resource group that contains the resource. // testBaseAccountName - The resource name of the Test Base Account. // parameters - Parameters supplied to the Test Base Package CheckNameAvailability operation. @@ -99,7 +100,7 @@ func (client *AccountsClient) checkPackageNameAvailabilityCreateRequest(ctx cont reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-12-16-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) } @@ -114,26 +115,28 @@ func (client *AccountsClient) checkPackageNameAvailabilityHandleResponse(resp *h // BeginCreate - Create or replace (overwrite/recreate, with potential downtime) a Test Base Account in the specified subscription. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview // resourceGroupName - The name of the resource group that contains the resource. // testBaseAccountName - The resource name of the Test Base Account. // parameters - Parameters supplied to create a Test Base Account. // options - AccountsClientBeginCreateOptions contains the optional parameters for the AccountsClient.BeginCreate method. -func (client *AccountsClient) BeginCreate(ctx context.Context, resourceGroupName string, testBaseAccountName string, parameters AccountResource, options *AccountsClientBeginCreateOptions) (*armruntime.Poller[AccountsClientCreateResponse], error) { +func (client *AccountsClient) BeginCreate(ctx context.Context, resourceGroupName string, testBaseAccountName string, parameters AccountResource, options *AccountsClientBeginCreateOptions) (*runtime.Poller[AccountsClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.create(ctx, resourceGroupName, testBaseAccountName, parameters, options) if err != nil { return nil, err } - return armruntime.NewPoller(resp, client.pl, &armruntime.NewPollerOptions[AccountsClientCreateResponse]{ - FinalStateVia: armruntime.FinalStateViaAzureAsyncOp, + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[AccountsClientCreateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) } else { - return armruntime.NewPollerFromResumeToken[AccountsClientCreateResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[AccountsClientCreateResponse](options.ResumeToken, client.pl, nil) } } // Create - Create or replace (overwrite/recreate, with potential downtime) a Test Base Account in the specified subscription. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview func (client *AccountsClient) create(ctx context.Context, resourceGroupName string, testBaseAccountName string, parameters AccountResource, options *AccountsClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, testBaseAccountName, parameters, options) if err != nil { @@ -174,31 +177,33 @@ func (client *AccountsClient) createCreateRequest(ctx context.Context, resourceG } reqQP.Set("api-version", "2020-12-16-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) } // BeginDelete - Deletes a Test Base Account. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview // resourceGroupName - The name of the resource group that contains the resource. // testBaseAccountName - The resource name of the Test Base Account. // options - AccountsClientBeginDeleteOptions contains the optional parameters for the AccountsClient.BeginDelete method. -func (client *AccountsClient) BeginDelete(ctx context.Context, resourceGroupName string, testBaseAccountName string, options *AccountsClientBeginDeleteOptions) (*armruntime.Poller[AccountsClientDeleteResponse], error) { +func (client *AccountsClient) BeginDelete(ctx context.Context, resourceGroupName string, testBaseAccountName string, options *AccountsClientBeginDeleteOptions) (*runtime.Poller[AccountsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, testBaseAccountName, options) if err != nil { return nil, err } - return armruntime.NewPoller(resp, client.pl, &armruntime.NewPollerOptions[AccountsClientDeleteResponse]{ - FinalStateVia: armruntime.FinalStateViaAzureAsyncOp, + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[AccountsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) } else { - return armruntime.NewPollerFromResumeToken[AccountsClientDeleteResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[AccountsClientDeleteResponse](options.ResumeToken, client.pl, nil) } } // Delete - Deletes a Test Base Account. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview func (client *AccountsClient) deleteOperation(ctx context.Context, resourceGroupName string, testBaseAccountName string, options *AccountsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, testBaseAccountName, options) if err != nil { @@ -236,12 +241,13 @@ func (client *AccountsClient) deleteCreateRequest(ctx context.Context, resourceG reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-12-16-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // Get - Gets a Test Base Account. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview // resourceGroupName - The name of the resource group that contains the resource. // testBaseAccountName - The resource name of the Test Base Account. // options - AccountsClientGetOptions contains the optional parameters for the AccountsClient.Get method. @@ -282,7 +288,7 @@ func (client *AccountsClient) getCreateRequest(ctx context.Context, resourceGrou reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-12-16-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -297,6 +303,7 @@ func (client *AccountsClient) getHandleResponse(resp *http.Response) (AccountsCl // GetFileUploadURL - Gets the file upload URL of a Test Base Account. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview // resourceGroupName - The name of the resource group that contains the resource. // testBaseAccountName - The resource name of the Test Base Account. // options - AccountsClientGetFileUploadURLOptions contains the optional parameters for the AccountsClient.GetFileUploadURL @@ -338,7 +345,7 @@ func (client *AccountsClient) getFileUploadURLCreateRequest(ctx context.Context, reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-12-16-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { return req, runtime.MarshalAsJSON(req, *options.Parameters) } @@ -356,11 +363,12 @@ func (client *AccountsClient) getFileUploadURLHandleResponse(resp *http.Response // NewListByResourceGroupPager - Lists all the Test Base Accounts in a resource group. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview // resourceGroupName - The name of the resource group that contains the resource. // options - AccountsClientListByResourceGroupOptions contains the optional parameters for the AccountsClient.ListByResourceGroup // method. func (client *AccountsClient) NewListByResourceGroupPager(resourceGroupName string, options *AccountsClientListByResourceGroupOptions) *runtime.Pager[AccountsClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PageProcessor[AccountsClientListByResourceGroupResponse]{ + return runtime.NewPager(runtime.PagingHandler[AccountsClientListByResourceGroupResponse]{ More: func(page AccountsClientListByResourceGroupResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, @@ -408,7 +416,7 @@ func (client *AccountsClient) listByResourceGroupCreateRequest(ctx context.Conte } reqQP.Set("api-version", "2020-12-16-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -423,10 +431,11 @@ func (client *AccountsClient) listByResourceGroupHandleResponse(resp *http.Respo // NewListBySubscriptionPager - Lists all the Test Base Accounts in a subscription. This API is required by ARM guidelines. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview // options - AccountsClientListBySubscriptionOptions contains the optional parameters for the AccountsClient.ListBySubscription // method. func (client *AccountsClient) NewListBySubscriptionPager(options *AccountsClientListBySubscriptionOptions) *runtime.Pager[AccountsClientListBySubscriptionResponse] { - return runtime.NewPager(runtime.PageProcessor[AccountsClientListBySubscriptionResponse]{ + return runtime.NewPager(runtime.PagingHandler[AccountsClientListBySubscriptionResponse]{ More: func(page AccountsClientListBySubscriptionResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, @@ -470,7 +479,7 @@ func (client *AccountsClient) listBySubscriptionCreateRequest(ctx context.Contex } reqQP.Set("api-version", "2020-12-16-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -485,25 +494,27 @@ func (client *AccountsClient) listBySubscriptionHandleResponse(resp *http.Respon // BeginOffboard - Offboard a Test Base Account. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview // resourceGroupName - The name of the resource group that contains the resource. // testBaseAccountName - The resource name of the Test Base Account. // options - AccountsClientBeginOffboardOptions contains the optional parameters for the AccountsClient.BeginOffboard method. -func (client *AccountsClient) BeginOffboard(ctx context.Context, resourceGroupName string, testBaseAccountName string, options *AccountsClientBeginOffboardOptions) (*armruntime.Poller[AccountsClientOffboardResponse], error) { +func (client *AccountsClient) BeginOffboard(ctx context.Context, resourceGroupName string, testBaseAccountName string, options *AccountsClientBeginOffboardOptions) (*runtime.Poller[AccountsClientOffboardResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.offboard(ctx, resourceGroupName, testBaseAccountName, options) if err != nil { return nil, err } - return armruntime.NewPoller(resp, client.pl, &armruntime.NewPollerOptions[AccountsClientOffboardResponse]{ - FinalStateVia: armruntime.FinalStateViaAzureAsyncOp, + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[AccountsClientOffboardResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) } else { - return armruntime.NewPollerFromResumeToken[AccountsClientOffboardResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[AccountsClientOffboardResponse](options.ResumeToken, client.pl, nil) } } // Offboard - Offboard a Test Base Account. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview func (client *AccountsClient) offboard(ctx context.Context, resourceGroupName string, testBaseAccountName string, options *AccountsClientBeginOffboardOptions) (*http.Response, error) { req, err := client.offboardCreateRequest(ctx, resourceGroupName, testBaseAccountName, options) if err != nil { @@ -541,32 +552,34 @@ func (client *AccountsClient) offboardCreateRequest(ctx context.Context, resourc reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-12-16-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // BeginUpdate - Update an existing Test Base Account. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview // resourceGroupName - The name of the resource group that contains the resource. // testBaseAccountName - The resource name of the Test Base Account. // parameters - Parameters supplied to update a Test Base Account. // options - AccountsClientBeginUpdateOptions contains the optional parameters for the AccountsClient.BeginUpdate method. -func (client *AccountsClient) BeginUpdate(ctx context.Context, resourceGroupName string, testBaseAccountName string, parameters AccountUpdateParameters, options *AccountsClientBeginUpdateOptions) (*armruntime.Poller[AccountsClientUpdateResponse], error) { +func (client *AccountsClient) BeginUpdate(ctx context.Context, resourceGroupName string, testBaseAccountName string, parameters AccountUpdateParameters, options *AccountsClientBeginUpdateOptions) (*runtime.Poller[AccountsClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, testBaseAccountName, parameters, options) if err != nil { return nil, err } - return armruntime.NewPoller(resp, client.pl, &armruntime.NewPollerOptions[AccountsClientUpdateResponse]{ - FinalStateVia: armruntime.FinalStateViaAzureAsyncOp, + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[AccountsClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) } else { - return armruntime.NewPollerFromResumeToken[AccountsClientUpdateResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[AccountsClientUpdateResponse](options.ResumeToken, client.pl, nil) } } // Update - Update an existing Test Base Account. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview func (client *AccountsClient) update(ctx context.Context, resourceGroupName string, testBaseAccountName string, parameters AccountUpdateParameters, options *AccountsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, testBaseAccountName, parameters, options) if err != nil { @@ -604,6 +617,6 @@ func (client *AccountsClient) updateCreateRequest(ctx context.Context, resourceG reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-12-16-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) } diff --git a/sdk/resourcemanager/testbase/armtestbase/zz_generated_analysisresults_client.go b/sdk/resourcemanager/testbase/armtestbase/zz_generated_analysisresults_client.go index 1a61401f7f3c..d9c847bd6333 100644 --- a/sdk/resourcemanager/testbase/armtestbase/zz_generated_analysisresults_client.go +++ b/sdk/resourcemanager/testbase/armtestbase/zz_generated_analysisresults_client.go @@ -38,7 +38,7 @@ func NewAnalysisResultsClient(subscriptionID string, credential azcore.TokenCred if options == nil { options = &arm.ClientOptions{} } - ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { ep = c.Endpoint } @@ -56,6 +56,7 @@ func NewAnalysisResultsClient(subscriptionID string, credential azcore.TokenCred // Get - Gets an Analysis Result of a Test Result by name. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview // resourceGroupName - The name of the resource group that contains the resource. // testBaseAccountName - The resource name of the Test Base Account. // packageName - The resource name of the Test Base Package. @@ -111,7 +112,7 @@ func (client *AnalysisResultsClient) getCreateRequest(ctx context.Context, resou reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-12-16-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -127,6 +128,7 @@ func (client *AnalysisResultsClient) getHandleResponse(resp *http.Response) (Ana // NewListPager - Lists the Analysis Results of a Test Result. The result collection will only contain one element as all // the data will be nested in a singleton object. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview // resourceGroupName - The name of the resource group that contains the resource. // testBaseAccountName - The resource name of the Test Base Account. // packageName - The resource name of the Test Base Package. @@ -134,7 +136,7 @@ func (client *AnalysisResultsClient) getHandleResponse(resp *http.Response) (Ana // analysisResultType - The type of the Analysis Result of a Test Result. // options - AnalysisResultsClientListOptions contains the optional parameters for the AnalysisResultsClient.List method. func (client *AnalysisResultsClient) NewListPager(resourceGroupName string, testBaseAccountName string, packageName string, testResultName string, analysisResultType AnalysisResultType, options *AnalysisResultsClientListOptions) *runtime.Pager[AnalysisResultsClientListResponse] { - return runtime.NewPager(runtime.PageProcessor[AnalysisResultsClientListResponse]{ + return runtime.NewPager(runtime.PagingHandler[AnalysisResultsClientListResponse]{ More: func(page AnalysisResultsClientListResponse) bool { return false }, @@ -186,7 +188,7 @@ func (client *AnalysisResultsClient) listCreateRequest(ctx context.Context, reso reqQP.Set("analysisResultType", string(analysisResultType)) reqQP.Set("api-version", "2020-12-16-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/testbase/armtestbase/zz_generated_availableos_client.go b/sdk/resourcemanager/testbase/armtestbase/zz_generated_availableos_client.go index 7534419916be..e2173f5f45de 100644 --- a/sdk/resourcemanager/testbase/armtestbase/zz_generated_availableos_client.go +++ b/sdk/resourcemanager/testbase/armtestbase/zz_generated_availableos_client.go @@ -38,7 +38,7 @@ func NewAvailableOSClient(subscriptionID string, credential azcore.TokenCredenti if options == nil { options = &arm.ClientOptions{} } - ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { ep = c.Endpoint } @@ -56,6 +56,7 @@ func NewAvailableOSClient(subscriptionID string, credential azcore.TokenCredenti // Get - Gets an available OS to run a package under a Test Base Account. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview // resourceGroupName - The name of the resource group that contains the resource. // testBaseAccountName - The resource name of the Test Base Account. // availableOSResourceName - The resource name of an Available OS. @@ -101,7 +102,7 @@ func (client *AvailableOSClient) getCreateRequest(ctx context.Context, resourceG reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-12-16-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -116,12 +117,13 @@ func (client *AvailableOSClient) getHandleResponse(resp *http.Response) (Availab // NewListPager - Lists all the available OSs to run a package under a Test Base Account. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview // resourceGroupName - The name of the resource group that contains the resource. // testBaseAccountName - The resource name of the Test Base Account. // osUpdateType - The type of the OS Update. // options - AvailableOSClientListOptions contains the optional parameters for the AvailableOSClient.List method. func (client *AvailableOSClient) NewListPager(resourceGroupName string, testBaseAccountName string, osUpdateType OsUpdateType, options *AvailableOSClientListOptions) *runtime.Pager[AvailableOSClientListResponse] { - return runtime.NewPager(runtime.PageProcessor[AvailableOSClientListResponse]{ + return runtime.NewPager(runtime.PagingHandler[AvailableOSClientListResponse]{ More: func(page AvailableOSClientListResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, @@ -171,7 +173,7 @@ func (client *AvailableOSClient) listCreateRequest(ctx context.Context, resource reqQP.Set("osUpdateType", string(osUpdateType)) reqQP.Set("api-version", "2020-12-16-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/testbase/armtestbase/zz_generated_constants.go b/sdk/resourcemanager/testbase/armtestbase/zz_generated_constants.go index e0151cc7c8cf..90d941846c9a 100644 --- a/sdk/resourcemanager/testbase/armtestbase/zz_generated_constants.go +++ b/sdk/resourcemanager/testbase/armtestbase/zz_generated_constants.go @@ -10,7 +10,7 @@ package armtestbase const ( moduleName = "armtestbase" - moduleVersion = "v0.4.0" + moduleVersion = "v0.5.0" ) // Action - The action of the command. diff --git a/sdk/resourcemanager/testbase/armtestbase/zz_generated_customerevents_client.go b/sdk/resourcemanager/testbase/armtestbase/zz_generated_customerevents_client.go index fe07dc7b20d7..939250156780 100644 --- a/sdk/resourcemanager/testbase/armtestbase/zz_generated_customerevents_client.go +++ b/sdk/resourcemanager/testbase/armtestbase/zz_generated_customerevents_client.go @@ -38,7 +38,7 @@ func NewCustomerEventsClient(subscriptionID string, credential azcore.TokenCrede if options == nil { options = &arm.ClientOptions{} } - ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { ep = c.Endpoint } @@ -56,28 +56,30 @@ func NewCustomerEventsClient(subscriptionID string, credential azcore.TokenCrede // BeginCreate - Create or replace a Test Base Customer Event. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview // resourceGroupName - The name of the resource group that contains the resource. // testBaseAccountName - The resource name of the Test Base Account. // customerEventName - The resource name of the Test Base Customer event. // parameters - Parameters supplied to create a Test Base CustomerEvent. // options - CustomerEventsClientBeginCreateOptions contains the optional parameters for the CustomerEventsClient.BeginCreate // method. -func (client *CustomerEventsClient) BeginCreate(ctx context.Context, resourceGroupName string, testBaseAccountName string, customerEventName string, parameters CustomerEventResource, options *CustomerEventsClientBeginCreateOptions) (*armruntime.Poller[CustomerEventsClientCreateResponse], error) { +func (client *CustomerEventsClient) BeginCreate(ctx context.Context, resourceGroupName string, testBaseAccountName string, customerEventName string, parameters CustomerEventResource, options *CustomerEventsClientBeginCreateOptions) (*runtime.Poller[CustomerEventsClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.create(ctx, resourceGroupName, testBaseAccountName, customerEventName, parameters, options) if err != nil { return nil, err } - return armruntime.NewPoller(resp, client.pl, &armruntime.NewPollerOptions[CustomerEventsClientCreateResponse]{ - FinalStateVia: armruntime.FinalStateViaAzureAsyncOp, + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[CustomerEventsClientCreateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) } else { - return armruntime.NewPollerFromResumeToken[CustomerEventsClientCreateResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[CustomerEventsClientCreateResponse](options.ResumeToken, client.pl, nil) } } // Create - Create or replace a Test Base Customer Event. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview func (client *CustomerEventsClient) create(ctx context.Context, resourceGroupName string, testBaseAccountName string, customerEventName string, parameters CustomerEventResource, options *CustomerEventsClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, testBaseAccountName, customerEventName, parameters, options) if err != nil { @@ -119,33 +121,35 @@ func (client *CustomerEventsClient) createCreateRequest(ctx context.Context, res reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-12-16-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) } // BeginDelete - Deletes a Test Base Customer Event. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview // resourceGroupName - The name of the resource group that contains the resource. // testBaseAccountName - The resource name of the Test Base Account. // customerEventName - The resource name of the Test Base Customer event. // options - CustomerEventsClientBeginDeleteOptions contains the optional parameters for the CustomerEventsClient.BeginDelete // method. -func (client *CustomerEventsClient) BeginDelete(ctx context.Context, resourceGroupName string, testBaseAccountName string, customerEventName string, options *CustomerEventsClientBeginDeleteOptions) (*armruntime.Poller[CustomerEventsClientDeleteResponse], error) { +func (client *CustomerEventsClient) BeginDelete(ctx context.Context, resourceGroupName string, testBaseAccountName string, customerEventName string, options *CustomerEventsClientBeginDeleteOptions) (*runtime.Poller[CustomerEventsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, testBaseAccountName, customerEventName, options) if err != nil { return nil, err } - return armruntime.NewPoller(resp, client.pl, &armruntime.NewPollerOptions[CustomerEventsClientDeleteResponse]{ - FinalStateVia: armruntime.FinalStateViaAzureAsyncOp, + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[CustomerEventsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) } else { - return armruntime.NewPollerFromResumeToken[CustomerEventsClientDeleteResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[CustomerEventsClientDeleteResponse](options.ResumeToken, client.pl, nil) } } // Delete - Deletes a Test Base Customer Event. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview func (client *CustomerEventsClient) deleteOperation(ctx context.Context, resourceGroupName string, testBaseAccountName string, customerEventName string, options *CustomerEventsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, testBaseAccountName, customerEventName, options) if err != nil { @@ -187,12 +191,13 @@ func (client *CustomerEventsClient) deleteCreateRequest(ctx context.Context, res reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-12-16-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // Get - Gets a Test Base CustomerEvent. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview // resourceGroupName - The name of the resource group that contains the resource. // testBaseAccountName - The resource name of the Test Base Account. // customerEventName - The resource name of the Test Base Customer event. @@ -238,7 +243,7 @@ func (client *CustomerEventsClient) getCreateRequest(ctx context.Context, resour reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-12-16-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -253,12 +258,13 @@ func (client *CustomerEventsClient) getHandleResponse(resp *http.Response) (Cust // NewListByTestBaseAccountPager - Lists all notification events subscribed under a Test Base Account. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview // resourceGroupName - The name of the resource group that contains the resource. // testBaseAccountName - The resource name of the Test Base Account. // options - CustomerEventsClientListByTestBaseAccountOptions contains the optional parameters for the CustomerEventsClient.ListByTestBaseAccount // method. func (client *CustomerEventsClient) NewListByTestBaseAccountPager(resourceGroupName string, testBaseAccountName string, options *CustomerEventsClientListByTestBaseAccountOptions) *runtime.Pager[CustomerEventsClientListByTestBaseAccountResponse] { - return runtime.NewPager(runtime.PageProcessor[CustomerEventsClientListByTestBaseAccountResponse]{ + return runtime.NewPager(runtime.PagingHandler[CustomerEventsClientListByTestBaseAccountResponse]{ More: func(page CustomerEventsClientListByTestBaseAccountResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, @@ -307,7 +313,7 @@ func (client *CustomerEventsClient) listByTestBaseAccountCreateRequest(ctx conte reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-12-16-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/testbase/armtestbase/zz_generated_emailevents_client.go b/sdk/resourcemanager/testbase/armtestbase/zz_generated_emailevents_client.go index 7e32b18f2cdf..550febc941f8 100644 --- a/sdk/resourcemanager/testbase/armtestbase/zz_generated_emailevents_client.go +++ b/sdk/resourcemanager/testbase/armtestbase/zz_generated_emailevents_client.go @@ -38,7 +38,7 @@ func NewEmailEventsClient(subscriptionID string, credential azcore.TokenCredenti if options == nil { options = &arm.ClientOptions{} } - ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { ep = c.Endpoint } @@ -56,6 +56,7 @@ func NewEmailEventsClient(subscriptionID string, credential azcore.TokenCredenti // Get - Gets a email event of a Test Base Account. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview // resourceGroupName - The name of the resource group that contains the resource. // testBaseAccountName - The resource name of the Test Base Account. // emailEventResourceName - The resource name of an email event. @@ -101,7 +102,7 @@ func (client *EmailEventsClient) getCreateRequest(ctx context.Context, resourceG reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-12-16-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -116,11 +117,12 @@ func (client *EmailEventsClient) getHandleResponse(resp *http.Response) (EmailEv // NewListPager - Lists all the email events of a Test Base Account. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview // resourceGroupName - The name of the resource group that contains the resource. // testBaseAccountName - The resource name of the Test Base Account. // options - EmailEventsClientListOptions contains the optional parameters for the EmailEventsClient.List method. func (client *EmailEventsClient) NewListPager(resourceGroupName string, testBaseAccountName string, options *EmailEventsClientListOptions) *runtime.Pager[EmailEventsClientListResponse] { - return runtime.NewPager(runtime.PageProcessor[EmailEventsClientListResponse]{ + return runtime.NewPager(runtime.PagingHandler[EmailEventsClientListResponse]{ More: func(page EmailEventsClientListResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, @@ -169,7 +171,7 @@ func (client *EmailEventsClient) listCreateRequest(ctx context.Context, resource reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-12-16-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/testbase/armtestbase/zz_generated_favoriteprocesses_client.go b/sdk/resourcemanager/testbase/armtestbase/zz_generated_favoriteprocesses_client.go index c0ca4ca36c12..cbb67bedca72 100644 --- a/sdk/resourcemanager/testbase/armtestbase/zz_generated_favoriteprocesses_client.go +++ b/sdk/resourcemanager/testbase/armtestbase/zz_generated_favoriteprocesses_client.go @@ -38,7 +38,7 @@ func NewFavoriteProcessesClient(subscriptionID string, credential azcore.TokenCr if options == nil { options = &arm.ClientOptions{} } - ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { ep = c.Endpoint } @@ -56,6 +56,7 @@ func NewFavoriteProcessesClient(subscriptionID string, credential azcore.TokenCr // Create - Create or replace a favorite process for a Test Base Package. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview // resourceGroupName - The name of the resource group that contains the resource. // testBaseAccountName - The resource name of the Test Base Account. // packageName - The resource name of the Test Base Package. @@ -110,7 +111,7 @@ func (client *FavoriteProcessesClient) createCreateRequest(ctx context.Context, reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-12-16-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) } @@ -125,6 +126,7 @@ func (client *FavoriteProcessesClient) createHandleResponse(resp *http.Response) // Delete - Deletes a favorite process for a specific package. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview // resourceGroupName - The name of the resource group that contains the resource. // testBaseAccountName - The resource name of the Test Base Account. // packageName - The resource name of the Test Base Package. @@ -178,12 +180,13 @@ func (client *FavoriteProcessesClient) deleteCreateRequest(ctx context.Context, reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-12-16-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // Get - Gets a favorite process for a Test Base Package. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview // resourceGroupName - The name of the resource group that contains the resource. // testBaseAccountName - The resource name of the Test Base Account. // packageName - The resource name of the Test Base Package. @@ -236,7 +239,7 @@ func (client *FavoriteProcessesClient) getCreateRequest(ctx context.Context, res reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-12-16-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -251,12 +254,13 @@ func (client *FavoriteProcessesClient) getHandleResponse(resp *http.Response) (F // NewListPager - Lists the favorite processes for a specific package. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview // resourceGroupName - The name of the resource group that contains the resource. // testBaseAccountName - The resource name of the Test Base Account. // packageName - The resource name of the Test Base Package. // options - FavoriteProcessesClientListOptions contains the optional parameters for the FavoriteProcessesClient.List method. func (client *FavoriteProcessesClient) NewListPager(resourceGroupName string, testBaseAccountName string, packageName string, options *FavoriteProcessesClientListOptions) *runtime.Pager[FavoriteProcessesClientListResponse] { - return runtime.NewPager(runtime.PageProcessor[FavoriteProcessesClientListResponse]{ + return runtime.NewPager(runtime.PagingHandler[FavoriteProcessesClientListResponse]{ More: func(page FavoriteProcessesClientListResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, @@ -309,7 +313,7 @@ func (client *FavoriteProcessesClient) listCreateRequest(ctx context.Context, re reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-12-16-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/testbase/armtestbase/zz_generated_flightingrings_client.go b/sdk/resourcemanager/testbase/armtestbase/zz_generated_flightingrings_client.go index d9b27f8834fa..cc69dd5a5c06 100644 --- a/sdk/resourcemanager/testbase/armtestbase/zz_generated_flightingrings_client.go +++ b/sdk/resourcemanager/testbase/armtestbase/zz_generated_flightingrings_client.go @@ -38,7 +38,7 @@ func NewFlightingRingsClient(subscriptionID string, credential azcore.TokenCrede if options == nil { options = &arm.ClientOptions{} } - ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { ep = c.Endpoint } @@ -56,6 +56,7 @@ func NewFlightingRingsClient(subscriptionID string, credential azcore.TokenCrede // Get - Gets a flighting ring of a Test Base Account. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview // resourceGroupName - The name of the resource group that contains the resource. // testBaseAccountName - The resource name of the Test Base Account. // flightingRingResourceName - The resource name of a flighting ring. @@ -101,7 +102,7 @@ func (client *FlightingRingsClient) getCreateRequest(ctx context.Context, resour reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-12-16-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -116,11 +117,12 @@ func (client *FlightingRingsClient) getHandleResponse(resp *http.Response) (Flig // NewListPager - Lists all the flighting rings of a Test Base Account. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview // resourceGroupName - The name of the resource group that contains the resource. // testBaseAccountName - The resource name of the Test Base Account. // options - FlightingRingsClientListOptions contains the optional parameters for the FlightingRingsClient.List method. func (client *FlightingRingsClient) NewListPager(resourceGroupName string, testBaseAccountName string, options *FlightingRingsClientListOptions) *runtime.Pager[FlightingRingsClientListResponse] { - return runtime.NewPager(runtime.PageProcessor[FlightingRingsClientListResponse]{ + return runtime.NewPager(runtime.PagingHandler[FlightingRingsClientListResponse]{ More: func(page FlightingRingsClientListResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, @@ -169,7 +171,7 @@ func (client *FlightingRingsClient) listCreateRequest(ctx context.Context, resou reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-12-16-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/testbase/armtestbase/zz_generated_models.go b/sdk/resourcemanager/testbase/armtestbase/zz_generated_models.go index 9c68cae8037e..cef5bc02c263 100644 --- a/sdk/resourcemanager/testbase/armtestbase/zz_generated_models.go +++ b/sdk/resourcemanager/testbase/armtestbase/zz_generated_models.go @@ -248,6 +248,12 @@ type AnalysisResultSingletonResourceProperties struct { Grade *Grade `json:"grade,omitempty"` } +// GetAnalysisResultSingletonResourceProperties implements the AnalysisResultSingletonResourcePropertiesClassification interface +// for type AnalysisResultSingletonResourceProperties. +func (a *AnalysisResultSingletonResourceProperties) GetAnalysisResultSingletonResourceProperties() *AnalysisResultSingletonResourceProperties { + return a +} + // AnalysisResultsClientGetOptions contains the optional parameters for the AnalysisResultsClient.Get method. type AnalysisResultsClientGetOptions struct { // placeholder for future optional parameters @@ -328,6 +334,15 @@ type CPURegressionResultSingletonResourceProperties struct { Grade *Grade `json:"grade,omitempty"` } +// GetAnalysisResultSingletonResourceProperties implements the AnalysisResultSingletonResourcePropertiesClassification interface +// for type CPURegressionResultSingletonResourceProperties. +func (c *CPURegressionResultSingletonResourceProperties) GetAnalysisResultSingletonResourceProperties() *AnalysisResultSingletonResourceProperties { + return &AnalysisResultSingletonResourceProperties{ + Grade: c.Grade, + AnalysisResultType: c.AnalysisResultType, + } +} + // CPUUtilizationResultSingletonResourceProperties - The properties of CPU Utilization Result. type CPUUtilizationResultSingletonResourceProperties struct { // REQUIRED; Type of the Analysis Result. @@ -340,6 +355,15 @@ type CPUUtilizationResultSingletonResourceProperties struct { Grade *Grade `json:"grade,omitempty"` } +// GetAnalysisResultSingletonResourceProperties implements the AnalysisResultSingletonResourcePropertiesClassification interface +// for type CPUUtilizationResultSingletonResourceProperties. +func (c *CPUUtilizationResultSingletonResourceProperties) GetAnalysisResultSingletonResourceProperties() *AnalysisResultSingletonResourceProperties { + return &AnalysisResultSingletonResourceProperties{ + Grade: c.Grade, + AnalysisResultType: c.AnalysisResultType, + } +} + // CheckNameAvailabilityResult - Description of a Check Name availability response properties. type CheckNameAvailabilityResult struct { // Value indicating the availability of the name: true if the name is available; otherwise, false. @@ -668,6 +692,15 @@ type MemoryRegressionResultSingletonResourceProperties struct { MemoryRegressionResults []*RegressionResult `json:"memoryRegressionResults,omitempty"` } +// GetAnalysisResultSingletonResourceProperties implements the AnalysisResultSingletonResourcePropertiesClassification interface +// for type MemoryRegressionResultSingletonResourceProperties. +func (m *MemoryRegressionResultSingletonResourceProperties) GetAnalysisResultSingletonResourceProperties() *AnalysisResultSingletonResourceProperties { + return &AnalysisResultSingletonResourceProperties{ + Grade: m.Grade, + AnalysisResultType: m.AnalysisResultType, + } +} + // MemoryUtilizationResultSingletonResourceProperties - The properties of Memory Utilization Result. type MemoryUtilizationResultSingletonResourceProperties struct { // REQUIRED; Type of the Analysis Result. @@ -680,6 +713,15 @@ type MemoryUtilizationResultSingletonResourceProperties struct { MemoryUtilizationResults []*UtilizationResult `json:"memoryUtilizationResults,omitempty"` } +// GetAnalysisResultSingletonResourceProperties implements the AnalysisResultSingletonResourcePropertiesClassification interface +// for type MemoryUtilizationResultSingletonResourceProperties. +func (m *MemoryUtilizationResultSingletonResourceProperties) GetAnalysisResultSingletonResourceProperties() *AnalysisResultSingletonResourceProperties { + return &AnalysisResultSingletonResourceProperties{ + Grade: m.Grade, + AnalysisResultType: m.AnalysisResultType, + } +} + // NotificationEventReceiver - A notification event receivers. type NotificationEventReceiver struct { // The type of the notification event receiver. @@ -1114,6 +1156,15 @@ type ReliabilityResultSingletonResourceProperties struct { ReliabilityResults []*ReliabilityResult `json:"reliabilityResults,omitempty"` } +// GetAnalysisResultSingletonResourceProperties implements the AnalysisResultSingletonResourcePropertiesClassification interface +// for type ReliabilityResultSingletonResourceProperties. +func (r *ReliabilityResultSingletonResourceProperties) GetAnalysisResultSingletonResourceProperties() *AnalysisResultSingletonResourceProperties { + return &AnalysisResultSingletonResourceProperties{ + Grade: r.Grade, + AnalysisResultType: r.AnalysisResultType, + } +} + // Resource - The Resource definition. type Resource struct { // READ-ONLY; Resource ID. @@ -1161,6 +1212,15 @@ type ScriptExecutionResultSingletonResourceProperties struct { ScriptExecutionResults []*ScriptExecutionResult `json:"scriptExecutionResults,omitempty"` } +// GetAnalysisResultSingletonResourceProperties implements the AnalysisResultSingletonResourcePropertiesClassification interface +// for type ScriptExecutionResultSingletonResourceProperties. +func (s *ScriptExecutionResultSingletonResourceProperties) GetAnalysisResultSingletonResourceProperties() *AnalysisResultSingletonResourceProperties { + return &AnalysisResultSingletonResourceProperties{ + Grade: s.Grade, + AnalysisResultType: s.AnalysisResultType, + } +} + // SubscriptionReceiverValue - The subscription role receiver value. type SubscriptionReceiverValue struct { // The role of the notification receiver. @@ -1242,6 +1302,15 @@ type TestAnalysisResultSingletonResourceProperties struct { TestAnalysisResult *TestAnalysisResult `json:"testAnalysisResult,omitempty"` } +// GetAnalysisResultSingletonResourceProperties implements the AnalysisResultSingletonResourcePropertiesClassification interface +// for type TestAnalysisResultSingletonResourceProperties. +func (t *TestAnalysisResultSingletonResourceProperties) GetAnalysisResultSingletonResourceProperties() *AnalysisResultSingletonResourceProperties { + return &AnalysisResultSingletonResourceProperties{ + Grade: t.Grade, + AnalysisResultType: t.AnalysisResultType, + } +} + // TestResultAnalysisSummary - The summary of a Test Analysis Result. type TestResultAnalysisSummary struct { // The analysis status. diff --git a/sdk/resourcemanager/testbase/armtestbase/zz_generated_models_serde.go b/sdk/resourcemanager/testbase/armtestbase/zz_generated_models_serde.go index 9303ca55896d..e572f0480023 100644 --- a/sdk/resourcemanager/testbase/armtestbase/zz_generated_models_serde.go +++ b/sdk/resourcemanager/testbase/armtestbase/zz_generated_models_serde.go @@ -10,18 +10,11 @@ package armtestbase import ( "encoding/json" + "fmt" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "reflect" ) -// MarshalJSON implements the json.Marshaller interface for type AccountListResult. -func (a AccountListResult) 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 AccountResource. func (a AccountResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -47,14 +40,6 @@ func (a AccountSKU) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// MarshalJSON implements the json.Marshaller interface for type AccountSKUListResult. -func (a AccountSKUListResult) 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 AccountUpdateParameters. func (a AccountUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -63,22 +48,6 @@ func (a AccountUpdateParameters) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// MarshalJSON implements the json.Marshaller interface for type AccountUsageDataList. -func (a AccountUsageDataList) 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 AnalysisResultListResult. -func (a AnalysisResultListResult) 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 AnalysisResultSingletonResource. func (a AnalysisResultSingletonResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -94,57 +63,34 @@ func (a AnalysisResultSingletonResource) MarshalJSON() ([]byte, error) { func (a *AnalysisResultSingletonResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { case "id": - err = unpopulate(val, &a.ID) + err = unpopulate(val, "ID", &a.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, &a.Name) + err = unpopulate(val, "Name", &a.Name) delete(rawMsg, key) case "properties": a.Properties, err = unmarshalAnalysisResultSingletonResourcePropertiesClassification(val) delete(rawMsg, key) case "systemData": - err = unpopulate(val, &a.SystemData) + err = unpopulate(val, "SystemData", &a.SystemData) delete(rawMsg, key) case "type": - err = unpopulate(val, &a.Type) + err = unpopulate(val, "Type", &a.Type) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// GetAnalysisResultSingletonResourceProperties implements the AnalysisResultSingletonResourcePropertiesClassification interface -// for type AnalysisResultSingletonResourceProperties. -func (a *AnalysisResultSingletonResourceProperties) GetAnalysisResultSingletonResourceProperties() *AnalysisResultSingletonResourceProperties { - return a -} - -// MarshalJSON implements the json.Marshaller interface for type AvailableOSListResult. -func (a AvailableOSListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", a.NextLink) - populate(objectMap, "value", a.Value) - return json.Marshal(objectMap) -} - -// GetAnalysisResultSingletonResourceProperties implements the AnalysisResultSingletonResourcePropertiesClassification interface -// for type CPURegressionResultSingletonResourceProperties. -func (c *CPURegressionResultSingletonResourceProperties) GetAnalysisResultSingletonResourceProperties() *AnalysisResultSingletonResourceProperties { - return &AnalysisResultSingletonResourceProperties{ - Grade: c.Grade, - AnalysisResultType: c.AnalysisResultType, - } -} - // MarshalJSON implements the json.Marshaller interface for type CPURegressionResultSingletonResourceProperties. func (c CPURegressionResultSingletonResourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -158,37 +104,28 @@ func (c CPURegressionResultSingletonResourceProperties) MarshalJSON() ([]byte, e func (c *CPURegressionResultSingletonResourceProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { case "analysisResultType": - err = unpopulate(val, &c.AnalysisResultType) + err = unpopulate(val, "AnalysisResultType", &c.AnalysisResultType) delete(rawMsg, key) case "cpuRegressionResults": - err = unpopulate(val, &c.CPURegressionResults) + err = unpopulate(val, "CPURegressionResults", &c.CPURegressionResults) delete(rawMsg, key) case "grade": - err = unpopulate(val, &c.Grade) + err = unpopulate(val, "Grade", &c.Grade) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// GetAnalysisResultSingletonResourceProperties implements the AnalysisResultSingletonResourcePropertiesClassification interface -// for type CPUUtilizationResultSingletonResourceProperties. -func (c *CPUUtilizationResultSingletonResourceProperties) GetAnalysisResultSingletonResourceProperties() *AnalysisResultSingletonResourceProperties { - return &AnalysisResultSingletonResourceProperties{ - Grade: c.Grade, - AnalysisResultType: c.AnalysisResultType, - } -} - // MarshalJSON implements the json.Marshaller interface for type CPUUtilizationResultSingletonResourceProperties. func (c CPUUtilizationResultSingletonResourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -202,36 +139,28 @@ func (c CPUUtilizationResultSingletonResourceProperties) MarshalJSON() ([]byte, func (c *CPUUtilizationResultSingletonResourceProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { case "analysisResultType": - err = unpopulate(val, &c.AnalysisResultType) + err = unpopulate(val, "AnalysisResultType", &c.AnalysisResultType) delete(rawMsg, key) case "cpuUtilizationResults": - err = unpopulate(val, &c.CPUUtilizationResults) + err = unpopulate(val, "CPUUtilizationResults", &c.CPUUtilizationResults) delete(rawMsg, key) case "grade": - err = unpopulate(val, &c.Grade) + err = unpopulate(val, "Grade", &c.Grade) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CustomerEventListResult. -func (c CustomerEventListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) - return json.Marshal(objectMap) -} - // MarshalJSON implements the json.Marshaller interface for type CustomerEventProperties. func (c CustomerEventProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -247,80 +176,29 @@ func (d DistributionGroupListReceiverValue) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// MarshalJSON implements the json.Marshaller interface for type DownloadURLResponse. -func (d DownloadURLResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "downloadUrl", d.DownloadURL) - populateTimeRFC3339(objectMap, "expirationTime", d.ExpirationTime) - return json.Marshal(objectMap) -} - // UnmarshalJSON implements the json.Unmarshaller interface for type DownloadURLResponse. func (d *DownloadURLResponse) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { case "downloadUrl": - err = unpopulate(val, &d.DownloadURL) + err = unpopulate(val, "DownloadURL", &d.DownloadURL) delete(rawMsg, key) case "expirationTime": - err = unpopulateTimeRFC3339(val, &d.ExpirationTime) + err = unpopulateTimeRFC3339(val, "ExpirationTime", &d.ExpirationTime) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EmailEventListResult. -func (e EmailEventListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", e.NextLink) - populate(objectMap, "value", e.Value) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ErrorDefinition. -func (e ErrorDefinition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "code", e.Code) - populate(objectMap, "details", e.Details) - populate(objectMap, "message", e.Message) - populate(objectMap, "target", e.Target) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type FavoriteProcessListResult. -func (f FavoriteProcessListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", f.NextLink) - populate(objectMap, "value", f.Value) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type FlightingRingListResult. -func (f FlightingRingListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", f.NextLink) - populate(objectMap, "value", f.Value) - return json.Marshal(objectMap) -} - -// GetAnalysisResultSingletonResourceProperties implements the AnalysisResultSingletonResourcePropertiesClassification interface -// for type MemoryRegressionResultSingletonResourceProperties. -func (m *MemoryRegressionResultSingletonResourceProperties) GetAnalysisResultSingletonResourceProperties() *AnalysisResultSingletonResourceProperties { - return &AnalysisResultSingletonResourceProperties{ - Grade: m.Grade, - AnalysisResultType: m.AnalysisResultType, - } -} - // MarshalJSON implements the json.Marshaller interface for type MemoryRegressionResultSingletonResourceProperties. func (m MemoryRegressionResultSingletonResourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -334,37 +212,28 @@ func (m MemoryRegressionResultSingletonResourceProperties) MarshalJSON() ([]byte func (m *MemoryRegressionResultSingletonResourceProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { case "analysisResultType": - err = unpopulate(val, &m.AnalysisResultType) + err = unpopulate(val, "AnalysisResultType", &m.AnalysisResultType) delete(rawMsg, key) case "grade": - err = unpopulate(val, &m.Grade) + err = unpopulate(val, "Grade", &m.Grade) delete(rawMsg, key) case "memoryRegressionResults": - err = unpopulate(val, &m.MemoryRegressionResults) + err = unpopulate(val, "MemoryRegressionResults", &m.MemoryRegressionResults) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// GetAnalysisResultSingletonResourceProperties implements the AnalysisResultSingletonResourcePropertiesClassification interface -// for type MemoryUtilizationResultSingletonResourceProperties. -func (m *MemoryUtilizationResultSingletonResourceProperties) GetAnalysisResultSingletonResourceProperties() *AnalysisResultSingletonResourceProperties { - return &AnalysisResultSingletonResourceProperties{ - Grade: m.Grade, - AnalysisResultType: m.AnalysisResultType, - } -} - // MarshalJSON implements the json.Marshaller interface for type MemoryUtilizationResultSingletonResourceProperties. func (m MemoryUtilizationResultSingletonResourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -378,36 +247,28 @@ func (m MemoryUtilizationResultSingletonResourceProperties) MarshalJSON() ([]byt func (m *MemoryUtilizationResultSingletonResourceProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { case "analysisResultType": - err = unpopulate(val, &m.AnalysisResultType) + err = unpopulate(val, "AnalysisResultType", &m.AnalysisResultType) delete(rawMsg, key) case "grade": - err = unpopulate(val, &m.Grade) + err = unpopulate(val, "Grade", &m.Grade) delete(rawMsg, key) case "memoryUtilizationResults": - err = unpopulate(val, &m.MemoryUtilizationResults) + err = unpopulate(val, "MemoryUtilizationResults", &m.MemoryUtilizationResults) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OSUpdateListResult. -func (o OSUpdateListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", o.NextLink) - populate(objectMap, "value", o.Value) - return json.Marshal(objectMap) -} - // MarshalJSON implements the json.Marshaller interface for type OSUpdateProperties. func (o OSUpdateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -425,35 +286,35 @@ func (o OSUpdateProperties) MarshalJSON() ([]byte, error) { func (o *OSUpdateProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { case "buildRevision": - err = unpopulate(val, &o.BuildRevision) + err = unpopulate(val, "BuildRevision", &o.BuildRevision) delete(rawMsg, key) case "buildVersion": - err = unpopulate(val, &o.BuildVersion) + err = unpopulate(val, "BuildVersion", &o.BuildVersion) delete(rawMsg, key) case "flightingRing": - err = unpopulate(val, &o.FlightingRing) + err = unpopulate(val, "FlightingRing", &o.FlightingRing) delete(rawMsg, key) case "osName": - err = unpopulate(val, &o.OSName) + err = unpopulate(val, "OSName", &o.OSName) delete(rawMsg, key) case "release": - err = unpopulate(val, &o.Release) + err = unpopulate(val, "Release", &o.Release) delete(rawMsg, key) case "releaseVersionDate": - err = unpopulateTimeRFC3339(val, &o.ReleaseVersionDate) + err = unpopulateTimeRFC3339(val, "ReleaseVersionDate", &o.ReleaseVersionDate) delete(rawMsg, key) case "type": - err = unpopulate(val, &o.Type) + err = unpopulate(val, "Type", &o.Type) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil @@ -480,47 +341,47 @@ func (o OSUpdateTestSummary) MarshalJSON() ([]byte, error) { func (o *OSUpdateTestSummary) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { case "buildRevision": - err = unpopulate(val, &o.BuildRevision) + err = unpopulate(val, "BuildRevision", &o.BuildRevision) delete(rawMsg, key) case "buildVersion": - err = unpopulate(val, &o.BuildVersion) + err = unpopulate(val, "BuildVersion", &o.BuildVersion) delete(rawMsg, key) case "executionStatus": - err = unpopulate(val, &o.ExecutionStatus) + err = unpopulate(val, "ExecutionStatus", &o.ExecutionStatus) delete(rawMsg, key) case "flightingRing": - err = unpopulate(val, &o.FlightingRing) + err = unpopulate(val, "FlightingRing", &o.FlightingRing) delete(rawMsg, key) case "grade": - err = unpopulate(val, &o.Grade) + err = unpopulate(val, "Grade", &o.Grade) delete(rawMsg, key) case "osName": - err = unpopulate(val, &o.OSName) + err = unpopulate(val, "OSName", &o.OSName) delete(rawMsg, key) case "releaseName": - err = unpopulate(val, &o.ReleaseName) + err = unpopulate(val, "ReleaseName", &o.ReleaseName) delete(rawMsg, key) case "releaseVersionDate": - err = unpopulateTimeRFC3339(val, &o.ReleaseVersionDate) + err = unpopulateTimeRFC3339(val, "ReleaseVersionDate", &o.ReleaseVersionDate) delete(rawMsg, key) case "testRunTime": - err = unpopulate(val, &o.TestRunTime) + err = unpopulate(val, "TestRunTime", &o.TestRunTime) delete(rawMsg, key) case "testStatus": - err = unpopulate(val, &o.TestStatus) + err = unpopulate(val, "TestStatus", &o.TestStatus) delete(rawMsg, key) case "testType": - err = unpopulate(val, &o.TestType) + err = unpopulate(val, "TestType", &o.TestType) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil @@ -537,22 +398,6 @@ func (o OSUpdatesTestSummary) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// MarshalJSON implements the json.Marshaller interface for type OperationListResult. -func (o OperationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", o.NextLink) - populate(objectMap, "value", o.Value) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type PackageListResult. -func (p PackageListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) - return json.Marshal(objectMap) -} - // MarshalJSON implements the json.Marshaller interface for type PackageProperties. func (p PackageProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -575,50 +420,50 @@ func (p PackageProperties) MarshalJSON() ([]byte, error) { func (p *PackageProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { case "applicationName": - err = unpopulate(val, &p.ApplicationName) + err = unpopulate(val, "ApplicationName", &p.ApplicationName) delete(rawMsg, key) case "blobPath": - err = unpopulate(val, &p.BlobPath) + err = unpopulate(val, "BlobPath", &p.BlobPath) delete(rawMsg, key) case "flightingRing": - err = unpopulate(val, &p.FlightingRing) + err = unpopulate(val, "FlightingRing", &p.FlightingRing) delete(rawMsg, key) case "isEnabled": - err = unpopulate(val, &p.IsEnabled) + err = unpopulate(val, "IsEnabled", &p.IsEnabled) delete(rawMsg, key) case "lastModifiedTime": - err = unpopulateTimeRFC3339(val, &p.LastModifiedTime) + err = unpopulateTimeRFC3339(val, "LastModifiedTime", &p.LastModifiedTime) delete(rawMsg, key) case "packageStatus": - err = unpopulate(val, &p.PackageStatus) + err = unpopulate(val, "PackageStatus", &p.PackageStatus) delete(rawMsg, key) case "provisioningState": - err = unpopulate(val, &p.ProvisioningState) + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) delete(rawMsg, key) case "targetOSList": - err = unpopulate(val, &p.TargetOSList) + err = unpopulate(val, "TargetOSList", &p.TargetOSList) delete(rawMsg, key) case "testTypes": - err = unpopulate(val, &p.TestTypes) + err = unpopulate(val, "TestTypes", &p.TestTypes) delete(rawMsg, key) case "tests": - err = unpopulate(val, &p.Tests) + err = unpopulate(val, "Tests", &p.Tests) delete(rawMsg, key) case "validationResults": - err = unpopulate(val, &p.ValidationResults) + err = unpopulate(val, "ValidationResults", &p.ValidationResults) delete(rawMsg, key) case "version": - err = unpopulate(val, &p.Version) + err = unpopulate(val, "Version", &p.Version) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil @@ -666,15 +511,6 @@ func (p PackageValidationResult) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// GetAnalysisResultSingletonResourceProperties implements the AnalysisResultSingletonResourcePropertiesClassification interface -// for type ReliabilityResultSingletonResourceProperties. -func (r *ReliabilityResultSingletonResourceProperties) GetAnalysisResultSingletonResourceProperties() *AnalysisResultSingletonResourceProperties { - return &AnalysisResultSingletonResourceProperties{ - Grade: r.Grade, - AnalysisResultType: r.AnalysisResultType, - } -} - // MarshalJSON implements the json.Marshaller interface for type ReliabilityResultSingletonResourceProperties. func (r ReliabilityResultSingletonResourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -688,23 +524,23 @@ func (r ReliabilityResultSingletonResourceProperties) MarshalJSON() ([]byte, err func (r *ReliabilityResultSingletonResourceProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { case "analysisResultType": - err = unpopulate(val, &r.AnalysisResultType) + err = unpopulate(val, "AnalysisResultType", &r.AnalysisResultType) delete(rawMsg, key) case "grade": - err = unpopulate(val, &r.Grade) + err = unpopulate(val, "Grade", &r.Grade) delete(rawMsg, key) case "reliabilityResults": - err = unpopulate(val, &r.ReliabilityResults) + err = unpopulate(val, "ReliabilityResults", &r.ReliabilityResults) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil @@ -725,43 +561,34 @@ func (s ScriptExecutionResult) MarshalJSON() ([]byte, error) { func (s *ScriptExecutionResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { case "endTime": - err = unpopulateTimeRFC3339(val, &s.EndTime) + err = unpopulateTimeRFC3339(val, "EndTime", &s.EndTime) delete(rawMsg, key) case "exitCode": - err = unpopulate(val, &s.ExitCode) + err = unpopulate(val, "ExitCode", &s.ExitCode) delete(rawMsg, key) case "scriptName": - err = unpopulate(val, &s.ScriptName) + err = unpopulate(val, "ScriptName", &s.ScriptName) delete(rawMsg, key) case "startTime": - err = unpopulateTimeRFC3339(val, &s.StartTime) + err = unpopulateTimeRFC3339(val, "StartTime", &s.StartTime) delete(rawMsg, key) case "timedOut": - err = unpopulate(val, &s.TimedOut) + err = unpopulate(val, "TimedOut", &s.TimedOut) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// GetAnalysisResultSingletonResourceProperties implements the AnalysisResultSingletonResourcePropertiesClassification interface -// for type ScriptExecutionResultSingletonResourceProperties. -func (s *ScriptExecutionResultSingletonResourceProperties) GetAnalysisResultSingletonResourceProperties() *AnalysisResultSingletonResourceProperties { - return &AnalysisResultSingletonResourceProperties{ - Grade: s.Grade, - AnalysisResultType: s.AnalysisResultType, - } -} - // MarshalJSON implements the json.Marshaller interface for type ScriptExecutionResultSingletonResourceProperties. func (s ScriptExecutionResultSingletonResourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -775,23 +602,23 @@ func (s ScriptExecutionResultSingletonResourceProperties) MarshalJSON() ([]byte, func (s *ScriptExecutionResultSingletonResourceProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { case "analysisResultType": - err = unpopulate(val, &s.AnalysisResultType) + err = unpopulate(val, "AnalysisResultType", &s.AnalysisResultType) delete(rawMsg, key) case "grade": - err = unpopulate(val, &s.Grade) + err = unpopulate(val, "Grade", &s.Grade) delete(rawMsg, key) case "scriptExecutionResults": - err = unpopulate(val, &s.ScriptExecutionResults) + err = unpopulate(val, "ScriptExecutionResults", &s.ScriptExecutionResults) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil @@ -813,32 +640,32 @@ func (s SystemData) MarshalJSON() ([]byte, error) { func (s *SystemData) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { case "createdAt": - err = unpopulateTimeRFC3339(val, &s.CreatedAt) + err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) delete(rawMsg, key) case "createdBy": - err = unpopulate(val, &s.CreatedBy) + err = unpopulate(val, "CreatedBy", &s.CreatedBy) delete(rawMsg, key) case "createdByType": - err = unpopulate(val, &s.CreatedByType) + err = unpopulate(val, "CreatedByType", &s.CreatedByType) delete(rawMsg, key) case "lastModifiedAt": - err = unpopulateTimeRFC3339(val, &s.LastModifiedAt) + err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) delete(rawMsg, key) case "lastModifiedBy": - err = unpopulate(val, &s.LastModifiedBy) + err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) delete(rawMsg, key) case "lastModifiedByType": - err = unpopulate(val, &s.LastModifiedByType) + err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil @@ -871,15 +698,6 @@ func (t TestAnalysisResult) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// GetAnalysisResultSingletonResourceProperties implements the AnalysisResultSingletonResourcePropertiesClassification interface -// for type TestAnalysisResultSingletonResourceProperties. -func (t *TestAnalysisResultSingletonResourceProperties) GetAnalysisResultSingletonResourceProperties() *AnalysisResultSingletonResourceProperties { - return &AnalysisResultSingletonResourceProperties{ - Grade: t.Grade, - AnalysisResultType: t.AnalysisResultType, - } -} - // MarshalJSON implements the json.Marshaller interface for type TestAnalysisResultSingletonResourceProperties. func (t TestAnalysisResultSingletonResourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -893,36 +711,28 @@ func (t TestAnalysisResultSingletonResourceProperties) MarshalJSON() ([]byte, er func (t *TestAnalysisResultSingletonResourceProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", t, err) } for key, val := range rawMsg { var err error switch key { case "analysisResultType": - err = unpopulate(val, &t.AnalysisResultType) + err = unpopulate(val, "AnalysisResultType", &t.AnalysisResultType) delete(rawMsg, key) case "grade": - err = unpopulate(val, &t.Grade) + err = unpopulate(val, "Grade", &t.Grade) delete(rawMsg, key) case "testAnalysisResult": - err = unpopulate(val, &t.TestAnalysisResult) + err = unpopulate(val, "TestAnalysisResult", &t.TestAnalysisResult) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", t, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type TestResultListResult. -func (t TestResultListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", t.NextLink) - populate(objectMap, "value", t.Value) - return json.Marshal(objectMap) -} - // MarshalJSON implements the json.Marshaller interface for type TestResultProperties. func (t TestResultProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -953,95 +763,79 @@ func (t TestResultProperties) MarshalJSON() ([]byte, error) { func (t *TestResultProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", t, err) } for key, val := range rawMsg { var err error switch key { case "analysisSummaries": - err = unpopulate(val, &t.AnalysisSummaries) + err = unpopulate(val, "AnalysisSummaries", &t.AnalysisSummaries) delete(rawMsg, key) case "applicationName": - err = unpopulate(val, &t.ApplicationName) + err = unpopulate(val, "ApplicationName", &t.ApplicationName) delete(rawMsg, key) case "applicationVersion": - err = unpopulate(val, &t.ApplicationVersion) + err = unpopulate(val, "ApplicationVersion", &t.ApplicationVersion) delete(rawMsg, key) case "baselineTestResultId": - err = unpopulate(val, &t.BaselineTestResultID) + err = unpopulate(val, "BaselineTestResultID", &t.BaselineTestResultID) delete(rawMsg, key) case "buildRevision": - err = unpopulate(val, &t.BuildRevision) + err = unpopulate(val, "BuildRevision", &t.BuildRevision) delete(rawMsg, key) case "buildVersion": - err = unpopulate(val, &t.BuildVersion) + err = unpopulate(val, "BuildVersion", &t.BuildVersion) delete(rawMsg, key) case "executionStatus": - err = unpopulate(val, &t.ExecutionStatus) + err = unpopulate(val, "ExecutionStatus", &t.ExecutionStatus) delete(rawMsg, key) case "flightingRing": - err = unpopulate(val, &t.FlightingRing) + err = unpopulate(val, "FlightingRing", &t.FlightingRing) delete(rawMsg, key) case "grade": - err = unpopulate(val, &t.Grade) + err = unpopulate(val, "Grade", &t.Grade) delete(rawMsg, key) case "isDownloadDataAvailable": - err = unpopulate(val, &t.IsDownloadDataAvailable) + err = unpopulate(val, "IsDownloadDataAvailable", &t.IsDownloadDataAvailable) delete(rawMsg, key) case "isVideoAvailable": - err = unpopulate(val, &t.IsVideoAvailable) + err = unpopulate(val, "IsVideoAvailable", &t.IsVideoAvailable) delete(rawMsg, key) case "kbNumber": - err = unpopulate(val, &t.KbNumber) + err = unpopulate(val, "KbNumber", &t.KbNumber) delete(rawMsg, key) case "osName": - err = unpopulate(val, &t.OSName) + err = unpopulate(val, "OSName", &t.OSName) delete(rawMsg, key) case "packageId": - err = unpopulate(val, &t.PackageID) + err = unpopulate(val, "PackageID", &t.PackageID) delete(rawMsg, key) case "packageVersion": - err = unpopulate(val, &t.PackageVersion) + err = unpopulate(val, "PackageVersion", &t.PackageVersion) delete(rawMsg, key) case "releaseName": - err = unpopulate(val, &t.ReleaseName) + err = unpopulate(val, "ReleaseName", &t.ReleaseName) delete(rawMsg, key) case "releaseVersionDate": - err = unpopulateTimeRFC3339(val, &t.ReleaseVersionDate) + err = unpopulateTimeRFC3339(val, "ReleaseVersionDate", &t.ReleaseVersionDate) delete(rawMsg, key) case "testRunTime": - err = unpopulate(val, &t.TestRunTime) + err = unpopulate(val, "TestRunTime", &t.TestRunTime) delete(rawMsg, key) case "testStatus": - err = unpopulate(val, &t.TestStatus) + err = unpopulate(val, "TestStatus", &t.TestStatus) delete(rawMsg, key) case "testType": - err = unpopulate(val, &t.TestType) + err = unpopulate(val, "TestType", &t.TestType) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", t, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type TestSummaryListResult. -func (t TestSummaryListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", t.NextLink) - populate(objectMap, "value", t.Value) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type TestTypeListResult. -func (t TestTypeListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", t.NextLink) - populate(objectMap, "value", t.Value) - return json.Marshal(objectMap) -} - // MarshalJSON implements the json.Marshaller interface for type TrackedResource. func (t TrackedResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -1073,20 +867,20 @@ func (u UtilizationEntry) MarshalJSON() ([]byte, error) { func (u *UtilizationEntry) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", u, err) } for key, val := range rawMsg { var err error switch key { case "timestamp": - err = unpopulateTimeRFC3339(val, &u.Timestamp) + err = unpopulateTimeRFC3339(val, "Timestamp", &u.Timestamp) delete(rawMsg, key) case "value": - err = unpopulate(val, &u.Value) + err = unpopulate(val, "Value", &u.Value) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", u, err) } } return nil @@ -1112,9 +906,12 @@ func populate(m map[string]interface{}, k string, v interface{}) { } } -func unpopulate(data json.RawMessage, v interface{}) error { +func unpopulate(data json.RawMessage, fn string, v interface{}) error { if data == nil { return nil } - return json.Unmarshal(data, v) + if err := json.Unmarshal(data, v); err != nil { + return fmt.Errorf("struct field %s: %v", fn, err) + } + return nil } diff --git a/sdk/resourcemanager/testbase/armtestbase/zz_generated_operations_client.go b/sdk/resourcemanager/testbase/armtestbase/zz_generated_operations_client.go index 1a5d7a815498..4246747c52d3 100644 --- a/sdk/resourcemanager/testbase/armtestbase/zz_generated_operations_client.go +++ b/sdk/resourcemanager/testbase/armtestbase/zz_generated_operations_client.go @@ -33,7 +33,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO if options == nil { options = &arm.ClientOptions{} } - ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { ep = c.Endpoint } @@ -50,9 +50,10 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Lists all of the available REST API operations of the Microsoft.TestBase provider. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview // options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { - return runtime.NewPager(runtime.PageProcessor[OperationsClientListResponse]{ + return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ More: func(page OperationsClientListResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, @@ -89,7 +90,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-12-16-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/testbase/armtestbase/zz_generated_osupdates_client.go b/sdk/resourcemanager/testbase/armtestbase/zz_generated_osupdates_client.go index 80fd10675eff..30aae3ad7814 100644 --- a/sdk/resourcemanager/testbase/armtestbase/zz_generated_osupdates_client.go +++ b/sdk/resourcemanager/testbase/armtestbase/zz_generated_osupdates_client.go @@ -38,7 +38,7 @@ func NewOSUpdatesClient(subscriptionID string, credential azcore.TokenCredential if options == nil { options = &arm.ClientOptions{} } - ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { ep = c.Endpoint } @@ -56,6 +56,7 @@ func NewOSUpdatesClient(subscriptionID string, credential azcore.TokenCredential // Get - Gets an OS Update by name in which the package was tested before. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview // resourceGroupName - The name of the resource group that contains the resource. // testBaseAccountName - The resource name of the Test Base Account. // packageName - The resource name of the Test Base Package. @@ -106,7 +107,7 @@ func (client *OSUpdatesClient) getCreateRequest(ctx context.Context, resourceGro reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-12-16-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -121,13 +122,14 @@ func (client *OSUpdatesClient) getHandleResponse(resp *http.Response) (OSUpdates // NewListPager - Lists the OS Updates in which the package were tested before. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview // resourceGroupName - The name of the resource group that contains the resource. // testBaseAccountName - The resource name of the Test Base Account. // packageName - The resource name of the Test Base Package. // osUpdateType - The type of the OS Update. // options - OSUpdatesClientListOptions contains the optional parameters for the OSUpdatesClient.List method. func (client *OSUpdatesClient) NewListPager(resourceGroupName string, testBaseAccountName string, packageName string, osUpdateType OsUpdateType, options *OSUpdatesClientListOptions) *runtime.Pager[OSUpdatesClientListResponse] { - return runtime.NewPager(runtime.PageProcessor[OSUpdatesClientListResponse]{ + return runtime.NewPager(runtime.PagingHandler[OSUpdatesClientListResponse]{ More: func(page OSUpdatesClientListResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, @@ -181,7 +183,7 @@ func (client *OSUpdatesClient) listCreateRequest(ctx context.Context, resourceGr reqQP.Set("osUpdateType", string(osUpdateType)) reqQP.Set("api-version", "2020-12-16-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/testbase/armtestbase/zz_generated_packages_client.go b/sdk/resourcemanager/testbase/armtestbase/zz_generated_packages_client.go index d52d856d4500..75aeaccaa576 100644 --- a/sdk/resourcemanager/testbase/armtestbase/zz_generated_packages_client.go +++ b/sdk/resourcemanager/testbase/armtestbase/zz_generated_packages_client.go @@ -38,7 +38,7 @@ func NewPackagesClient(subscriptionID string, credential azcore.TokenCredential, if options == nil { options = &arm.ClientOptions{} } - ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { ep = c.Endpoint } @@ -56,27 +56,29 @@ func NewPackagesClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreate - Create or replace (overwrite/recreate, with potential downtime) a Test Base Package. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview // resourceGroupName - The name of the resource group that contains the resource. // testBaseAccountName - The resource name of the Test Base Account. // packageName - The resource name of the Test Base Package. // parameters - Parameters supplied to create a Test Base Package. // options - PackagesClientBeginCreateOptions contains the optional parameters for the PackagesClient.BeginCreate method. -func (client *PackagesClient) BeginCreate(ctx context.Context, resourceGroupName string, testBaseAccountName string, packageName string, parameters PackageResource, options *PackagesClientBeginCreateOptions) (*armruntime.Poller[PackagesClientCreateResponse], error) { +func (client *PackagesClient) BeginCreate(ctx context.Context, resourceGroupName string, testBaseAccountName string, packageName string, parameters PackageResource, options *PackagesClientBeginCreateOptions) (*runtime.Poller[PackagesClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.create(ctx, resourceGroupName, testBaseAccountName, packageName, parameters, options) if err != nil { return nil, err } - return armruntime.NewPoller(resp, client.pl, &armruntime.NewPollerOptions[PackagesClientCreateResponse]{ - FinalStateVia: armruntime.FinalStateViaAzureAsyncOp, + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[PackagesClientCreateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) } else { - return armruntime.NewPollerFromResumeToken[PackagesClientCreateResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[PackagesClientCreateResponse](options.ResumeToken, client.pl, nil) } } // Create - Create or replace (overwrite/recreate, with potential downtime) a Test Base Package. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview func (client *PackagesClient) create(ctx context.Context, resourceGroupName string, testBaseAccountName string, packageName string, parameters PackageResource, options *PackagesClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, testBaseAccountName, packageName, parameters, options) if err != nil { @@ -118,32 +120,34 @@ func (client *PackagesClient) createCreateRequest(ctx context.Context, resourceG reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-12-16-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) } // BeginDelete - Deletes a Test Base Package. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview // resourceGroupName - The name of the resource group that contains the resource. // testBaseAccountName - The resource name of the Test Base Account. // packageName - The resource name of the Test Base Package. // options - PackagesClientBeginDeleteOptions contains the optional parameters for the PackagesClient.BeginDelete method. -func (client *PackagesClient) BeginDelete(ctx context.Context, resourceGroupName string, testBaseAccountName string, packageName string, options *PackagesClientBeginDeleteOptions) (*armruntime.Poller[PackagesClientDeleteResponse], error) { +func (client *PackagesClient) BeginDelete(ctx context.Context, resourceGroupName string, testBaseAccountName string, packageName string, options *PackagesClientBeginDeleteOptions) (*runtime.Poller[PackagesClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, testBaseAccountName, packageName, options) if err != nil { return nil, err } - return armruntime.NewPoller(resp, client.pl, &armruntime.NewPollerOptions[PackagesClientDeleteResponse]{ - FinalStateVia: armruntime.FinalStateViaAzureAsyncOp, + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[PackagesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) } else { - return armruntime.NewPollerFromResumeToken[PackagesClientDeleteResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[PackagesClientDeleteResponse](options.ResumeToken, client.pl, nil) } } // Delete - Deletes a Test Base Package. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview func (client *PackagesClient) deleteOperation(ctx context.Context, resourceGroupName string, testBaseAccountName string, packageName string, options *PackagesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, testBaseAccountName, packageName, options) if err != nil { @@ -185,12 +189,13 @@ func (client *PackagesClient) deleteCreateRequest(ctx context.Context, resourceG reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-12-16-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // Get - Gets a Test Base Package. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview // resourceGroupName - The name of the resource group that contains the resource. // testBaseAccountName - The resource name of the Test Base Account. // packageName - The resource name of the Test Base Package. @@ -236,7 +241,7 @@ func (client *PackagesClient) getCreateRequest(ctx context.Context, resourceGrou reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-12-16-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -251,6 +256,7 @@ func (client *PackagesClient) getHandleResponse(resp *http.Response) (PackagesCl // GetDownloadURL - Gets the download URL of a package. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview // resourceGroupName - The name of the resource group that contains the resource. // testBaseAccountName - The resource name of the Test Base Account. // packageName - The resource name of the Test Base Package. @@ -296,7 +302,7 @@ func (client *PackagesClient) getDownloadURLCreateRequest(ctx context.Context, r reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-12-16-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -311,27 +317,29 @@ func (client *PackagesClient) getDownloadURLHandleResponse(resp *http.Response) // BeginHardDelete - Hard Delete a Test Base Package. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview // resourceGroupName - The name of the resource group that contains the resource. // testBaseAccountName - The resource name of the Test Base Account. // packageName - The resource name of the Test Base Package. // options - PackagesClientBeginHardDeleteOptions contains the optional parameters for the PackagesClient.BeginHardDelete // method. -func (client *PackagesClient) BeginHardDelete(ctx context.Context, resourceGroupName string, testBaseAccountName string, packageName string, options *PackagesClientBeginHardDeleteOptions) (*armruntime.Poller[PackagesClientHardDeleteResponse], error) { +func (client *PackagesClient) BeginHardDelete(ctx context.Context, resourceGroupName string, testBaseAccountName string, packageName string, options *PackagesClientBeginHardDeleteOptions) (*runtime.Poller[PackagesClientHardDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.hardDelete(ctx, resourceGroupName, testBaseAccountName, packageName, options) if err != nil { return nil, err } - return armruntime.NewPoller(resp, client.pl, &armruntime.NewPollerOptions[PackagesClientHardDeleteResponse]{ - FinalStateVia: armruntime.FinalStateViaAzureAsyncOp, + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[PackagesClientHardDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) } else { - return armruntime.NewPollerFromResumeToken[PackagesClientHardDeleteResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[PackagesClientHardDeleteResponse](options.ResumeToken, client.pl, nil) } } // HardDelete - Hard Delete a Test Base Package. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview func (client *PackagesClient) hardDelete(ctx context.Context, resourceGroupName string, testBaseAccountName string, packageName string, options *PackagesClientBeginHardDeleteOptions) (*http.Response, error) { req, err := client.hardDeleteCreateRequest(ctx, resourceGroupName, testBaseAccountName, packageName, options) if err != nil { @@ -373,18 +381,19 @@ func (client *PackagesClient) hardDeleteCreateRequest(ctx context.Context, resou reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-12-16-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // NewListByTestBaseAccountPager - Lists all the packages under a Test Base Account. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview // resourceGroupName - The name of the resource group that contains the resource. // testBaseAccountName - The resource name of the Test Base Account. // options - PackagesClientListByTestBaseAccountOptions contains the optional parameters for the PackagesClient.ListByTestBaseAccount // method. func (client *PackagesClient) NewListByTestBaseAccountPager(resourceGroupName string, testBaseAccountName string, options *PackagesClientListByTestBaseAccountOptions) *runtime.Pager[PackagesClientListByTestBaseAccountResponse] { - return runtime.NewPager(runtime.PageProcessor[PackagesClientListByTestBaseAccountResponse]{ + return runtime.NewPager(runtime.PagingHandler[PackagesClientListByTestBaseAccountResponse]{ More: func(page PackagesClientListByTestBaseAccountResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, @@ -433,7 +442,7 @@ func (client *PackagesClient) listByTestBaseAccountCreateRequest(ctx context.Con reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-12-16-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -448,27 +457,29 @@ func (client *PackagesClient) listByTestBaseAccountHandleResponse(resp *http.Res // BeginUpdate - Update an existing Test Base Package. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview // resourceGroupName - The name of the resource group that contains the resource. // testBaseAccountName - The resource name of the Test Base Account. // packageName - The resource name of the Test Base Package. // parameters - Parameters supplied to update a Test Base Package. // options - PackagesClientBeginUpdateOptions contains the optional parameters for the PackagesClient.BeginUpdate method. -func (client *PackagesClient) BeginUpdate(ctx context.Context, resourceGroupName string, testBaseAccountName string, packageName string, parameters PackageUpdateParameters, options *PackagesClientBeginUpdateOptions) (*armruntime.Poller[PackagesClientUpdateResponse], error) { +func (client *PackagesClient) BeginUpdate(ctx context.Context, resourceGroupName string, testBaseAccountName string, packageName string, parameters PackageUpdateParameters, options *PackagesClientBeginUpdateOptions) (*runtime.Poller[PackagesClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, testBaseAccountName, packageName, parameters, options) if err != nil { return nil, err } - return armruntime.NewPoller(resp, client.pl, &armruntime.NewPollerOptions[PackagesClientUpdateResponse]{ - FinalStateVia: armruntime.FinalStateViaAzureAsyncOp, + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[PackagesClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) } else { - return armruntime.NewPollerFromResumeToken[PackagesClientUpdateResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[PackagesClientUpdateResponse](options.ResumeToken, client.pl, nil) } } // Update - Update an existing Test Base Package. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview func (client *PackagesClient) update(ctx context.Context, resourceGroupName string, testBaseAccountName string, packageName string, parameters PackageUpdateParameters, options *PackagesClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, testBaseAccountName, packageName, parameters, options) if err != nil { @@ -510,6 +521,6 @@ func (client *PackagesClient) updateCreateRequest(ctx context.Context, resourceG reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-12-16-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) } diff --git a/sdk/resourcemanager/testbase/armtestbase/zz_generated_skus_client.go b/sdk/resourcemanager/testbase/armtestbase/zz_generated_skus_client.go index b23793ac5fae..373cb58854d2 100644 --- a/sdk/resourcemanager/testbase/armtestbase/zz_generated_skus_client.go +++ b/sdk/resourcemanager/testbase/armtestbase/zz_generated_skus_client.go @@ -38,7 +38,7 @@ func NewSKUsClient(subscriptionID string, credential azcore.TokenCredential, opt if options == nil { options = &arm.ClientOptions{} } - ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { ep = c.Endpoint } @@ -56,9 +56,10 @@ func NewSKUsClient(subscriptionID string, credential azcore.TokenCredential, opt // NewListPager - Lists the available SKUs of Test Base Account in a subscription. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview // options - SKUsClientListOptions contains the optional parameters for the SKUsClient.List method. func (client *SKUsClient) NewListPager(options *SKUsClientListOptions) *runtime.Pager[SKUsClientListResponse] { - return runtime.NewPager(runtime.PageProcessor[SKUsClientListResponse]{ + return runtime.NewPager(runtime.PagingHandler[SKUsClientListResponse]{ More: func(page SKUsClientListResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, @@ -99,7 +100,7 @@ func (client *SKUsClient) listCreateRequest(ctx context.Context, options *SKUsCl reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-12-16-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/testbase/armtestbase/zz_generated_testresults_client.go b/sdk/resourcemanager/testbase/armtestbase/zz_generated_testresults_client.go index 03ed1646a21e..eadab44fe67c 100644 --- a/sdk/resourcemanager/testbase/armtestbase/zz_generated_testresults_client.go +++ b/sdk/resourcemanager/testbase/armtestbase/zz_generated_testresults_client.go @@ -38,7 +38,7 @@ func NewTestResultsClient(subscriptionID string, credential azcore.TokenCredenti if options == nil { options = &arm.ClientOptions{} } - ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { ep = c.Endpoint } @@ -56,6 +56,7 @@ func NewTestResultsClient(subscriptionID string, credential azcore.TokenCredenti // Get - Get the Test Result by Id with specified OS Update type for a Test Base Package. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview // resourceGroupName - The name of the resource group that contains the resource. // testBaseAccountName - The resource name of the Test Base Account. // packageName - The resource name of the Test Base Package. @@ -106,7 +107,7 @@ func (client *TestResultsClient) getCreateRequest(ctx context.Context, resourceG reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-12-16-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -121,6 +122,7 @@ func (client *TestResultsClient) getHandleResponse(resp *http.Response) (TestRes // GetDownloadURL - Gets the download URL of the test result. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview // resourceGroupName - The name of the resource group that contains the resource. // testBaseAccountName - The resource name of the Test Base Account. // packageName - The resource name of the Test Base Package. @@ -172,7 +174,7 @@ func (client *TestResultsClient) getDownloadURLCreateRequest(ctx context.Context reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-12-16-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -187,6 +189,7 @@ func (client *TestResultsClient) getDownloadURLHandleResponse(resp *http.Respons // GetVideoDownloadURL - Gets the download URL of the test execution screen recording. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview // resourceGroupName - The name of the resource group that contains the resource. // testBaseAccountName - The resource name of the Test Base Account. // packageName - The resource name of the Test Base Package. @@ -238,7 +241,7 @@ func (client *TestResultsClient) getVideoDownloadURLCreateRequest(ctx context.Co reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-12-16-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -254,13 +257,14 @@ func (client *TestResultsClient) getVideoDownloadURLHandleResponse(resp *http.Re // NewListPager - Lists all the Test Results with specified OS Update type for a Test Base Package. Can be filtered by osName, // releaseName, flightingRing, buildVersion, buildRevision. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview // resourceGroupName - The name of the resource group that contains the resource. // testBaseAccountName - The resource name of the Test Base Account. // packageName - The resource name of the Test Base Package. // osUpdateType - The type of the OS Update. // options - TestResultsClientListOptions contains the optional parameters for the TestResultsClient.List method. func (client *TestResultsClient) NewListPager(resourceGroupName string, testBaseAccountName string, packageName string, osUpdateType OsUpdateType, options *TestResultsClientListOptions) *runtime.Pager[TestResultsClientListResponse] { - return runtime.NewPager(runtime.PageProcessor[TestResultsClientListResponse]{ + return runtime.NewPager(runtime.PagingHandler[TestResultsClientListResponse]{ More: func(page TestResultsClientListResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, @@ -317,7 +321,7 @@ func (client *TestResultsClient) listCreateRequest(ctx context.Context, resource } reqQP.Set("api-version", "2020-12-16-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/testbase/armtestbase/zz_generated_testsummaries_client.go b/sdk/resourcemanager/testbase/armtestbase/zz_generated_testsummaries_client.go index 87c7c4818bca..3e3879b8a262 100644 --- a/sdk/resourcemanager/testbase/armtestbase/zz_generated_testsummaries_client.go +++ b/sdk/resourcemanager/testbase/armtestbase/zz_generated_testsummaries_client.go @@ -38,7 +38,7 @@ func NewTestSummariesClient(subscriptionID string, credential azcore.TokenCreden if options == nil { options = &arm.ClientOptions{} } - ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { ep = c.Endpoint } @@ -56,6 +56,7 @@ func NewTestSummariesClient(subscriptionID string, credential azcore.TokenCreden // Get - Gets a Test Summary with specific name from all the Test Summaries of all the packages under a Test Base Account. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview // resourceGroupName - The name of the resource group that contains the resource. // testBaseAccountName - The resource name of the Test Base Account. // testSummaryName - The name of the Test Summary. @@ -101,7 +102,7 @@ func (client *TestSummariesClient) getCreateRequest(ctx context.Context, resourc reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-12-16-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -116,11 +117,12 @@ func (client *TestSummariesClient) getHandleResponse(resp *http.Response) (TestS // NewListPager - Lists the Test Summaries of all the packages under a Test Base Account. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview // resourceGroupName - The name of the resource group that contains the resource. // testBaseAccountName - The resource name of the Test Base Account. // options - TestSummariesClientListOptions contains the optional parameters for the TestSummariesClient.List method. func (client *TestSummariesClient) NewListPager(resourceGroupName string, testBaseAccountName string, options *TestSummariesClientListOptions) *runtime.Pager[TestSummariesClientListResponse] { - return runtime.NewPager(runtime.PageProcessor[TestSummariesClientListResponse]{ + return runtime.NewPager(runtime.PagingHandler[TestSummariesClientListResponse]{ More: func(page TestSummariesClientListResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, @@ -169,7 +171,7 @@ func (client *TestSummariesClient) listCreateRequest(ctx context.Context, resour reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-12-16-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/testbase/armtestbase/zz_generated_testtypes_client.go b/sdk/resourcemanager/testbase/armtestbase/zz_generated_testtypes_client.go index ada25958551c..aa6b582cdafd 100644 --- a/sdk/resourcemanager/testbase/armtestbase/zz_generated_testtypes_client.go +++ b/sdk/resourcemanager/testbase/armtestbase/zz_generated_testtypes_client.go @@ -38,7 +38,7 @@ func NewTestTypesClient(subscriptionID string, credential azcore.TokenCredential if options == nil { options = &arm.ClientOptions{} } - ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { ep = c.Endpoint } @@ -56,6 +56,7 @@ func NewTestTypesClient(subscriptionID string, credential azcore.TokenCredential // Get - Gets a test type of a Test Base Account. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview // resourceGroupName - The name of the resource group that contains the resource. // testBaseAccountName - The resource name of the Test Base Account. // testTypeResourceName - The resource name of a test type. @@ -101,7 +102,7 @@ func (client *TestTypesClient) getCreateRequest(ctx context.Context, resourceGro reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-12-16-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -116,11 +117,12 @@ func (client *TestTypesClient) getHandleResponse(resp *http.Response) (TestTypes // NewListPager - Lists all the test types of a Test Base Account. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview // resourceGroupName - The name of the resource group that contains the resource. // testBaseAccountName - The resource name of the Test Base Account. // options - TestTypesClientListOptions contains the optional parameters for the TestTypesClient.List method. func (client *TestTypesClient) NewListPager(resourceGroupName string, testBaseAccountName string, options *TestTypesClientListOptions) *runtime.Pager[TestTypesClientListResponse] { - return runtime.NewPager(runtime.PageProcessor[TestTypesClientListResponse]{ + return runtime.NewPager(runtime.PagingHandler[TestTypesClientListResponse]{ More: func(page TestTypesClientListResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, @@ -169,7 +171,7 @@ func (client *TestTypesClient) listCreateRequest(ctx context.Context, resourceGr reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-12-16-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/testbase/armtestbase/zz_generated_time_rfc3339.go b/sdk/resourcemanager/testbase/armtestbase/zz_generated_time_rfc3339.go index 4a446b009329..05286d832709 100644 --- a/sdk/resourcemanager/testbase/armtestbase/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/testbase/armtestbase/zz_generated_time_rfc3339.go @@ -10,6 +10,7 @@ package armtestbase import ( "encoding/json" + "fmt" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "reflect" "regexp" @@ -72,13 +73,13 @@ func populateTimeRFC3339(m map[string]interface{}, k string, t *time.Time) { m[k] = (*timeRFC3339)(t) } -func unpopulateTimeRFC3339(data json.RawMessage, t **time.Time) error { +func unpopulateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { if data == nil || strings.EqualFold(string(data), "null") { return nil } var aux timeRFC3339 if err := json.Unmarshal(data, &aux); err != nil { - return err + return fmt.Errorf("struct field %s: %v", fn, err) } *t = (*time.Time)(&aux) return nil diff --git a/sdk/resourcemanager/testbase/armtestbase/zz_generated_usage_client.go b/sdk/resourcemanager/testbase/armtestbase/zz_generated_usage_client.go index 61d21ee301e2..cae62fb44a8c 100644 --- a/sdk/resourcemanager/testbase/armtestbase/zz_generated_usage_client.go +++ b/sdk/resourcemanager/testbase/armtestbase/zz_generated_usage_client.go @@ -38,7 +38,7 @@ func NewUsageClient(subscriptionID string, credential azcore.TokenCredential, op if options == nil { options = &arm.ClientOptions{} } - ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { ep = c.Endpoint } @@ -56,11 +56,12 @@ func NewUsageClient(subscriptionID string, credential azcore.TokenCredential, op // NewListPager - Lists the usage data of a Test Base Account. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-12-16-preview // resourceGroupName - The name of the resource group that contains the resource. // testBaseAccountName - The resource name of the Test Base Account. // options - UsageClientListOptions contains the optional parameters for the UsageClient.List method. func (client *UsageClient) NewListPager(resourceGroupName string, testBaseAccountName string, options *UsageClientListOptions) *runtime.Pager[UsageClientListResponse] { - return runtime.NewPager(runtime.PageProcessor[UsageClientListResponse]{ + return runtime.NewPager(runtime.PagingHandler[UsageClientListResponse]{ More: func(page UsageClientListResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, @@ -112,7 +113,7 @@ func (client *UsageClient) listCreateRequest(ctx context.Context, resourceGroupN } reqQP.Set("api-version", "2020-12-16-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil }