diff --git a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/CHANGELOG.md b/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/CHANGELOG.md index 8211b0d974a2..2d93dc836fde 100644 --- a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/CHANGELOG.md +++ b/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 1.0.1 (2022-08-31) +### Other Changes + + ## 1.0.0 (2022-05-18) The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager` is using our [next generation design principles](https://azure.github.io/azure-sdk/general_introduction.html) since version 1.0.0, which contains breaking changes. diff --git a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/autorest.md b/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/autorest.md index 103c29f87bb5..2a8603639f73 100644 --- a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/autorest.md +++ b/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybriddatamanager/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybriddatamanager/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/hybriddatamanager/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/hybriddatamanager/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 +module-version: 1.0.1 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/zz_generated_constants.go b/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/constants.go similarity index 99% rename from sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/zz_generated_constants.go rename to sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/constants.go index e0f8a55b0e91..b11e9a1cc418 100644 --- a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/zz_generated_constants.go +++ b/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/constants.go @@ -5,12 +5,13 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armhybriddatamanager const ( moduleName = "armhybriddatamanager" - moduleVersion = "v1.0.0" + moduleVersion = "v1.0.1" ) // IsJobCancellable - Describes whether the job is cancellable. diff --git a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/zz_generated_datamanagers_client.go b/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/datamanagers_client.go similarity index 99% rename from sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/zz_generated_datamanagers_client.go rename to sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/datamanagers_client.go index de8903414d3e..971ce18450f0 100644 --- a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/zz_generated_datamanagers_client.go +++ b/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/datamanagers_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armhybriddatamanager diff --git a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/zz_generated_dataservices_client.go b/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/dataservices_client.go similarity index 99% rename from sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/zz_generated_dataservices_client.go rename to sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/dataservices_client.go index b0f68fe73651..976599e0ce83 100644 --- a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/zz_generated_dataservices_client.go +++ b/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/dataservices_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armhybriddatamanager diff --git a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/zz_generated_datastores_client.go b/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/datastores_client.go similarity index 99% rename from sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/zz_generated_datastores_client.go rename to sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/datastores_client.go index 6795505db429..393430d7a8c5 100644 --- a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/zz_generated_datastores_client.go +++ b/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/datastores_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armhybriddatamanager diff --git a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/zz_generated_datastoretypes_client.go b/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/datastoretypes_client.go similarity index 99% rename from sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/zz_generated_datastoretypes_client.go rename to sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/datastoretypes_client.go index e788979b91af..11f3ea3cc1b1 100644 --- a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/zz_generated_datastoretypes_client.go +++ b/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/datastoretypes_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armhybriddatamanager diff --git a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/go.mod b/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/go.mod index c1b82275f3ac..496259ce0328 100644 --- a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/go.mod +++ b/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/go.mod @@ -2,20 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybriddatamanager/a go 1.18 -require ( - 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/azcore v1.0.0 require ( 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-20220511200225-c6db032c6c88 // indirect + github.com/davecgh/go-spew v1.1.1 // 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 + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/go.sum b/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/go.sum index ed5b814680ee..3afb578030a5 100644 --- a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/go.sum +++ b/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/go.sum @@ -1,33 +1,15 @@ 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.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= -github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= -github.com/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/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/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -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-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= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/zz_generated_jobdefinitions_client.go b/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/jobdefinitions_client.go similarity index 99% rename from sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/zz_generated_jobdefinitions_client.go rename to sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/jobdefinitions_client.go index 5204a34853b4..5e9dab051321 100644 --- a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/zz_generated_jobdefinitions_client.go +++ b/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/jobdefinitions_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armhybriddatamanager diff --git a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/zz_generated_jobs_client.go b/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/jobs_client.go similarity index 99% rename from sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/zz_generated_jobs_client.go rename to sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/jobs_client.go index c253dccf428e..604781d61a71 100644 --- a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/zz_generated_jobs_client.go +++ b/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/jobs_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armhybriddatamanager diff --git a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/zz_generated_models.go b/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/models.go similarity index 99% rename from sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/zz_generated_models.go rename to sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/models.go index 1c0b75e3dec5..f9fa43786b88 100644 --- a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/zz_generated_models.go +++ b/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/models.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armhybriddatamanager diff --git a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/models_serde.go b/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/models_serde.go new file mode 100644 index 000000000000..760cfaf69e15 --- /dev/null +++ b/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/models_serde.go @@ -0,0 +1,1447 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armhybriddatamanager + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" +) + +// MarshalJSON implements the json.Marshaller interface for type AvailableProviderOperation. +func (a AvailableProviderOperation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "display", a.Display) + populate(objectMap, "name", a.Name) + populate(objectMap, "origin", a.Origin) + populate(objectMap, "properties", &a.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AvailableProviderOperation. +func (a *AvailableProviderOperation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "display": + err = unpopulate(val, "Display", &a.Display) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "origin": + err = unpopulate(val, "Origin", &a.Origin) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AvailableProviderOperationDisplay. +func (a AvailableProviderOperationDisplay) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", a.Description) + populate(objectMap, "operation", a.Operation) + populate(objectMap, "provider", a.Provider) + populate(objectMap, "resource", a.Resource) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AvailableProviderOperationDisplay. +func (a *AvailableProviderOperationDisplay) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &a.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &a.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &a.Resource) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AvailableProviderOperations. +func (a AvailableProviderOperations) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AvailableProviderOperations. +func (a *AvailableProviderOperations) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CustomerSecret. +func (c CustomerSecret) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "algorithm", c.Algorithm) + populate(objectMap, "keyIdentifier", c.KeyIdentifier) + populate(objectMap, "keyValue", c.KeyValue) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomerSecret. +func (c *CustomerSecret) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "algorithm": + err = unpopulate(val, "Algorithm", &c.Algorithm) + delete(rawMsg, key) + case "keyIdentifier": + err = unpopulate(val, "KeyIdentifier", &c.KeyIdentifier) + delete(rawMsg, key) + case "keyValue": + err = unpopulate(val, "KeyValue", &c.KeyValue) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DataManager. +func (d DataManager) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", d.Etag) + populate(objectMap, "id", d.ID) + populate(objectMap, "location", d.Location) + populate(objectMap, "name", d.Name) + populate(objectMap, "sku", d.SKU) + populate(objectMap, "tags", d.Tags) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataManager. +func (d *DataManager) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &d.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &d.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &d.SKU) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &d.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DataManagerList. +func (d DataManagerList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataManagerList. +func (d *DataManagerList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &d.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DataManagerUpdateParameter. +func (d DataManagerUpdateParameter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "sku", d.SKU) + populate(objectMap, "tags", d.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataManagerUpdateParameter. +func (d *DataManagerUpdateParameter) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "sku": + err = unpopulate(val, "SKU", &d.SKU) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &d.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DataService. +func (d DataService) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataService. +func (d *DataService) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DataServiceList. +func (d DataServiceList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataServiceList. +func (d *DataServiceList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &d.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DataServiceProperties. +func (d DataServiceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "state", d.State) + populate(objectMap, "supportedDataSinkTypes", d.SupportedDataSinkTypes) + populate(objectMap, "supportedDataSourceTypes", d.SupportedDataSourceTypes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataServiceProperties. +func (d *DataServiceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "state": + err = unpopulate(val, "State", &d.State) + delete(rawMsg, key) + case "supportedDataSinkTypes": + err = unpopulate(val, "SupportedDataSinkTypes", &d.SupportedDataSinkTypes) + delete(rawMsg, key) + case "supportedDataSourceTypes": + err = unpopulate(val, "SupportedDataSourceTypes", &d.SupportedDataSourceTypes) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DataStore. +func (d DataStore) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataStore. +func (d *DataStore) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DataStoreFilter. +func (d DataStoreFilter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "dataStoreTypeId", d.DataStoreTypeID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataStoreFilter. +func (d *DataStoreFilter) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dataStoreTypeId": + err = unpopulate(val, "DataStoreTypeID", &d.DataStoreTypeID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DataStoreList. +func (d DataStoreList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataStoreList. +func (d *DataStoreList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &d.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DataStoreProperties. +func (d DataStoreProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "customerSecrets", d.CustomerSecrets) + populate(objectMap, "dataStoreTypeId", d.DataStoreTypeID) + populate(objectMap, "extendedProperties", &d.ExtendedProperties) + populate(objectMap, "repositoryId", d.RepositoryID) + populate(objectMap, "state", d.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataStoreProperties. +func (d *DataStoreProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "customerSecrets": + err = unpopulate(val, "CustomerSecrets", &d.CustomerSecrets) + delete(rawMsg, key) + case "dataStoreTypeId": + err = unpopulate(val, "DataStoreTypeID", &d.DataStoreTypeID) + delete(rawMsg, key) + case "extendedProperties": + err = unpopulate(val, "ExtendedProperties", &d.ExtendedProperties) + delete(rawMsg, key) + case "repositoryId": + err = unpopulate(val, "RepositoryID", &d.RepositoryID) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &d.State) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DataStoreType. +func (d DataStoreType) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataStoreType. +func (d *DataStoreType) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DataStoreTypeList. +func (d DataStoreTypeList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataStoreTypeList. +func (d *DataStoreTypeList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &d.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DataStoreTypeProperties. +func (d DataStoreTypeProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "repositoryType", d.RepositoryType) + populate(objectMap, "state", d.State) + populate(objectMap, "supportedDataServicesAsSink", d.SupportedDataServicesAsSink) + populate(objectMap, "supportedDataServicesAsSource", d.SupportedDataServicesAsSource) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataStoreTypeProperties. +func (d *DataStoreTypeProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "repositoryType": + err = unpopulate(val, "RepositoryType", &d.RepositoryType) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &d.State) + delete(rawMsg, key) + case "supportedDataServicesAsSink": + err = unpopulate(val, "SupportedDataServicesAsSink", &d.SupportedDataServicesAsSink) + delete(rawMsg, key) + case "supportedDataServicesAsSource": + err = unpopulate(val, "SupportedDataServicesAsSource", &d.SupportedDataServicesAsSource) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DmsBaseObject. +func (d DmsBaseObject) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DmsBaseObject. +func (d *DmsBaseObject) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Error. +func (e Error) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "code", e.Code) + populate(objectMap, "message", e.Message) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Error. +func (e *Error) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "code": + err = unpopulate(val, "Code", &e.Code) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &e.Message) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorDetails. +func (e ErrorDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "errorCode", e.ErrorCode) + populate(objectMap, "errorMessage", e.ErrorMessage) + populate(objectMap, "exceptionMessage", e.ExceptionMessage) + populate(objectMap, "recommendedAction", e.RecommendedAction) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetails. +func (e *ErrorDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "errorCode": + err = unpopulate(val, "ErrorCode", &e.ErrorCode) + delete(rawMsg, key) + case "errorMessage": + err = unpopulate(val, "ErrorMessage", &e.ErrorMessage) + delete(rawMsg, key) + case "exceptionMessage": + err = unpopulate(val, "ExceptionMessage", &e.ExceptionMessage) + delete(rawMsg, key) + case "recommendedAction": + err = unpopulate(val, "RecommendedAction", &e.RecommendedAction) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Job. +func (j Job) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "endTime", j.EndTime) + populate(objectMap, "error", j.Error) + populate(objectMap, "id", j.ID) + populate(objectMap, "name", j.Name) + populate(objectMap, "properties", j.Properties) + populateTimeRFC3339(objectMap, "startTime", j.StartTime) + populate(objectMap, "status", j.Status) + populate(objectMap, "type", j.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Job. +func (j *Job) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &j.EndTime) + delete(rawMsg, key) + case "error": + err = unpopulate(val, "Error", &j.Error) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &j.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &j.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &j.Properties) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &j.StartTime) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &j.Status) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &j.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobDefinition. +func (j JobDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", j.ID) + populate(objectMap, "name", j.Name) + populate(objectMap, "properties", j.Properties) + populate(objectMap, "type", j.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobDefinition. +func (j *JobDefinition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &j.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &j.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &j.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &j.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobDefinitionFilter. +func (j JobDefinitionFilter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "dataSource", j.DataSource) + populateTimeRFC3339(objectMap, "lastModified", j.LastModified) + populate(objectMap, "state", j.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobDefinitionFilter. +func (j *JobDefinitionFilter) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dataSource": + err = unpopulate(val, "DataSource", &j.DataSource) + delete(rawMsg, key) + case "lastModified": + err = unpopulateTimeRFC3339(val, "LastModified", &j.LastModified) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &j.State) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobDefinitionList. +func (j JobDefinitionList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", j.NextLink) + populate(objectMap, "value", j.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobDefinitionList. +func (j *JobDefinitionList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &j.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &j.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobDefinitionProperties. +func (j JobDefinitionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "customerSecrets", j.CustomerSecrets) + populate(objectMap, "dataServiceInput", &j.DataServiceInput) + populate(objectMap, "dataSinkId", j.DataSinkID) + populate(objectMap, "dataSourceId", j.DataSourceID) + populateTimeRFC3339(objectMap, "lastModifiedTime", j.LastModifiedTime) + populate(objectMap, "runLocation", j.RunLocation) + populate(objectMap, "schedules", j.Schedules) + populate(objectMap, "state", j.State) + populate(objectMap, "userConfirmation", j.UserConfirmation) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobDefinitionProperties. +func (j *JobDefinitionProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "customerSecrets": + err = unpopulate(val, "CustomerSecrets", &j.CustomerSecrets) + delete(rawMsg, key) + case "dataServiceInput": + err = unpopulate(val, "DataServiceInput", &j.DataServiceInput) + delete(rawMsg, key) + case "dataSinkId": + err = unpopulate(val, "DataSinkID", &j.DataSinkID) + delete(rawMsg, key) + case "dataSourceId": + err = unpopulate(val, "DataSourceID", &j.DataSourceID) + delete(rawMsg, key) + case "lastModifiedTime": + err = unpopulateTimeRFC3339(val, "LastModifiedTime", &j.LastModifiedTime) + delete(rawMsg, key) + case "runLocation": + err = unpopulate(val, "RunLocation", &j.RunLocation) + delete(rawMsg, key) + case "schedules": + err = unpopulate(val, "Schedules", &j.Schedules) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &j.State) + delete(rawMsg, key) + case "userConfirmation": + err = unpopulate(val, "UserConfirmation", &j.UserConfirmation) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobDetails. +func (j JobDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "errorDetails", j.ErrorDetails) + populate(objectMap, "itemDetailsLink", j.ItemDetailsLink) + populate(objectMap, "jobDefinition", j.JobDefinition) + populate(objectMap, "jobStages", j.JobStages) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobDetails. +func (j *JobDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "errorDetails": + err = unpopulate(val, "ErrorDetails", &j.ErrorDetails) + delete(rawMsg, key) + case "itemDetailsLink": + err = unpopulate(val, "ItemDetailsLink", &j.ItemDetailsLink) + delete(rawMsg, key) + case "jobDefinition": + err = unpopulate(val, "JobDefinition", &j.JobDefinition) + delete(rawMsg, key) + case "jobStages": + err = unpopulate(val, "JobStages", &j.JobStages) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobFilter. +func (j JobFilter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "startTime", j.StartTime) + populate(objectMap, "status", j.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobFilter. +func (j *JobFilter) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &j.StartTime) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &j.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobList. +func (j JobList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", j.NextLink) + populate(objectMap, "value", j.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobList. +func (j *JobList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &j.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &j.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobProperties. +func (j JobProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "bytesProcessed", j.BytesProcessed) + populate(objectMap, "dataSinkName", j.DataSinkName) + populate(objectMap, "dataSourceName", j.DataSourceName) + populate(objectMap, "details", j.Details) + populate(objectMap, "isCancellable", j.IsCancellable) + populate(objectMap, "itemsProcessed", j.ItemsProcessed) + populate(objectMap, "totalBytesToProcess", j.TotalBytesToProcess) + populate(objectMap, "totalItemsToProcess", j.TotalItemsToProcess) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobProperties. +func (j *JobProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "bytesProcessed": + err = unpopulate(val, "BytesProcessed", &j.BytesProcessed) + delete(rawMsg, key) + case "dataSinkName": + err = unpopulate(val, "DataSinkName", &j.DataSinkName) + delete(rawMsg, key) + case "dataSourceName": + err = unpopulate(val, "DataSourceName", &j.DataSourceName) + delete(rawMsg, key) + case "details": + err = unpopulate(val, "Details", &j.Details) + delete(rawMsg, key) + case "isCancellable": + err = unpopulate(val, "IsCancellable", &j.IsCancellable) + delete(rawMsg, key) + case "itemsProcessed": + err = unpopulate(val, "ItemsProcessed", &j.ItemsProcessed) + delete(rawMsg, key) + case "totalBytesToProcess": + err = unpopulate(val, "TotalBytesToProcess", &j.TotalBytesToProcess) + delete(rawMsg, key) + case "totalItemsToProcess": + err = unpopulate(val, "TotalItemsToProcess", &j.TotalItemsToProcess) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobStages. +func (j JobStages) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "errorDetails", j.ErrorDetails) + populate(objectMap, "jobStageDetails", &j.JobStageDetails) + populate(objectMap, "stageName", j.StageName) + populate(objectMap, "stageStatus", j.StageStatus) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobStages. +func (j *JobStages) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "errorDetails": + err = unpopulate(val, "ErrorDetails", &j.ErrorDetails) + delete(rawMsg, key) + case "jobStageDetails": + err = unpopulate(val, "JobStageDetails", &j.JobStageDetails) + delete(rawMsg, key) + case "stageName": + err = unpopulate(val, "StageName", &j.StageName) + delete(rawMsg, key) + case "stageStatus": + err = unpopulate(val, "StageStatus", &j.StageStatus) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Key. +func (k Key) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "encryptionChunkSizeInBytes", k.EncryptionChunkSizeInBytes) + populate(objectMap, "keyExponent", k.KeyExponent) + populate(objectMap, "keyModulus", k.KeyModulus) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Key. +func (k *Key) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "encryptionChunkSizeInBytes": + err = unpopulate(val, "EncryptionChunkSizeInBytes", &k.EncryptionChunkSizeInBytes) + delete(rawMsg, key) + case "keyExponent": + err = unpopulate(val, "KeyExponent", &k.KeyExponent) + delete(rawMsg, key) + case "keyModulus": + err = unpopulate(val, "KeyModulus", &k.KeyModulus) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PublicKey. +func (p PublicKey) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PublicKey. +func (p *PublicKey) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PublicKeyList. +func (p PublicKeyList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PublicKeyList. +func (p *PublicKeyList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &p.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PublicKeyProperties. +func (p PublicKeyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "dataServiceLevel1Key", p.DataServiceLevel1Key) + populate(objectMap, "dataServiceLevel2Key", p.DataServiceLevel2Key) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PublicKeyProperties. +func (p *PublicKeyProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dataServiceLevel1Key": + err = unpopulate(val, "DataServiceLevel1Key", &p.DataServiceLevel1Key) + delete(rawMsg, key) + case "dataServiceLevel2Key": + err = unpopulate(val, "DataServiceLevel2Key", &p.DataServiceLevel2Key) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + populate(objectMap, "location", r.Location) + populate(objectMap, "name", r.Name) + populate(objectMap, "sku", r.SKU) + populate(objectMap, "tags", r.Tags) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Resource. +func (r *Resource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &r.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &r.SKU) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &r.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RunParameters. +func (r RunParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "customerSecrets", r.CustomerSecrets) + populate(objectMap, "dataServiceInput", &r.DataServiceInput) + populate(objectMap, "userConfirmation", r.UserConfirmation) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RunParameters. +func (r *RunParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "customerSecrets": + err = unpopulate(val, "CustomerSecrets", &r.CustomerSecrets) + delete(rawMsg, key) + case "dataServiceInput": + err = unpopulate(val, "DataServiceInput", &r.DataServiceInput) + delete(rawMsg, key) + case "userConfirmation": + err = unpopulate(val, "UserConfirmation", &r.UserConfirmation) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SKU. +func (s SKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", s.Name) + populate(objectMap, "tier", s.Tier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SKU. +func (s *SKU) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "tier": + err = unpopulate(val, "Tier", &s.Tier) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Schedule. +func (s Schedule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", s.Name) + populate(objectMap, "policyList", s.PolicyList) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Schedule. +func (s *Schedule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "policyList": + err = unpopulate(val, "PolicyList", &s.PolicyList) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +func populate(m map[string]interface{}, k string, v interface{}) { + if v == nil { + return + } else if azcore.IsNullValue(v) { + m[k] = nil + } else if !reflect.ValueOf(v).IsNil() { + m[k] = v + } +} + +func unpopulate(data json.RawMessage, fn string, v interface{}) error { + if data == nil { + return nil + } + if err := json.Unmarshal(data, v); err != nil { + return fmt.Errorf("struct field %s: %v", fn, err) + } + return nil +} diff --git a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/zz_generated_operations_client.go b/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/operations_client.go similarity index 99% rename from sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/zz_generated_operations_client.go rename to sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/operations_client.go index 2145ca62b189..59d127ef30a8 100644 --- a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/zz_generated_operations_client.go +++ b/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/operations_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armhybriddatamanager diff --git a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/zz_generated_publickeys_client.go b/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/publickeys_client.go similarity index 99% rename from sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/zz_generated_publickeys_client.go rename to sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/publickeys_client.go index 2c0b364be0cc..db6e0b709ee6 100644 --- a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/zz_generated_publickeys_client.go +++ b/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/publickeys_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armhybriddatamanager diff --git a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/zz_generated_response_types.go b/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/response_types.go similarity index 99% rename from sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/zz_generated_response_types.go rename to sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/response_types.go index a840b1319dd2..8c21abb01812 100644 --- a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/zz_generated_response_types.go +++ b/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/response_types.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armhybriddatamanager diff --git a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/zz_generated_time_rfc3339.go b/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/time_rfc3339.go similarity index 99% rename from sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/zz_generated_time_rfc3339.go rename to sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/time_rfc3339.go index edb7078f065b..aed4094d38f1 100644 --- a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/time_rfc3339.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armhybriddatamanager diff --git a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/ze_generated_example_datamanagers_client_test.go b/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/ze_generated_example_datamanagers_client_test.go deleted file mode 100644 index ec0c90d0554e..000000000000 --- a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/ze_generated_example_datamanagers_client_test.go +++ /dev/null @@ -1,177 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armhybriddatamanager_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/DataManagers_List-GET-example-21.json -func ExampleDataManagersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybriddatamanager.NewDataManagersClient("6e0219f5-327a-4365-904f-05eed4227ad7", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/DataManagers_ListByResourceGroup-GET-example-31.json -func ExampleDataManagersClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybriddatamanager.NewDataManagersClient("6e0219f5-327a-4365-904f-05eed4227ad7", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("ResourceGroupForSDKTest", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/DataManagers_Get-GET-example-41.json -func ExampleDataManagersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybriddatamanager.NewDataManagersClient("6e0219f5-327a-4365-904f-05eed4227ad7", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "ResourceGroupForSDKTest", - "TestAzureSDKOperations", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/DataManagers_Create-PUT-example-41.json -func ExampleDataManagersClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybriddatamanager.NewDataManagersClient("6e0219f5-327a-4365-904f-05eed4227ad7", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, - "ResourceGroupForSDKTest", - "TestAzureSDKOperations", - armhybriddatamanager.DataManager{ - Location: to.Ptr("westus"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/DataManagers_Delete-DELETE-example-41.json -func ExampleDataManagersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybriddatamanager.NewDataManagersClient("6e0219f5-327a-4365-904f-05eed4227ad7", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "ResourceGroupForSDKTest", - "TestAzureSDKOperations", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, 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/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/DataManagers_Update-PATCH-example-43.json -func ExampleDataManagersClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybriddatamanager.NewDataManagersClient("6e0219f5-327a-4365-904f-05eed4227ad7", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "ResourceGroupForSDKTest", - "TestAzureSDKOperations", - armhybriddatamanager.DataManagerUpdateParameter{ - SKU: &armhybriddatamanager.SKU{ - Name: to.Ptr("DS0"), - Tier: to.Ptr("Standard"), - }, - Tags: map[string]*string{ - "UpdateDateTime": to.Ptr("05-Feb-20 2:17:22 PM"), - }, - }, - &armhybriddatamanager.DataManagersClientBeginUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/ze_generated_example_dataservices_client_test.go b/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/ze_generated_example_dataservices_client_test.go deleted file mode 100644 index ab17b9be20ca..000000000000 --- a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/ze_generated_example_dataservices_client_test.go +++ /dev/null @@ -1,66 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armhybriddatamanager_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/DataServices_ListByDataManager-GET-example-51.json -func ExampleDataServicesClient_NewListByDataManagerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybriddatamanager.NewDataServicesClient("6e0219f5-327a-4365-904f-05eed4227ad7", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDataManagerPager("ResourceGroupForSDKTest", - "TestAzureSDKOperations", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/DataServices_Get-GET-example-62.json -func ExampleDataServicesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybriddatamanager.NewDataServicesClient("6e0219f5-327a-4365-904f-05eed4227ad7", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "DataTransformation", - "ResourceGroupForSDKTest", - "TestAzureSDKOperations", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/ze_generated_example_datastores_client_test.go b/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/ze_generated_example_datastores_client_test.go deleted file mode 100644 index 953074ac09a9..000000000000 --- a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/ze_generated_example_datastores_client_test.go +++ /dev/null @@ -1,142 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armhybriddatamanager_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/DataStores_ListByDataManager-GET-example-151.json -func ExampleDataStoresClient_NewListByDataManagerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybriddatamanager.NewDataStoresClient("6e0219f5-327a-4365-904f-05eed4227ad7", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDataManagerPager("ResourceGroupForSDKTest", - "TestAzureSDKOperations", - &armhybriddatamanager.DataStoresClientListByDataManagerOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/DataStores_Get-GET-example-161.json -func ExampleDataStoresClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybriddatamanager.NewDataStoresClient("6e0219f5-327a-4365-904f-05eed4227ad7", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "TestStorSimpleSource1", - "ResourceGroupForSDKTest", - "TestAzureSDKOperations", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/DataStores_CreateOrUpdate_DataSink-PUT-example-162.json -func ExampleDataStoresClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybriddatamanager.NewDataStoresClient("6e0219f5-327a-4365-904f-05eed4227ad7", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "TestAzureStorage1", - "ResourceGroupForSDKTest", - "TestAzureSDKOperations", - armhybriddatamanager.DataStore{ - Properties: &armhybriddatamanager.DataStoreProperties{ - CustomerSecrets: []*armhybriddatamanager.CustomerSecret{ - { - Algorithm: to.Ptr(armhybriddatamanager.SupportedAlgorithmRSA15), - KeyIdentifier: to.Ptr("StorageAccountAccessKey"), - KeyValue: to.Ptr("Of4H9eF03G8QuxvkZQEbFWv3YdN3U//WugzuqReQekbXXQyg+QSicVKrwSOOKVi1zWMYGbKg7d5/ES2gdz+O5ZEw89bvE4mJD/wQmkIsqhPnbN0gyVK6nZePXVUU1A+UzjLfvhSA6KyUQfzNAZ5/TLt6fo1JyQrKTtkvnkLFyfv1AqBZ+dw8JK3RZi/rEN8HD3R3qsBwUYfyEuGLGiujy2CGrr/1uPiUVMR6QuFWRsjm39eMSHa4maLg4tQ0IY/jIy8rMlx3KjF3CcCbPzAqEq5vXy37wkjZbus771te1gLSrzcpVKIMg4DrmgaoJ02jAu+izBjNgLXAFPSUneQ8yw==:ezMkh4PMhCnjJtYkpTaP0SdblP5VAeRe4glW2PgIzICHw3T8ZyGDoaTrCv4/m5wtcEhWdtxhta+j1MQWlK5MIA+hvf8QjIDIjQv696ov5y+pcFe/upd2ekGOei7FCwB2u7I8WnkAtIKTUkf6eDQBZXm26DjfG1Dlc+Mjjq+AerukEa6WpOyqrD7Qub26Pgmj4AsuBx19X1EAmTZacubkoiNagXM8V+IDanHOhLMvfgQ7rw8oZhWfofxi4m+eJqjOXXaqSyorNK8UEcqP6P9pDP8AN8ulXEx6rZy2B5Oi0vSV+wlRLbUuQslga4ItOGxctW/ZX8uWozt+5A3k4URt6A=="), - }, - { - Algorithm: to.Ptr(armhybriddatamanager.SupportedAlgorithmRSA15), - KeyIdentifier: to.Ptr("StorageAccountAccessKeyForQueue"), - KeyValue: to.Ptr("Of4H9eF03G8QuxvkZQEbFWv3YdN3U//WugzuqReQekbXXQyg+QSicVKrwSOOKVi1zWMYGbKg7d5/ES2gdz+O5ZEw89bvE4mJD/wQmkIsqhPnbN0gyVK6nZePXVUU1A+UzjLfvhSA6KyUQfzNAZ5/TLt6fo1JyQrKTtkvnkLFyfv1AqBZ+dw8JK3RZi/rEN8HD3R3qsBwUYfyEuGLGiujy2CGrr/1uPiUVMR6QuFWRsjm39eMSHa4maLg4tQ0IY/jIy8rMlx3KjF3CcCbPzAqEq5vXy37wkjZbus771te1gLSrzcpVKIMg4DrmgaoJ02jAu+izBjNgLXAFPSUneQ8yw==:ezMkh4PMhCnjJtYkpTaP0SdblP5VAeRe4glW2PgIzICHw3T8ZyGDoaTrCv4/m5wtcEhWdtxhta+j1MQWlK5MIA+hvf8QjIDIjQv696ov5y+pcFe/upd2ekGOei7FCwB2u7I8WnkAtIKTUkf6eDQBZXm26DjfG1Dlc+Mjjq+AerukEa6WpOyqrD7Qub26Pgmj4AsuBx19X1EAmTZacubkoiNagXM8V+IDanHOhLMvfgQ7rw8oZhWfofxi4m+eJqjOXXaqSyorNK8UEcqP6P9pDP8AN8ulXEx6rZy2B5Oi0vSV+wlRLbUuQslga4ItOGxctW/ZX8uWozt+5A3k4URt6A=="), - }}, - DataStoreTypeID: to.Ptr("/subscriptions/6e0219f5-327a-4365-904f-05eed4227ad7/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.HybridData/dataManagers/TestAzureSDKOperations/dataStoreTypes/AzureStorageAccount"), - ExtendedProperties: map[string]interface{}{ - "extendedSaKey": nil, - "extendedSaName": "/subscriptions/6e0219f5-327a-4365-904f-05eed4227ad7/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.Storage/storageAccounts/dmsdatasink", - "storageAccountNameForQueue": "/subscriptions/6e0219f5-327a-4365-904f-05eed4227ad7/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.Storage/storageAccounts/dmsdatasink", - }, - RepositoryID: to.Ptr("/subscriptions/6e0219f5-327a-4365-904f-05eed4227ad7/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.Storage/storageAccounts/dmsdatasink"), - State: to.Ptr(armhybriddatamanager.StateEnabled), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/DataStores_Delete_DataSink-DELETE-example-161.json -func ExampleDataStoresClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybriddatamanager.NewDataStoresClient("6e0219f5-327a-4365-904f-05eed4227ad7", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "TestAzureStorage1", - "ResourceGroupForSDKTest", - "TestAzureSDKOperations", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/ze_generated_example_datastoretypes_client_test.go b/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/ze_generated_example_datastoretypes_client_test.go deleted file mode 100644 index f61a838b61f0..000000000000 --- a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/ze_generated_example_datastoretypes_client_test.go +++ /dev/null @@ -1,66 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armhybriddatamanager_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/DataStoreTypes_ListByDataManager-GET-example-171.json -func ExampleDataStoreTypesClient_NewListByDataManagerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybriddatamanager.NewDataStoreTypesClient("6e0219f5-327a-4365-904f-05eed4227ad7", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDataManagerPager("ResourceGroupForSDKTest", - "TestAzureSDKOperations", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/DataStoreTypes_Get-GET-example-182.json -func ExampleDataStoreTypesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybriddatamanager.NewDataStoreTypesClient("6e0219f5-327a-4365-904f-05eed4227ad7", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "StorSimple8000Series", - "ResourceGroupForSDKTest", - "TestAzureSDKOperations", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/ze_generated_example_jobdefinitions_client_test.go b/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/ze_generated_example_jobdefinitions_client_test.go deleted file mode 100644 index 85b27bcdc1b6..000000000000 --- a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/ze_generated_example_jobdefinitions_client_test.go +++ /dev/null @@ -1,216 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armhybriddatamanager_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/JobDefinitions_ListByDataService-GET-example-71.json -func ExampleJobDefinitionsClient_NewListByDataServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybriddatamanager.NewJobDefinitionsClient("6e0219f5-327a-4365-904f-05eed4227ad7", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDataServicePager("DataTransformation", - "ResourceGroupForSDKTest", - "TestAzureSDKOperations", - &armhybriddatamanager.JobDefinitionsClientListByDataServiceOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/JobDefinitions_Get-GET-example-81.json -func ExampleJobDefinitionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybriddatamanager.NewJobDefinitionsClient("6e0219f5-327a-4365-904f-05eed4227ad7", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "DataTransformation", - "jobdeffromtestcode1", - "ResourceGroupForSDKTest", - "TestAzureSDKOperations", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/JobDefinitions_CreateOrUpdate-PUT-example-83.json -func ExampleJobDefinitionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybriddatamanager.NewJobDefinitionsClient("6e0219f5-327a-4365-904f-05eed4227ad7", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "DataTransformation", - "jobdeffromtestcode1", - "ResourceGroupForSDKTest", - "TestAzureSDKOperations", - armhybriddatamanager.JobDefinition{ - Properties: &armhybriddatamanager.JobDefinitionProperties{ - DataServiceInput: map[string]interface{}{ - "AzureStorageType": "Blob", - "BackupChoice": "UseExistingLatest", - "ContainerName": "containerfromtest", - "DeviceName": "8600-SHG0997877L71FC", - "FileNameFilter": "*", - "IsDirectoryMode": false, - "RootDirectories": []interface{}{ - "\\", - }, - "VolumeNames": []interface{}{ - "TestAutomation", - }, - }, - DataSinkID: to.Ptr("/subscriptions/6e0219f5-327a-4365-904f-05eed4227ad7/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.HybridData/dataManagers/TestAzureSDKOperations/dataStores/TestAzureStorage1"), - DataSourceID: to.Ptr("/subscriptions/6e0219f5-327a-4365-904f-05eed4227ad7/resourceGroups/ResourceGroupForSDKTest/providers/Microsoft.HybridData/dataManagers/TestAzureSDKOperations/dataStores/TestStorSimpleSource1"), - RunLocation: to.Ptr(armhybriddatamanager.RunLocationWestus), - State: to.Ptr(armhybriddatamanager.StateEnabled), - UserConfirmation: to.Ptr(armhybriddatamanager.UserConfirmationRequired), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/JobDefinitions_Delete-DELETE-example-81.json -func ExampleJobDefinitionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybriddatamanager.NewJobDefinitionsClient("6e0219f5-327a-4365-904f-05eed4227ad7", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "DataTransformation", - "jobdeffromtestcode1", - "ResourceGroupForSDKTest", - "TestAzureSDKOperations", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, 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/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/JobDefinitions_Run-POST-example-132.json -func ExampleJobDefinitionsClient_BeginRun() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybriddatamanager.NewJobDefinitionsClient("6e0219f5-327a-4365-904f-05eed4227ad7", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRun(ctx, - "DataTransformation", - "jobdeffromtestcode1", - "ResourceGroupForSDKTest", - "TestAzureSDKOperations", - armhybriddatamanager.RunParameters{ - CustomerSecrets: []*armhybriddatamanager.CustomerSecret{}, - DataServiceInput: map[string]interface{}{ - "AzureStorageType": "Blob", - "BackupChoice": "UseExistingLatest", - "ContainerName": "containerfromtest", - "DeviceName": "8600-SHG0997877L71FC", - "FileNameFilter": "*", - "IsDirectoryMode": false, - "RootDirectories": []interface{}{ - "\\", - }, - "VolumeNames": []interface{}{ - "TestAutomation", - }, - }, - UserConfirmation: to.Ptr(armhybriddatamanager.UserConfirmationNotRequired), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, 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/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/JobDefinitions_ListByDataManager-GET-example-191.json -func ExampleJobDefinitionsClient_NewListByDataManagerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybriddatamanager.NewJobDefinitionsClient("6e0219f5-327a-4365-904f-05eed4227ad7", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDataManagerPager("ResourceGroupForSDKTest", - "TestAzureSDKOperations", - &armhybriddatamanager.JobDefinitionsClientListByDataManagerOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/ze_generated_example_jobs_client_test.go b/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/ze_generated_example_jobs_client_test.go deleted file mode 100644 index ea879f040942..000000000000 --- a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/ze_generated_example_jobs_client_test.go +++ /dev/null @@ -1,177 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armhybriddatamanager_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/Jobs_ListByJobDefinition-GET-example-91.json -func ExampleJobsClient_NewListByJobDefinitionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybriddatamanager.NewJobsClient("6e0219f5-327a-4365-904f-05eed4227ad7", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByJobDefinitionPager("DataTransformation", - "jobdeffromtestcode1", - "ResourceGroupForSDKTest", - "TestAzureSDKOperations", - &armhybriddatamanager.JobsClientListByJobDefinitionOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/Jobs_Get-GET-example-101.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 := armhybriddatamanager.NewJobsClient("6e0219f5-327a-4365-904f-05eed4227ad7", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "DataTransformation", - "jobdeffromtestcode1", - "99ef93fe-36be-43e4-bebf-de6746730601", - "ResourceGroupForSDKTest", - "TestAzureSDKOperations", - &armhybriddatamanager.JobsClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/Jobs_Cancel-POST-example-111.json -func ExampleJobsClient_BeginCancel() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybriddatamanager.NewJobsClient("6e0219f5-327a-4365-904f-05eed4227ad7", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCancel(ctx, - "DataTransformation", - "jobdeffromtestcode1", - "6eca9b3d-5ffe-4b44-9607-1ba838371ff7", - "ResourceGroupForSDKTest", - "TestAzureSDKOperations", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, 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/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/Jobs_Resume-POST-example-121.json -func ExampleJobsClient_BeginResume() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybriddatamanager.NewJobsClient("6e0219f5-327a-4365-904f-05eed4227ad7", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginResume(ctx, - "DataTransformation", - "jobdeffromtestcode1", - "99ef93fe-36be-43e4-bebf-de6746730601", - "ResourceGroupForSDKTest", - "TestAzureSDKOperations", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, 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/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/Jobs_ListByDataService-GET-example-141.json -func ExampleJobsClient_NewListByDataServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybriddatamanager.NewJobsClient("6e0219f5-327a-4365-904f-05eed4227ad7", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDataServicePager("DataTransformation", - "ResourceGroupForSDKTest", - "TestAzureSDKOperations", - &armhybriddatamanager.JobsClientListByDataServiceOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/Jobs_ListByDataManager-GET-example-201.json -func ExampleJobsClient_NewListByDataManagerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybriddatamanager.NewJobsClient("6e0219f5-327a-4365-904f-05eed4227ad7", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDataManagerPager("ResourceGroupForSDKTest", - "TestAzureSDKOperations", - &armhybriddatamanager.JobsClientListByDataManagerOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/ze_generated_example_operations_client_test.go deleted file mode 100644 index d3af7c15217b..000000000000 --- a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/ze_generated_example_operations_client_test.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armhybriddatamanager_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/Operations_List-GET-example-11.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybriddatamanager.NewOperationsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/ze_generated_example_publickeys_client_test.go b/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/ze_generated_example_publickeys_client_test.go deleted file mode 100644 index 362c96d869aa..000000000000 --- a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/ze_generated_example_publickeys_client_test.go +++ /dev/null @@ -1,66 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armhybriddatamanager_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/PublicKeys_ListByDataManager-GET-example-211.json -func ExamplePublicKeysClient_NewListByDataManagerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybriddatamanager.NewPublicKeysClient("6e0219f5-327a-4365-904f-05eed4227ad7", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDataManagerPager("ResourceGroupForSDKTest", - "TestAzureSDKOperations", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybriddatamanager/resource-manager/Microsoft.HybridData/stable/2019-06-01/examples/PublicKeys_Get-GET-example-222.json -func ExamplePublicKeysClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybriddatamanager.NewPublicKeysClient("6e0219f5-327a-4365-904f-05eed4227ad7", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "default", - "ResourceGroupForSDKTest", - "TestAzureSDKOperations", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/zz_generated_models_serde.go b/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/zz_generated_models_serde.go deleted file mode 100644 index c06ad46c4ee9..000000000000 --- a/sdk/resourcemanager/hybriddatamanager/armhybriddatamanager/zz_generated_models_serde.go +++ /dev/null @@ -1,299 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armhybriddatamanager - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" -) - -// MarshalJSON implements the json.Marshaller interface for type DataManager. -func (d DataManager) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", d.Etag) - populate(objectMap, "id", d.ID) - populate(objectMap, "location", d.Location) - populate(objectMap, "name", d.Name) - populate(objectMap, "sku", d.SKU) - populate(objectMap, "tags", d.Tags) - populate(objectMap, "type", d.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DataManagerUpdateParameter. -func (d DataManagerUpdateParameter) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "sku", d.SKU) - populate(objectMap, "tags", d.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DataServiceProperties. -func (d DataServiceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "state", d.State) - populate(objectMap, "supportedDataSinkTypes", d.SupportedDataSinkTypes) - populate(objectMap, "supportedDataSourceTypes", d.SupportedDataSourceTypes) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DataStoreProperties. -func (d DataStoreProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "customerSecrets", d.CustomerSecrets) - populate(objectMap, "dataStoreTypeId", d.DataStoreTypeID) - populate(objectMap, "extendedProperties", &d.ExtendedProperties) - populate(objectMap, "repositoryId", d.RepositoryID) - populate(objectMap, "state", d.State) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DataStoreTypeProperties. -func (d DataStoreTypeProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "repositoryType", d.RepositoryType) - populate(objectMap, "state", d.State) - populate(objectMap, "supportedDataServicesAsSink", d.SupportedDataServicesAsSink) - populate(objectMap, "supportedDataServicesAsSource", d.SupportedDataServicesAsSource) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type Job. -func (j Job) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "endTime", j.EndTime) - populate(objectMap, "error", j.Error) - populate(objectMap, "id", j.ID) - populate(objectMap, "name", j.Name) - populate(objectMap, "properties", j.Properties) - populateTimeRFC3339(objectMap, "startTime", j.StartTime) - populate(objectMap, "status", j.Status) - populate(objectMap, "type", j.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Job. -func (j *Job) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &j.EndTime) - delete(rawMsg, key) - case "error": - err = unpopulate(val, "Error", &j.Error) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &j.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &j.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &j.Properties) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &j.StartTime) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &j.Status) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &j.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) - } - } - return nil -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type JobDefinitionFilter. -func (j *JobDefinitionFilter) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "dataSource": - err = unpopulate(val, "DataSource", &j.DataSource) - delete(rawMsg, key) - case "lastModified": - err = unpopulateTimeRFC3339(val, "LastModified", &j.LastModified) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &j.State) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type JobDefinitionProperties. -func (j JobDefinitionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "customerSecrets", j.CustomerSecrets) - populate(objectMap, "dataServiceInput", &j.DataServiceInput) - populate(objectMap, "dataSinkId", j.DataSinkID) - populate(objectMap, "dataSourceId", j.DataSourceID) - populateTimeRFC3339(objectMap, "lastModifiedTime", j.LastModifiedTime) - populate(objectMap, "runLocation", j.RunLocation) - populate(objectMap, "schedules", j.Schedules) - populate(objectMap, "state", j.State) - populate(objectMap, "userConfirmation", j.UserConfirmation) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type JobDefinitionProperties. -func (j *JobDefinitionProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "customerSecrets": - err = unpopulate(val, "CustomerSecrets", &j.CustomerSecrets) - delete(rawMsg, key) - case "dataServiceInput": - err = unpopulate(val, "DataServiceInput", &j.DataServiceInput) - delete(rawMsg, key) - case "dataSinkId": - err = unpopulate(val, "DataSinkID", &j.DataSinkID) - delete(rawMsg, key) - case "dataSourceId": - err = unpopulate(val, "DataSourceID", &j.DataSourceID) - delete(rawMsg, key) - case "lastModifiedTime": - err = unpopulateTimeRFC3339(val, "LastModifiedTime", &j.LastModifiedTime) - delete(rawMsg, key) - case "runLocation": - err = unpopulate(val, "RunLocation", &j.RunLocation) - delete(rawMsg, key) - case "schedules": - err = unpopulate(val, "Schedules", &j.Schedules) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &j.State) - delete(rawMsg, key) - case "userConfirmation": - err = unpopulate(val, "UserConfirmation", &j.UserConfirmation) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type JobDetails. -func (j JobDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "errorDetails", j.ErrorDetails) - populate(objectMap, "itemDetailsLink", j.ItemDetailsLink) - populate(objectMap, "jobDefinition", j.JobDefinition) - populate(objectMap, "jobStages", j.JobStages) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type JobFilter. -func (j *JobFilter) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &j.StartTime) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &j.Status) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type JobStages. -func (j JobStages) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "errorDetails", j.ErrorDetails) - populate(objectMap, "jobStageDetails", &j.JobStageDetails) - populate(objectMap, "stageName", j.StageName) - populate(objectMap, "stageStatus", j.StageStatus) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type Resource. -func (r Resource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", r.ID) - populate(objectMap, "location", r.Location) - populate(objectMap, "name", r.Name) - populate(objectMap, "sku", r.SKU) - populate(objectMap, "tags", r.Tags) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type RunParameters. -func (r RunParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "customerSecrets", r.CustomerSecrets) - populate(objectMap, "dataServiceInput", &r.DataServiceInput) - populate(objectMap, "userConfirmation", r.UserConfirmation) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type Schedule. -func (s Schedule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "name", s.Name) - populate(objectMap, "policyList", s.PolicyList) - return json.Marshal(objectMap) -} - -func populate(m map[string]interface{}, k string, v interface{}) { - if v == nil { - return - } else if azcore.IsNullValue(v) { - m[k] = nil - } else if !reflect.ValueOf(v).IsNil() { - m[k] = v - } -} - -func unpopulate(data json.RawMessage, fn string, v interface{}) error { - if data == nil { - return nil - } - if err := json.Unmarshal(data, v); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - return nil -}