diff --git a/sdk/resourcemanager/databox/armdatabox/CHANGELOG.md b/sdk/resourcemanager/databox/armdatabox/CHANGELOG.md index 167da6f7258d..a8dfcdc3f043 100644 --- a/sdk/resourcemanager/databox/armdatabox/CHANGELOG.md +++ b/sdk/resourcemanager/databox/armdatabox/CHANGELOG.md @@ -1,5 +1,49 @@ # Release History +## 1.0.0 (2022-05-18) +### Breaking Changes + +- Function `*JobsClient.BeginCreate` return value(s) have been changed from `(*armruntime.Poller[JobsClientCreateResponse], error)` to `(*runtime.Poller[JobsClientCreateResponse], error)` +- Function `*JobsClient.BeginUpdate` return value(s) have been changed from `(*armruntime.Poller[JobsClientUpdateResponse], error)` to `(*runtime.Poller[JobsClientUpdateResponse], error)` +- Function `*JobsClient.BeginDelete` return value(s) have been changed from `(*armruntime.Poller[JobsClientDeleteResponse], error)` to `(*runtime.Poller[JobsClientDeleteResponse], error)` +- Function `ShipmentPickUpResponse.MarshalJSON` has been removed +- Function `JobSecrets.MarshalJSON` has been removed +- Function `TransportAvailabilityResponse.MarshalJSON` has been removed +- Function `RegionConfigurationResponse.MarshalJSON` has been removed +- Function `PreferencesValidationResponseProperties.MarshalJSON` has been removed +- Function `AvailableSKUsResult.MarshalJSON` has been removed +- Function `ValidationResponseProperties.MarshalJSON` has been removed +- Function `DiskJobSecrets.MarshalJSON` has been removed +- Function `AddressValidationProperties.MarshalJSON` has been removed +- Function `ScheduleAvailabilityResponse.MarshalJSON` has been removed +- Function `UnencryptedCredentialsList.MarshalJSON` has been removed +- Function `SubscriptionIsAllowedToCreateJobValidationResponseProperties.MarshalJSON` has been removed +- Function `DiskGranularCopyLogDetails.MarshalJSON` has been removed +- Function `DataTransferDetailsValidationResponseProperties.MarshalJSON` has been removed +- Function `JobResourceList.MarshalJSON` has been removed +- Function `OperationList.MarshalJSON` has been removed +- Function `HeavySecret.MarshalJSON` has been removed +- Function `SKUAvailabilityValidationResponseProperties.MarshalJSON` has been removed +- Function `UnencryptedCredentials.MarshalJSON` has been removed +- Function `CreateOrderLimitForSubscriptionValidationResponseProperties.MarshalJSON` has been removed +- Function `Secret.MarshalJSON` has been removed +- Function `ShareCredentialDetails.MarshalJSON` has been removed +- Function `AccountCredentialDetails.MarshalJSON` has been removed +- Function `HeavyJobSecrets.MarshalJSON` has been removed +- Function `CustomerDiskJobSecrets.MarshalJSON` has been removed +- Function `ErrorDetail.MarshalJSON` has been removed +- Function `SKUProperties.MarshalJSON` has been removed + +### Features Added + +- New struct `DeviceErasureDetails` +- New field `DeviceErasureDetails` in struct `CommonJobDetails` +- New field `DeviceErasureDetails` in struct `CustomerDiskJobDetails` +- New field `DeviceErasureDetails` in struct `DiskJobDetails` +- New field `DeviceErasureDetails` in struct `HeavyJobDetails` +- New field `DeviceErasureDetails` in struct `JobDetails` + + ## 0.4.0 (2022-04-15) ### Breaking Changes diff --git a/sdk/resourcemanager/databox/armdatabox/autorest.md b/sdk/resourcemanager/databox/armdatabox/autorest.md index f191e5d9a02e..733abe2b40b0 100644 --- a/sdk/resourcemanager/databox/armdatabox/autorest.md +++ b/sdk/resourcemanager/databox/armdatabox/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/cc26f1d28c939bbcde00a29aa8958b3eebb10cea/specification/databox/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/cc26f1d28c939bbcde00a29aa8958b3eebb10cea/specification/databox/resource-manager/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/databox/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/databox/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.4.0 +module-version: 1.0.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/databox/armdatabox/go.mod b/sdk/resourcemanager/databox/armdatabox/go.mod index b5a2862fcb5f..fe4c446ec19c 100644 --- a/sdk/resourcemanager/databox/armdatabox/go.mod +++ b/sdk/resourcemanager/databox/armdatabox/go.mod @@ -3,19 +3,19 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databox/armdatabox 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/databox/armdatabox/go.sum b/sdk/resourcemanager/databox/armdatabox/go.sum index 56d1c32628ae..ed5b814680ee 100644 --- a/sdk/resourcemanager/databox/armdatabox/go.sum +++ b/sdk/resourcemanager/databox/armdatabox/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/databox/armdatabox/ze_generated_example_databoxmanagementclient_client_test.go b/sdk/resourcemanager/databox/armdatabox/ze_generated_example_databoxmanagementclient_client_test.go index c4e741bedbed..06b42066948b 100644 --- a/sdk/resourcemanager/databox/armdatabox/ze_generated_example_databoxmanagementclient_client_test.go +++ b/sdk/resourcemanager/databox/armdatabox/ze_generated_example_databoxmanagementclient_client_test.go @@ -17,20 +17,20 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databox/armdatabox" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databox/resource-manager/Microsoft.DataBox/stable/2021-12-01/examples/JobMitigate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databox/resource-manager/Microsoft.DataBox/stable/2022-02-01/examples/JobMitigate.json func ExampleManagementClient_Mitigate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armdatabox.NewManagementClient("", cred, nil) + client, err := armdatabox.NewManagementClient("fa68082f-8ff7-4a25-95c7-ce9da541242f", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = client.Mitigate(ctx, - "", - "", + "SdkJob8367", + "SdkRg9836", armdatabox.MitigateJobRequest{ CustomerResolutionCode: to.Ptr(armdatabox.CustomerResolutionCodeMoveToCleanUpDevice), }, diff --git a/sdk/resourcemanager/databox/armdatabox/ze_generated_example_jobs_client_test.go b/sdk/resourcemanager/databox/armdatabox/ze_generated_example_jobs_client_test.go index 0d276bec77e6..22139a1b8a6f 100644 --- a/sdk/resourcemanager/databox/armdatabox/ze_generated_example_jobs_client_test.go +++ b/sdk/resourcemanager/databox/armdatabox/ze_generated_example_jobs_client_test.go @@ -19,14 +19,14 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databox/armdatabox" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databox/resource-manager/Microsoft.DataBox/stable/2021-12-01/examples/JobsList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databox/resource-manager/Microsoft.DataBox/stable/2022-02-01/examples/JobsList.json func ExampleJobsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armdatabox.NewJobsClient("", cred, nil) + client, err := armdatabox.NewJobsClient("fa68082f-8ff7-4a25-95c7-ce9da541242f", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -35,7 +35,6 @@ func ExampleJobsClient_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 @@ -44,24 +43,24 @@ func ExampleJobsClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databox/resource-manager/Microsoft.DataBox/stable/2021-12-01/examples/MarkDevicesShipped.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databox/resource-manager/Microsoft.DataBox/stable/2022-02-01/examples/MarkDevicesShipped.json func ExampleJobsClient_MarkDevicesShipped() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armdatabox.NewJobsClient("", cred, nil) + client, err := armdatabox.NewJobsClient("fa68082f-8ff7-4a25-95c7-ce9da541242f", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = client.MarkDevicesShipped(ctx, - "", - "", + "SdkJob8367", + "SdkRg9836", armdatabox.MarkDevicesShippedRequest{ DeliverToDcPackageDetails: &armdatabox.PackageCarrierInfo{ - CarrierName: to.Ptr(""), - TrackingID: to.Ptr(""), + CarrierName: to.Ptr("DHL"), + TrackingID: to.Ptr("123456"), }, }, nil) @@ -70,24 +69,23 @@ func ExampleJobsClient_MarkDevicesShipped() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databox/resource-manager/Microsoft.DataBox/stable/2021-12-01/examples/JobsListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databox/resource-manager/Microsoft.DataBox/stable/2022-02-01/examples/JobsListByResourceGroup.json func ExampleJobsClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armdatabox.NewJobsClient("", cred, nil) + client, err := armdatabox.NewJobsClient("fa68082f-8ff7-4a25-95c7-ce9da541242f", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListByResourceGroupPager("", + pager := client.NewListByResourceGroupPager("SdkRg5154", &armdatabox.JobsClientListByResourceGroupOptions{SkipToken: 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 @@ -96,21 +94,21 @@ func ExampleJobsClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databox/resource-manager/Microsoft.DataBox/stable/2021-12-01/examples/JobsGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databox/resource-manager/Microsoft.DataBox/stable/2022-02-01/examples/JobsGet.json func ExampleJobsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armdatabox.NewJobsClient("", cred, nil) + client, err := armdatabox.NewJobsClient("fa68082f-8ff7-4a25-95c7-ce9da541242f", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.Get(ctx, - "", - "", - &armdatabox.JobsClientGetOptions{Expand: to.Ptr("")}) + "SdkRg5154", + "SdkJob952", + &armdatabox.JobsClientGetOptions{Expand: to.Ptr("details")}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -118,22 +116,22 @@ func ExampleJobsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databox/resource-manager/Microsoft.DataBox/stable/2021-12-01/examples/JobsCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databox/resource-manager/Microsoft.DataBox/stable/2022-02-01/examples/JobsCreate.json func ExampleJobsClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armdatabox.NewJobsClient("", cred, nil) + client, err := armdatabox.NewJobsClient("fa68082f-8ff7-4a25-95c7-ce9da541242f", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := client.BeginCreate(ctx, - "", - "", + "SdkRg5154", + "SdkJob952", armdatabox.JobResource{ - Location: to.Ptr(""), + Location: to.Ptr("westus"), SKU: &armdatabox.SKU{ Name: to.Ptr(armdatabox.SKUNameDataBox), }, @@ -141,38 +139,38 @@ func ExampleJobsClient_BeginCreate() { TransferType: to.Ptr(armdatabox.TransferTypeImportToAzure), Details: &armdatabox.JobDetails{ ContactDetails: &armdatabox.ContactDetails{ - ContactName: to.Ptr(""), + ContactName: to.Ptr("Public SDK Test"), EmailList: []*string{ to.Ptr("testing@microsoft.com")}, - Phone: to.Ptr(""), - PhoneExtension: to.Ptr(""), + Phone: to.Ptr("1234567890"), + PhoneExtension: to.Ptr("1234"), }, DataImportDetails: []*armdatabox.DataImportDetails{ { AccountDetails: &armdatabox.StorageAccountDetails{ DataAccountType: to.Ptr(armdatabox.DataAccountTypeStorageAccount), - StorageAccountID: to.Ptr(""), + StorageAccountID: to.Ptr("/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount"), }, }}, JobDetailsType: to.Ptr(armdatabox.ClassDiscriminatorDataBox), ShippingAddress: &armdatabox.ShippingAddress{ AddressType: to.Ptr(armdatabox.AddressTypeCommercial), - City: to.Ptr(""), - CompanyName: to.Ptr(""), - Country: to.Ptr(""), - PostalCode: to.Ptr(""), - StateOrProvince: to.Ptr(""), - StreetAddress1: to.Ptr(""), - StreetAddress2: to.Ptr(""), + City: to.Ptr("San Francisco"), + CompanyName: to.Ptr("Microsoft"), + Country: to.Ptr("US"), + PostalCode: to.Ptr("94107"), + StateOrProvince: to.Ptr("CA"), + StreetAddress1: to.Ptr("16 TOWNSEND ST"), + StreetAddress2: to.Ptr("Unit 1"), }, }, }, }, - &armdatabox.JobsClientBeginCreateOptions{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) } @@ -180,74 +178,72 @@ func ExampleJobsClient_BeginCreate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databox/resource-manager/Microsoft.DataBox/stable/2021-12-01/examples/JobsDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databox/resource-manager/Microsoft.DataBox/stable/2022-02-01/examples/JobsDelete.json func ExampleJobsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armdatabox.NewJobsClient("", cred, nil) + client, err := armdatabox.NewJobsClient("fa68082f-8ff7-4a25-95c7-ce9da541242f", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := client.BeginDelete(ctx, - "", - "", - &armdatabox.JobsClientBeginDeleteOptions{ResumeToken: ""}) + "SdkRg5154", + "SdkJob952", + 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) } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databox/resource-manager/Microsoft.DataBox/stable/2021-12-01/examples/JobsPatch.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databox/resource-manager/Microsoft.DataBox/stable/2022-02-01/examples/JobsPatch.json func ExampleJobsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armdatabox.NewJobsClient("", cred, nil) + client, err := armdatabox.NewJobsClient("fa68082f-8ff7-4a25-95c7-ce9da541242f", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := client.BeginUpdate(ctx, - "", - "", + "SdkRg5154", + "SdkJob952", armdatabox.JobResourceUpdateParameter{ Properties: &armdatabox.UpdateJobProperties{ Details: &armdatabox.UpdateJobDetails{ ContactDetails: &armdatabox.ContactDetails{ - ContactName: to.Ptr(""), + ContactName: to.Ptr("Update Job"), EmailList: []*string{ to.Ptr("testing@microsoft.com")}, - Phone: to.Ptr(""), - PhoneExtension: to.Ptr(""), + Phone: to.Ptr("1234567890"), + PhoneExtension: to.Ptr("1234"), }, ShippingAddress: &armdatabox.ShippingAddress{ AddressType: to.Ptr(armdatabox.AddressTypeCommercial), - City: to.Ptr(""), - CompanyName: to.Ptr(""), - Country: to.Ptr(""), - PostalCode: to.Ptr(""), - StateOrProvince: to.Ptr(""), - StreetAddress1: to.Ptr(""), - StreetAddress2: to.Ptr(""), + City: to.Ptr("San Francisco"), + CompanyName: to.Ptr("Microsoft"), + Country: to.Ptr("US"), + PostalCode: to.Ptr("94107"), + StateOrProvince: to.Ptr("CA"), + StreetAddress1: to.Ptr("16 TOWNSEND ST"), + StreetAddress2: to.Ptr("Unit 1"), }, }, }, }, - &armdatabox.JobsClientBeginUpdateOptions{IfMatch: nil, - ResumeToken: "", - }) + &armdatabox.JobsClientBeginUpdateOptions{IfMatch: 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) } @@ -255,23 +251,23 @@ func ExampleJobsClient_BeginUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databox/resource-manager/Microsoft.DataBox/stable/2021-12-01/examples/BookShipmentPickupPost.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databox/resource-manager/Microsoft.DataBox/stable/2022-02-01/examples/BookShipmentPickupPost.json func ExampleJobsClient_BookShipmentPickUp() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armdatabox.NewJobsClient("", cred, nil) + client, err := armdatabox.NewJobsClient("fa68082f-8ff7-4a25-95c7-ce9da541242f", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.BookShipmentPickUp(ctx, - "", - "", + "bvttoolrg6", + "TJ-636646322037905056", armdatabox.ShipmentPickUpRequest{ EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-22T18:30:00Z"); return t }()), - ShipmentLocation: to.Ptr(""), + ShipmentLocation: to.Ptr("Front desk"), StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-20T18:30:00Z"); return t }()), }, nil) @@ -282,22 +278,22 @@ func ExampleJobsClient_BookShipmentPickUp() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databox/resource-manager/Microsoft.DataBox/stable/2021-12-01/examples/JobsCancelPost.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databox/resource-manager/Microsoft.DataBox/stable/2022-02-01/examples/JobsCancelPost.json func ExampleJobsClient_Cancel() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armdatabox.NewJobsClient("", cred, nil) + client, err := armdatabox.NewJobsClient("fa68082f-8ff7-4a25-95c7-ce9da541242f", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = client.Cancel(ctx, - "", - "", + "SdkRg5154", + "SdkJob952", armdatabox.CancellationReason{ - Reason: to.Ptr(""), + Reason: to.Ptr("CancelTest"), }, nil) if err != nil { @@ -305,25 +301,24 @@ func ExampleJobsClient_Cancel() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databox/resource-manager/Microsoft.DataBox/stable/2021-12-01/examples/JobsListCredentials.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databox/resource-manager/Microsoft.DataBox/stable/2022-02-01/examples/JobsListCredentials.json func ExampleJobsClient_NewListCredentialsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armdatabox.NewJobsClient("", cred, nil) + client, err := armdatabox.NewJobsClient("fa68082f-8ff7-4a25-95c7-ce9da541242f", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListCredentialsPager("", - "", + pager := client.NewListCredentialsPager("bvttoolrg6", + "TJ-636646322037905056", 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/databox/armdatabox/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/databox/armdatabox/ze_generated_example_operations_client_test.go index a37406467567..5b043bcd84d3 100644 --- a/sdk/resourcemanager/databox/armdatabox/ze_generated_example_operations_client_test.go +++ b/sdk/resourcemanager/databox/armdatabox/ze_generated_example_operations_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databox/armdatabox" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databox/resource-manager/Microsoft.DataBox/stable/2021-12-01/examples/OperationsGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databox/resource-manager/Microsoft.DataBox/stable/2022-02-01/examples/OperationsGet.json func ExampleOperationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -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/databox/armdatabox/ze_generated_example_service_client_test.go b/sdk/resourcemanager/databox/armdatabox/ze_generated_example_service_client_test.go index 7fe37704aa56..8cdfcee7125d 100644 --- a/sdk/resourcemanager/databox/armdatabox/ze_generated_example_service_client_test.go +++ b/sdk/resourcemanager/databox/armdatabox/ze_generated_example_service_client_test.go @@ -17,31 +17,31 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databox/armdatabox" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databox/resource-manager/Microsoft.DataBox/stable/2021-12-01/examples/ValidateAddressPost.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databox/resource-manager/Microsoft.DataBox/stable/2022-02-01/examples/ValidateAddressPost.json func ExampleServiceClient_ValidateAddress() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armdatabox.NewServiceClient("", cred, nil) + client, err := armdatabox.NewServiceClient("fa68082f-8ff7-4a25-95c7-ce9da541242f", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.ValidateAddress(ctx, - "", + "westus", armdatabox.ValidateAddress{ ValidationType: to.Ptr(armdatabox.ValidationInputDiscriminatorValidateAddress), DeviceType: to.Ptr(armdatabox.SKUNameDataBox), ShippingAddress: &armdatabox.ShippingAddress{ AddressType: to.Ptr(armdatabox.AddressTypeCommercial), - City: to.Ptr(""), - CompanyName: to.Ptr(""), - Country: to.Ptr(""), - PostalCode: to.Ptr(""), - StateOrProvince: to.Ptr(""), - StreetAddress1: to.Ptr(""), - StreetAddress2: to.Ptr(""), + City: to.Ptr("San Francisco"), + CompanyName: to.Ptr("Microsoft"), + Country: to.Ptr("US"), + PostalCode: to.Ptr("94107"), + StateOrProvince: to.Ptr("CA"), + StreetAddress1: to.Ptr("16 TOWNSEND ST"), + StreetAddress2: to.Ptr("Unit 1"), }, }, nil) @@ -52,20 +52,20 @@ func ExampleServiceClient_ValidateAddress() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databox/resource-manager/Microsoft.DataBox/stable/2021-12-01/examples/ValidateInputsByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databox/resource-manager/Microsoft.DataBox/stable/2022-02-01/examples/ValidateInputsByResourceGroup.json func ExampleServiceClient_ValidateInputsByResourceGroup() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armdatabox.NewServiceClient("", cred, nil) + client, err := armdatabox.NewServiceClient("fa68082f-8ff7-4a25-95c7-ce9da541242f", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.ValidateInputsByResourceGroup(ctx, - "", - "", + "SdkRg6861", + "westus", &armdatabox.CreateJobValidations{ IndividualRequestDetails: []armdatabox.ValidationInputRequestClassification{ &armdatabox.DataTransferDetailsValidationRequest{ @@ -74,7 +74,7 @@ func ExampleServiceClient_ValidateInputsByResourceGroup() { { AccountDetails: &armdatabox.StorageAccountDetails{ DataAccountType: to.Ptr(armdatabox.DataAccountTypeStorageAccount), - StorageAccountID: to.Ptr(""), + StorageAccountID: to.Ptr("/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount"), }, }}, DeviceType: to.Ptr(armdatabox.SKUNameDataBox), @@ -85,13 +85,13 @@ func ExampleServiceClient_ValidateInputsByResourceGroup() { DeviceType: to.Ptr(armdatabox.SKUNameDataBox), ShippingAddress: &armdatabox.ShippingAddress{ AddressType: to.Ptr(armdatabox.AddressTypeCommercial), - City: to.Ptr(""), - CompanyName: to.Ptr(""), - Country: to.Ptr(""), - PostalCode: to.Ptr(""), - StateOrProvince: to.Ptr(""), - StreetAddress1: to.Ptr(""), - StreetAddress2: to.Ptr(""), + City: to.Ptr("San Francisco"), + CompanyName: to.Ptr("Microsoft"), + Country: to.Ptr("US"), + PostalCode: to.Ptr("94107"), + StateOrProvince: to.Ptr("CA"), + StreetAddress1: to.Ptr("16 TOWNSEND ST"), + StreetAddress2: to.Ptr("Unit 1"), }, TransportPreferences: &armdatabox.TransportPreferences{ PreferredShipmentType: to.Ptr(armdatabox.TransportShipmentTypesMicrosoftManaged), @@ -102,9 +102,9 @@ func ExampleServiceClient_ValidateInputsByResourceGroup() { }, &armdatabox.SKUAvailabilityValidationRequest{ ValidationType: to.Ptr(armdatabox.ValidationInputDiscriminatorValidateSKUAvailability), - Country: to.Ptr(""), + Country: to.Ptr("US"), DeviceType: to.Ptr(armdatabox.SKUNameDataBox), - Location: to.Ptr(""), + Location: to.Ptr("westus"), TransferType: to.Ptr(armdatabox.TransferTypeImportToAzure), }, &armdatabox.CreateOrderLimitForSubscriptionValidationRequest{ @@ -120,7 +120,7 @@ func ExampleServiceClient_ValidateInputsByResourceGroup() { }, }, }}, - ValidationCategory: to.Ptr(""), + ValidationCategory: to.Ptr("JobCreationValidation"), }, nil) if err != nil { @@ -130,19 +130,19 @@ func ExampleServiceClient_ValidateInputsByResourceGroup() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databox/resource-manager/Microsoft.DataBox/stable/2021-12-01/examples/ValidateInputs.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databox/resource-manager/Microsoft.DataBox/stable/2022-02-01/examples/ValidateInputs.json func ExampleServiceClient_ValidateInputs() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armdatabox.NewServiceClient("", cred, nil) + client, err := armdatabox.NewServiceClient("fa68082f-8ff7-4a25-95c7-ce9da541242f", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.ValidateInputs(ctx, - "", + "westus", &armdatabox.CreateJobValidations{ IndividualRequestDetails: []armdatabox.ValidationInputRequestClassification{ &armdatabox.DataTransferDetailsValidationRequest{ @@ -151,7 +151,7 @@ func ExampleServiceClient_ValidateInputs() { { AccountDetails: &armdatabox.StorageAccountDetails{ DataAccountType: to.Ptr(armdatabox.DataAccountTypeStorageAccount), - StorageAccountID: to.Ptr(""), + StorageAccountID: to.Ptr("/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount"), }, }}, DeviceType: to.Ptr(armdatabox.SKUNameDataBox), @@ -162,13 +162,13 @@ func ExampleServiceClient_ValidateInputs() { DeviceType: to.Ptr(armdatabox.SKUNameDataBox), ShippingAddress: &armdatabox.ShippingAddress{ AddressType: to.Ptr(armdatabox.AddressTypeCommercial), - City: to.Ptr(""), - CompanyName: to.Ptr(""), - Country: to.Ptr(""), - PostalCode: to.Ptr(""), - StateOrProvince: to.Ptr(""), - StreetAddress1: to.Ptr(""), - StreetAddress2: to.Ptr(""), + City: to.Ptr("San Francisco"), + CompanyName: to.Ptr("Microsoft"), + Country: to.Ptr("US"), + PostalCode: to.Ptr("94107"), + StateOrProvince: to.Ptr("CA"), + StreetAddress1: to.Ptr("16 TOWNSEND ST"), + StreetAddress2: to.Ptr("Unit 1"), }, TransportPreferences: &armdatabox.TransportPreferences{ PreferredShipmentType: to.Ptr(armdatabox.TransportShipmentTypesMicrosoftManaged), @@ -179,9 +179,9 @@ func ExampleServiceClient_ValidateInputs() { }, &armdatabox.SKUAvailabilityValidationRequest{ ValidationType: to.Ptr(armdatabox.ValidationInputDiscriminatorValidateSKUAvailability), - Country: to.Ptr(""), + Country: to.Ptr("US"), DeviceType: to.Ptr(armdatabox.SKUNameDataBox), - Location: to.Ptr(""), + Location: to.Ptr("westus"), TransferType: to.Ptr(armdatabox.TransferTypeImportToAzure), }, &armdatabox.CreateOrderLimitForSubscriptionValidationRequest{ @@ -197,7 +197,7 @@ func ExampleServiceClient_ValidateInputs() { }, }, }}, - ValidationCategory: to.Ptr(""), + ValidationCategory: to.Ptr("JobCreationValidation"), }, nil) if err != nil { @@ -207,23 +207,23 @@ func ExampleServiceClient_ValidateInputs() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databox/resource-manager/Microsoft.DataBox/stable/2021-12-01/examples/RegionConfiguration.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databox/resource-manager/Microsoft.DataBox/stable/2022-02-01/examples/RegionConfiguration.json func ExampleServiceClient_RegionConfiguration() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armdatabox.NewServiceClient("", cred, nil) + client, err := armdatabox.NewServiceClient("fa68082f-8ff7-4a25-95c7-ce9da541242f", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.RegionConfiguration(ctx, - "", + "westus", armdatabox.RegionConfigurationRequest{ ScheduleAvailabilityRequest: &armdatabox.ScheduleAvailabilityRequest{ SKUName: to.Ptr(armdatabox.SKUNameDataBox), - StorageLocation: to.Ptr(""), + StorageLocation: to.Ptr("westus"), }, }, nil) @@ -234,24 +234,24 @@ func ExampleServiceClient_RegionConfiguration() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databox/resource-manager/Microsoft.DataBox/stable/2021-12-01/examples/RegionConfigurationByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databox/resource-manager/Microsoft.DataBox/stable/2022-02-01/examples/RegionConfigurationByResourceGroup.json func ExampleServiceClient_RegionConfigurationByResourceGroup() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armdatabox.NewServiceClient("", cred, nil) + client, err := armdatabox.NewServiceClient("fa68082f-8ff7-4a25-95c7-ce9da541242f", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.RegionConfigurationByResourceGroup(ctx, - "", - "", + "SdkRg4981", + "westus", armdatabox.RegionConfigurationRequest{ ScheduleAvailabilityRequest: &armdatabox.ScheduleAvailabilityRequest{ SKUName: to.Ptr(armdatabox.SKUNameDataBox), - StorageLocation: to.Ptr(""), + StorageLocation: to.Ptr("westus"), }, }, nil) diff --git a/sdk/resourcemanager/databox/armdatabox/zz_generated_constants.go b/sdk/resourcemanager/databox/armdatabox/zz_generated_constants.go index 738c3f170d3c..2101651dbd56 100644 --- a/sdk/resourcemanager/databox/armdatabox/zz_generated_constants.go +++ b/sdk/resourcemanager/databox/armdatabox/zz_generated_constants.go @@ -10,7 +10,7 @@ package armdatabox const ( moduleName = "armdatabox" - moduleVersion = "v0.4.0" + moduleVersion = "v1.0.0" ) type AccessProtocol string @@ -661,7 +661,7 @@ func PossibleStageNameValues() []StageName { } } -// StageStatus - Status of the job stage. +// StageStatus - Holds the device erasure completion status type StageStatus string const ( @@ -689,7 +689,7 @@ const ( StageStatusWaitingForCustomerActionForCleanUp StageStatus = "WaitingForCustomerActionForCleanUp" // StageStatusCustomerActionPerformedForCleanUp - Stage has performed customer action for clean up. StageStatusCustomerActionPerformedForCleanUp StageStatus = "CustomerActionPerformedForCleanUp" - // StageStatusCustomerActionPerformed - Stage has performed customer action. + // StageStatusCustomerActionPerformed - Stage has performed customer action for clean up. StageStatusCustomerActionPerformed StageStatus = "CustomerActionPerformed" ) diff --git a/sdk/resourcemanager/databox/armdatabox/zz_generated_jobs_client.go b/sdk/resourcemanager/databox/armdatabox/zz_generated_jobs_client.go index 1a19fcd9a89d..f9b363fc6b66 100644 --- a/sdk/resourcemanager/databox/armdatabox/zz_generated_jobs_client.go +++ b/sdk/resourcemanager/databox/armdatabox/zz_generated_jobs_client.go @@ -38,7 +38,7 @@ func NewJobsClient(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,6 +56,7 @@ func NewJobsClient(subscriptionID string, credential azcore.TokenCredential, opt // BookShipmentPickUp - Book shipment pick up. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-01 // resourceGroupName - The Resource Group Name // jobName - The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters // in length and use any alphanumeric and underscore only @@ -96,9 +97,9 @@ func (client *JobsClient) bookShipmentPickUpCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-02-01") 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, shipmentPickUpRequest) } @@ -113,6 +114,7 @@ func (client *JobsClient) bookShipmentPickUpHandleResponse(resp *http.Response) // Cancel - CancelJob. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-01 // resourceGroupName - The Resource Group Name // jobName - The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters // in length and use any alphanumeric and underscore only @@ -153,35 +155,37 @@ func (client *JobsClient) cancelCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-02-01") 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, cancellationReason) } // BeginCreate - Creates a new job with the specified parameters. Existing job cannot be updated with this API and should // instead be updated with the Update job API. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-01 // resourceGroupName - The Resource Group Name // jobName - The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters // in length and use any alphanumeric and underscore only // jobResource - Job details from request body. // options - JobsClientBeginCreateOptions contains the optional parameters for the JobsClient.BeginCreate method. -func (client *JobsClient) BeginCreate(ctx context.Context, resourceGroupName string, jobName string, jobResource JobResource, options *JobsClientBeginCreateOptions) (*armruntime.Poller[JobsClientCreateResponse], error) { +func (client *JobsClient) BeginCreate(ctx context.Context, resourceGroupName string, jobName string, jobResource JobResource, options *JobsClientBeginCreateOptions) (*runtime.Poller[JobsClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.create(ctx, resourceGroupName, jobName, jobResource, options) if err != nil { return nil, err } - return armruntime.NewPoller[JobsClientCreateResponse](resp, client.pl, nil) + return runtime.NewPoller[JobsClientCreateResponse](resp, client.pl, nil) } else { - return armruntime.NewPollerFromResumeToken[JobsClientCreateResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[JobsClientCreateResponse](options.ResumeToken, client.pl, nil) } } // Create - Creates a new job with the specified parameters. Existing job cannot be updated with this API and should instead // be updated with the Update job API. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-01 func (client *JobsClient) create(ctx context.Context, resourceGroupName string, jobName string, jobResource JobResource, options *JobsClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, jobName, jobResource, options) if err != nil { @@ -217,32 +221,34 @@ func (client *JobsClient) createCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-02-01") 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, jobResource) } // BeginDelete - Deletes a job. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-01 // resourceGroupName - The Resource Group Name // jobName - The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters // in length and use any alphanumeric and underscore only // options - JobsClientBeginDeleteOptions contains the optional parameters for the JobsClient.BeginDelete method. -func (client *JobsClient) BeginDelete(ctx context.Context, resourceGroupName string, jobName string, options *JobsClientBeginDeleteOptions) (*armruntime.Poller[JobsClientDeleteResponse], error) { +func (client *JobsClient) BeginDelete(ctx context.Context, resourceGroupName string, jobName string, options *JobsClientBeginDeleteOptions) (*runtime.Poller[JobsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, jobName, options) if err != nil { return nil, err } - return armruntime.NewPoller[JobsClientDeleteResponse](resp, client.pl, nil) + return runtime.NewPoller[JobsClientDeleteResponse](resp, client.pl, nil) } else { - return armruntime.NewPollerFromResumeToken[JobsClientDeleteResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[JobsClientDeleteResponse](options.ResumeToken, client.pl, nil) } } // Delete - Deletes a job. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-01 func (client *JobsClient) deleteOperation(ctx context.Context, resourceGroupName string, jobName string, options *JobsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, jobName, options) if err != nil { @@ -278,14 +284,15 @@ func (client *JobsClient) deleteCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-02-01") 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 information about the specified job. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-01 // resourceGroupName - The Resource Group Name // jobName - The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters // in length and use any alphanumeric and underscore only @@ -325,12 +332,12 @@ func (client *JobsClient) getCreateRequest(ctx context.Context, resourceGroupNam return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-02-01") if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -345,9 +352,10 @@ func (client *JobsClient) getHandleResponse(resp *http.Response) (JobsClientGetR // NewListPager - Lists all the jobs available under the subscription. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-01 // options - JobsClientListOptions contains the optional parameters for the JobsClient.List method. func (client *JobsClient) NewListPager(options *JobsClientListOptions) *runtime.Pager[JobsClientListResponse] { - return runtime.NewPager(runtime.PageProcessor[JobsClientListResponse]{ + return runtime.NewPager(runtime.PagingHandler[JobsClientListResponse]{ More: func(page JobsClientListResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, @@ -386,12 +394,12 @@ func (client *JobsClient) listCreateRequest(ctx context.Context, options *JobsCl return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-02-01") if options != nil && options.SkipToken != nil { reqQP.Set("$skipToken", *options.SkipToken) } req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -406,11 +414,12 @@ func (client *JobsClient) listHandleResponse(resp *http.Response) (JobsClientLis // NewListByResourceGroupPager - Lists all the jobs available under the given resource group. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-01 // resourceGroupName - The Resource Group Name // options - JobsClientListByResourceGroupOptions contains the optional parameters for the JobsClient.ListByResourceGroup // method. func (client *JobsClient) NewListByResourceGroupPager(resourceGroupName string, options *JobsClientListByResourceGroupOptions) *runtime.Pager[JobsClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PageProcessor[JobsClientListByResourceGroupResponse]{ + return runtime.NewPager(runtime.PagingHandler[JobsClientListByResourceGroupResponse]{ More: func(page JobsClientListByResourceGroupResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, @@ -453,12 +462,12 @@ func (client *JobsClient) listByResourceGroupCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-02-01") if options != nil && options.SkipToken != nil { reqQP.Set("$skipToken", *options.SkipToken) } req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -473,12 +482,13 @@ func (client *JobsClient) listByResourceGroupHandleResponse(resp *http.Response) // NewListCredentialsPager - This method gets the unencrypted secrets related to the job. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-01 // resourceGroupName - The Resource Group Name // jobName - The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters // in length and use any alphanumeric and underscore only // options - JobsClientListCredentialsOptions contains the optional parameters for the JobsClient.ListCredentials method. func (client *JobsClient) NewListCredentialsPager(resourceGroupName string, jobName string, options *JobsClientListCredentialsOptions) *runtime.Pager[JobsClientListCredentialsResponse] { - return runtime.NewPager(runtime.PageProcessor[JobsClientListCredentialsResponse]{ + return runtime.NewPager(runtime.PagingHandler[JobsClientListCredentialsResponse]{ More: func(page JobsClientListCredentialsResponse) bool { return false }, @@ -519,9 +529,9 @@ func (client *JobsClient) listCredentialsCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-02-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -536,6 +546,7 @@ func (client *JobsClient) listCredentialsHandleResponse(resp *http.Response) (Jo // MarkDevicesShipped - Request to mark devices for a given job as shipped // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-01 // jobName - The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters // in length and use any alphanumeric and underscore only // resourceGroupName - The Resource Group Name @@ -576,33 +587,35 @@ func (client *JobsClient) markDevicesShippedCreateRequest(ctx context.Context, j return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-02-01") 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, markDevicesShippedRequest) } // BeginUpdate - Updates the properties of an existing job. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-01 // resourceGroupName - The Resource Group Name // jobName - The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters // in length and use any alphanumeric and underscore only // jobResourceUpdateParameter - Job update parameters from request body. // options - JobsClientBeginUpdateOptions contains the optional parameters for the JobsClient.BeginUpdate method. -func (client *JobsClient) BeginUpdate(ctx context.Context, resourceGroupName string, jobName string, jobResourceUpdateParameter JobResourceUpdateParameter, options *JobsClientBeginUpdateOptions) (*armruntime.Poller[JobsClientUpdateResponse], error) { +func (client *JobsClient) BeginUpdate(ctx context.Context, resourceGroupName string, jobName string, jobResourceUpdateParameter JobResourceUpdateParameter, options *JobsClientBeginUpdateOptions) (*runtime.Poller[JobsClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, jobName, jobResourceUpdateParameter, options) if err != nil { return nil, err } - return armruntime.NewPoller[JobsClientUpdateResponse](resp, client.pl, nil) + return runtime.NewPoller[JobsClientUpdateResponse](resp, client.pl, nil) } else { - return armruntime.NewPollerFromResumeToken[JobsClientUpdateResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[JobsClientUpdateResponse](options.ResumeToken, client.pl, nil) } } // Update - Updates the properties of an existing job. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-01 func (client *JobsClient) update(ctx context.Context, resourceGroupName string, jobName string, jobResourceUpdateParameter JobResourceUpdateParameter, options *JobsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, jobName, jobResourceUpdateParameter, options) if err != nil { @@ -638,11 +651,11 @@ func (client *JobsClient) updateCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-02-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { - req.Raw().Header.Set("If-Match", *options.IfMatch) + req.Raw().Header["If-Match"] = []string{*options.IfMatch} } - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, jobResourceUpdateParameter) } diff --git a/sdk/resourcemanager/databox/armdatabox/zz_generated_management_client.go b/sdk/resourcemanager/databox/armdatabox/zz_generated_management_client.go index 124e5684abd4..98b02f4d0710 100644 --- a/sdk/resourcemanager/databox/armdatabox/zz_generated_management_client.go +++ b/sdk/resourcemanager/databox/armdatabox/zz_generated_management_client.go @@ -38,7 +38,7 @@ func NewManagementClient(subscriptionID string, credential azcore.TokenCredentia 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 NewManagementClient(subscriptionID string, credential azcore.TokenCredentia // Mitigate - Request to mitigate for a given job // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-01 // jobName - The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters // in length and use any alphanumeric and underscore only // resourceGroupName - The Resource Group Name @@ -96,8 +97,8 @@ func (client *ManagementClient) mitigateCreateRequest(ctx context.Context, jobNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-02-01") 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, mitigateJobRequest) } diff --git a/sdk/resourcemanager/databox/armdatabox/zz_generated_models.go b/sdk/resourcemanager/databox/armdatabox/zz_generated_models.go index 149c79f0f150..278173e2a7c2 100644 --- a/sdk/resourcemanager/databox/armdatabox/zz_generated_models.go +++ b/sdk/resourcemanager/databox/armdatabox/zz_generated_models.go @@ -30,6 +30,13 @@ type AccountCopyLogDetails struct { CopyVerboseLogLink *string `json:"copyVerboseLogLink,omitempty" azure:"ro"` } +// GetCopyLogDetails implements the CopyLogDetailsClassification interface for type AccountCopyLogDetails. +func (a *AccountCopyLogDetails) GetCopyLogDetails() *CopyLogDetails { + return &CopyLogDetails{ + CopyLogDetailsType: a.CopyLogDetailsType, + } +} + // AccountCredentialDetails - Credential details of the account. type AccountCredentialDetails struct { // READ-ONLY; Connection string of the account endpoint to use the account as a storage endpoint on the device. @@ -75,6 +82,14 @@ type AddressValidationProperties struct { ValidationStatus *AddressValidationStatus `json:"validationStatus,omitempty" azure:"ro"` } +// GetValidationInputResponse implements the ValidationInputResponseClassification interface for type AddressValidationProperties. +func (a *AddressValidationProperties) GetValidationInputResponse() *ValidationInputResponse { + return &ValidationInputResponse{ + ValidationType: a.ValidationType, + Error: a.Error, + } +} + // ApplianceNetworkConfiguration - The Network Adapter configuration of a DataBox. type ApplianceNetworkConfiguration struct { // READ-ONLY; Mac Address. @@ -221,6 +236,9 @@ type CommonJobDetails struct { // READ-ONLY; Delivery package shipping details. DeliveryPackage *PackageShippingDetails `json:"deliveryPackage,omitempty" azure:"ro"` + // READ-ONLY; Holds device data erasure details + DeviceErasureDetails *DeviceErasureDetails `json:"deviceErasureDetails,omitempty" azure:"ro"` + // READ-ONLY; List of stages that run in the job. JobStages []*JobStages `json:"jobStages,omitempty" azure:"ro"` @@ -234,6 +252,9 @@ type CommonJobDetails struct { ReverseShipmentLabelSasKey *string `json:"reverseShipmentLabelSasKey,omitempty" azure:"ro"` } +// GetCommonJobDetails implements the CommonJobDetailsClassification interface for type CommonJobDetails. +func (c *CommonJobDetails) GetCommonJobDetails() *CommonJobDetails { return c } + // CommonJobSecretsClassification provides polymorphic access to related types. // Call the interface's GetCommonJobSecrets() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: @@ -255,6 +276,9 @@ type CommonJobSecrets struct { Error *CloudError `json:"error,omitempty" azure:"ro"` } +// GetCommonJobSecrets implements the CommonJobSecretsClassification interface for type CommonJobSecrets. +func (c *CommonJobSecrets) GetCommonJobSecrets() *CommonJobSecrets { return c } + // CommonScheduleAvailabilityRequestClassification provides polymorphic access to related types. // Call the interface's GetCommonScheduleAvailabilityRequest() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: @@ -276,6 +300,12 @@ type CommonScheduleAvailabilityRequest struct { Country *string `json:"country,omitempty"` } +// GetCommonScheduleAvailabilityRequest implements the CommonScheduleAvailabilityRequestClassification interface for type +// CommonScheduleAvailabilityRequest. +func (c *CommonScheduleAvailabilityRequest) GetCommonScheduleAvailabilityRequest() *CommonScheduleAvailabilityRequest { + return c +} + // ContactDetails - Contact Details. type ContactDetails struct { // REQUIRED; Contact name of the person. @@ -312,6 +342,9 @@ type CopyLogDetails struct { CopyLogDetailsType *ClassDiscriminator `json:"copyLogDetailsType,omitempty"` } +// GetCopyLogDetails implements the CopyLogDetailsClassification interface for type CopyLogDetails. +func (c *CopyLogDetails) GetCopyLogDetails() *CopyLogDetails { return c } + // CopyProgress - Copy progress. type CopyProgress struct { // READ-ONLY; Id of the account where the data needs to be uploaded. @@ -369,6 +402,14 @@ type CreateJobValidations struct { ValidationCategory *string `json:"validationCategory,omitempty"` } +// GetValidationRequest implements the ValidationRequestClassification interface for type CreateJobValidations. +func (c *CreateJobValidations) GetValidationRequest() *ValidationRequest { + return &ValidationRequest{ + ValidationCategory: c.ValidationCategory, + IndividualRequestDetails: c.IndividualRequestDetails, + } +} + // CreateOrderLimitForSubscriptionValidationRequest - Request to validate create order limit for current subscription. type CreateOrderLimitForSubscriptionValidationRequest struct { // REQUIRED; Device type to be used for the job. @@ -378,6 +419,13 @@ type CreateOrderLimitForSubscriptionValidationRequest struct { ValidationType *ValidationInputDiscriminator `json:"validationType,omitempty"` } +// GetValidationInputRequest implements the ValidationInputRequestClassification interface for type CreateOrderLimitForSubscriptionValidationRequest. +func (c *CreateOrderLimitForSubscriptionValidationRequest) GetValidationInputRequest() *ValidationInputRequest { + return &ValidationInputRequest{ + ValidationType: c.ValidationType, + } +} + // CreateOrderLimitForSubscriptionValidationResponseProperties - Properties of create order limit for subscription validation // response. type CreateOrderLimitForSubscriptionValidationResponseProperties struct { @@ -391,6 +439,14 @@ type CreateOrderLimitForSubscriptionValidationResponseProperties struct { Status *ValidationStatus `json:"status,omitempty" azure:"ro"` } +// GetValidationInputResponse implements the ValidationInputResponseClassification interface for type CreateOrderLimitForSubscriptionValidationResponseProperties. +func (c *CreateOrderLimitForSubscriptionValidationResponseProperties) GetValidationInputResponse() *ValidationInputResponse { + return &ValidationInputResponse{ + ValidationType: c.ValidationType, + Error: c.Error, + } +} + // CustomerDiskCopyLogDetails - Copy Log Details for customer disk type CustomerDiskCopyLogDetails struct { // REQUIRED; Indicates the type of job details. @@ -406,6 +462,13 @@ type CustomerDiskCopyLogDetails struct { VerboseLogLink *string `json:"verboseLogLink,omitempty" azure:"ro"` } +// GetCopyLogDetails implements the CopyLogDetailsClassification interface for type CustomerDiskCopyLogDetails. +func (c *CustomerDiskCopyLogDetails) GetCopyLogDetails() *CopyLogDetails { + return &CopyLogDetails{ + CopyLogDetailsType: c.CopyLogDetailsType, + } +} + // CustomerDiskCopyProgress - DataBox CustomerDisk Copy Progress type CustomerDiskCopyProgress struct { // READ-ONLY; Id of the account where the data needs to be uploaded. @@ -519,6 +582,9 @@ type CustomerDiskJobDetails struct { // READ-ONLY; Delivery package shipping details. DeliveryPackage *PackageShippingDetails `json:"deliveryPackage,omitempty" azure:"ro"` + // READ-ONLY; Holds device data erasure details + DeviceErasureDetails *DeviceErasureDetails `json:"deviceErasureDetails,omitempty" azure:"ro"` + // READ-ONLY; Contains the map of disk serial number to the disk details for export jobs. ExportDiskDetailsCollection map[string]*ExportDiskDetails `json:"exportDiskDetailsCollection,omitempty" azure:"ro"` @@ -535,6 +601,31 @@ type CustomerDiskJobDetails struct { ReverseShipmentLabelSasKey *string `json:"reverseShipmentLabelSasKey,omitempty" azure:"ro"` } +// GetCommonJobDetails implements the CommonJobDetailsClassification interface for type CustomerDiskJobDetails. +func (c *CustomerDiskJobDetails) GetCommonJobDetails() *CommonJobDetails { + return &CommonJobDetails{ + JobStages: c.JobStages, + ContactDetails: c.ContactDetails, + ShippingAddress: c.ShippingAddress, + DeliveryPackage: c.DeliveryPackage, + ReturnPackage: c.ReturnPackage, + DataImportDetails: c.DataImportDetails, + DataExportDetails: c.DataExportDetails, + JobDetailsType: c.JobDetailsType, + Preferences: c.Preferences, + CopyLogDetails: c.CopyLogDetails, + ReverseShipmentLabelSasKey: c.ReverseShipmentLabelSasKey, + ChainOfCustodySasKey: c.ChainOfCustodySasKey, + DeviceErasureDetails: c.DeviceErasureDetails, + KeyEncryptionKey: c.KeyEncryptionKey, + ExpectedDataSizeInTeraBytes: c.ExpectedDataSizeInTeraBytes, + Actions: c.Actions, + LastMitigationActionOnJob: c.LastMitigationActionOnJob, + DatacenterAddress: c.DatacenterAddress, + DataCenterCode: c.DataCenterCode, + } +} + // CustomerDiskJobSecrets - The secrets related to customer disk job. type CustomerDiskJobSecrets struct { // REQUIRED; Used to indicate what type of job secrets object. @@ -553,6 +644,15 @@ type CustomerDiskJobSecrets struct { Error *CloudError `json:"error,omitempty" azure:"ro"` } +// GetCommonJobSecrets implements the CommonJobSecretsClassification interface for type CustomerDiskJobSecrets. +func (c *CustomerDiskJobSecrets) GetCommonJobSecrets() *CommonJobSecrets { + return &CommonJobSecrets{ + JobSecretsType: c.JobSecretsType, + DcAccessSecurityCode: c.DcAccessSecurityCode, + Error: c.Error, + } +} + // DataAccountDetailsClassification provides polymorphic access to related types. // Call the interface's GetDataAccountDetails() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: @@ -576,6 +676,9 @@ type DataAccountDetails struct { SharePassword *string `json:"sharePassword,omitempty"` } +// GetDataAccountDetails implements the DataAccountDetailsClassification interface for type DataAccountDetails. +func (d *DataAccountDetails) GetDataAccountDetails() *DataAccountDetails { return d } + // DataExportDetails - Details of the data to be used for exporting data from azure. type DataExportDetails struct { // REQUIRED; Account details of the data to be transferred @@ -624,6 +727,13 @@ type DataTransferDetailsValidationRequest struct { DataImportDetails []*DataImportDetails `json:"dataImportDetails,omitempty"` } +// GetValidationInputRequest implements the ValidationInputRequestClassification interface for type DataTransferDetailsValidationRequest. +func (d *DataTransferDetailsValidationRequest) GetValidationInputRequest() *ValidationInputRequest { + return &ValidationInputRequest{ + ValidationType: d.ValidationType, + } +} + // DataTransferDetailsValidationResponseProperties - Properties of data transfer details validation response. type DataTransferDetailsValidationResponseProperties struct { // REQUIRED; Identifies the type of validation response. @@ -636,6 +746,14 @@ type DataTransferDetailsValidationResponseProperties struct { Status *ValidationStatus `json:"status,omitempty" azure:"ro"` } +// GetValidationInputResponse implements the ValidationInputResponseClassification interface for type DataTransferDetailsValidationResponseProperties. +func (d *DataTransferDetailsValidationResponseProperties) GetValidationInputResponse() *ValidationInputResponse { + return &ValidationInputResponse{ + ValidationType: d.ValidationType, + Error: d.Error, + } +} + // DatacenterAddressInstructionResponse - Datacenter instruction for given storage location. type DatacenterAddressInstructionResponse struct { // REQUIRED; Data center address type @@ -651,6 +769,15 @@ type DatacenterAddressInstructionResponse struct { SupportedCarriersForReturnShipment []*string `json:"supportedCarriersForReturnShipment,omitempty" azure:"ro"` } +// GetDatacenterAddressResponse implements the DatacenterAddressResponseClassification interface for type DatacenterAddressInstructionResponse. +func (d *DatacenterAddressInstructionResponse) GetDatacenterAddressResponse() *DatacenterAddressResponse { + return &DatacenterAddressResponse{ + DatacenterAddressType: d.DatacenterAddressType, + SupportedCarriersForReturnShipment: d.SupportedCarriersForReturnShipment, + DataCenterAzureLocation: d.DataCenterAzureLocation, + } +} + // DatacenterAddressLocationResponse - Datacenter address for given storage location. type DatacenterAddressLocationResponse struct { // REQUIRED; Data center address type @@ -702,6 +829,15 @@ type DatacenterAddressLocationResponse struct { Zip *string `json:"zip,omitempty" azure:"ro"` } +// GetDatacenterAddressResponse implements the DatacenterAddressResponseClassification interface for type DatacenterAddressLocationResponse. +func (d *DatacenterAddressLocationResponse) GetDatacenterAddressResponse() *DatacenterAddressResponse { + return &DatacenterAddressResponse{ + DatacenterAddressType: d.DatacenterAddressType, + SupportedCarriersForReturnShipment: d.SupportedCarriersForReturnShipment, + DataCenterAzureLocation: d.DataCenterAzureLocation, + } +} + // DatacenterAddressRequest - Request body to get the datacenter address. type DatacenterAddressRequest struct { // REQUIRED; Sku Name for which the data center address requested. @@ -732,6 +868,11 @@ type DatacenterAddressResponse struct { SupportedCarriersForReturnShipment []*string `json:"supportedCarriersForReturnShipment,omitempty" azure:"ro"` } +// GetDatacenterAddressResponse implements the DatacenterAddressResponseClassification interface for type DatacenterAddressResponse. +func (d *DatacenterAddressResponse) GetDatacenterAddressResponse() *DatacenterAddressResponse { + return d +} + // DcAccessSecurityCode - Dc access security code type DcAccessSecurityCode struct { // Forward Dc access security code. @@ -749,6 +890,15 @@ type Details struct { Message *string `json:"message,omitempty"` } +// DeviceErasureDetails - Device erasure details with erasure completion status and erasureordestructionlog sas key +type DeviceErasureDetails struct { + // READ-ONLY; Holds the device erasure completion status + DeviceErasureStatus *StageStatus `json:"deviceErasureStatus,omitempty" azure:"ro"` + + // READ-ONLY; Shared access key to download cleanup or destruction certificate for device + ErasureOrDestructionCertificateSasKey *string `json:"erasureOrDestructionCertificateSasKey,omitempty" azure:"ro"` +} + // DiskCopyLogDetails - Copy Log Details for a disk type DiskCopyLogDetails struct { // REQUIRED; Indicates the type of job details. @@ -764,6 +914,13 @@ type DiskCopyLogDetails struct { VerboseLogLink *string `json:"verboseLogLink,omitempty" azure:"ro"` } +// GetCopyLogDetails implements the CopyLogDetailsClassification interface for type DiskCopyLogDetails. +func (d *DiskCopyLogDetails) GetCopyLogDetails() *CopyLogDetails { + return &CopyLogDetails{ + CopyLogDetailsType: d.CopyLogDetailsType, + } +} + // DiskCopyProgress - DataBox Disk Copy Progress type DiskCopyProgress struct { // READ-ONLY; Bytes copied during the copy of disk. @@ -797,6 +954,13 @@ type DiskGranularCopyLogDetails struct { VerboseLogLink *string `json:"verboseLogLink,omitempty" azure:"ro"` } +// GetGranularCopyLogDetails implements the GranularCopyLogDetailsClassification interface for type DiskGranularCopyLogDetails. +func (d *DiskGranularCopyLogDetails) GetGranularCopyLogDetails() *GranularCopyLogDetails { + return &GranularCopyLogDetails{ + CopyLogDetailsType: d.CopyLogDetailsType, + } +} + // DiskGranularCopyProgress - DataBox Disk Granular Copy Progress type DiskGranularCopyProgress struct { // READ-ONLY; Id of the account where the data needs to be uploaded. @@ -905,6 +1069,9 @@ type DiskJobDetails struct { // READ-ONLY; Delivery package shipping details. DeliveryPackage *PackageShippingDetails `json:"deliveryPackage,omitempty" azure:"ro"` + // READ-ONLY; Holds device data erasure details + DeviceErasureDetails *DeviceErasureDetails `json:"deviceErasureDetails,omitempty" azure:"ro"` + // READ-ONLY; Contains the map of disk serial number to the disk size being used for the job. Is returned only after the disks // are shipped to the customer. DisksAndSizeDetails map[string]*int32 `json:"disksAndSizeDetails,omitempty" azure:"ro"` @@ -925,6 +1092,31 @@ type DiskJobDetails struct { ReverseShipmentLabelSasKey *string `json:"reverseShipmentLabelSasKey,omitempty" azure:"ro"` } +// GetCommonJobDetails implements the CommonJobDetailsClassification interface for type DiskJobDetails. +func (d *DiskJobDetails) GetCommonJobDetails() *CommonJobDetails { + return &CommonJobDetails{ + JobStages: d.JobStages, + ContactDetails: d.ContactDetails, + ShippingAddress: d.ShippingAddress, + DeliveryPackage: d.DeliveryPackage, + ReturnPackage: d.ReturnPackage, + DataImportDetails: d.DataImportDetails, + DataExportDetails: d.DataExportDetails, + JobDetailsType: d.JobDetailsType, + Preferences: d.Preferences, + CopyLogDetails: d.CopyLogDetails, + ReverseShipmentLabelSasKey: d.ReverseShipmentLabelSasKey, + ChainOfCustodySasKey: d.ChainOfCustodySasKey, + DeviceErasureDetails: d.DeviceErasureDetails, + KeyEncryptionKey: d.KeyEncryptionKey, + ExpectedDataSizeInTeraBytes: d.ExpectedDataSizeInTeraBytes, + Actions: d.Actions, + LastMitigationActionOnJob: d.LastMitigationActionOnJob, + DatacenterAddress: d.DatacenterAddress, + DataCenterCode: d.DataCenterCode, + } +} + // DiskJobSecrets - The secrets related to disk job. type DiskJobSecrets struct { // REQUIRED; Used to indicate what type of job secrets object. @@ -946,6 +1138,15 @@ type DiskJobSecrets struct { PassKey *string `json:"passKey,omitempty" azure:"ro"` } +// GetCommonJobSecrets implements the CommonJobSecretsClassification interface for type DiskJobSecrets. +func (d *DiskJobSecrets) GetCommonJobSecrets() *CommonJobSecrets { + return &CommonJobSecrets{ + JobSecretsType: d.JobSecretsType, + DcAccessSecurityCode: d.DcAccessSecurityCode, + Error: d.Error, + } +} + // DiskScheduleAvailabilityRequest - Request body to get the availability for scheduling disk orders. type DiskScheduleAvailabilityRequest struct { // REQUIRED; The expected size of the data, which needs to be transferred in this job, in terabytes. @@ -961,6 +1162,16 @@ type DiskScheduleAvailabilityRequest struct { Country *string `json:"country,omitempty"` } +// GetCommonScheduleAvailabilityRequest implements the CommonScheduleAvailabilityRequestClassification interface for type +// DiskScheduleAvailabilityRequest. +func (d *DiskScheduleAvailabilityRequest) GetCommonScheduleAvailabilityRequest() *CommonScheduleAvailabilityRequest { + return &CommonScheduleAvailabilityRequest{ + StorageLocation: d.StorageLocation, + SKUName: d.SKUName, + Country: d.Country, + } +} + // DiskSecret - Contains all the secrets of a Disk. type DiskSecret struct { // READ-ONLY; Bit Locker key of the disk which can be used to unlock the disk to copy data. @@ -1022,6 +1233,9 @@ type GranularCopyLogDetails struct { CopyLogDetailsType *ClassDiscriminator `json:"copyLogDetailsType,omitempty"` } +// GetGranularCopyLogDetails implements the GranularCopyLogDetailsClassification interface for type GranularCopyLogDetails. +func (g *GranularCopyLogDetails) GetGranularCopyLogDetails() *GranularCopyLogDetails { return g } + // GranularCopyProgress - Granular Copy progress. type GranularCopyProgress struct { // READ-ONLY; Id of the account where the data needs to be uploaded. @@ -1085,6 +1299,13 @@ type HeavyAccountCopyLogDetails struct { CopyVerboseLogLink []*string `json:"copyVerboseLogLink,omitempty" azure:"ro"` } +// GetCopyLogDetails implements the CopyLogDetailsClassification interface for type HeavyAccountCopyLogDetails. +func (h *HeavyAccountCopyLogDetails) GetCopyLogDetails() *CopyLogDetails { + return &CopyLogDetails{ + CopyLogDetailsType: h.CopyLogDetailsType, + } +} + // HeavyJobDetails - Databox Heavy Device Job Details type HeavyJobDetails struct { // REQUIRED; Contact details for notification and shipping. @@ -1139,6 +1360,9 @@ type HeavyJobDetails struct { // READ-ONLY; Delivery package shipping details. DeliveryPackage *PackageShippingDetails `json:"deliveryPackage,omitempty" azure:"ro"` + // READ-ONLY; Holds device data erasure details + DeviceErasureDetails *DeviceErasureDetails `json:"deviceErasureDetails,omitempty" azure:"ro"` + // READ-ONLY; List of stages that run in the job. JobStages []*JobStages `json:"jobStages,omitempty" azure:"ro"` @@ -1152,6 +1376,31 @@ type HeavyJobDetails struct { ReverseShipmentLabelSasKey *string `json:"reverseShipmentLabelSasKey,omitempty" azure:"ro"` } +// GetCommonJobDetails implements the CommonJobDetailsClassification interface for type HeavyJobDetails. +func (h *HeavyJobDetails) GetCommonJobDetails() *CommonJobDetails { + return &CommonJobDetails{ + JobStages: h.JobStages, + ContactDetails: h.ContactDetails, + ShippingAddress: h.ShippingAddress, + DeliveryPackage: h.DeliveryPackage, + ReturnPackage: h.ReturnPackage, + DataImportDetails: h.DataImportDetails, + DataExportDetails: h.DataExportDetails, + JobDetailsType: h.JobDetailsType, + Preferences: h.Preferences, + CopyLogDetails: h.CopyLogDetails, + ReverseShipmentLabelSasKey: h.ReverseShipmentLabelSasKey, + ChainOfCustodySasKey: h.ChainOfCustodySasKey, + DeviceErasureDetails: h.DeviceErasureDetails, + KeyEncryptionKey: h.KeyEncryptionKey, + ExpectedDataSizeInTeraBytes: h.ExpectedDataSizeInTeraBytes, + Actions: h.Actions, + LastMitigationActionOnJob: h.LastMitigationActionOnJob, + DatacenterAddress: h.DatacenterAddress, + DataCenterCode: h.DataCenterCode, + } +} + // HeavyJobSecrets - The secrets related to a databox heavy job. type HeavyJobSecrets struct { // REQUIRED; Used to indicate what type of job secrets object. @@ -1167,6 +1416,15 @@ type HeavyJobSecrets struct { Error *CloudError `json:"error,omitempty" azure:"ro"` } +// GetCommonJobSecrets implements the CommonJobSecretsClassification interface for type HeavyJobSecrets. +func (h *HeavyJobSecrets) GetCommonJobSecrets() *CommonJobSecrets { + return &CommonJobSecrets{ + JobSecretsType: h.JobSecretsType, + DcAccessSecurityCode: h.DcAccessSecurityCode, + Error: h.Error, + } +} + // HeavyScheduleAvailabilityRequest - Request body to get the availability for scheduling heavy orders. type HeavyScheduleAvailabilityRequest struct { // REQUIRED; Sku Name for which the order is to be scheduled. @@ -1179,6 +1437,16 @@ type HeavyScheduleAvailabilityRequest struct { Country *string `json:"country,omitempty"` } +// GetCommonScheduleAvailabilityRequest implements the CommonScheduleAvailabilityRequestClassification interface for type +// HeavyScheduleAvailabilityRequest. +func (h *HeavyScheduleAvailabilityRequest) GetCommonScheduleAvailabilityRequest() *CommonScheduleAvailabilityRequest { + return &CommonScheduleAvailabilityRequest{ + StorageLocation: h.StorageLocation, + SKUName: h.SKUName, + Country: h.Country, + } +} + // HeavySecret - The secrets related to a databox heavy. type HeavySecret struct { // READ-ONLY; Per account level access credentials. @@ -1281,6 +1549,9 @@ type JobDetails struct { // READ-ONLY; Delivery package shipping details. DeliveryPackage *PackageShippingDetails `json:"deliveryPackage,omitempty" azure:"ro"` + // READ-ONLY; Holds device data erasure details + DeviceErasureDetails *DeviceErasureDetails `json:"deviceErasureDetails,omitempty" azure:"ro"` + // READ-ONLY; List of stages that run in the job. JobStages []*JobStages `json:"jobStages,omitempty" azure:"ro"` @@ -1294,6 +1565,31 @@ type JobDetails struct { ReverseShipmentLabelSasKey *string `json:"reverseShipmentLabelSasKey,omitempty" azure:"ro"` } +// GetCommonJobDetails implements the CommonJobDetailsClassification interface for type JobDetails. +func (j *JobDetails) GetCommonJobDetails() *CommonJobDetails { + return &CommonJobDetails{ + JobStages: j.JobStages, + ContactDetails: j.ContactDetails, + ShippingAddress: j.ShippingAddress, + DeliveryPackage: j.DeliveryPackage, + ReturnPackage: j.ReturnPackage, + DataImportDetails: j.DataImportDetails, + DataExportDetails: j.DataExportDetails, + JobDetailsType: j.JobDetailsType, + Preferences: j.Preferences, + CopyLogDetails: j.CopyLogDetails, + ReverseShipmentLabelSasKey: j.ReverseShipmentLabelSasKey, + ChainOfCustodySasKey: j.ChainOfCustodySasKey, + DeviceErasureDetails: j.DeviceErasureDetails, + KeyEncryptionKey: j.KeyEncryptionKey, + ExpectedDataSizeInTeraBytes: j.ExpectedDataSizeInTeraBytes, + Actions: j.Actions, + LastMitigationActionOnJob: j.LastMitigationActionOnJob, + DatacenterAddress: j.DatacenterAddress, + DataCenterCode: j.DataCenterCode, + } +} + // JobProperties - Job Properties type JobProperties struct { // REQUIRED; Type of the data transfer. @@ -1406,6 +1702,15 @@ type JobSecrets struct { Error *CloudError `json:"error,omitempty" azure:"ro"` } +// GetCommonJobSecrets implements the CommonJobSecretsClassification interface for type JobSecrets. +func (j *JobSecrets) GetCommonJobSecrets() *CommonJobSecrets { + return &CommonJobSecrets{ + JobSecretsType: j.JobSecretsType, + DcAccessSecurityCode: j.DcAccessSecurityCode, + Error: j.Error, + } +} + // JobStages - Job stages. type JobStages struct { // READ-ONLY; Display name of the job stage. @@ -1529,6 +1834,14 @@ type ManagedDiskDetails struct { SharePassword *string `json:"sharePassword,omitempty"` } +// GetDataAccountDetails implements the DataAccountDetailsClassification interface for type ManagedDiskDetails. +func (m *ManagedDiskDetails) GetDataAccountDetails() *DataAccountDetails { + return &DataAccountDetails{ + DataAccountType: m.DataAccountType, + SharePassword: m.SharePassword, + } +} + // ManagementClientMitigateOptions contains the optional parameters for the ManagementClient.Mitigate method. type ManagementClientMitigateOptions struct { // placeholder for future optional parameters @@ -1662,6 +1975,13 @@ type PreferencesValidationRequest struct { Preference *Preferences `json:"preference,omitempty"` } +// GetValidationInputRequest implements the ValidationInputRequestClassification interface for type PreferencesValidationRequest. +func (p *PreferencesValidationRequest) GetValidationInputRequest() *ValidationInputRequest { + return &ValidationInputRequest{ + ValidationType: p.ValidationType, + } +} + // PreferencesValidationResponseProperties - Properties of data center and transport preference validation response. type PreferencesValidationResponseProperties struct { // REQUIRED; Identifies the type of validation response. @@ -1674,6 +1994,14 @@ type PreferencesValidationResponseProperties struct { Status *ValidationStatus `json:"status,omitempty" azure:"ro"` } +// GetValidationInputResponse implements the ValidationInputResponseClassification interface for type PreferencesValidationResponseProperties. +func (p *PreferencesValidationResponseProperties) GetValidationInputResponse() *ValidationInputResponse { + return &ValidationInputResponse{ + ValidationType: p.ValidationType, + Error: p.Error, + } +} + // RegionConfigurationRequest - Request body to get the configuration for the region. type RegionConfigurationRequest struct { // Request body to get the datacenter address for given sku. @@ -1761,6 +2089,13 @@ type SKUAvailabilityValidationRequest struct { ValidationType *ValidationInputDiscriminator `json:"validationType,omitempty"` } +// GetValidationInputRequest implements the ValidationInputRequestClassification interface for type SKUAvailabilityValidationRequest. +func (s *SKUAvailabilityValidationRequest) GetValidationInputRequest() *ValidationInputRequest { + return &ValidationInputRequest{ + ValidationType: s.ValidationType, + } +} + // SKUAvailabilityValidationResponseProperties - Properties of sku availability validation response. type SKUAvailabilityValidationResponseProperties struct { // REQUIRED; Identifies the type of validation response. @@ -1773,6 +2108,14 @@ type SKUAvailabilityValidationResponseProperties struct { Status *ValidationStatus `json:"status,omitempty" azure:"ro"` } +// GetValidationInputResponse implements the ValidationInputResponseClassification interface for type SKUAvailabilityValidationResponseProperties. +func (s *SKUAvailabilityValidationResponseProperties) GetValidationInputResponse() *ValidationInputResponse { + return &ValidationInputResponse{ + ValidationType: s.ValidationType, + Error: s.Error, + } +} + // SKUCapacity - Capacity of the sku. type SKUCapacity struct { // READ-ONLY; Maximum capacity in TB. @@ -1843,6 +2186,16 @@ type ScheduleAvailabilityRequest struct { Country *string `json:"country,omitempty"` } +// GetCommonScheduleAvailabilityRequest implements the CommonScheduleAvailabilityRequestClassification interface for type +// ScheduleAvailabilityRequest. +func (s *ScheduleAvailabilityRequest) GetCommonScheduleAvailabilityRequest() *CommonScheduleAvailabilityRequest { + return &CommonScheduleAvailabilityRequest{ + StorageLocation: s.StorageLocation, + SKUName: s.SKUName, + Country: s.Country, + } +} + // ScheduleAvailabilityResponse - Schedule availability for given sku in a region. type ScheduleAvailabilityResponse struct { // READ-ONLY; List of dates available to schedule @@ -1989,12 +2342,27 @@ type StorageAccountDetails struct { SharePassword *string `json:"sharePassword,omitempty"` } +// GetDataAccountDetails implements the DataAccountDetailsClassification interface for type StorageAccountDetails. +func (s *StorageAccountDetails) GetDataAccountDetails() *DataAccountDetails { + return &DataAccountDetails{ + DataAccountType: s.DataAccountType, + SharePassword: s.SharePassword, + } +} + // SubscriptionIsAllowedToCreateJobValidationRequest - Request to validate subscription permission to create jobs. type SubscriptionIsAllowedToCreateJobValidationRequest struct { // REQUIRED; Identifies the type of validation request. ValidationType *ValidationInputDiscriminator `json:"validationType,omitempty"` } +// GetValidationInputRequest implements the ValidationInputRequestClassification interface for type SubscriptionIsAllowedToCreateJobValidationRequest. +func (s *SubscriptionIsAllowedToCreateJobValidationRequest) GetValidationInputRequest() *ValidationInputRequest { + return &ValidationInputRequest{ + ValidationType: s.ValidationType, + } +} + // SubscriptionIsAllowedToCreateJobValidationResponseProperties - Properties of subscription permission to create job validation // response. type SubscriptionIsAllowedToCreateJobValidationResponseProperties struct { @@ -2008,6 +2376,14 @@ type SubscriptionIsAllowedToCreateJobValidationResponseProperties struct { Status *ValidationStatus `json:"status,omitempty" azure:"ro"` } +// GetValidationInputResponse implements the ValidationInputResponseClassification interface for type SubscriptionIsAllowedToCreateJobValidationResponseProperties. +func (s *SubscriptionIsAllowedToCreateJobValidationResponseProperties) GetValidationInputResponse() *ValidationInputResponse { + return &ValidationInputResponse{ + ValidationType: s.ValidationType, + Error: s.Error, + } +} + // SystemData - Provides details about resource creation and update time type SystemData struct { // READ-ONLY; The timestamp of resource creation (UTC) @@ -2177,6 +2553,13 @@ type ValidateAddress struct { TransportPreferences *TransportPreferences `json:"transportPreferences,omitempty"` } +// GetValidationInputRequest implements the ValidationInputRequestClassification interface for type ValidateAddress. +func (v *ValidateAddress) GetValidationInputRequest() *ValidationInputRequest { + return &ValidationInputRequest{ + ValidationType: v.ValidationType, + } +} + // ValidationInputRequestClassification provides polymorphic access to related types. // Call the interface's GetValidationInputRequest() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: @@ -2193,6 +2576,9 @@ type ValidationInputRequest struct { ValidationType *ValidationInputDiscriminator `json:"validationType,omitempty"` } +// GetValidationInputRequest implements the ValidationInputRequestClassification interface for type ValidationInputRequest. +func (v *ValidationInputRequest) GetValidationInputRequest() *ValidationInputRequest { return v } + // ValidationInputResponseClassification provides polymorphic access to related types. // Call the interface's GetValidationInputResponse() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: @@ -2213,6 +2599,9 @@ type ValidationInputResponse struct { Error *CloudError `json:"error,omitempty" azure:"ro"` } +// GetValidationInputResponse implements the ValidationInputResponseClassification interface for type ValidationInputResponse. +func (v *ValidationInputResponse) GetValidationInputResponse() *ValidationInputResponse { return v } + // ValidationRequestClassification provides polymorphic access to related types. // Call the interface's GetValidationRequest() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: @@ -2231,6 +2620,9 @@ type ValidationRequest struct { ValidationCategory *string `json:"validationCategory,omitempty"` } +// GetValidationRequest implements the ValidationRequestClassification interface for type ValidationRequest. +func (v *ValidationRequest) GetValidationRequest() *ValidationRequest { return v } + // ValidationResponse - Response of pre job creation validations. type ValidationResponse struct { // READ-ONLY; Properties of pre job creation validation response. diff --git a/sdk/resourcemanager/databox/armdatabox/zz_generated_models_serde.go b/sdk/resourcemanager/databox/armdatabox/zz_generated_models_serde.go index 6c2744a8ac50..b21deda1aba7 100644 --- a/sdk/resourcemanager/databox/armdatabox/zz_generated_models_serde.go +++ b/sdk/resourcemanager/databox/armdatabox/zz_generated_models_serde.go @@ -10,17 +10,11 @@ package armdatabox import ( "encoding/json" + "fmt" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "reflect" ) -// GetCopyLogDetails implements the CopyLogDetailsClassification interface for type AccountCopyLogDetails. -func (a *AccountCopyLogDetails) GetCopyLogDetails() *CopyLogDetails { - return &CopyLogDetails{ - CopyLogDetailsType: a.CopyLogDetailsType, - } -} - // MarshalJSON implements the json.Marshaller interface for type AccountCopyLogDetails. func (a AccountCopyLogDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -35,83 +29,55 @@ func (a AccountCopyLogDetails) MarshalJSON() ([]byte, error) { func (a *AccountCopyLogDetails) 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 "accountName": - err = unpopulate(val, &a.AccountName) + err = unpopulate(val, "AccountName", &a.AccountName) delete(rawMsg, key) case "copyLogDetailsType": - err = unpopulate(val, &a.CopyLogDetailsType) + err = unpopulate(val, "CopyLogDetailsType", &a.CopyLogDetailsType) delete(rawMsg, key) case "copyLogLink": - err = unpopulate(val, &a.CopyLogLink) + err = unpopulate(val, "CopyLogLink", &a.CopyLogLink) delete(rawMsg, key) case "copyVerboseLogLink": - err = unpopulate(val, &a.CopyVerboseLogLink) + err = unpopulate(val, "CopyVerboseLogLink", &a.CopyVerboseLogLink) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type AccountCredentialDetails. -func (a AccountCredentialDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "accountConnectionString", a.AccountConnectionString) - populate(objectMap, "accountName", a.AccountName) - populate(objectMap, "dataAccountType", a.DataAccountType) - populate(objectMap, "shareCredentialDetails", a.ShareCredentialDetails) - return json.Marshal(objectMap) -} - -// GetValidationInputResponse implements the ValidationInputResponseClassification interface for type AddressValidationProperties. -func (a *AddressValidationProperties) GetValidationInputResponse() *ValidationInputResponse { - return &ValidationInputResponse{ - ValidationType: a.ValidationType, - Error: a.Error, - } -} - -// MarshalJSON implements the json.Marshaller interface for type AddressValidationProperties. -func (a AddressValidationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "alternateAddresses", a.AlternateAddresses) - populate(objectMap, "error", a.Error) - populate(objectMap, "validationStatus", a.ValidationStatus) - objectMap["validationType"] = ValidationInputDiscriminatorValidateAddress - return json.Marshal(objectMap) -} - // UnmarshalJSON implements the json.Unmarshaller interface for type AddressValidationProperties. func (a *AddressValidationProperties) 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 "alternateAddresses": - err = unpopulate(val, &a.AlternateAddresses) + err = unpopulate(val, "AlternateAddresses", &a.AlternateAddresses) delete(rawMsg, key) case "error": - err = unpopulate(val, &a.Error) + err = unpopulate(val, "Error", &a.Error) delete(rawMsg, key) case "validationStatus": - err = unpopulate(val, &a.ValidationStatus) + err = unpopulate(val, "ValidationStatus", &a.ValidationStatus) delete(rawMsg, key) case "validationType": - err = unpopulate(val, &a.ValidationType) + err = unpopulate(val, "ValidationType", &a.ValidationType) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil @@ -127,14 +93,6 @@ func (a AvailableSKURequest) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// MarshalJSON implements the json.Marshaller interface for type AvailableSKUsResult. -func (a AvailableSKUsResult) 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 AzureFileFilterDetails. func (a AzureFileFilterDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -164,9 +122,6 @@ func (c CloudError) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// GetCommonJobDetails implements the CommonJobDetailsClassification interface for type CommonJobDetails. -func (c *CommonJobDetails) GetCommonJobDetails() *CommonJobDetails { return c } - // MarshalJSON implements the json.Marshaller interface for type CommonJobDetails. func (c CommonJobDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -179,6 +134,7 @@ func (c CommonJobDetails) MarshalJSON() ([]byte, error) { populate(objectMap, "dataImportDetails", c.DataImportDetails) populate(objectMap, "datacenterAddress", c.DatacenterAddress) populate(objectMap, "deliveryPackage", c.DeliveryPackage) + populate(objectMap, "deviceErasureDetails", c.DeviceErasureDetails) populate(objectMap, "expectedDataSizeInTeraBytes", c.ExpectedDataSizeInTeraBytes) objectMap["jobDetailsType"] = c.JobDetailsType populate(objectMap, "jobStages", c.JobStages) @@ -195,82 +151,76 @@ func (c CommonJobDetails) MarshalJSON() ([]byte, error) { func (c *CommonJobDetails) 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 "actions": - err = unpopulate(val, &c.Actions) + err = unpopulate(val, "Actions", &c.Actions) delete(rawMsg, key) case "chainOfCustodySasKey": - err = unpopulate(val, &c.ChainOfCustodySasKey) + err = unpopulate(val, "ChainOfCustodySasKey", &c.ChainOfCustodySasKey) delete(rawMsg, key) case "contactDetails": - err = unpopulate(val, &c.ContactDetails) + err = unpopulate(val, "ContactDetails", &c.ContactDetails) delete(rawMsg, key) case "copyLogDetails": c.CopyLogDetails, err = unmarshalCopyLogDetailsClassificationArray(val) delete(rawMsg, key) case "dataCenterCode": - err = unpopulate(val, &c.DataCenterCode) + err = unpopulate(val, "DataCenterCode", &c.DataCenterCode) delete(rawMsg, key) case "dataExportDetails": - err = unpopulate(val, &c.DataExportDetails) + err = unpopulate(val, "DataExportDetails", &c.DataExportDetails) delete(rawMsg, key) case "dataImportDetails": - err = unpopulate(val, &c.DataImportDetails) + err = unpopulate(val, "DataImportDetails", &c.DataImportDetails) delete(rawMsg, key) case "datacenterAddress": c.DatacenterAddress, err = unmarshalDatacenterAddressResponseClassification(val) delete(rawMsg, key) case "deliveryPackage": - err = unpopulate(val, &c.DeliveryPackage) + err = unpopulate(val, "DeliveryPackage", &c.DeliveryPackage) + delete(rawMsg, key) + case "deviceErasureDetails": + err = unpopulate(val, "DeviceErasureDetails", &c.DeviceErasureDetails) delete(rawMsg, key) case "expectedDataSizeInTeraBytes": - err = unpopulate(val, &c.ExpectedDataSizeInTeraBytes) + err = unpopulate(val, "ExpectedDataSizeInTeraBytes", &c.ExpectedDataSizeInTeraBytes) delete(rawMsg, key) case "jobDetailsType": - err = unpopulate(val, &c.JobDetailsType) + err = unpopulate(val, "JobDetailsType", &c.JobDetailsType) delete(rawMsg, key) case "jobStages": - err = unpopulate(val, &c.JobStages) + err = unpopulate(val, "JobStages", &c.JobStages) delete(rawMsg, key) case "keyEncryptionKey": - err = unpopulate(val, &c.KeyEncryptionKey) + err = unpopulate(val, "KeyEncryptionKey", &c.KeyEncryptionKey) delete(rawMsg, key) case "lastMitigationActionOnJob": - err = unpopulate(val, &c.LastMitigationActionOnJob) + err = unpopulate(val, "LastMitigationActionOnJob", &c.LastMitigationActionOnJob) delete(rawMsg, key) case "preferences": - err = unpopulate(val, &c.Preferences) + err = unpopulate(val, "Preferences", &c.Preferences) delete(rawMsg, key) case "returnPackage": - err = unpopulate(val, &c.ReturnPackage) + err = unpopulate(val, "ReturnPackage", &c.ReturnPackage) delete(rawMsg, key) case "reverseShipmentLabelSasKey": - err = unpopulate(val, &c.ReverseShipmentLabelSasKey) + err = unpopulate(val, "ReverseShipmentLabelSasKey", &c.ReverseShipmentLabelSasKey) delete(rawMsg, key) case "shippingAddress": - err = unpopulate(val, &c.ShippingAddress) + err = unpopulate(val, "ShippingAddress", &c.ShippingAddress) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// GetCommonJobSecrets implements the CommonJobSecretsClassification interface for type CommonJobSecrets. -func (c *CommonJobSecrets) GetCommonJobSecrets() *CommonJobSecrets { return c } - -// GetCommonScheduleAvailabilityRequest implements the CommonScheduleAvailabilityRequestClassification interface for type -// CommonScheduleAvailabilityRequest. -func (c *CommonScheduleAvailabilityRequest) GetCommonScheduleAvailabilityRequest() *CommonScheduleAvailabilityRequest { - return c -} - // MarshalJSON implements the json.Marshaller interface for type ContactDetails. func (c ContactDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -283,17 +233,6 @@ func (c ContactDetails) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// GetCopyLogDetails implements the CopyLogDetailsClassification interface for type CopyLogDetails. -func (c *CopyLogDetails) GetCopyLogDetails() *CopyLogDetails { return c } - -// GetValidationRequest implements the ValidationRequestClassification interface for type CreateJobValidations. -func (c *CreateJobValidations) GetValidationRequest() *ValidationRequest { - return &ValidationRequest{ - ValidationCategory: c.ValidationCategory, - IndividualRequestDetails: c.IndividualRequestDetails, - } -} - // MarshalJSON implements the json.Marshaller interface for type CreateJobValidations. func (c CreateJobValidations) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -306,7 +245,7 @@ func (c CreateJobValidations) MarshalJSON() ([]byte, error) { func (c *CreateJobValidations) 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 @@ -315,23 +254,16 @@ func (c *CreateJobValidations) UnmarshalJSON(data []byte) error { c.IndividualRequestDetails, err = unmarshalValidationInputRequestClassificationArray(val) delete(rawMsg, key) case "validationCategory": - err = unpopulate(val, &c.ValidationCategory) + err = unpopulate(val, "ValidationCategory", &c.ValidationCategory) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// GetValidationInputRequest implements the ValidationInputRequestClassification interface for type CreateOrderLimitForSubscriptionValidationRequest. -func (c *CreateOrderLimitForSubscriptionValidationRequest) GetValidationInputRequest() *ValidationInputRequest { - return &ValidationInputRequest{ - ValidationType: c.ValidationType, - } -} - // MarshalJSON implements the json.Marshaller interface for type CreateOrderLimitForSubscriptionValidationRequest. func (c CreateOrderLimitForSubscriptionValidationRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -344,75 +276,51 @@ func (c CreateOrderLimitForSubscriptionValidationRequest) MarshalJSON() ([]byte, func (c *CreateOrderLimitForSubscriptionValidationRequest) 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 "deviceType": - err = unpopulate(val, &c.DeviceType) + err = unpopulate(val, "DeviceType", &c.DeviceType) delete(rawMsg, key) case "validationType": - err = unpopulate(val, &c.ValidationType) + err = unpopulate(val, "ValidationType", &c.ValidationType) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// GetValidationInputResponse implements the ValidationInputResponseClassification interface for type CreateOrderLimitForSubscriptionValidationResponseProperties. -func (c *CreateOrderLimitForSubscriptionValidationResponseProperties) GetValidationInputResponse() *ValidationInputResponse { - return &ValidationInputResponse{ - ValidationType: c.ValidationType, - Error: c.Error, - } -} - -// MarshalJSON implements the json.Marshaller interface for type CreateOrderLimitForSubscriptionValidationResponseProperties. -func (c CreateOrderLimitForSubscriptionValidationResponseProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "error", c.Error) - populate(objectMap, "status", c.Status) - objectMap["validationType"] = ValidationInputDiscriminatorValidateCreateOrderLimit - return json.Marshal(objectMap) -} - // UnmarshalJSON implements the json.Unmarshaller interface for type CreateOrderLimitForSubscriptionValidationResponseProperties. func (c *CreateOrderLimitForSubscriptionValidationResponseProperties) 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 "error": - err = unpopulate(val, &c.Error) + err = unpopulate(val, "Error", &c.Error) delete(rawMsg, key) case "status": - err = unpopulate(val, &c.Status) + err = unpopulate(val, "Status", &c.Status) delete(rawMsg, key) case "validationType": - err = unpopulate(val, &c.ValidationType) + err = unpopulate(val, "ValidationType", &c.ValidationType) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// GetCopyLogDetails implements the CopyLogDetailsClassification interface for type CustomerDiskCopyLogDetails. -func (c *CustomerDiskCopyLogDetails) GetCopyLogDetails() *CopyLogDetails { - return &CopyLogDetails{ - CopyLogDetailsType: c.CopyLogDetailsType, - } -} - // MarshalJSON implements the json.Marshaller interface for type CustomerDiskCopyLogDetails. func (c CustomerDiskCopyLogDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -427,55 +335,31 @@ func (c CustomerDiskCopyLogDetails) MarshalJSON() ([]byte, error) { func (c *CustomerDiskCopyLogDetails) 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 "copyLogDetailsType": - err = unpopulate(val, &c.CopyLogDetailsType) + err = unpopulate(val, "CopyLogDetailsType", &c.CopyLogDetailsType) delete(rawMsg, key) case "errorLogLink": - err = unpopulate(val, &c.ErrorLogLink) + err = unpopulate(val, "ErrorLogLink", &c.ErrorLogLink) delete(rawMsg, key) case "serialNumber": - err = unpopulate(val, &c.SerialNumber) + err = unpopulate(val, "SerialNumber", &c.SerialNumber) delete(rawMsg, key) case "verboseLogLink": - err = unpopulate(val, &c.VerboseLogLink) + err = unpopulate(val, "VerboseLogLink", &c.VerboseLogLink) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// GetCommonJobDetails implements the CommonJobDetailsClassification interface for type CustomerDiskJobDetails. -func (c *CustomerDiskJobDetails) GetCommonJobDetails() *CommonJobDetails { - return &CommonJobDetails{ - JobStages: c.JobStages, - ContactDetails: c.ContactDetails, - ShippingAddress: c.ShippingAddress, - DeliveryPackage: c.DeliveryPackage, - ReturnPackage: c.ReturnPackage, - DataImportDetails: c.DataImportDetails, - DataExportDetails: c.DataExportDetails, - JobDetailsType: c.JobDetailsType, - Preferences: c.Preferences, - CopyLogDetails: c.CopyLogDetails, - ReverseShipmentLabelSasKey: c.ReverseShipmentLabelSasKey, - ChainOfCustodySasKey: c.ChainOfCustodySasKey, - KeyEncryptionKey: c.KeyEncryptionKey, - ExpectedDataSizeInTeraBytes: c.ExpectedDataSizeInTeraBytes, - Actions: c.Actions, - LastMitigationActionOnJob: c.LastMitigationActionOnJob, - DatacenterAddress: c.DatacenterAddress, - DataCenterCode: c.DataCenterCode, - } -} - // MarshalJSON implements the json.Marshaller interface for type CustomerDiskJobDetails. func (c CustomerDiskJobDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -490,6 +374,7 @@ func (c CustomerDiskJobDetails) MarshalJSON() ([]byte, error) { populate(objectMap, "datacenterAddress", c.DatacenterAddress) populate(objectMap, "deliverToDcPackageDetails", c.DeliverToDcPackageDetails) populate(objectMap, "deliveryPackage", c.DeliveryPackage) + populate(objectMap, "deviceErasureDetails", c.DeviceErasureDetails) populate(objectMap, "enableManifestBackup", c.EnableManifestBackup) populate(objectMap, "expectedDataSizeInTeraBytes", c.ExpectedDataSizeInTeraBytes) populate(objectMap, "exportDiskDetailsCollection", c.ExportDiskDetailsCollection) @@ -510,146 +395,126 @@ func (c CustomerDiskJobDetails) MarshalJSON() ([]byte, error) { func (c *CustomerDiskJobDetails) 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 "actions": - err = unpopulate(val, &c.Actions) + err = unpopulate(val, "Actions", &c.Actions) delete(rawMsg, key) case "chainOfCustodySasKey": - err = unpopulate(val, &c.ChainOfCustodySasKey) + err = unpopulate(val, "ChainOfCustodySasKey", &c.ChainOfCustodySasKey) delete(rawMsg, key) case "contactDetails": - err = unpopulate(val, &c.ContactDetails) + err = unpopulate(val, "ContactDetails", &c.ContactDetails) delete(rawMsg, key) case "copyLogDetails": c.CopyLogDetails, err = unmarshalCopyLogDetailsClassificationArray(val) delete(rawMsg, key) case "copyProgress": - err = unpopulate(val, &c.CopyProgress) + err = unpopulate(val, "CopyProgress", &c.CopyProgress) delete(rawMsg, key) case "dataCenterCode": - err = unpopulate(val, &c.DataCenterCode) + err = unpopulate(val, "DataCenterCode", &c.DataCenterCode) delete(rawMsg, key) case "dataExportDetails": - err = unpopulate(val, &c.DataExportDetails) + err = unpopulate(val, "DataExportDetails", &c.DataExportDetails) delete(rawMsg, key) case "dataImportDetails": - err = unpopulate(val, &c.DataImportDetails) + err = unpopulate(val, "DataImportDetails", &c.DataImportDetails) delete(rawMsg, key) case "datacenterAddress": c.DatacenterAddress, err = unmarshalDatacenterAddressResponseClassification(val) delete(rawMsg, key) case "deliverToDcPackageDetails": - err = unpopulate(val, &c.DeliverToDcPackageDetails) + err = unpopulate(val, "DeliverToDcPackageDetails", &c.DeliverToDcPackageDetails) delete(rawMsg, key) case "deliveryPackage": - err = unpopulate(val, &c.DeliveryPackage) + err = unpopulate(val, "DeliveryPackage", &c.DeliveryPackage) + delete(rawMsg, key) + case "deviceErasureDetails": + err = unpopulate(val, "DeviceErasureDetails", &c.DeviceErasureDetails) delete(rawMsg, key) case "enableManifestBackup": - err = unpopulate(val, &c.EnableManifestBackup) + err = unpopulate(val, "EnableManifestBackup", &c.EnableManifestBackup) delete(rawMsg, key) case "expectedDataSizeInTeraBytes": - err = unpopulate(val, &c.ExpectedDataSizeInTeraBytes) + err = unpopulate(val, "ExpectedDataSizeInTeraBytes", &c.ExpectedDataSizeInTeraBytes) delete(rawMsg, key) case "exportDiskDetailsCollection": - err = unpopulate(val, &c.ExportDiskDetailsCollection) + err = unpopulate(val, "ExportDiskDetailsCollection", &c.ExportDiskDetailsCollection) delete(rawMsg, key) case "importDiskDetailsCollection": - err = unpopulate(val, &c.ImportDiskDetailsCollection) + err = unpopulate(val, "ImportDiskDetailsCollection", &c.ImportDiskDetailsCollection) delete(rawMsg, key) case "jobDetailsType": - err = unpopulate(val, &c.JobDetailsType) + err = unpopulate(val, "JobDetailsType", &c.JobDetailsType) delete(rawMsg, key) case "jobStages": - err = unpopulate(val, &c.JobStages) + err = unpopulate(val, "JobStages", &c.JobStages) delete(rawMsg, key) case "keyEncryptionKey": - err = unpopulate(val, &c.KeyEncryptionKey) + err = unpopulate(val, "KeyEncryptionKey", &c.KeyEncryptionKey) delete(rawMsg, key) case "lastMitigationActionOnJob": - err = unpopulate(val, &c.LastMitigationActionOnJob) + err = unpopulate(val, "LastMitigationActionOnJob", &c.LastMitigationActionOnJob) delete(rawMsg, key) case "preferences": - err = unpopulate(val, &c.Preferences) + err = unpopulate(val, "Preferences", &c.Preferences) delete(rawMsg, key) case "returnPackage": - err = unpopulate(val, &c.ReturnPackage) + err = unpopulate(val, "ReturnPackage", &c.ReturnPackage) delete(rawMsg, key) case "returnToCustomerPackageDetails": - err = unpopulate(val, &c.ReturnToCustomerPackageDetails) + err = unpopulate(val, "ReturnToCustomerPackageDetails", &c.ReturnToCustomerPackageDetails) delete(rawMsg, key) case "reverseShipmentLabelSasKey": - err = unpopulate(val, &c.ReverseShipmentLabelSasKey) + err = unpopulate(val, "ReverseShipmentLabelSasKey", &c.ReverseShipmentLabelSasKey) delete(rawMsg, key) case "shippingAddress": - err = unpopulate(val, &c.ShippingAddress) + err = unpopulate(val, "ShippingAddress", &c.ShippingAddress) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// GetCommonJobSecrets implements the CommonJobSecretsClassification interface for type CustomerDiskJobSecrets. -func (c *CustomerDiskJobSecrets) GetCommonJobSecrets() *CommonJobSecrets { - return &CommonJobSecrets{ - JobSecretsType: c.JobSecretsType, - DcAccessSecurityCode: c.DcAccessSecurityCode, - Error: c.Error, - } -} - -// MarshalJSON implements the json.Marshaller interface for type CustomerDiskJobSecrets. -func (c CustomerDiskJobSecrets) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "carrierAccountNumber", c.CarrierAccountNumber) - populate(objectMap, "dcAccessSecurityCode", c.DcAccessSecurityCode) - populate(objectMap, "diskSecrets", c.DiskSecrets) - populate(objectMap, "error", c.Error) - objectMap["jobSecretsType"] = ClassDiscriminatorDataBoxCustomerDisk - return json.Marshal(objectMap) -} - // UnmarshalJSON implements the json.Unmarshaller interface for type CustomerDiskJobSecrets. func (c *CustomerDiskJobSecrets) 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 "carrierAccountNumber": - err = unpopulate(val, &c.CarrierAccountNumber) + err = unpopulate(val, "CarrierAccountNumber", &c.CarrierAccountNumber) delete(rawMsg, key) case "dcAccessSecurityCode": - err = unpopulate(val, &c.DcAccessSecurityCode) + err = unpopulate(val, "DcAccessSecurityCode", &c.DcAccessSecurityCode) delete(rawMsg, key) case "diskSecrets": - err = unpopulate(val, &c.DiskSecrets) + err = unpopulate(val, "DiskSecrets", &c.DiskSecrets) delete(rawMsg, key) case "error": - err = unpopulate(val, &c.Error) + err = unpopulate(val, "Error", &c.Error) delete(rawMsg, key) case "jobSecretsType": - err = unpopulate(val, &c.JobSecretsType) + err = unpopulate(val, "JobSecretsType", &c.JobSecretsType) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// GetDataAccountDetails implements the DataAccountDetailsClassification interface for type DataAccountDetails. -func (d *DataAccountDetails) GetDataAccountDetails() *DataAccountDetails { return d } - // MarshalJSON implements the json.Marshaller interface for type DataExportDetails. func (d DataExportDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -663,7 +528,7 @@ func (d DataExportDetails) MarshalJSON() ([]byte, error) { func (d *DataExportDetails) 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 @@ -672,14 +537,14 @@ func (d *DataExportDetails) UnmarshalJSON(data []byte) error { d.AccountDetails, err = unmarshalDataAccountDetailsClassification(val) delete(rawMsg, key) case "logCollectionLevel": - err = unpopulate(val, &d.LogCollectionLevel) + err = unpopulate(val, "LogCollectionLevel", &d.LogCollectionLevel) delete(rawMsg, key) case "transferConfiguration": - err = unpopulate(val, &d.TransferConfiguration) + err = unpopulate(val, "TransferConfiguration", &d.TransferConfiguration) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil @@ -697,7 +562,7 @@ func (d DataImportDetails) MarshalJSON() ([]byte, error) { func (d *DataImportDetails) 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 @@ -706,23 +571,16 @@ func (d *DataImportDetails) UnmarshalJSON(data []byte) error { d.AccountDetails, err = unmarshalDataAccountDetailsClassification(val) delete(rawMsg, key) case "logCollectionLevel": - err = unpopulate(val, &d.LogCollectionLevel) + err = unpopulate(val, "LogCollectionLevel", &d.LogCollectionLevel) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// GetValidationInputRequest implements the ValidationInputRequestClassification interface for type DataTransferDetailsValidationRequest. -func (d *DataTransferDetailsValidationRequest) GetValidationInputRequest() *ValidationInputRequest { - return &ValidationInputRequest{ - ValidationType: d.ValidationType, - } -} - // MarshalJSON implements the json.Marshaller interface for type DataTransferDetailsValidationRequest. func (d DataTransferDetailsValidationRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -738,86 +596,60 @@ func (d DataTransferDetailsValidationRequest) MarshalJSON() ([]byte, error) { func (d *DataTransferDetailsValidationRequest) 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 "dataExportDetails": - err = unpopulate(val, &d.DataExportDetails) + err = unpopulate(val, "DataExportDetails", &d.DataExportDetails) delete(rawMsg, key) case "dataImportDetails": - err = unpopulate(val, &d.DataImportDetails) + err = unpopulate(val, "DataImportDetails", &d.DataImportDetails) delete(rawMsg, key) case "deviceType": - err = unpopulate(val, &d.DeviceType) + err = unpopulate(val, "DeviceType", &d.DeviceType) delete(rawMsg, key) case "transferType": - err = unpopulate(val, &d.TransferType) + err = unpopulate(val, "TransferType", &d.TransferType) delete(rawMsg, key) case "validationType": - err = unpopulate(val, &d.ValidationType) + err = unpopulate(val, "ValidationType", &d.ValidationType) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// GetValidationInputResponse implements the ValidationInputResponseClassification interface for type DataTransferDetailsValidationResponseProperties. -func (d *DataTransferDetailsValidationResponseProperties) GetValidationInputResponse() *ValidationInputResponse { - return &ValidationInputResponse{ - ValidationType: d.ValidationType, - Error: d.Error, - } -} - -// MarshalJSON implements the json.Marshaller interface for type DataTransferDetailsValidationResponseProperties. -func (d DataTransferDetailsValidationResponseProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "error", d.Error) - populate(objectMap, "status", d.Status) - objectMap["validationType"] = ValidationInputDiscriminatorValidateDataTransferDetails - return json.Marshal(objectMap) -} - // UnmarshalJSON implements the json.Unmarshaller interface for type DataTransferDetailsValidationResponseProperties. func (d *DataTransferDetailsValidationResponseProperties) 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 "error": - err = unpopulate(val, &d.Error) + err = unpopulate(val, "Error", &d.Error) delete(rawMsg, key) case "status": - err = unpopulate(val, &d.Status) + err = unpopulate(val, "Status", &d.Status) delete(rawMsg, key) case "validationType": - err = unpopulate(val, &d.ValidationType) + err = unpopulate(val, "ValidationType", &d.ValidationType) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// GetDatacenterAddressResponse implements the DatacenterAddressResponseClassification interface for type DatacenterAddressInstructionResponse. -func (d *DatacenterAddressInstructionResponse) GetDatacenterAddressResponse() *DatacenterAddressResponse { - return &DatacenterAddressResponse{ - DatacenterAddressType: d.DatacenterAddressType, - SupportedCarriersForReturnShipment: d.SupportedCarriersForReturnShipment, - DataCenterAzureLocation: d.DataCenterAzureLocation, - } -} - // MarshalJSON implements the json.Marshaller interface for type DatacenterAddressInstructionResponse. func (d DatacenterAddressInstructionResponse) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -832,40 +664,31 @@ func (d DatacenterAddressInstructionResponse) MarshalJSON() ([]byte, error) { func (d *DatacenterAddressInstructionResponse) 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 "communicationInstruction": - err = unpopulate(val, &d.CommunicationInstruction) + err = unpopulate(val, "CommunicationInstruction", &d.CommunicationInstruction) delete(rawMsg, key) case "dataCenterAzureLocation": - err = unpopulate(val, &d.DataCenterAzureLocation) + err = unpopulate(val, "DataCenterAzureLocation", &d.DataCenterAzureLocation) delete(rawMsg, key) case "datacenterAddressType": - err = unpopulate(val, &d.DatacenterAddressType) + err = unpopulate(val, "DatacenterAddressType", &d.DatacenterAddressType) delete(rawMsg, key) case "supportedCarriersForReturnShipment": - err = unpopulate(val, &d.SupportedCarriersForReturnShipment) + err = unpopulate(val, "SupportedCarriersForReturnShipment", &d.SupportedCarriersForReturnShipment) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// GetDatacenterAddressResponse implements the DatacenterAddressResponseClassification interface for type DatacenterAddressLocationResponse. -func (d *DatacenterAddressLocationResponse) GetDatacenterAddressResponse() *DatacenterAddressResponse { - return &DatacenterAddressResponse{ - DatacenterAddressType: d.DatacenterAddressType, - SupportedCarriersForReturnShipment: d.SupportedCarriersForReturnShipment, - DataCenterAzureLocation: d.DataCenterAzureLocation, - } -} - // MarshalJSON implements the json.Marshaller interface for type DatacenterAddressLocationResponse. func (d DatacenterAddressLocationResponse) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -892,72 +715,67 @@ func (d DatacenterAddressLocationResponse) MarshalJSON() ([]byte, error) { func (d *DatacenterAddressLocationResponse) 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 "additionalShippingInformation": - err = unpopulate(val, &d.AdditionalShippingInformation) + err = unpopulate(val, "AdditionalShippingInformation", &d.AdditionalShippingInformation) delete(rawMsg, key) case "addressType": - err = unpopulate(val, &d.AddressType) + err = unpopulate(val, "AddressType", &d.AddressType) delete(rawMsg, key) case "city": - err = unpopulate(val, &d.City) + err = unpopulate(val, "City", &d.City) delete(rawMsg, key) case "company": - err = unpopulate(val, &d.Company) + err = unpopulate(val, "Company", &d.Company) delete(rawMsg, key) case "contactPersonName": - err = unpopulate(val, &d.ContactPersonName) + err = unpopulate(val, "ContactPersonName", &d.ContactPersonName) delete(rawMsg, key) case "country": - err = unpopulate(val, &d.Country) + err = unpopulate(val, "Country", &d.Country) delete(rawMsg, key) case "dataCenterAzureLocation": - err = unpopulate(val, &d.DataCenterAzureLocation) + err = unpopulate(val, "DataCenterAzureLocation", &d.DataCenterAzureLocation) delete(rawMsg, key) case "datacenterAddressType": - err = unpopulate(val, &d.DatacenterAddressType) + err = unpopulate(val, "DatacenterAddressType", &d.DatacenterAddressType) delete(rawMsg, key) case "phone": - err = unpopulate(val, &d.Phone) + err = unpopulate(val, "Phone", &d.Phone) delete(rawMsg, key) case "phoneExtension": - err = unpopulate(val, &d.PhoneExtension) + err = unpopulate(val, "PhoneExtension", &d.PhoneExtension) delete(rawMsg, key) case "state": - err = unpopulate(val, &d.State) + err = unpopulate(val, "State", &d.State) delete(rawMsg, key) case "street1": - err = unpopulate(val, &d.Street1) + err = unpopulate(val, "Street1", &d.Street1) delete(rawMsg, key) case "street2": - err = unpopulate(val, &d.Street2) + err = unpopulate(val, "Street2", &d.Street2) delete(rawMsg, key) case "street3": - err = unpopulate(val, &d.Street3) + err = unpopulate(val, "Street3", &d.Street3) delete(rawMsg, key) case "supportedCarriersForReturnShipment": - err = unpopulate(val, &d.SupportedCarriersForReturnShipment) + err = unpopulate(val, "SupportedCarriersForReturnShipment", &d.SupportedCarriersForReturnShipment) delete(rawMsg, key) case "zip": - err = unpopulate(val, &d.Zip) + err = unpopulate(val, "Zip", &d.Zip) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// GetDatacenterAddressResponse implements the DatacenterAddressResponseClassification interface for type DatacenterAddressResponse. -func (d *DatacenterAddressResponse) GetDatacenterAddressResponse() *DatacenterAddressResponse { - return d -} - // MarshalJSON implements the json.Marshaller interface for type DatacenterAddressResponse. func (d DatacenterAddressResponse) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -967,13 +785,6 @@ func (d DatacenterAddressResponse) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// GetCopyLogDetails implements the CopyLogDetailsClassification interface for type DiskCopyLogDetails. -func (d *DiskCopyLogDetails) GetCopyLogDetails() *CopyLogDetails { - return &CopyLogDetails{ - CopyLogDetailsType: d.CopyLogDetailsType, - } -} - // MarshalJSON implements the json.Marshaller interface for type DiskCopyLogDetails. func (d DiskCopyLogDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -988,105 +799,63 @@ func (d DiskCopyLogDetails) MarshalJSON() ([]byte, error) { func (d *DiskCopyLogDetails) 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 "copyLogDetailsType": - err = unpopulate(val, &d.CopyLogDetailsType) + err = unpopulate(val, "CopyLogDetailsType", &d.CopyLogDetailsType) delete(rawMsg, key) case "diskSerialNumber": - err = unpopulate(val, &d.DiskSerialNumber) + err = unpopulate(val, "DiskSerialNumber", &d.DiskSerialNumber) delete(rawMsg, key) case "errorLogLink": - err = unpopulate(val, &d.ErrorLogLink) + err = unpopulate(val, "ErrorLogLink", &d.ErrorLogLink) delete(rawMsg, key) case "verboseLogLink": - err = unpopulate(val, &d.VerboseLogLink) + err = unpopulate(val, "VerboseLogLink", &d.VerboseLogLink) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// GetGranularCopyLogDetails implements the GranularCopyLogDetailsClassification interface for type DiskGranularCopyLogDetails. -func (d *DiskGranularCopyLogDetails) GetGranularCopyLogDetails() *GranularCopyLogDetails { - return &GranularCopyLogDetails{ - CopyLogDetailsType: d.CopyLogDetailsType, - } -} - -// MarshalJSON implements the json.Marshaller interface for type DiskGranularCopyLogDetails. -func (d DiskGranularCopyLogDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "accountName", d.AccountName) - objectMap["copyLogDetailsType"] = ClassDiscriminatorDataBoxCustomerDisk - populate(objectMap, "errorLogLink", d.ErrorLogLink) - populate(objectMap, "serialNumber", d.SerialNumber) - populate(objectMap, "verboseLogLink", d.VerboseLogLink) - return json.Marshal(objectMap) -} - // UnmarshalJSON implements the json.Unmarshaller interface for type DiskGranularCopyLogDetails. func (d *DiskGranularCopyLogDetails) 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 "accountName": - err = unpopulate(val, &d.AccountName) + err = unpopulate(val, "AccountName", &d.AccountName) delete(rawMsg, key) case "copyLogDetailsType": - err = unpopulate(val, &d.CopyLogDetailsType) + err = unpopulate(val, "CopyLogDetailsType", &d.CopyLogDetailsType) delete(rawMsg, key) case "errorLogLink": - err = unpopulate(val, &d.ErrorLogLink) + err = unpopulate(val, "ErrorLogLink", &d.ErrorLogLink) delete(rawMsg, key) case "serialNumber": - err = unpopulate(val, &d.SerialNumber) + err = unpopulate(val, "SerialNumber", &d.SerialNumber) delete(rawMsg, key) case "verboseLogLink": - err = unpopulate(val, &d.VerboseLogLink) + err = unpopulate(val, "VerboseLogLink", &d.VerboseLogLink) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// GetCommonJobDetails implements the CommonJobDetailsClassification interface for type DiskJobDetails. -func (d *DiskJobDetails) GetCommonJobDetails() *CommonJobDetails { - return &CommonJobDetails{ - JobStages: d.JobStages, - ContactDetails: d.ContactDetails, - ShippingAddress: d.ShippingAddress, - DeliveryPackage: d.DeliveryPackage, - ReturnPackage: d.ReturnPackage, - DataImportDetails: d.DataImportDetails, - DataExportDetails: d.DataExportDetails, - JobDetailsType: d.JobDetailsType, - Preferences: d.Preferences, - CopyLogDetails: d.CopyLogDetails, - ReverseShipmentLabelSasKey: d.ReverseShipmentLabelSasKey, - ChainOfCustodySasKey: d.ChainOfCustodySasKey, - KeyEncryptionKey: d.KeyEncryptionKey, - ExpectedDataSizeInTeraBytes: d.ExpectedDataSizeInTeraBytes, - Actions: d.Actions, - LastMitigationActionOnJob: d.LastMitigationActionOnJob, - DatacenterAddress: d.DatacenterAddress, - DataCenterCode: d.DataCenterCode, - } -} - // MarshalJSON implements the json.Marshaller interface for type DiskJobDetails. func (d DiskJobDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -1100,6 +869,7 @@ func (d DiskJobDetails) MarshalJSON() ([]byte, error) { populate(objectMap, "dataImportDetails", d.DataImportDetails) populate(objectMap, "datacenterAddress", d.DatacenterAddress) populate(objectMap, "deliveryPackage", d.DeliveryPackage) + populate(objectMap, "deviceErasureDetails", d.DeviceErasureDetails) populate(objectMap, "disksAndSizeDetails", d.DisksAndSizeDetails) populate(objectMap, "expectedDataSizeInTeraBytes", d.ExpectedDataSizeInTeraBytes) populate(objectMap, "granularCopyProgress", d.GranularCopyProgress) @@ -1120,154 +890,126 @@ func (d DiskJobDetails) MarshalJSON() ([]byte, error) { func (d *DiskJobDetails) 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 "actions": - err = unpopulate(val, &d.Actions) + err = unpopulate(val, "Actions", &d.Actions) delete(rawMsg, key) case "chainOfCustodySasKey": - err = unpopulate(val, &d.ChainOfCustodySasKey) + err = unpopulate(val, "ChainOfCustodySasKey", &d.ChainOfCustodySasKey) delete(rawMsg, key) case "contactDetails": - err = unpopulate(val, &d.ContactDetails) + err = unpopulate(val, "ContactDetails", &d.ContactDetails) delete(rawMsg, key) case "copyLogDetails": d.CopyLogDetails, err = unmarshalCopyLogDetailsClassificationArray(val) delete(rawMsg, key) case "copyProgress": - err = unpopulate(val, &d.CopyProgress) + err = unpopulate(val, "CopyProgress", &d.CopyProgress) delete(rawMsg, key) case "dataCenterCode": - err = unpopulate(val, &d.DataCenterCode) + err = unpopulate(val, "DataCenterCode", &d.DataCenterCode) delete(rawMsg, key) case "dataExportDetails": - err = unpopulate(val, &d.DataExportDetails) + err = unpopulate(val, "DataExportDetails", &d.DataExportDetails) delete(rawMsg, key) case "dataImportDetails": - err = unpopulate(val, &d.DataImportDetails) + err = unpopulate(val, "DataImportDetails", &d.DataImportDetails) delete(rawMsg, key) case "datacenterAddress": d.DatacenterAddress, err = unmarshalDatacenterAddressResponseClassification(val) delete(rawMsg, key) case "deliveryPackage": - err = unpopulate(val, &d.DeliveryPackage) + err = unpopulate(val, "DeliveryPackage", &d.DeliveryPackage) + delete(rawMsg, key) + case "deviceErasureDetails": + err = unpopulate(val, "DeviceErasureDetails", &d.DeviceErasureDetails) delete(rawMsg, key) case "disksAndSizeDetails": - err = unpopulate(val, &d.DisksAndSizeDetails) + err = unpopulate(val, "DisksAndSizeDetails", &d.DisksAndSizeDetails) delete(rawMsg, key) case "expectedDataSizeInTeraBytes": - err = unpopulate(val, &d.ExpectedDataSizeInTeraBytes) + err = unpopulate(val, "ExpectedDataSizeInTeraBytes", &d.ExpectedDataSizeInTeraBytes) delete(rawMsg, key) case "granularCopyProgress": - err = unpopulate(val, &d.GranularCopyProgress) + err = unpopulate(val, "GranularCopyProgress", &d.GranularCopyProgress) delete(rawMsg, key) case "jobDetailsType": - err = unpopulate(val, &d.JobDetailsType) + err = unpopulate(val, "JobDetailsType", &d.JobDetailsType) delete(rawMsg, key) case "jobStages": - err = unpopulate(val, &d.JobStages) + err = unpopulate(val, "JobStages", &d.JobStages) delete(rawMsg, key) case "keyEncryptionKey": - err = unpopulate(val, &d.KeyEncryptionKey) + err = unpopulate(val, "KeyEncryptionKey", &d.KeyEncryptionKey) delete(rawMsg, key) case "lastMitigationActionOnJob": - err = unpopulate(val, &d.LastMitigationActionOnJob) + err = unpopulate(val, "LastMitigationActionOnJob", &d.LastMitigationActionOnJob) delete(rawMsg, key) case "passkey": - err = unpopulate(val, &d.Passkey) + err = unpopulate(val, "Passkey", &d.Passkey) delete(rawMsg, key) case "preferences": - err = unpopulate(val, &d.Preferences) + err = unpopulate(val, "Preferences", &d.Preferences) delete(rawMsg, key) case "preferredDisks": - err = unpopulate(val, &d.PreferredDisks) + err = unpopulate(val, "PreferredDisks", &d.PreferredDisks) delete(rawMsg, key) case "returnPackage": - err = unpopulate(val, &d.ReturnPackage) + err = unpopulate(val, "ReturnPackage", &d.ReturnPackage) delete(rawMsg, key) case "reverseShipmentLabelSasKey": - err = unpopulate(val, &d.ReverseShipmentLabelSasKey) + err = unpopulate(val, "ReverseShipmentLabelSasKey", &d.ReverseShipmentLabelSasKey) delete(rawMsg, key) case "shippingAddress": - err = unpopulate(val, &d.ShippingAddress) + err = unpopulate(val, "ShippingAddress", &d.ShippingAddress) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// GetCommonJobSecrets implements the CommonJobSecretsClassification interface for type DiskJobSecrets. -func (d *DiskJobSecrets) GetCommonJobSecrets() *CommonJobSecrets { - return &CommonJobSecrets{ - JobSecretsType: d.JobSecretsType, - DcAccessSecurityCode: d.DcAccessSecurityCode, - Error: d.Error, - } -} - -// MarshalJSON implements the json.Marshaller interface for type DiskJobSecrets. -func (d DiskJobSecrets) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dcAccessSecurityCode", d.DcAccessSecurityCode) - populate(objectMap, "diskSecrets", d.DiskSecrets) - populate(objectMap, "error", d.Error) - populate(objectMap, "isPasskeyUserDefined", d.IsPasskeyUserDefined) - objectMap["jobSecretsType"] = ClassDiscriminatorDataBoxDisk - populate(objectMap, "passKey", d.PassKey) - return json.Marshal(objectMap) -} - // UnmarshalJSON implements the json.Unmarshaller interface for type DiskJobSecrets. func (d *DiskJobSecrets) 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 "dcAccessSecurityCode": - err = unpopulate(val, &d.DcAccessSecurityCode) + err = unpopulate(val, "DcAccessSecurityCode", &d.DcAccessSecurityCode) delete(rawMsg, key) case "diskSecrets": - err = unpopulate(val, &d.DiskSecrets) + err = unpopulate(val, "DiskSecrets", &d.DiskSecrets) delete(rawMsg, key) case "error": - err = unpopulate(val, &d.Error) + err = unpopulate(val, "Error", &d.Error) delete(rawMsg, key) case "isPasskeyUserDefined": - err = unpopulate(val, &d.IsPasskeyUserDefined) + err = unpopulate(val, "IsPasskeyUserDefined", &d.IsPasskeyUserDefined) delete(rawMsg, key) case "jobSecretsType": - err = unpopulate(val, &d.JobSecretsType) + err = unpopulate(val, "JobSecretsType", &d.JobSecretsType) delete(rawMsg, key) case "passKey": - err = unpopulate(val, &d.PassKey) + err = unpopulate(val, "PassKey", &d.PassKey) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// GetCommonScheduleAvailabilityRequest implements the CommonScheduleAvailabilityRequestClassification interface for type -// DiskScheduleAvailabilityRequest. -func (d *DiskScheduleAvailabilityRequest) GetCommonScheduleAvailabilityRequest() *CommonScheduleAvailabilityRequest { - return &CommonScheduleAvailabilityRequest{ - StorageLocation: d.StorageLocation, - SKUName: d.SKUName, - Country: d.Country, - } -} - // MarshalJSON implements the json.Marshaller interface for type DiskScheduleAvailabilityRequest. func (d DiskScheduleAvailabilityRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -1282,51 +1024,31 @@ func (d DiskScheduleAvailabilityRequest) MarshalJSON() ([]byte, error) { func (d *DiskScheduleAvailabilityRequest) 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 "country": - err = unpopulate(val, &d.Country) + err = unpopulate(val, "Country", &d.Country) delete(rawMsg, key) case "expectedDataSizeInTeraBytes": - err = unpopulate(val, &d.ExpectedDataSizeInTeraBytes) + err = unpopulate(val, "ExpectedDataSizeInTeraBytes", &d.ExpectedDataSizeInTeraBytes) delete(rawMsg, key) case "skuName": - err = unpopulate(val, &d.SKUName) + err = unpopulate(val, "SKUName", &d.SKUName) delete(rawMsg, key) case "storageLocation": - err = unpopulate(val, &d.StorageLocation) + err = unpopulate(val, "StorageLocation", &d.StorageLocation) 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 ErrorDetail. -func (e ErrorDetail) 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) -} - -// GetGranularCopyLogDetails implements the GranularCopyLogDetailsClassification interface for type GranularCopyLogDetails. -func (g *GranularCopyLogDetails) GetGranularCopyLogDetails() *GranularCopyLogDetails { return g } - -// GetCopyLogDetails implements the CopyLogDetailsClassification interface for type HeavyAccountCopyLogDetails. -func (h *HeavyAccountCopyLogDetails) GetCopyLogDetails() *CopyLogDetails { - return &CopyLogDetails{ - CopyLogDetailsType: h.CopyLogDetailsType, - } -} - // MarshalJSON implements the json.Marshaller interface for type HeavyAccountCopyLogDetails. func (h HeavyAccountCopyLogDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -1341,55 +1063,31 @@ func (h HeavyAccountCopyLogDetails) MarshalJSON() ([]byte, error) { func (h *HeavyAccountCopyLogDetails) 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", h, err) } for key, val := range rawMsg { var err error switch key { case "accountName": - err = unpopulate(val, &h.AccountName) + err = unpopulate(val, "AccountName", &h.AccountName) delete(rawMsg, key) case "copyLogDetailsType": - err = unpopulate(val, &h.CopyLogDetailsType) + err = unpopulate(val, "CopyLogDetailsType", &h.CopyLogDetailsType) delete(rawMsg, key) case "copyLogLink": - err = unpopulate(val, &h.CopyLogLink) + err = unpopulate(val, "CopyLogLink", &h.CopyLogLink) delete(rawMsg, key) case "copyVerboseLogLink": - err = unpopulate(val, &h.CopyVerboseLogLink) + err = unpopulate(val, "CopyVerboseLogLink", &h.CopyVerboseLogLink) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", h, err) } } return nil } -// GetCommonJobDetails implements the CommonJobDetailsClassification interface for type HeavyJobDetails. -func (h *HeavyJobDetails) GetCommonJobDetails() *CommonJobDetails { - return &CommonJobDetails{ - JobStages: h.JobStages, - ContactDetails: h.ContactDetails, - ShippingAddress: h.ShippingAddress, - DeliveryPackage: h.DeliveryPackage, - ReturnPackage: h.ReturnPackage, - DataImportDetails: h.DataImportDetails, - DataExportDetails: h.DataExportDetails, - JobDetailsType: h.JobDetailsType, - Preferences: h.Preferences, - CopyLogDetails: h.CopyLogDetails, - ReverseShipmentLabelSasKey: h.ReverseShipmentLabelSasKey, - ChainOfCustodySasKey: h.ChainOfCustodySasKey, - KeyEncryptionKey: h.KeyEncryptionKey, - ExpectedDataSizeInTeraBytes: h.ExpectedDataSizeInTeraBytes, - Actions: h.Actions, - LastMitigationActionOnJob: h.LastMitigationActionOnJob, - DatacenterAddress: h.DatacenterAddress, - DataCenterCode: h.DataCenterCode, - } -} - // MarshalJSON implements the json.Marshaller interface for type HeavyJobDetails. func (h HeavyJobDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -1403,6 +1101,7 @@ func (h HeavyJobDetails) MarshalJSON() ([]byte, error) { populate(objectMap, "dataImportDetails", h.DataImportDetails) populate(objectMap, "datacenterAddress", h.DatacenterAddress) populate(objectMap, "deliveryPackage", h.DeliveryPackage) + populate(objectMap, "deviceErasureDetails", h.DeviceErasureDetails) populate(objectMap, "devicePassword", h.DevicePassword) populate(objectMap, "expectedDataSizeInTeraBytes", h.ExpectedDataSizeInTeraBytes) objectMap["jobDetailsType"] = ClassDiscriminatorDataBoxHeavy @@ -1420,137 +1119,111 @@ func (h HeavyJobDetails) MarshalJSON() ([]byte, error) { func (h *HeavyJobDetails) 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", h, err) } for key, val := range rawMsg { var err error switch key { case "actions": - err = unpopulate(val, &h.Actions) + err = unpopulate(val, "Actions", &h.Actions) delete(rawMsg, key) case "chainOfCustodySasKey": - err = unpopulate(val, &h.ChainOfCustodySasKey) + err = unpopulate(val, "ChainOfCustodySasKey", &h.ChainOfCustodySasKey) delete(rawMsg, key) case "contactDetails": - err = unpopulate(val, &h.ContactDetails) + err = unpopulate(val, "ContactDetails", &h.ContactDetails) delete(rawMsg, key) case "copyLogDetails": h.CopyLogDetails, err = unmarshalCopyLogDetailsClassificationArray(val) delete(rawMsg, key) case "copyProgress": - err = unpopulate(val, &h.CopyProgress) + err = unpopulate(val, "CopyProgress", &h.CopyProgress) delete(rawMsg, key) case "dataCenterCode": - err = unpopulate(val, &h.DataCenterCode) + err = unpopulate(val, "DataCenterCode", &h.DataCenterCode) delete(rawMsg, key) case "dataExportDetails": - err = unpopulate(val, &h.DataExportDetails) + err = unpopulate(val, "DataExportDetails", &h.DataExportDetails) delete(rawMsg, key) case "dataImportDetails": - err = unpopulate(val, &h.DataImportDetails) + err = unpopulate(val, "DataImportDetails", &h.DataImportDetails) delete(rawMsg, key) case "datacenterAddress": h.DatacenterAddress, err = unmarshalDatacenterAddressResponseClassification(val) delete(rawMsg, key) case "deliveryPackage": - err = unpopulate(val, &h.DeliveryPackage) + err = unpopulate(val, "DeliveryPackage", &h.DeliveryPackage) + delete(rawMsg, key) + case "deviceErasureDetails": + err = unpopulate(val, "DeviceErasureDetails", &h.DeviceErasureDetails) delete(rawMsg, key) case "devicePassword": - err = unpopulate(val, &h.DevicePassword) + err = unpopulate(val, "DevicePassword", &h.DevicePassword) delete(rawMsg, key) case "expectedDataSizeInTeraBytes": - err = unpopulate(val, &h.ExpectedDataSizeInTeraBytes) + err = unpopulate(val, "ExpectedDataSizeInTeraBytes", &h.ExpectedDataSizeInTeraBytes) delete(rawMsg, key) case "jobDetailsType": - err = unpopulate(val, &h.JobDetailsType) + err = unpopulate(val, "JobDetailsType", &h.JobDetailsType) delete(rawMsg, key) case "jobStages": - err = unpopulate(val, &h.JobStages) + err = unpopulate(val, "JobStages", &h.JobStages) delete(rawMsg, key) case "keyEncryptionKey": - err = unpopulate(val, &h.KeyEncryptionKey) + err = unpopulate(val, "KeyEncryptionKey", &h.KeyEncryptionKey) delete(rawMsg, key) case "lastMitigationActionOnJob": - err = unpopulate(val, &h.LastMitigationActionOnJob) + err = unpopulate(val, "LastMitigationActionOnJob", &h.LastMitigationActionOnJob) delete(rawMsg, key) case "preferences": - err = unpopulate(val, &h.Preferences) + err = unpopulate(val, "Preferences", &h.Preferences) delete(rawMsg, key) case "returnPackage": - err = unpopulate(val, &h.ReturnPackage) + err = unpopulate(val, "ReturnPackage", &h.ReturnPackage) delete(rawMsg, key) case "reverseShipmentLabelSasKey": - err = unpopulate(val, &h.ReverseShipmentLabelSasKey) + err = unpopulate(val, "ReverseShipmentLabelSasKey", &h.ReverseShipmentLabelSasKey) delete(rawMsg, key) case "shippingAddress": - err = unpopulate(val, &h.ShippingAddress) + err = unpopulate(val, "ShippingAddress", &h.ShippingAddress) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", h, err) } } return nil } -// GetCommonJobSecrets implements the CommonJobSecretsClassification interface for type HeavyJobSecrets. -func (h *HeavyJobSecrets) GetCommonJobSecrets() *CommonJobSecrets { - return &CommonJobSecrets{ - JobSecretsType: h.JobSecretsType, - DcAccessSecurityCode: h.DcAccessSecurityCode, - Error: h.Error, - } -} - -// MarshalJSON implements the json.Marshaller interface for type HeavyJobSecrets. -func (h HeavyJobSecrets) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "cabinetPodSecrets", h.CabinetPodSecrets) - populate(objectMap, "dcAccessSecurityCode", h.DcAccessSecurityCode) - populate(objectMap, "error", h.Error) - objectMap["jobSecretsType"] = ClassDiscriminatorDataBoxHeavy - return json.Marshal(objectMap) -} - // UnmarshalJSON implements the json.Unmarshaller interface for type HeavyJobSecrets. func (h *HeavyJobSecrets) 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", h, err) } for key, val := range rawMsg { var err error switch key { case "cabinetPodSecrets": - err = unpopulate(val, &h.CabinetPodSecrets) + err = unpopulate(val, "CabinetPodSecrets", &h.CabinetPodSecrets) delete(rawMsg, key) case "dcAccessSecurityCode": - err = unpopulate(val, &h.DcAccessSecurityCode) + err = unpopulate(val, "DcAccessSecurityCode", &h.DcAccessSecurityCode) delete(rawMsg, key) case "error": - err = unpopulate(val, &h.Error) + err = unpopulate(val, "Error", &h.Error) delete(rawMsg, key) case "jobSecretsType": - err = unpopulate(val, &h.JobSecretsType) + err = unpopulate(val, "JobSecretsType", &h.JobSecretsType) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", h, err) } } return nil } -// GetCommonScheduleAvailabilityRequest implements the CommonScheduleAvailabilityRequestClassification interface for type -// HeavyScheduleAvailabilityRequest. -func (h *HeavyScheduleAvailabilityRequest) GetCommonScheduleAvailabilityRequest() *CommonScheduleAvailabilityRequest { - return &CommonScheduleAvailabilityRequest{ - StorageLocation: h.StorageLocation, - SKUName: h.SKUName, - Country: h.Country, - } -} - // MarshalJSON implements the json.Marshaller interface for type HeavyScheduleAvailabilityRequest. func (h HeavyScheduleAvailabilityRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -1564,39 +1237,28 @@ func (h HeavyScheduleAvailabilityRequest) MarshalJSON() ([]byte, error) { func (h *HeavyScheduleAvailabilityRequest) 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", h, err) } for key, val := range rawMsg { var err error switch key { case "country": - err = unpopulate(val, &h.Country) + err = unpopulate(val, "Country", &h.Country) delete(rawMsg, key) case "skuName": - err = unpopulate(val, &h.SKUName) + err = unpopulate(val, "SKUName", &h.SKUName) delete(rawMsg, key) case "storageLocation": - err = unpopulate(val, &h.StorageLocation) + err = unpopulate(val, "StorageLocation", &h.StorageLocation) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", h, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type HeavySecret. -func (h HeavySecret) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "accountCredentialDetails", h.AccountCredentialDetails) - populate(objectMap, "devicePassword", h.DevicePassword) - populate(objectMap, "deviceSerialNumber", h.DeviceSerialNumber) - populate(objectMap, "encodedValidationCertPubKey", h.EncodedValidationCertPubKey) - populate(objectMap, "networkConfigurations", h.NetworkConfigurations) - return json.Marshal(objectMap) -} - // MarshalJSON implements the json.Marshaller interface for type JobDeliveryInfo. func (j JobDeliveryInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -1608,46 +1270,22 @@ func (j JobDeliveryInfo) MarshalJSON() ([]byte, error) { func (j *JobDeliveryInfo) 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", j, err) } for key, val := range rawMsg { var err error switch key { case "scheduledDateTime": - err = unpopulateTimeRFC3339(val, &j.ScheduledDateTime) + err = unpopulateTimeRFC3339(val, "ScheduledDateTime", &j.ScheduledDateTime) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// GetCommonJobDetails implements the CommonJobDetailsClassification interface for type JobDetails. -func (j *JobDetails) GetCommonJobDetails() *CommonJobDetails { - return &CommonJobDetails{ - JobStages: j.JobStages, - ContactDetails: j.ContactDetails, - ShippingAddress: j.ShippingAddress, - DeliveryPackage: j.DeliveryPackage, - ReturnPackage: j.ReturnPackage, - DataImportDetails: j.DataImportDetails, - DataExportDetails: j.DataExportDetails, - JobDetailsType: j.JobDetailsType, - Preferences: j.Preferences, - CopyLogDetails: j.CopyLogDetails, - ReverseShipmentLabelSasKey: j.ReverseShipmentLabelSasKey, - ChainOfCustodySasKey: j.ChainOfCustodySasKey, - KeyEncryptionKey: j.KeyEncryptionKey, - ExpectedDataSizeInTeraBytes: j.ExpectedDataSizeInTeraBytes, - Actions: j.Actions, - LastMitigationActionOnJob: j.LastMitigationActionOnJob, - DatacenterAddress: j.DatacenterAddress, - DataCenterCode: j.DataCenterCode, - } -} - // MarshalJSON implements the json.Marshaller interface for type JobDetails. func (j JobDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -1661,6 +1299,7 @@ func (j JobDetails) MarshalJSON() ([]byte, error) { populate(objectMap, "dataImportDetails", j.DataImportDetails) populate(objectMap, "datacenterAddress", j.DatacenterAddress) populate(objectMap, "deliveryPackage", j.DeliveryPackage) + populate(objectMap, "deviceErasureDetails", j.DeviceErasureDetails) populate(objectMap, "devicePassword", j.DevicePassword) populate(objectMap, "expectedDataSizeInTeraBytes", j.ExpectedDataSizeInTeraBytes) objectMap["jobDetailsType"] = ClassDiscriminatorDataBox @@ -1678,74 +1317,77 @@ func (j JobDetails) MarshalJSON() ([]byte, error) { func (j *JobDetails) 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", j, err) } for key, val := range rawMsg { var err error switch key { case "actions": - err = unpopulate(val, &j.Actions) + err = unpopulate(val, "Actions", &j.Actions) delete(rawMsg, key) case "chainOfCustodySasKey": - err = unpopulate(val, &j.ChainOfCustodySasKey) + err = unpopulate(val, "ChainOfCustodySasKey", &j.ChainOfCustodySasKey) delete(rawMsg, key) case "contactDetails": - err = unpopulate(val, &j.ContactDetails) + err = unpopulate(val, "ContactDetails", &j.ContactDetails) delete(rawMsg, key) case "copyLogDetails": j.CopyLogDetails, err = unmarshalCopyLogDetailsClassificationArray(val) delete(rawMsg, key) case "copyProgress": - err = unpopulate(val, &j.CopyProgress) + err = unpopulate(val, "CopyProgress", &j.CopyProgress) delete(rawMsg, key) case "dataCenterCode": - err = unpopulate(val, &j.DataCenterCode) + err = unpopulate(val, "DataCenterCode", &j.DataCenterCode) delete(rawMsg, key) case "dataExportDetails": - err = unpopulate(val, &j.DataExportDetails) + err = unpopulate(val, "DataExportDetails", &j.DataExportDetails) delete(rawMsg, key) case "dataImportDetails": - err = unpopulate(val, &j.DataImportDetails) + err = unpopulate(val, "DataImportDetails", &j.DataImportDetails) delete(rawMsg, key) case "datacenterAddress": j.DatacenterAddress, err = unmarshalDatacenterAddressResponseClassification(val) delete(rawMsg, key) case "deliveryPackage": - err = unpopulate(val, &j.DeliveryPackage) + err = unpopulate(val, "DeliveryPackage", &j.DeliveryPackage) + delete(rawMsg, key) + case "deviceErasureDetails": + err = unpopulate(val, "DeviceErasureDetails", &j.DeviceErasureDetails) delete(rawMsg, key) case "devicePassword": - err = unpopulate(val, &j.DevicePassword) + err = unpopulate(val, "DevicePassword", &j.DevicePassword) delete(rawMsg, key) case "expectedDataSizeInTeraBytes": - err = unpopulate(val, &j.ExpectedDataSizeInTeraBytes) + err = unpopulate(val, "ExpectedDataSizeInTeraBytes", &j.ExpectedDataSizeInTeraBytes) delete(rawMsg, key) case "jobDetailsType": - err = unpopulate(val, &j.JobDetailsType) + err = unpopulate(val, "JobDetailsType", &j.JobDetailsType) delete(rawMsg, key) case "jobStages": - err = unpopulate(val, &j.JobStages) + err = unpopulate(val, "JobStages", &j.JobStages) delete(rawMsg, key) case "keyEncryptionKey": - err = unpopulate(val, &j.KeyEncryptionKey) + err = unpopulate(val, "KeyEncryptionKey", &j.KeyEncryptionKey) delete(rawMsg, key) case "lastMitigationActionOnJob": - err = unpopulate(val, &j.LastMitigationActionOnJob) + err = unpopulate(val, "LastMitigationActionOnJob", &j.LastMitigationActionOnJob) delete(rawMsg, key) case "preferences": - err = unpopulate(val, &j.Preferences) + err = unpopulate(val, "Preferences", &j.Preferences) delete(rawMsg, key) case "returnPackage": - err = unpopulate(val, &j.ReturnPackage) + err = unpopulate(val, "ReturnPackage", &j.ReturnPackage) delete(rawMsg, key) case "reverseShipmentLabelSasKey": - err = unpopulate(val, &j.ReverseShipmentLabelSasKey) + err = unpopulate(val, "ReverseShipmentLabelSasKey", &j.ReverseShipmentLabelSasKey) delete(rawMsg, key) case "shippingAddress": - err = unpopulate(val, &j.ShippingAddress) + err = unpopulate(val, "ShippingAddress", &j.ShippingAddress) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil @@ -1774,53 +1416,53 @@ func (j JobProperties) MarshalJSON() ([]byte, error) { func (j *JobProperties) 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", j, err) } for key, val := range rawMsg { var err error switch key { case "cancellationReason": - err = unpopulate(val, &j.CancellationReason) + err = unpopulate(val, "CancellationReason", &j.CancellationReason) delete(rawMsg, key) case "deliveryInfo": - err = unpopulate(val, &j.DeliveryInfo) + err = unpopulate(val, "DeliveryInfo", &j.DeliveryInfo) delete(rawMsg, key) case "deliveryType": - err = unpopulate(val, &j.DeliveryType) + err = unpopulate(val, "DeliveryType", &j.DeliveryType) delete(rawMsg, key) case "details": j.Details, err = unmarshalCommonJobDetailsClassification(val) delete(rawMsg, key) case "error": - err = unpopulate(val, &j.Error) + err = unpopulate(val, "Error", &j.Error) delete(rawMsg, key) case "isCancellable": - err = unpopulate(val, &j.IsCancellable) + err = unpopulate(val, "IsCancellable", &j.IsCancellable) delete(rawMsg, key) case "isCancellableWithoutFee": - err = unpopulate(val, &j.IsCancellableWithoutFee) + err = unpopulate(val, "IsCancellableWithoutFee", &j.IsCancellableWithoutFee) delete(rawMsg, key) case "isDeletable": - err = unpopulate(val, &j.IsDeletable) + err = unpopulate(val, "IsDeletable", &j.IsDeletable) delete(rawMsg, key) case "isPrepareToShipEnabled": - err = unpopulate(val, &j.IsPrepareToShipEnabled) + err = unpopulate(val, "IsPrepareToShipEnabled", &j.IsPrepareToShipEnabled) delete(rawMsg, key) case "isShippingAddressEditable": - err = unpopulate(val, &j.IsShippingAddressEditable) + err = unpopulate(val, "IsShippingAddressEditable", &j.IsShippingAddressEditable) delete(rawMsg, key) case "startTime": - err = unpopulateTimeRFC3339(val, &j.StartTime) + err = unpopulateTimeRFC3339(val, "StartTime", &j.StartTime) delete(rawMsg, key) case "status": - err = unpopulate(val, &j.Status) + err = unpopulate(val, "Status", &j.Status) delete(rawMsg, key) case "transferType": - err = unpopulate(val, &j.TransferType) + err = unpopulate(val, "TransferType", &j.TransferType) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil @@ -1841,14 +1483,6 @@ func (j JobResource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// MarshalJSON implements the json.Marshaller interface for type JobResourceList. -func (j JobResourceList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", j.NextLink) - populate(objectMap, "value", j.Value) - return json.Marshal(objectMap) -} - // MarshalJSON implements the json.Marshaller interface for type JobResourceUpdateParameter. func (j JobResourceUpdateParameter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -1858,49 +1492,30 @@ func (j JobResourceUpdateParameter) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// GetCommonJobSecrets implements the CommonJobSecretsClassification interface for type JobSecrets. -func (j *JobSecrets) GetCommonJobSecrets() *CommonJobSecrets { - return &CommonJobSecrets{ - JobSecretsType: j.JobSecretsType, - DcAccessSecurityCode: j.DcAccessSecurityCode, - Error: j.Error, - } -} - -// MarshalJSON implements the json.Marshaller interface for type JobSecrets. -func (j JobSecrets) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dcAccessSecurityCode", j.DcAccessSecurityCode) - populate(objectMap, "error", j.Error) - objectMap["jobSecretsType"] = ClassDiscriminatorDataBox - populate(objectMap, "podSecrets", j.PodSecrets) - return json.Marshal(objectMap) -} - // UnmarshalJSON implements the json.Unmarshaller interface for type JobSecrets. func (j *JobSecrets) 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", j, err) } for key, val := range rawMsg { var err error switch key { case "dcAccessSecurityCode": - err = unpopulate(val, &j.DcAccessSecurityCode) + err = unpopulate(val, "DcAccessSecurityCode", &j.DcAccessSecurityCode) delete(rawMsg, key) case "error": - err = unpopulate(val, &j.Error) + err = unpopulate(val, "Error", &j.Error) delete(rawMsg, key) case "jobSecretsType": - err = unpopulate(val, &j.JobSecretsType) + err = unpopulate(val, "JobSecretsType", &j.JobSecretsType) delete(rawMsg, key) case "podSecrets": - err = unpopulate(val, &j.PodSecrets) + err = unpopulate(val, "PodSecrets", &j.PodSecrets) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil @@ -1921,29 +1536,29 @@ func (j JobStages) MarshalJSON() ([]byte, error) { func (j *JobStages) 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", j, err) } for key, val := range rawMsg { var err error switch key { case "displayName": - err = unpopulate(val, &j.DisplayName) + err = unpopulate(val, "DisplayName", &j.DisplayName) delete(rawMsg, key) case "jobStageDetails": - err = unpopulate(val, &j.JobStageDetails) + err = unpopulate(val, "JobStageDetails", &j.JobStageDetails) delete(rawMsg, key) case "stageName": - err = unpopulate(val, &j.StageName) + err = unpopulate(val, "StageName", &j.StageName) delete(rawMsg, key) case "stageStatus": - err = unpopulate(val, &j.StageStatus) + err = unpopulate(val, "StageStatus", &j.StageStatus) delete(rawMsg, key) case "stageTime": - err = unpopulateTimeRFC3339(val, &j.StageTime) + err = unpopulateTimeRFC3339(val, "StageTime", &j.StageTime) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil @@ -1962,36 +1577,28 @@ func (l LastMitigationActionOnJob) MarshalJSON() ([]byte, error) { func (l *LastMitigationActionOnJob) 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", l, err) } for key, val := range rawMsg { var err error switch key { case "actionDateTimeInUtc": - err = unpopulateTimeRFC3339(val, &l.ActionDateTimeInUTC) + err = unpopulateTimeRFC3339(val, "ActionDateTimeInUTC", &l.ActionDateTimeInUTC) delete(rawMsg, key) case "customerResolution": - err = unpopulate(val, &l.CustomerResolution) + err = unpopulate(val, "CustomerResolution", &l.CustomerResolution) delete(rawMsg, key) case "isPerformedByCustomer": - err = unpopulate(val, &l.IsPerformedByCustomer) + err = unpopulate(val, "IsPerformedByCustomer", &l.IsPerformedByCustomer) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// GetDataAccountDetails implements the DataAccountDetailsClassification interface for type ManagedDiskDetails. -func (m *ManagedDiskDetails) GetDataAccountDetails() *DataAccountDetails { - return &DataAccountDetails{ - DataAccountType: m.DataAccountType, - SharePassword: m.SharePassword, - } -} - // MarshalJSON implements the json.Marshaller interface for type ManagedDiskDetails. func (m ManagedDiskDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -2006,39 +1613,31 @@ func (m ManagedDiskDetails) MarshalJSON() ([]byte, error) { func (m *ManagedDiskDetails) 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 "dataAccountType": - err = unpopulate(val, &m.DataAccountType) + err = unpopulate(val, "DataAccountType", &m.DataAccountType) delete(rawMsg, key) case "resourceGroupId": - err = unpopulate(val, &m.ResourceGroupID) + err = unpopulate(val, "ResourceGroupID", &m.ResourceGroupID) delete(rawMsg, key) case "sharePassword": - err = unpopulate(val, &m.SharePassword) + err = unpopulate(val, "SharePassword", &m.SharePassword) delete(rawMsg, key) case "stagingStorageAccountId": - err = unpopulate(val, &m.StagingStorageAccountID) + err = unpopulate(val, "StagingStorageAccountID", &m.StagingStorageAccountID) 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 OperationList. -func (o OperationList) 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 Preferences. func (p Preferences) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -2049,13 +1648,6 @@ func (p Preferences) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// GetValidationInputRequest implements the ValidationInputRequestClassification interface for type PreferencesValidationRequest. -func (p *PreferencesValidationRequest) GetValidationInputRequest() *ValidationInputRequest { - return &ValidationInputRequest{ - ValidationType: p.ValidationType, - } -} - // MarshalJSON implements the json.Marshaller interface for type PreferencesValidationRequest. func (p PreferencesValidationRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -2069,66 +1661,49 @@ func (p PreferencesValidationRequest) MarshalJSON() ([]byte, error) { func (p *PreferencesValidationRequest) 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 "deviceType": - err = unpopulate(val, &p.DeviceType) + err = unpopulate(val, "DeviceType", &p.DeviceType) delete(rawMsg, key) case "preference": - err = unpopulate(val, &p.Preference) + err = unpopulate(val, "Preference", &p.Preference) delete(rawMsg, key) case "validationType": - err = unpopulate(val, &p.ValidationType) + err = unpopulate(val, "ValidationType", &p.ValidationType) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// GetValidationInputResponse implements the ValidationInputResponseClassification interface for type PreferencesValidationResponseProperties. -func (p *PreferencesValidationResponseProperties) GetValidationInputResponse() *ValidationInputResponse { - return &ValidationInputResponse{ - ValidationType: p.ValidationType, - Error: p.Error, - } -} - -// MarshalJSON implements the json.Marshaller interface for type PreferencesValidationResponseProperties. -func (p PreferencesValidationResponseProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "error", p.Error) - populate(objectMap, "status", p.Status) - objectMap["validationType"] = ValidationInputDiscriminatorValidatePreferences - return json.Marshal(objectMap) -} - // UnmarshalJSON implements the json.Unmarshaller interface for type PreferencesValidationResponseProperties. func (p *PreferencesValidationResponseProperties) 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 "error": - err = unpopulate(val, &p.Error) + err = unpopulate(val, "Error", &p.Error) delete(rawMsg, key) case "status": - err = unpopulate(val, &p.Status) + err = unpopulate(val, "Status", &p.Status) delete(rawMsg, key) case "validationType": - err = unpopulate(val, &p.ValidationType) + err = unpopulate(val, "ValidationType", &p.ValidationType) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil @@ -2147,42 +1722,33 @@ func (r RegionConfigurationRequest) MarshalJSON() ([]byte, error) { func (r *RegionConfigurationRequest) 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 "datacenterAddressRequest": - err = unpopulate(val, &r.DatacenterAddressRequest) + err = unpopulate(val, "DatacenterAddressRequest", &r.DatacenterAddressRequest) delete(rawMsg, key) case "scheduleAvailabilityRequest": r.ScheduleAvailabilityRequest, err = unmarshalCommonScheduleAvailabilityRequestClassification(val) delete(rawMsg, key) case "transportAvailabilityRequest": - err = unpopulate(val, &r.TransportAvailabilityRequest) + err = unpopulate(val, "TransportAvailabilityRequest", &r.TransportAvailabilityRequest) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RegionConfigurationResponse. -func (r RegionConfigurationResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "datacenterAddressResponse", r.DatacenterAddressResponse) - populate(objectMap, "scheduleAvailabilityResponse", r.ScheduleAvailabilityResponse) - populate(objectMap, "transportAvailabilityResponse", r.TransportAvailabilityResponse) - return json.Marshal(objectMap) -} - // UnmarshalJSON implements the json.Unmarshaller interface for type RegionConfigurationResponse. func (r *RegionConfigurationResponse) 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 @@ -2191,14 +1757,14 @@ func (r *RegionConfigurationResponse) UnmarshalJSON(data []byte) error { r.DatacenterAddressResponse, err = unmarshalDatacenterAddressResponseClassification(val) delete(rawMsg, key) case "scheduleAvailabilityResponse": - err = unpopulate(val, &r.ScheduleAvailabilityResponse) + err = unpopulate(val, "ScheduleAvailabilityResponse", &r.ScheduleAvailabilityResponse) delete(rawMsg, key) case "transportAvailabilityResponse": - err = unpopulate(val, &r.TransportAvailabilityResponse) + err = unpopulate(val, "TransportAvailabilityResponse", &r.TransportAvailabilityResponse) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil @@ -2224,13 +1790,6 @@ func (r ResourceIdentity) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// GetValidationInputRequest implements the ValidationInputRequestClassification interface for type SKUAvailabilityValidationRequest. -func (s *SKUAvailabilityValidationRequest) GetValidationInputRequest() *ValidationInputRequest { - return &ValidationInputRequest{ - ValidationType: s.ValidationType, - } -} - // MarshalJSON implements the json.Marshaller interface for type SKUAvailabilityValidationRequest. func (s SKUAvailabilityValidationRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -2246,100 +1805,60 @@ func (s SKUAvailabilityValidationRequest) MarshalJSON() ([]byte, error) { func (s *SKUAvailabilityValidationRequest) 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 "country": - err = unpopulate(val, &s.Country) + err = unpopulate(val, "Country", &s.Country) delete(rawMsg, key) case "deviceType": - err = unpopulate(val, &s.DeviceType) + err = unpopulate(val, "DeviceType", &s.DeviceType) delete(rawMsg, key) case "location": - err = unpopulate(val, &s.Location) + err = unpopulate(val, "Location", &s.Location) delete(rawMsg, key) case "transferType": - err = unpopulate(val, &s.TransferType) + err = unpopulate(val, "TransferType", &s.TransferType) delete(rawMsg, key) case "validationType": - err = unpopulate(val, &s.ValidationType) + err = unpopulate(val, "ValidationType", &s.ValidationType) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// GetValidationInputResponse implements the ValidationInputResponseClassification interface for type SKUAvailabilityValidationResponseProperties. -func (s *SKUAvailabilityValidationResponseProperties) GetValidationInputResponse() *ValidationInputResponse { - return &ValidationInputResponse{ - ValidationType: s.ValidationType, - Error: s.Error, - } -} - -// MarshalJSON implements the json.Marshaller interface for type SKUAvailabilityValidationResponseProperties. -func (s SKUAvailabilityValidationResponseProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "error", s.Error) - populate(objectMap, "status", s.Status) - objectMap["validationType"] = ValidationInputDiscriminatorValidateSKUAvailability - return json.Marshal(objectMap) -} - // UnmarshalJSON implements the json.Unmarshaller interface for type SKUAvailabilityValidationResponseProperties. func (s *SKUAvailabilityValidationResponseProperties) 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 "error": - err = unpopulate(val, &s.Error) + err = unpopulate(val, "Error", &s.Error) delete(rawMsg, key) case "status": - err = unpopulate(val, &s.Status) + err = unpopulate(val, "Status", &s.Status) delete(rawMsg, key) case "validationType": - err = unpopulate(val, &s.ValidationType) + err = unpopulate(val, "ValidationType", &s.ValidationType) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type SKUProperties. -func (s SKUProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "apiVersions", s.APIVersions) - populate(objectMap, "capacity", s.Capacity) - populate(objectMap, "costs", s.Costs) - populate(objectMap, "dataLocationToServiceLocationMap", s.DataLocationToServiceLocationMap) - populate(objectMap, "disabledReason", s.DisabledReason) - populate(objectMap, "disabledReasonMessage", s.DisabledReasonMessage) - populate(objectMap, "requiredFeature", s.RequiredFeature) - return json.Marshal(objectMap) -} - -// GetCommonScheduleAvailabilityRequest implements the CommonScheduleAvailabilityRequestClassification interface for type -// ScheduleAvailabilityRequest. -func (s *ScheduleAvailabilityRequest) GetCommonScheduleAvailabilityRequest() *CommonScheduleAvailabilityRequest { - return &CommonScheduleAvailabilityRequest{ - StorageLocation: s.StorageLocation, - SKUName: s.SKUName, - Country: s.Country, - } -} - // MarshalJSON implements the json.Marshaller interface for type ScheduleAvailabilityRequest. func (s ScheduleAvailabilityRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -2353,61 +1872,28 @@ func (s ScheduleAvailabilityRequest) MarshalJSON() ([]byte, error) { func (s *ScheduleAvailabilityRequest) 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 "country": - err = unpopulate(val, &s.Country) + err = unpopulate(val, "Country", &s.Country) delete(rawMsg, key) case "skuName": - err = unpopulate(val, &s.SKUName) + err = unpopulate(val, "SKUName", &s.SKUName) delete(rawMsg, key) case "storageLocation": - err = unpopulate(val, &s.StorageLocation) + err = unpopulate(val, "StorageLocation", &s.StorageLocation) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ScheduleAvailabilityResponse. -func (s ScheduleAvailabilityResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - aux := make([]*timeRFC3339, len(s.AvailableDates), len(s.AvailableDates)) - for i := 0; i < len(s.AvailableDates); i++ { - aux[i] = (*timeRFC3339)(s.AvailableDates[i]) - } - populate(objectMap, "availableDates", aux) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type Secret. -func (s Secret) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "accountCredentialDetails", s.AccountCredentialDetails) - populate(objectMap, "devicePassword", s.DevicePassword) - populate(objectMap, "deviceSerialNumber", s.DeviceSerialNumber) - populate(objectMap, "encodedValidationCertPubKey", s.EncodedValidationCertPubKey) - populate(objectMap, "networkConfigurations", s.NetworkConfigurations) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ShareCredentialDetails. -func (s ShareCredentialDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "password", s.Password) - populate(objectMap, "shareName", s.ShareName) - populate(objectMap, "shareType", s.ShareType) - populate(objectMap, "supportedAccessProtocols", s.SupportedAccessProtocols) - populate(objectMap, "userName", s.UserName) - return json.Marshal(objectMap) -} - // MarshalJSON implements the json.Marshaller interface for type ShipmentPickUpRequest. func (s ShipmentPickUpRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -2421,67 +1907,51 @@ func (s ShipmentPickUpRequest) MarshalJSON() ([]byte, error) { func (s *ShipmentPickUpRequest) 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 "shipmentLocation": - err = unpopulate(val, &s.ShipmentLocation) + err = unpopulate(val, "ShipmentLocation", &s.ShipmentLocation) delete(rawMsg, key) case "startTime": - err = unpopulateTimeRFC3339(val, &s.StartTime) + err = unpopulateTimeRFC3339(val, "StartTime", &s.StartTime) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ShipmentPickUpResponse. -func (s ShipmentPickUpResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "confirmationNumber", s.ConfirmationNumber) - populateTimeRFC3339(objectMap, "readyByTime", s.ReadyByTime) - return json.Marshal(objectMap) -} - // UnmarshalJSON implements the json.Unmarshaller interface for type ShipmentPickUpResponse. func (s *ShipmentPickUpResponse) 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 "confirmationNumber": - err = unpopulate(val, &s.ConfirmationNumber) + err = unpopulate(val, "ConfirmationNumber", &s.ConfirmationNumber) delete(rawMsg, key) case "readyByTime": - err = unpopulateTimeRFC3339(val, &s.ReadyByTime) + err = unpopulateTimeRFC3339(val, "ReadyByTime", &s.ReadyByTime) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// GetDataAccountDetails implements the DataAccountDetailsClassification interface for type StorageAccountDetails. -func (s *StorageAccountDetails) GetDataAccountDetails() *DataAccountDetails { - return &DataAccountDetails{ - DataAccountType: s.DataAccountType, - SharePassword: s.SharePassword, - } -} - // MarshalJSON implements the json.Marshaller interface for type StorageAccountDetails. func (s StorageAccountDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -2495,35 +1965,28 @@ func (s StorageAccountDetails) MarshalJSON() ([]byte, error) { func (s *StorageAccountDetails) 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 "dataAccountType": - err = unpopulate(val, &s.DataAccountType) + err = unpopulate(val, "DataAccountType", &s.DataAccountType) delete(rawMsg, key) case "sharePassword": - err = unpopulate(val, &s.SharePassword) + err = unpopulate(val, "SharePassword", &s.SharePassword) delete(rawMsg, key) case "storageAccountId": - err = unpopulate(val, &s.StorageAccountID) + err = unpopulate(val, "StorageAccountID", &s.StorageAccountID) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// GetValidationInputRequest implements the ValidationInputRequestClassification interface for type SubscriptionIsAllowedToCreateJobValidationRequest. -func (s *SubscriptionIsAllowedToCreateJobValidationRequest) GetValidationInputRequest() *ValidationInputRequest { - return &ValidationInputRequest{ - ValidationType: s.ValidationType, - } -} - // MarshalJSON implements the json.Marshaller interface for type SubscriptionIsAllowedToCreateJobValidationRequest. func (s SubscriptionIsAllowedToCreateJobValidationRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -2535,60 +1998,43 @@ func (s SubscriptionIsAllowedToCreateJobValidationRequest) MarshalJSON() ([]byte func (s *SubscriptionIsAllowedToCreateJobValidationRequest) 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 "validationType": - err = unpopulate(val, &s.ValidationType) + err = unpopulate(val, "ValidationType", &s.ValidationType) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// GetValidationInputResponse implements the ValidationInputResponseClassification interface for type SubscriptionIsAllowedToCreateJobValidationResponseProperties. -func (s *SubscriptionIsAllowedToCreateJobValidationResponseProperties) GetValidationInputResponse() *ValidationInputResponse { - return &ValidationInputResponse{ - ValidationType: s.ValidationType, - Error: s.Error, - } -} - -// MarshalJSON implements the json.Marshaller interface for type SubscriptionIsAllowedToCreateJobValidationResponseProperties. -func (s SubscriptionIsAllowedToCreateJobValidationResponseProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "error", s.Error) - populate(objectMap, "status", s.Status) - objectMap["validationType"] = ValidationInputDiscriminatorValidateSubscriptionIsAllowedToCreateJob - return json.Marshal(objectMap) -} - // UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionIsAllowedToCreateJobValidationResponseProperties. func (s *SubscriptionIsAllowedToCreateJobValidationResponseProperties) 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 "error": - err = unpopulate(val, &s.Error) + err = unpopulate(val, "Error", &s.Error) delete(rawMsg, key) case "status": - err = unpopulate(val, &s.Status) + err = unpopulate(val, "Status", &s.Status) delete(rawMsg, key) case "validationType": - err = unpopulate(val, &s.ValidationType) + err = unpopulate(val, "ValidationType", &s.ValidationType) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil @@ -2610,32 +2056,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 @@ -2651,59 +2097,29 @@ func (t TransferFilterDetails) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// MarshalJSON implements the json.Marshaller interface for type TransportAvailabilityResponse. -func (t TransportAvailabilityResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "transportAvailabilityDetails", t.TransportAvailabilityDetails) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type UnencryptedCredentials. -func (u UnencryptedCredentials) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "jobName", u.JobName) - populate(objectMap, "jobSecrets", u.JobSecrets) - return json.Marshal(objectMap) -} - // UnmarshalJSON implements the json.Unmarshaller interface for type UnencryptedCredentials. func (u *UnencryptedCredentials) 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 "jobName": - err = unpopulate(val, &u.JobName) + err = unpopulate(val, "JobName", &u.JobName) delete(rawMsg, key) case "jobSecrets": u.JobSecrets, err = unmarshalCommonJobSecretsClassification(val) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", u, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type UnencryptedCredentialsList. -func (u UnencryptedCredentialsList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", u.NextLink) - populate(objectMap, "value", u.Value) - return json.Marshal(objectMap) -} - -// GetValidationInputRequest implements the ValidationInputRequestClassification interface for type ValidateAddress. -func (v *ValidateAddress) GetValidationInputRequest() *ValidationInputRequest { - return &ValidationInputRequest{ - ValidationType: v.ValidationType, - } -} - // MarshalJSON implements the json.Marshaller interface for type ValidateAddress. func (v ValidateAddress) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -2718,40 +2134,31 @@ func (v ValidateAddress) MarshalJSON() ([]byte, error) { func (v *ValidateAddress) 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", v, err) } for key, val := range rawMsg { var err error switch key { case "deviceType": - err = unpopulate(val, &v.DeviceType) + err = unpopulate(val, "DeviceType", &v.DeviceType) delete(rawMsg, key) case "shippingAddress": - err = unpopulate(val, &v.ShippingAddress) + err = unpopulate(val, "ShippingAddress", &v.ShippingAddress) delete(rawMsg, key) case "transportPreferences": - err = unpopulate(val, &v.TransportPreferences) + err = unpopulate(val, "TransportPreferences", &v.TransportPreferences) delete(rawMsg, key) case "validationType": - err = unpopulate(val, &v.ValidationType) + err = unpopulate(val, "ValidationType", &v.ValidationType) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", v, err) } } return nil } -// GetValidationInputRequest implements the ValidationInputRequestClassification interface for type ValidationInputRequest. -func (v *ValidationInputRequest) GetValidationInputRequest() *ValidationInputRequest { return v } - -// GetValidationInputResponse implements the ValidationInputResponseClassification interface for type ValidationInputResponse. -func (v *ValidationInputResponse) GetValidationInputResponse() *ValidationInputResponse { return v } - -// GetValidationRequest implements the ValidationRequestClassification interface for type ValidationRequest. -func (v *ValidationRequest) GetValidationRequest() *ValidationRequest { return v } - // MarshalJSON implements the json.Marshaller interface for type ValidationRequest. func (v ValidationRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -2764,7 +2171,7 @@ func (v ValidationRequest) MarshalJSON() ([]byte, error) { func (v *ValidationRequest) 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", v, err) } for key, val := range rawMsg { var err error @@ -2773,29 +2180,21 @@ func (v *ValidationRequest) UnmarshalJSON(data []byte) error { v.IndividualRequestDetails, err = unmarshalValidationInputRequestClassificationArray(val) delete(rawMsg, key) case "validationCategory": - err = unpopulate(val, &v.ValidationCategory) + err = unpopulate(val, "ValidationCategory", &v.ValidationCategory) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", v, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ValidationResponseProperties. -func (v ValidationResponseProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "individualResponseDetails", v.IndividualResponseDetails) - populate(objectMap, "status", v.Status) - return json.Marshal(objectMap) -} - // UnmarshalJSON implements the json.Unmarshaller interface for type ValidationResponseProperties. func (v *ValidationResponseProperties) 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", v, err) } for key, val := range rawMsg { var err error @@ -2804,11 +2203,11 @@ func (v *ValidationResponseProperties) UnmarshalJSON(data []byte) error { v.IndividualResponseDetails, err = unmarshalValidationInputResponseClassificationArray(val) delete(rawMsg, key) case "status": - err = unpopulate(val, &v.Status) + err = unpopulate(val, "Status", &v.Status) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", v, err) } } return nil @@ -2824,9 +2223,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/databox/armdatabox/zz_generated_operations_client.go b/sdk/resourcemanager/databox/armdatabox/zz_generated_operations_client.go index 99f1ddaf6e1f..cbad04078d4b 100644 --- a/sdk/resourcemanager/databox/armdatabox/zz_generated_operations_client.go +++ b/sdk/resourcemanager/databox/armdatabox/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 - This method gets all the operations. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-01 // 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 }, @@ -87,9 +88,9 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-02-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/databox/armdatabox/zz_generated_service_client.go b/sdk/resourcemanager/databox/armdatabox/zz_generated_service_client.go index 1f8bf0445e1a..2a279f91b686 100644 --- a/sdk/resourcemanager/databox/armdatabox/zz_generated_service_client.go +++ b/sdk/resourcemanager/databox/armdatabox/zz_generated_service_client.go @@ -38,7 +38,7 @@ func NewServiceClient(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,13 +57,14 @@ func NewServiceClient(subscriptionID string, credential azcore.TokenCredential, // NewListAvailableSKUsByResourceGroupPager - This method provides the list of available skus for the given subscription, // resource group and location. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-01 // resourceGroupName - The Resource Group Name // location - The location of the resource // availableSKURequest - Filters for showing the available skus. // options - ServiceClientListAvailableSKUsByResourceGroupOptions contains the optional parameters for the ServiceClient.ListAvailableSKUsByResourceGroup // method. func (client *ServiceClient) NewListAvailableSKUsByResourceGroupPager(resourceGroupName string, location string, availableSKURequest AvailableSKURequest, options *ServiceClientListAvailableSKUsByResourceGroupOptions) *runtime.Pager[ServiceClientListAvailableSKUsByResourceGroupResponse] { - return runtime.NewPager(runtime.PageProcessor[ServiceClientListAvailableSKUsByResourceGroupResponse]{ + return runtime.NewPager(runtime.PagingHandler[ServiceClientListAvailableSKUsByResourceGroupResponse]{ More: func(page ServiceClientListAvailableSKUsByResourceGroupResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, @@ -110,9 +111,9 @@ func (client *ServiceClient) listAvailableSKUsByResourceGroupCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-02-01") 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, availableSKURequest) } @@ -127,6 +128,7 @@ func (client *ServiceClient) listAvailableSKUsByResourceGroupHandleResponse(resp // RegionConfiguration - This API provides configuration details specific to given region/location at Subscription level. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-01 // location - The location of the resource // regionConfigurationRequest - Request body to get the configuration for the region. // options - ServiceClientRegionConfigurationOptions contains the optional parameters for the ServiceClient.RegionConfiguration @@ -162,9 +164,9 @@ func (client *ServiceClient) regionConfigurationCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-02-01") 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, regionConfigurationRequest) } @@ -180,6 +182,7 @@ func (client *ServiceClient) regionConfigurationHandleResponse(resp *http.Respon // RegionConfigurationByResourceGroup - This API provides configuration details specific to given region/location at Resource // group level. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-01 // resourceGroupName - The Resource Group Name // location - The location of the resource // regionConfigurationRequest - Request body to get the configuration for the region at resource group level. @@ -220,9 +223,9 @@ func (client *ServiceClient) regionConfigurationByResourceGroupCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-02-01") 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, regionConfigurationRequest) } @@ -238,6 +241,7 @@ func (client *ServiceClient) regionConfigurationByResourceGroupHandleResponse(re // ValidateAddress - [DEPRECATED NOTICE: This operation will soon be removed]. This method validates the customer shipping // address and provide alternate addresses if any. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-01 // location - The location of the resource // validateAddress - Shipping address of the customer. // options - ServiceClientValidateAddressOptions contains the optional parameters for the ServiceClient.ValidateAddress method. @@ -272,9 +276,9 @@ func (client *ServiceClient) validateAddressCreateRequest(ctx context.Context, l return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-02-01") 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, validateAddress) } @@ -289,6 +293,7 @@ func (client *ServiceClient) validateAddressHandleResponse(resp *http.Response) // ValidateInputs - This method does all necessary pre-job creation validation under subscription. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-01 // location - The location of the resource // validationRequest - Inputs of the customer. // options - ServiceClientValidateInputsOptions contains the optional parameters for the ServiceClient.ValidateInputs method. @@ -323,9 +328,9 @@ func (client *ServiceClient) validateInputsCreateRequest(ctx context.Context, lo return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-02-01") 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, validationRequest) } @@ -340,6 +345,7 @@ func (client *ServiceClient) validateInputsHandleResponse(resp *http.Response) ( // ValidateInputsByResourceGroup - This method does all necessary pre-job creation validation under resource group. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-01 // resourceGroupName - The Resource Group Name // location - The location of the resource // validationRequest - Inputs of the customer. @@ -380,9 +386,9 @@ func (client *ServiceClient) validateInputsByResourceGroupCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-02-01") 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, validationRequest) } diff --git a/sdk/resourcemanager/databox/armdatabox/zz_generated_time_rfc3339.go b/sdk/resourcemanager/databox/armdatabox/zz_generated_time_rfc3339.go index 0505d9c3eaf7..884fe0e1a44a 100644 --- a/sdk/resourcemanager/databox/armdatabox/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/databox/armdatabox/zz_generated_time_rfc3339.go @@ -10,6 +10,7 @@ package armdatabox 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