From a01da276aded5d0106ed0e4a0e8a14d541aa3fe9 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 29 Jun 2022 02:07:00 +0000 Subject: [PATCH] CodeGen from PR 19556 in Azure/azure-rest-api-specs Merge 5bbdd43001e965e34bc6f892ee4faa1e0a4cc238 into ac155b972d0619a6e5bf665a863fb05ee7eeb30f --- .../armstreamanalytics/CHANGELOG.md | 16 + .../armstreamanalytics/autorest.md | 6 +- ..._clusters_client.go => clusters_client.go} | 1 + ...zz_generated_constants.go => constants.go} | 3 +- ...unctions_client.go => functions_client.go} | 1 + .../streamanalytics/armstreamanalytics/go.mod | 14 +- .../streamanalytics/armstreamanalytics/go.sum | 24 +- ...ated_inputs_client.go => inputs_client.go} | 1 + .../{zz_generated_models.go => models.go} | 97 +- .../armstreamanalytics/models_serde.go | 4689 +++++++++++++++++ ...rations_client.go => operations_client.go} | 1 + ...ed_outputs_client.go => outputs_client.go} | 1 + ...phic_helpers.go => polymorphic_helpers.go} | 7 + ...s_client.go => privateendpoints_client.go} | 1 + ...ed_response_types.go => response_types.go} | 1 + ...jobs_client.go => streamingjobs_client.go} | 1 + ...ions_client.go => subscriptions_client.go} | 1 + ...erated_time_rfc3339.go => time_rfc3339.go} | 1 + ...ns_client.go => transformations_client.go} | 1 + ..._generated_example_clusters_client_test.go | 209 - ...generated_example_functions_client_test.go | 226 - ...ze_generated_example_inputs_client_test.go | 207 - ...enerated_example_operations_client_test.go | 41 - ...e_generated_example_outputs_client_test.go | 188 - ...ed_example_privateendpoints_client_test.go | 129 - ...rated_example_streamingjobs_client_test.go | 318 -- ...rated_example_subscriptions_client_test.go | 38 - ...ted_example_transformations_client_test.go | 100 - .../zz_generated_models_serde.go | 1623 ------ 29 files changed, 4821 insertions(+), 3125 deletions(-) rename sdk/resourcemanager/streamanalytics/armstreamanalytics/{zz_generated_clusters_client.go => clusters_client.go} (99%) rename sdk/resourcemanager/streamanalytics/armstreamanalytics/{zz_generated_constants.go => constants.go} (99%) rename sdk/resourcemanager/streamanalytics/armstreamanalytics/{zz_generated_functions_client.go => functions_client.go} (99%) rename sdk/resourcemanager/streamanalytics/armstreamanalytics/{zz_generated_inputs_client.go => inputs_client.go} (99%) rename sdk/resourcemanager/streamanalytics/armstreamanalytics/{zz_generated_models.go => models.go} (96%) create mode 100644 sdk/resourcemanager/streamanalytics/armstreamanalytics/models_serde.go rename sdk/resourcemanager/streamanalytics/armstreamanalytics/{zz_generated_operations_client.go => operations_client.go} (99%) rename sdk/resourcemanager/streamanalytics/armstreamanalytics/{zz_generated_outputs_client.go => outputs_client.go} (99%) rename sdk/resourcemanager/streamanalytics/armstreamanalytics/{zz_generated_polymorphic_helpers.go => polymorphic_helpers.go} (96%) rename sdk/resourcemanager/streamanalytics/armstreamanalytics/{zz_generated_privateendpoints_client.go => privateendpoints_client.go} (99%) rename sdk/resourcemanager/streamanalytics/armstreamanalytics/{zz_generated_response_types.go => response_types.go} (99%) rename sdk/resourcemanager/streamanalytics/armstreamanalytics/{zz_generated_streamingjobs_client.go => streamingjobs_client.go} (99%) rename sdk/resourcemanager/streamanalytics/armstreamanalytics/{zz_generated_subscriptions_client.go => subscriptions_client.go} (99%) rename sdk/resourcemanager/streamanalytics/armstreamanalytics/{zz_generated_time_rfc3339.go => time_rfc3339.go} (99%) rename sdk/resourcemanager/streamanalytics/armstreamanalytics/{zz_generated_transformations_client.go => transformations_client.go} (99%) delete mode 100644 sdk/resourcemanager/streamanalytics/armstreamanalytics/ze_generated_example_clusters_client_test.go delete mode 100644 sdk/resourcemanager/streamanalytics/armstreamanalytics/ze_generated_example_functions_client_test.go delete mode 100644 sdk/resourcemanager/streamanalytics/armstreamanalytics/ze_generated_example_inputs_client_test.go delete mode 100644 sdk/resourcemanager/streamanalytics/armstreamanalytics/ze_generated_example_operations_client_test.go delete mode 100644 sdk/resourcemanager/streamanalytics/armstreamanalytics/ze_generated_example_outputs_client_test.go delete mode 100644 sdk/resourcemanager/streamanalytics/armstreamanalytics/ze_generated_example_privateendpoints_client_test.go delete mode 100644 sdk/resourcemanager/streamanalytics/armstreamanalytics/ze_generated_example_streamingjobs_client_test.go delete mode 100644 sdk/resourcemanager/streamanalytics/armstreamanalytics/ze_generated_example_subscriptions_client_test.go delete mode 100644 sdk/resourcemanager/streamanalytics/armstreamanalytics/ze_generated_example_transformations_client_test.go delete mode 100644 sdk/resourcemanager/streamanalytics/armstreamanalytics/zz_generated_models_serde.go diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/CHANGELOG.md b/sdk/resourcemanager/streamanalytics/armstreamanalytics/CHANGELOG.md index a49998a84e8d..4da0e3fd719e 100644 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/CHANGELOG.md +++ b/sdk/resourcemanager/streamanalytics/armstreamanalytics/CHANGELOG.md @@ -1,5 +1,21 @@ # Release History +## 1.1.0 (2022-06-29) +### Features Added + +- New function `*GatewayMessageBusOutputDataSource.GetOutputDataSource() *OutputDataSource` +- New function `*GatewayMessageBusStreamInputDataSource.GetStreamInputDataSource() *StreamInputDataSource` +- New function `*FileReferenceInputDataSource.GetReferenceInputDataSource() *ReferenceInputDataSource` +- New struct `FileReferenceInputDataSource` +- New struct `FileReferenceInputDataSourceProperties` +- New struct `GatewayMessageBusOutputDataSource` +- New struct `GatewayMessageBusOutputDataSourceProperties` +- New struct `GatewayMessageBusSourceProperties` +- New struct `GatewayMessageBusStreamInputDataSource` +- New struct `GatewayMessageBusStreamInputDataSourceProperties` +- New field `BlobPathPrefix` in struct `BlobOutputDataSourceProperties` + + ## 1.0.0 (2022-05-18) The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/streamanalytics/armstreamanalytics` 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/streamanalytics/armstreamanalytics/autorest.md b/sdk/resourcemanager/streamanalytics/armstreamanalytics/autorest.md index a40bbeea4731..6a3ce2f14580 100644 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/autorest.md +++ b/sdk/resourcemanager/streamanalytics/armstreamanalytics/autorest.md @@ -5,8 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/streamanalytics/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/streamanalytics/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/streamanalytics/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/streamanalytics/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 +module-version: 1.1.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/zz_generated_clusters_client.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/clusters_client.go similarity index 99% rename from sdk/resourcemanager/streamanalytics/armstreamanalytics/zz_generated_clusters_client.go rename to sdk/resourcemanager/streamanalytics/armstreamanalytics/clusters_client.go index 0328ffe7bf81..6262f71fd989 100644 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/zz_generated_clusters_client.go +++ b/sdk/resourcemanager/streamanalytics/armstreamanalytics/clusters_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 armstreamanalytics diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/zz_generated_constants.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/constants.go similarity index 99% rename from sdk/resourcemanager/streamanalytics/armstreamanalytics/zz_generated_constants.go rename to sdk/resourcemanager/streamanalytics/armstreamanalytics/constants.go index 899a7c090e5d..75acdf6c3a2f 100644 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/zz_generated_constants.go +++ b/sdk/resourcemanager/streamanalytics/armstreamanalytics/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 armstreamanalytics const ( moduleName = "armstreamanalytics" - moduleVersion = "v1.0.0" + moduleVersion = "v1.1.0" ) // AuthenticationMode - Authentication Mode. Valid modes are ConnectionString, Msi and 'UserToken'. diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/zz_generated_functions_client.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/functions_client.go similarity index 99% rename from sdk/resourcemanager/streamanalytics/armstreamanalytics/zz_generated_functions_client.go rename to sdk/resourcemanager/streamanalytics/armstreamanalytics/functions_client.go index 0c23cc510678..d7a2404366fe 100644 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/zz_generated_functions_client.go +++ b/sdk/resourcemanager/streamanalytics/armstreamanalytics/functions_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 armstreamanalytics diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/go.mod b/sdk/resourcemanager/streamanalytics/armstreamanalytics/go.mod index 4a976b251a86..9a6da40322c1 100644 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/go.mod +++ b/sdk/resourcemanager/streamanalytics/armstreamanalytics/go.mod @@ -2,20 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/streamanalytics/arm 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/streamanalytics/armstreamanalytics/go.sum b/sdk/resourcemanager/streamanalytics/armstreamanalytics/go.sum index ed5b814680ee..3afb578030a5 100644 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/go.sum +++ b/sdk/resourcemanager/streamanalytics/armstreamanalytics/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/streamanalytics/armstreamanalytics/zz_generated_inputs_client.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/inputs_client.go similarity index 99% rename from sdk/resourcemanager/streamanalytics/armstreamanalytics/zz_generated_inputs_client.go rename to sdk/resourcemanager/streamanalytics/armstreamanalytics/inputs_client.go index 1e86cd6a2a6d..909ea92e8f33 100644 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/zz_generated_inputs_client.go +++ b/sdk/resourcemanager/streamanalytics/armstreamanalytics/inputs_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 armstreamanalytics diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/zz_generated_models.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/models.go similarity index 96% rename from sdk/resourcemanager/streamanalytics/armstreamanalytics/zz_generated_models.go rename to sdk/resourcemanager/streamanalytics/armstreamanalytics/models.go index 730a9b21635f..9fafb16b7782 100644 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/zz_generated_models.go +++ b/sdk/resourcemanager/streamanalytics/armstreamanalytics/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 armstreamanalytics @@ -497,6 +498,9 @@ type BlobOutputDataSourceProperties struct { // Authentication Mode. AuthenticationMode *AuthenticationMode `json:"authenticationMode,omitempty"` + // Blob path prefix. + BlobPathPrefix *string `json:"blobPathPrefix,omitempty"` + // The name of a container within the associated Storage account. This container contains either the blob(s) to be read from // or written to. Required on PUT (CreateOrReplace) requests. Container *string `json:"container,omitempty"` @@ -1024,6 +1028,28 @@ func (e *EventHubV2StreamInputDataSource) GetStreamInputDataSource() *StreamInpu } } +// FileReferenceInputDataSource - Describes a file input data source that contains reference data. +type FileReferenceInputDataSource struct { + // REQUIRED; Indicates the type of input data source containing reference data. Required on PUT (CreateOrReplace) requests. + Type *string `json:"type,omitempty"` + + // The properties that are associated with a file input containing reference data. Required on PUT (CreateOrReplace) requests. + Properties *FileReferenceInputDataSourceProperties `json:"properties,omitempty"` +} + +// GetReferenceInputDataSource implements the ReferenceInputDataSourceClassification interface for type FileReferenceInputDataSource. +func (f *FileReferenceInputDataSource) GetReferenceInputDataSource() *ReferenceInputDataSource { + return &ReferenceInputDataSource{ + Type: f.Type, + } +} + +// FileReferenceInputDataSourceProperties - The properties that are associated with a file input containing reference data. +type FileReferenceInputDataSourceProperties struct { + // The path of the file. + Path *string `json:"path,omitempty"` +} + // Function - A function object, containing all information associated with the named function. All functions are contained // under a streaming job. type Function struct { @@ -1198,16 +1224,67 @@ type FunctionsClientUpdateOptions struct { IfMatch *string } -// Identity - Describes how identity is verified -type Identity struct { - // The identity principal ID - PrincipalID *string `json:"principalId,omitempty"` +// GatewayMessageBusOutputDataSource - Describes a Gateway Message Bus output data source. +type GatewayMessageBusOutputDataSource struct { + // REQUIRED; Indicates the type of data source output will be written to. Required on PUT (CreateOrReplace) requests. + Type *string `json:"type,omitempty"` - // The identity tenantId - TenantID *string `json:"tenantId,omitempty"` + // The properties that are associated with a Gateway Message Bus output. Required on PUT (CreateOrReplace) requests. + Properties *GatewayMessageBusOutputDataSourceProperties `json:"properties,omitempty"` +} +// GetOutputDataSource implements the OutputDataSourceClassification interface for type GatewayMessageBusOutputDataSource. +func (g *GatewayMessageBusOutputDataSource) GetOutputDataSource() *OutputDataSource { + return &OutputDataSource{ + Type: g.Type, + } +} + +// GatewayMessageBusOutputDataSourceProperties - The properties that are associated with a Gateway Message Bus. +type GatewayMessageBusOutputDataSourceProperties struct { + // The name of the Service Bus topic. + Topic *string `json:"topic,omitempty"` +} + +// GatewayMessageBusSourceProperties - The properties that are associated with a gateway message bus datasource. +type GatewayMessageBusSourceProperties struct { + // The name of the Service Bus topic. + Topic *string `json:"topic,omitempty"` +} + +// GatewayMessageBusStreamInputDataSource - Describes a blob input data source that contains stream data. +type GatewayMessageBusStreamInputDataSource struct { + // REQUIRED; Indicates the type of input data source containing stream data. Required on PUT (CreateOrReplace) requests. + Type *string `json:"type,omitempty"` + + // The properties that are associated with a gateway message bus input containing stream data. + Properties *GatewayMessageBusStreamInputDataSourceProperties `json:"properties,omitempty"` +} + +// GetStreamInputDataSource implements the StreamInputDataSourceClassification interface for type GatewayMessageBusStreamInputDataSource. +func (g *GatewayMessageBusStreamInputDataSource) GetStreamInputDataSource() *StreamInputDataSource { + return &StreamInputDataSource{ + Type: g.Type, + } +} + +// GatewayMessageBusStreamInputDataSourceProperties - The properties that are associated with a gateway message bus input +// containing stream data. +type GatewayMessageBusStreamInputDataSourceProperties struct { + // The name of the Service Bus topic. + Topic *string `json:"topic,omitempty"` +} + +// Identity - Describes how identity is verified +type Identity struct { // The identity type Type *string `json:"type,omitempty"` + + // READ-ONLY; The identity principal ID + PrincipalID *string `json:"principalId,omitempty" azure:"ro"` + + // READ-ONLY; The identity tenantId + TenantID *string `json:"tenantId,omitempty" azure:"ro"` } // Input - An input object, containing all information associated with the named input. All inputs are contained under a streaming @@ -1528,7 +1605,7 @@ type Output struct { // Use a type switch to determine the concrete type. The possible types are: // - *AzureDataLakeStoreOutputDataSource, *AzureFunctionOutputDataSource, *AzureSQLDatabaseOutputDataSource, *AzureSynapseOutputDataSource, // - *AzureTableOutputDataSource, *BlobOutputDataSource, *DocumentDbOutputDataSource, *EventHubOutputDataSource, *EventHubV2OutputDataSource, -// - *OutputDataSource, *PowerBIOutputDataSource, *ServiceBusQueueOutputDataSource, *ServiceBusTopicOutputDataSource +// - *GatewayMessageBusOutputDataSource, *OutputDataSource, *PowerBIOutputDataSource, *ServiceBusQueueOutputDataSource, *ServiceBusTopicOutputDataSource type OutputDataSourceClassification interface { // GetOutputDataSource returns the OutputDataSource content of the underlying type. GetOutputDataSource() *OutputDataSource @@ -1805,7 +1882,7 @@ type ProxyResource struct { // ReferenceInputDataSourceClassification provides polymorphic access to related types. // Call the interface's GetReferenceInputDataSource() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: -// - *AzureSQLReferenceInputDataSource, *BlobReferenceInputDataSource, *ReferenceInputDataSource +// - *AzureSQLReferenceInputDataSource, *BlobReferenceInputDataSource, *FileReferenceInputDataSource, *ReferenceInputDataSource type ReferenceInputDataSourceClassification interface { // GetReferenceInputDataSource returns the ReferenceInputDataSource content of the underlying type. GetReferenceInputDataSource() *ReferenceInputDataSource @@ -2062,8 +2139,8 @@ type StorageAccount struct { // StreamInputDataSourceClassification provides polymorphic access to related types. // Call the interface's GetStreamInputDataSource() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: -// - *BlobStreamInputDataSource, *EventHubStreamInputDataSource, *EventHubV2StreamInputDataSource, *IoTHubStreamInputDataSource, -// - *StreamInputDataSource +// - *BlobStreamInputDataSource, *EventHubStreamInputDataSource, *EventHubV2StreamInputDataSource, *GatewayMessageBusStreamInputDataSource, +// - *IoTHubStreamInputDataSource, *StreamInputDataSource type StreamInputDataSourceClassification interface { // GetStreamInputDataSource returns the StreamInputDataSource content of the underlying type. GetStreamInputDataSource() *StreamInputDataSource diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/models_serde.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/models_serde.go new file mode 100644 index 000000000000..35461d7543ba --- /dev/null +++ b/sdk/resourcemanager/streamanalytics/armstreamanalytics/models_serde.go @@ -0,0 +1,4689 @@ +//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 armstreamanalytics + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" +) + +// MarshalJSON implements the json.Marshaller interface for type AggregateFunctionProperties. +func (a AggregateFunctionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", a.Etag) + populate(objectMap, "properties", a.Properties) + objectMap["type"] = "Aggregate" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AggregateFunctionProperties. +func (a *AggregateFunctionProperties) 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 "etag": + err = unpopulate(val, "Etag", &a.Etag) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + 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 AvroSerialization. +func (a AvroSerialization) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", &a.Properties) + objectMap["type"] = EventSerializationTypeAvro + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AvroSerialization. +func (a *AvroSerialization) 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 "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + 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 AzureDataLakeStoreOutputDataSource. +func (a AzureDataLakeStoreOutputDataSource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", a.Properties) + objectMap["type"] = "Microsoft.DataLake/Accounts" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureDataLakeStoreOutputDataSource. +func (a *AzureDataLakeStoreOutputDataSource) 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 "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + 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 AzureDataLakeStoreOutputDataSourceProperties. +func (a AzureDataLakeStoreOutputDataSourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "accountName", a.AccountName) + populate(objectMap, "authenticationMode", a.AuthenticationMode) + populate(objectMap, "dateFormat", a.DateFormat) + populate(objectMap, "filePathPrefix", a.FilePathPrefix) + populate(objectMap, "refreshToken", a.RefreshToken) + populate(objectMap, "tenantId", a.TenantID) + populate(objectMap, "timeFormat", a.TimeFormat) + populate(objectMap, "tokenUserDisplayName", a.TokenUserDisplayName) + populate(objectMap, "tokenUserPrincipalName", a.TokenUserPrincipalName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureDataLakeStoreOutputDataSourceProperties. +func (a *AzureDataLakeStoreOutputDataSourceProperties) 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 "accountName": + err = unpopulate(val, "AccountName", &a.AccountName) + delete(rawMsg, key) + case "authenticationMode": + err = unpopulate(val, "AuthenticationMode", &a.AuthenticationMode) + delete(rawMsg, key) + case "dateFormat": + err = unpopulate(val, "DateFormat", &a.DateFormat) + delete(rawMsg, key) + case "filePathPrefix": + err = unpopulate(val, "FilePathPrefix", &a.FilePathPrefix) + delete(rawMsg, key) + case "refreshToken": + err = unpopulate(val, "RefreshToken", &a.RefreshToken) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &a.TenantID) + delete(rawMsg, key) + case "timeFormat": + err = unpopulate(val, "TimeFormat", &a.TimeFormat) + delete(rawMsg, key) + case "tokenUserDisplayName": + err = unpopulate(val, "TokenUserDisplayName", &a.TokenUserDisplayName) + delete(rawMsg, key) + case "tokenUserPrincipalName": + err = unpopulate(val, "TokenUserPrincipalName", &a.TokenUserPrincipalName) + 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 AzureFunctionOutputDataSource. +func (a AzureFunctionOutputDataSource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", a.Properties) + objectMap["type"] = "Microsoft.AzureFunction" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFunctionOutputDataSource. +func (a *AzureFunctionOutputDataSource) 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 "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + 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 AzureFunctionOutputDataSourceProperties. +func (a AzureFunctionOutputDataSourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "apiKey", a.APIKey) + populate(objectMap, "functionAppName", a.FunctionAppName) + populate(objectMap, "functionName", a.FunctionName) + populate(objectMap, "maxBatchCount", a.MaxBatchCount) + populate(objectMap, "maxBatchSize", a.MaxBatchSize) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFunctionOutputDataSourceProperties. +func (a *AzureFunctionOutputDataSourceProperties) 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 "apiKey": + err = unpopulate(val, "APIKey", &a.APIKey) + delete(rawMsg, key) + case "functionAppName": + err = unpopulate(val, "FunctionAppName", &a.FunctionAppName) + delete(rawMsg, key) + case "functionName": + err = unpopulate(val, "FunctionName", &a.FunctionName) + delete(rawMsg, key) + case "maxBatchCount": + err = unpopulate(val, "MaxBatchCount", &a.MaxBatchCount) + delete(rawMsg, key) + case "maxBatchSize": + err = unpopulate(val, "MaxBatchSize", &a.MaxBatchSize) + 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 AzureMachineLearningWebServiceFunctionBinding. +func (a AzureMachineLearningWebServiceFunctionBinding) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", a.Properties) + objectMap["type"] = "Microsoft.MachineLearning/WebService" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMachineLearningWebServiceFunctionBinding. +func (a *AzureMachineLearningWebServiceFunctionBinding) 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 "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + 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 AzureMachineLearningWebServiceFunctionBindingProperties. +func (a AzureMachineLearningWebServiceFunctionBindingProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "apiKey", a.APIKey) + populate(objectMap, "batchSize", a.BatchSize) + populate(objectMap, "endpoint", a.Endpoint) + populate(objectMap, "inputs", a.Inputs) + populate(objectMap, "outputs", a.Outputs) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMachineLearningWebServiceFunctionBindingProperties. +func (a *AzureMachineLearningWebServiceFunctionBindingProperties) 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 "apiKey": + err = unpopulate(val, "APIKey", &a.APIKey) + delete(rawMsg, key) + case "batchSize": + err = unpopulate(val, "BatchSize", &a.BatchSize) + delete(rawMsg, key) + case "endpoint": + err = unpopulate(val, "Endpoint", &a.Endpoint) + delete(rawMsg, key) + case "inputs": + err = unpopulate(val, "Inputs", &a.Inputs) + delete(rawMsg, key) + case "outputs": + err = unpopulate(val, "Outputs", &a.Outputs) + 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 AzureMachineLearningWebServiceFunctionBindingRetrievalProperties. +func (a AzureMachineLearningWebServiceFunctionBindingRetrievalProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "executeEndpoint", a.ExecuteEndpoint) + objectMap["udfType"] = "Scalar" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMachineLearningWebServiceFunctionBindingRetrievalProperties. +func (a *AzureMachineLearningWebServiceFunctionBindingRetrievalProperties) 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 "executeEndpoint": + err = unpopulate(val, "ExecuteEndpoint", &a.ExecuteEndpoint) + delete(rawMsg, key) + case "udfType": + err = unpopulate(val, "UdfType", &a.UdfType) + 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 AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters. +func (a AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "bindingRetrievalProperties", a.BindingRetrievalProperties) + objectMap["bindingType"] = "Microsoft.MachineLearning/WebService" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters. +func (a *AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters) 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 "bindingRetrievalProperties": + err = unpopulate(val, "BindingRetrievalProperties", &a.BindingRetrievalProperties) + delete(rawMsg, key) + case "bindingType": + err = unpopulate(val, "BindingType", &a.BindingType) + 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 AzureMachineLearningWebServiceInputColumn. +func (a AzureMachineLearningWebServiceInputColumn) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "dataType", a.DataType) + populate(objectMap, "mapTo", a.MapTo) + populate(objectMap, "name", a.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMachineLearningWebServiceInputColumn. +func (a *AzureMachineLearningWebServiceInputColumn) 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 "dataType": + err = unpopulate(val, "DataType", &a.DataType) + delete(rawMsg, key) + case "mapTo": + err = unpopulate(val, "MapTo", &a.MapTo) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + 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 AzureMachineLearningWebServiceInputs. +func (a AzureMachineLearningWebServiceInputs) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "columnNames", a.ColumnNames) + populate(objectMap, "name", a.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMachineLearningWebServiceInputs. +func (a *AzureMachineLearningWebServiceInputs) 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 "columnNames": + err = unpopulate(val, "ColumnNames", &a.ColumnNames) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + 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 AzureMachineLearningWebServiceOutputColumn. +func (a AzureMachineLearningWebServiceOutputColumn) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "dataType", a.DataType) + populate(objectMap, "name", a.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMachineLearningWebServiceOutputColumn. +func (a *AzureMachineLearningWebServiceOutputColumn) 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 "dataType": + err = unpopulate(val, "DataType", &a.DataType) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + 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 AzureSQLDatabaseDataSourceProperties. +func (a AzureSQLDatabaseDataSourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "authenticationMode", a.AuthenticationMode) + populate(objectMap, "database", a.Database) + populate(objectMap, "maxBatchCount", a.MaxBatchCount) + populate(objectMap, "maxWriterCount", a.MaxWriterCount) + populate(objectMap, "password", a.Password) + populate(objectMap, "server", a.Server) + populate(objectMap, "table", a.Table) + populate(objectMap, "user", a.User) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureSQLDatabaseDataSourceProperties. +func (a *AzureSQLDatabaseDataSourceProperties) 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 "authenticationMode": + err = unpopulate(val, "AuthenticationMode", &a.AuthenticationMode) + delete(rawMsg, key) + case "database": + err = unpopulate(val, "Database", &a.Database) + delete(rawMsg, key) + case "maxBatchCount": + err = unpopulate(val, "MaxBatchCount", &a.MaxBatchCount) + delete(rawMsg, key) + case "maxWriterCount": + err = unpopulate(val, "MaxWriterCount", &a.MaxWriterCount) + delete(rawMsg, key) + case "password": + err = unpopulate(val, "Password", &a.Password) + delete(rawMsg, key) + case "server": + err = unpopulate(val, "Server", &a.Server) + delete(rawMsg, key) + case "table": + err = unpopulate(val, "Table", &a.Table) + delete(rawMsg, key) + case "user": + err = unpopulate(val, "User", &a.User) + 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 AzureSQLDatabaseOutputDataSource. +func (a AzureSQLDatabaseOutputDataSource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", a.Properties) + objectMap["type"] = "Microsoft.Sql/Server/Database" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureSQLDatabaseOutputDataSource. +func (a *AzureSQLDatabaseOutputDataSource) 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 "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + 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 AzureSQLDatabaseOutputDataSourceProperties. +func (a AzureSQLDatabaseOutputDataSourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "authenticationMode", a.AuthenticationMode) + populate(objectMap, "database", a.Database) + populate(objectMap, "maxBatchCount", a.MaxBatchCount) + populate(objectMap, "maxWriterCount", a.MaxWriterCount) + populate(objectMap, "password", a.Password) + populate(objectMap, "server", a.Server) + populate(objectMap, "table", a.Table) + populate(objectMap, "user", a.User) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureSQLDatabaseOutputDataSourceProperties. +func (a *AzureSQLDatabaseOutputDataSourceProperties) 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 "authenticationMode": + err = unpopulate(val, "AuthenticationMode", &a.AuthenticationMode) + delete(rawMsg, key) + case "database": + err = unpopulate(val, "Database", &a.Database) + delete(rawMsg, key) + case "maxBatchCount": + err = unpopulate(val, "MaxBatchCount", &a.MaxBatchCount) + delete(rawMsg, key) + case "maxWriterCount": + err = unpopulate(val, "MaxWriterCount", &a.MaxWriterCount) + delete(rawMsg, key) + case "password": + err = unpopulate(val, "Password", &a.Password) + delete(rawMsg, key) + case "server": + err = unpopulate(val, "Server", &a.Server) + delete(rawMsg, key) + case "table": + err = unpopulate(val, "Table", &a.Table) + delete(rawMsg, key) + case "user": + err = unpopulate(val, "User", &a.User) + 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 AzureSQLReferenceInputDataSource. +func (a AzureSQLReferenceInputDataSource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", a.Properties) + objectMap["type"] = "Microsoft.Sql/Server/Database" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureSQLReferenceInputDataSource. +func (a *AzureSQLReferenceInputDataSource) 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 "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + 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 AzureSQLReferenceInputDataSourceProperties. +func (a AzureSQLReferenceInputDataSourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "database", a.Database) + populate(objectMap, "deltaSnapshotQuery", a.DeltaSnapshotQuery) + populate(objectMap, "fullSnapshotQuery", a.FullSnapshotQuery) + populate(objectMap, "password", a.Password) + populate(objectMap, "refreshRate", a.RefreshRate) + populate(objectMap, "refreshType", a.RefreshType) + populate(objectMap, "server", a.Server) + populate(objectMap, "table", a.Table) + populate(objectMap, "user", a.User) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureSQLReferenceInputDataSourceProperties. +func (a *AzureSQLReferenceInputDataSourceProperties) 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 "database": + err = unpopulate(val, "Database", &a.Database) + delete(rawMsg, key) + case "deltaSnapshotQuery": + err = unpopulate(val, "DeltaSnapshotQuery", &a.DeltaSnapshotQuery) + delete(rawMsg, key) + case "fullSnapshotQuery": + err = unpopulate(val, "FullSnapshotQuery", &a.FullSnapshotQuery) + delete(rawMsg, key) + case "password": + err = unpopulate(val, "Password", &a.Password) + delete(rawMsg, key) + case "refreshRate": + err = unpopulate(val, "RefreshRate", &a.RefreshRate) + delete(rawMsg, key) + case "refreshType": + err = unpopulate(val, "RefreshType", &a.RefreshType) + delete(rawMsg, key) + case "server": + err = unpopulate(val, "Server", &a.Server) + delete(rawMsg, key) + case "table": + err = unpopulate(val, "Table", &a.Table) + delete(rawMsg, key) + case "user": + err = unpopulate(val, "User", &a.User) + 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 AzureSynapseDataSourceProperties. +func (a AzureSynapseDataSourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "database", a.Database) + populate(objectMap, "password", a.Password) + populate(objectMap, "server", a.Server) + populate(objectMap, "table", a.Table) + populate(objectMap, "user", a.User) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureSynapseDataSourceProperties. +func (a *AzureSynapseDataSourceProperties) 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 "database": + err = unpopulate(val, "Database", &a.Database) + delete(rawMsg, key) + case "password": + err = unpopulate(val, "Password", &a.Password) + delete(rawMsg, key) + case "server": + err = unpopulate(val, "Server", &a.Server) + delete(rawMsg, key) + case "table": + err = unpopulate(val, "Table", &a.Table) + delete(rawMsg, key) + case "user": + err = unpopulate(val, "User", &a.User) + 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 AzureSynapseOutputDataSource. +func (a AzureSynapseOutputDataSource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", a.Properties) + objectMap["type"] = "Microsoft.Sql/Server/DataWarehouse" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureSynapseOutputDataSource. +func (a *AzureSynapseOutputDataSource) 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 "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + 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 AzureSynapseOutputDataSourceProperties. +func (a AzureSynapseOutputDataSourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "database", a.Database) + populate(objectMap, "password", a.Password) + populate(objectMap, "server", a.Server) + populate(objectMap, "table", a.Table) + populate(objectMap, "user", a.User) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureSynapseOutputDataSourceProperties. +func (a *AzureSynapseOutputDataSourceProperties) 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 "database": + err = unpopulate(val, "Database", &a.Database) + delete(rawMsg, key) + case "password": + err = unpopulate(val, "Password", &a.Password) + delete(rawMsg, key) + case "server": + err = unpopulate(val, "Server", &a.Server) + delete(rawMsg, key) + case "table": + err = unpopulate(val, "Table", &a.Table) + delete(rawMsg, key) + case "user": + err = unpopulate(val, "User", &a.User) + 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 AzureTableOutputDataSource. +func (a AzureTableOutputDataSource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", a.Properties) + objectMap["type"] = "Microsoft.Storage/Table" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureTableOutputDataSource. +func (a *AzureTableOutputDataSource) 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 "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + 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 AzureTableOutputDataSourceProperties. +func (a AzureTableOutputDataSourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "accountKey", a.AccountKey) + populate(objectMap, "accountName", a.AccountName) + populate(objectMap, "batchSize", a.BatchSize) + populate(objectMap, "columnsToRemove", a.ColumnsToRemove) + populate(objectMap, "partitionKey", a.PartitionKey) + populate(objectMap, "rowKey", a.RowKey) + populate(objectMap, "table", a.Table) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureTableOutputDataSourceProperties. +func (a *AzureTableOutputDataSourceProperties) 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 "accountKey": + err = unpopulate(val, "AccountKey", &a.AccountKey) + delete(rawMsg, key) + case "accountName": + err = unpopulate(val, "AccountName", &a.AccountName) + delete(rawMsg, key) + case "batchSize": + err = unpopulate(val, "BatchSize", &a.BatchSize) + delete(rawMsg, key) + case "columnsToRemove": + err = unpopulate(val, "ColumnsToRemove", &a.ColumnsToRemove) + delete(rawMsg, key) + case "partitionKey": + err = unpopulate(val, "PartitionKey", &a.PartitionKey) + delete(rawMsg, key) + case "rowKey": + err = unpopulate(val, "RowKey", &a.RowKey) + delete(rawMsg, key) + case "table": + err = unpopulate(val, "Table", &a.Table) + 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 BlobDataSourceProperties. +func (b BlobDataSourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "authenticationMode", b.AuthenticationMode) + populate(objectMap, "container", b.Container) + populate(objectMap, "dateFormat", b.DateFormat) + populate(objectMap, "pathPattern", b.PathPattern) + populate(objectMap, "storageAccounts", b.StorageAccounts) + populate(objectMap, "timeFormat", b.TimeFormat) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BlobDataSourceProperties. +func (b *BlobDataSourceProperties) 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", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "authenticationMode": + err = unpopulate(val, "AuthenticationMode", &b.AuthenticationMode) + delete(rawMsg, key) + case "container": + err = unpopulate(val, "Container", &b.Container) + delete(rawMsg, key) + case "dateFormat": + err = unpopulate(val, "DateFormat", &b.DateFormat) + delete(rawMsg, key) + case "pathPattern": + err = unpopulate(val, "PathPattern", &b.PathPattern) + delete(rawMsg, key) + case "storageAccounts": + err = unpopulate(val, "StorageAccounts", &b.StorageAccounts) + delete(rawMsg, key) + case "timeFormat": + err = unpopulate(val, "TimeFormat", &b.TimeFormat) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BlobOutputDataSource. +func (b BlobOutputDataSource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", b.Properties) + objectMap["type"] = "Microsoft.Storage/Blob" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BlobOutputDataSource. +func (b *BlobOutputDataSource) 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", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &b.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &b.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BlobOutputDataSourceProperties. +func (b BlobOutputDataSourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "authenticationMode", b.AuthenticationMode) + populate(objectMap, "blobPathPrefix", b.BlobPathPrefix) + populate(objectMap, "container", b.Container) + populate(objectMap, "dateFormat", b.DateFormat) + populate(objectMap, "pathPattern", b.PathPattern) + populate(objectMap, "storageAccounts", b.StorageAccounts) + populate(objectMap, "timeFormat", b.TimeFormat) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BlobOutputDataSourceProperties. +func (b *BlobOutputDataSourceProperties) 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", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "authenticationMode": + err = unpopulate(val, "AuthenticationMode", &b.AuthenticationMode) + delete(rawMsg, key) + case "blobPathPrefix": + err = unpopulate(val, "BlobPathPrefix", &b.BlobPathPrefix) + delete(rawMsg, key) + case "container": + err = unpopulate(val, "Container", &b.Container) + delete(rawMsg, key) + case "dateFormat": + err = unpopulate(val, "DateFormat", &b.DateFormat) + delete(rawMsg, key) + case "pathPattern": + err = unpopulate(val, "PathPattern", &b.PathPattern) + delete(rawMsg, key) + case "storageAccounts": + err = unpopulate(val, "StorageAccounts", &b.StorageAccounts) + delete(rawMsg, key) + case "timeFormat": + err = unpopulate(val, "TimeFormat", &b.TimeFormat) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BlobReferenceInputDataSource. +func (b BlobReferenceInputDataSource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", b.Properties) + objectMap["type"] = "Microsoft.Storage/Blob" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BlobReferenceInputDataSource. +func (b *BlobReferenceInputDataSource) 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", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &b.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &b.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BlobReferenceInputDataSourceProperties. +func (b BlobReferenceInputDataSourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "authenticationMode", b.AuthenticationMode) + populate(objectMap, "container", b.Container) + populate(objectMap, "dateFormat", b.DateFormat) + populate(objectMap, "pathPattern", b.PathPattern) + populate(objectMap, "storageAccounts", b.StorageAccounts) + populate(objectMap, "timeFormat", b.TimeFormat) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BlobReferenceInputDataSourceProperties. +func (b *BlobReferenceInputDataSourceProperties) 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", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "authenticationMode": + err = unpopulate(val, "AuthenticationMode", &b.AuthenticationMode) + delete(rawMsg, key) + case "container": + err = unpopulate(val, "Container", &b.Container) + delete(rawMsg, key) + case "dateFormat": + err = unpopulate(val, "DateFormat", &b.DateFormat) + delete(rawMsg, key) + case "pathPattern": + err = unpopulate(val, "PathPattern", &b.PathPattern) + delete(rawMsg, key) + case "storageAccounts": + err = unpopulate(val, "StorageAccounts", &b.StorageAccounts) + delete(rawMsg, key) + case "timeFormat": + err = unpopulate(val, "TimeFormat", &b.TimeFormat) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BlobStreamInputDataSource. +func (b BlobStreamInputDataSource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", b.Properties) + objectMap["type"] = "Microsoft.Storage/Blob" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BlobStreamInputDataSource. +func (b *BlobStreamInputDataSource) 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", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &b.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &b.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BlobStreamInputDataSourceProperties. +func (b BlobStreamInputDataSourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "authenticationMode", b.AuthenticationMode) + populate(objectMap, "container", b.Container) + populate(objectMap, "dateFormat", b.DateFormat) + populate(objectMap, "pathPattern", b.PathPattern) + populate(objectMap, "sourcePartitionCount", b.SourcePartitionCount) + populate(objectMap, "storageAccounts", b.StorageAccounts) + populate(objectMap, "timeFormat", b.TimeFormat) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BlobStreamInputDataSourceProperties. +func (b *BlobStreamInputDataSourceProperties) 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", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "authenticationMode": + err = unpopulate(val, "AuthenticationMode", &b.AuthenticationMode) + delete(rawMsg, key) + case "container": + err = unpopulate(val, "Container", &b.Container) + delete(rawMsg, key) + case "dateFormat": + err = unpopulate(val, "DateFormat", &b.DateFormat) + delete(rawMsg, key) + case "pathPattern": + err = unpopulate(val, "PathPattern", &b.PathPattern) + delete(rawMsg, key) + case "sourcePartitionCount": + err = unpopulate(val, "SourcePartitionCount", &b.SourcePartitionCount) + delete(rawMsg, key) + case "storageAccounts": + err = unpopulate(val, "StorageAccounts", &b.StorageAccounts) + delete(rawMsg, key) + case "timeFormat": + err = unpopulate(val, "TimeFormat", &b.TimeFormat) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CSVSerialization. +func (c CSVSerialization) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", c.Properties) + objectMap["type"] = EventSerializationTypeCSV + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CSVSerialization. +func (c *CSVSerialization) 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 "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + 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 CSVSerializationProperties. +func (c CSVSerializationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "encoding", c.Encoding) + populate(objectMap, "fieldDelimiter", c.FieldDelimiter) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CSVSerializationProperties. +func (c *CSVSerializationProperties) 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 "encoding": + err = unpopulate(val, "Encoding", &c.Encoding) + delete(rawMsg, key) + case "fieldDelimiter": + err = unpopulate(val, "FieldDelimiter", &c.FieldDelimiter) + 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 Cluster. +func (c Cluster) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", c.Etag) + populate(objectMap, "id", c.ID) + populate(objectMap, "location", c.Location) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "sku", c.SKU) + populate(objectMap, "tags", c.Tags) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Cluster. +func (c *Cluster) 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 "etag": + err = unpopulate(val, "Etag", &c.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &c.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &c.SKU) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &c.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + 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 ClusterInfo. +func (c ClusterInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", c.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterInfo. +func (c *ClusterInfo) 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 "id": + err = unpopulate(val, "ID", &c.ID) + 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 ClusterJob. +func (c ClusterJob) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", c.ID) + populate(objectMap, "jobState", c.JobState) + populate(objectMap, "streamingUnits", c.StreamingUnits) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterJob. +func (c *ClusterJob) 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 "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "jobState": + err = unpopulate(val, "JobState", &c.JobState) + delete(rawMsg, key) + case "streamingUnits": + err = unpopulate(val, "StreamingUnits", &c.StreamingUnits) + 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 ClusterJobListResult. +func (c ClusterJobListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterJobListResult. +func (c *ClusterJobListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) + 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 ClusterListResult. +func (c ClusterListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterListResult. +func (c *ClusterListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) + 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 ClusterProperties. +func (c ClusterProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "capacityAllocated", c.CapacityAllocated) + populate(objectMap, "capacityAssigned", c.CapacityAssigned) + populate(objectMap, "clusterId", c.ClusterID) + populateTimeRFC3339(objectMap, "createdDate", c.CreatedDate) + populate(objectMap, "provisioningState", c.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterProperties. +func (c *ClusterProperties) 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 "capacityAllocated": + err = unpopulate(val, "CapacityAllocated", &c.CapacityAllocated) + delete(rawMsg, key) + case "capacityAssigned": + err = unpopulate(val, "CapacityAssigned", &c.CapacityAssigned) + delete(rawMsg, key) + case "clusterId": + err = unpopulate(val, "ClusterID", &c.ClusterID) + delete(rawMsg, key) + case "createdDate": + err = unpopulateTimeRFC3339(val, "CreatedDate", &c.CreatedDate) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + 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 ClusterSKU. +func (c ClusterSKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "capacity", c.Capacity) + populate(objectMap, "name", c.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterSKU. +func (c *ClusterSKU) 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 "capacity": + err = unpopulate(val, "Capacity", &c.Capacity) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + 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 Compression. +func (c Compression) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Compression. +func (c *Compression) 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 "type": + err = unpopulate(val, "Type", &c.Type) + 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 DiagnosticCondition. +func (d DiagnosticCondition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "code", d.Code) + populate(objectMap, "message", d.Message) + populate(objectMap, "since", d.Since) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticCondition. +func (d *DiagnosticCondition) 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 "code": + err = unpopulate(val, "Code", &d.Code) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &d.Message) + delete(rawMsg, key) + case "since": + err = unpopulate(val, "Since", &d.Since) + 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 Diagnostics. +func (d Diagnostics) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "conditions", d.Conditions) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Diagnostics. +func (d *Diagnostics) 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 "conditions": + err = unpopulate(val, "Conditions", &d.Conditions) + 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 DocumentDbOutputDataSource. +func (d DocumentDbOutputDataSource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", d.Properties) + objectMap["type"] = "Microsoft.Storage/DocumentDB" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DocumentDbOutputDataSource. +func (d *DocumentDbOutputDataSource) 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 "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 DocumentDbOutputDataSourceProperties. +func (d DocumentDbOutputDataSourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "accountId", d.AccountID) + populate(objectMap, "accountKey", d.AccountKey) + populate(objectMap, "collectionNamePattern", d.CollectionNamePattern) + populate(objectMap, "database", d.Database) + populate(objectMap, "documentId", d.DocumentID) + populate(objectMap, "partitionKey", d.PartitionKey) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DocumentDbOutputDataSourceProperties. +func (d *DocumentDbOutputDataSourceProperties) 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 "accountId": + err = unpopulate(val, "AccountID", &d.AccountID) + delete(rawMsg, key) + case "accountKey": + err = unpopulate(val, "AccountKey", &d.AccountKey) + delete(rawMsg, key) + case "collectionNamePattern": + err = unpopulate(val, "CollectionNamePattern", &d.CollectionNamePattern) + delete(rawMsg, key) + case "database": + err = unpopulate(val, "Database", &d.Database) + delete(rawMsg, key) + case "documentId": + err = unpopulate(val, "DocumentID", &d.DocumentID) + delete(rawMsg, key) + case "partitionKey": + err = unpopulate(val, "PartitionKey", &d.PartitionKey) + 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, "error", e.Error) + 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 "error": + err = unpopulate(val, "Error", &e.Error) + 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, "code", e.Code) + populate(objectMap, "message", e.Message) + populate(objectMap, "target", e.Target) + 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 "code": + err = unpopulate(val, "Code", &e.Code) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &e.Message) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &e.Target) + 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 ErrorError. +func (e ErrorError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "code", e.Code) + populate(objectMap, "details", e.Details) + populate(objectMap, "message", e.Message) + populate(objectMap, "target", e.Target) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorError. +func (e *ErrorError) 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 "details": + err = unpopulate(val, "Details", &e.Details) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &e.Message) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &e.Target) + 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 ErrorResponse. +func (e ErrorResponse) 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 ErrorResponse. +func (e *ErrorResponse) 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 EventHubDataSourceProperties. +func (e EventHubDataSourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "authenticationMode", e.AuthenticationMode) + populate(objectMap, "eventHubName", e.EventHubName) + populate(objectMap, "serviceBusNamespace", e.ServiceBusNamespace) + populate(objectMap, "sharedAccessPolicyKey", e.SharedAccessPolicyKey) + populate(objectMap, "sharedAccessPolicyName", e.SharedAccessPolicyName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EventHubDataSourceProperties. +func (e *EventHubDataSourceProperties) 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 "authenticationMode": + err = unpopulate(val, "AuthenticationMode", &e.AuthenticationMode) + delete(rawMsg, key) + case "eventHubName": + err = unpopulate(val, "EventHubName", &e.EventHubName) + delete(rawMsg, key) + case "serviceBusNamespace": + err = unpopulate(val, "ServiceBusNamespace", &e.ServiceBusNamespace) + delete(rawMsg, key) + case "sharedAccessPolicyKey": + err = unpopulate(val, "SharedAccessPolicyKey", &e.SharedAccessPolicyKey) + delete(rawMsg, key) + case "sharedAccessPolicyName": + err = unpopulate(val, "SharedAccessPolicyName", &e.SharedAccessPolicyName) + 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 EventHubOutputDataSource. +func (e EventHubOutputDataSource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", e.Properties) + objectMap["type"] = "Microsoft.ServiceBus/EventHub" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EventHubOutputDataSource. +func (e *EventHubOutputDataSource) 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 "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + 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 EventHubOutputDataSourceProperties. +func (e EventHubOutputDataSourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "authenticationMode", e.AuthenticationMode) + populate(objectMap, "eventHubName", e.EventHubName) + populate(objectMap, "partitionKey", e.PartitionKey) + populate(objectMap, "propertyColumns", e.PropertyColumns) + populate(objectMap, "serviceBusNamespace", e.ServiceBusNamespace) + populate(objectMap, "sharedAccessPolicyKey", e.SharedAccessPolicyKey) + populate(objectMap, "sharedAccessPolicyName", e.SharedAccessPolicyName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EventHubOutputDataSourceProperties. +func (e *EventHubOutputDataSourceProperties) 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 "authenticationMode": + err = unpopulate(val, "AuthenticationMode", &e.AuthenticationMode) + delete(rawMsg, key) + case "eventHubName": + err = unpopulate(val, "EventHubName", &e.EventHubName) + delete(rawMsg, key) + case "partitionKey": + err = unpopulate(val, "PartitionKey", &e.PartitionKey) + delete(rawMsg, key) + case "propertyColumns": + err = unpopulate(val, "PropertyColumns", &e.PropertyColumns) + delete(rawMsg, key) + case "serviceBusNamespace": + err = unpopulate(val, "ServiceBusNamespace", &e.ServiceBusNamespace) + delete(rawMsg, key) + case "sharedAccessPolicyKey": + err = unpopulate(val, "SharedAccessPolicyKey", &e.SharedAccessPolicyKey) + delete(rawMsg, key) + case "sharedAccessPolicyName": + err = unpopulate(val, "SharedAccessPolicyName", &e.SharedAccessPolicyName) + 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 EventHubStreamInputDataSource. +func (e EventHubStreamInputDataSource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", e.Properties) + objectMap["type"] = "Microsoft.ServiceBus/EventHub" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EventHubStreamInputDataSource. +func (e *EventHubStreamInputDataSource) 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 "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + 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 EventHubStreamInputDataSourceProperties. +func (e EventHubStreamInputDataSourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "authenticationMode", e.AuthenticationMode) + populate(objectMap, "consumerGroupName", e.ConsumerGroupName) + populate(objectMap, "eventHubName", e.EventHubName) + populate(objectMap, "serviceBusNamespace", e.ServiceBusNamespace) + populate(objectMap, "sharedAccessPolicyKey", e.SharedAccessPolicyKey) + populate(objectMap, "sharedAccessPolicyName", e.SharedAccessPolicyName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EventHubStreamInputDataSourceProperties. +func (e *EventHubStreamInputDataSourceProperties) 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 "authenticationMode": + err = unpopulate(val, "AuthenticationMode", &e.AuthenticationMode) + delete(rawMsg, key) + case "consumerGroupName": + err = unpopulate(val, "ConsumerGroupName", &e.ConsumerGroupName) + delete(rawMsg, key) + case "eventHubName": + err = unpopulate(val, "EventHubName", &e.EventHubName) + delete(rawMsg, key) + case "serviceBusNamespace": + err = unpopulate(val, "ServiceBusNamespace", &e.ServiceBusNamespace) + delete(rawMsg, key) + case "sharedAccessPolicyKey": + err = unpopulate(val, "SharedAccessPolicyKey", &e.SharedAccessPolicyKey) + delete(rawMsg, key) + case "sharedAccessPolicyName": + err = unpopulate(val, "SharedAccessPolicyName", &e.SharedAccessPolicyName) + 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 EventHubV2OutputDataSource. +func (e EventHubV2OutputDataSource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", e.Properties) + objectMap["type"] = "Microsoft.EventHub/EventHub" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EventHubV2OutputDataSource. +func (e *EventHubV2OutputDataSource) 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 "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + 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 EventHubV2StreamInputDataSource. +func (e EventHubV2StreamInputDataSource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", e.Properties) + objectMap["type"] = "Microsoft.EventHub/EventHub" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EventHubV2StreamInputDataSource. +func (e *EventHubV2StreamInputDataSource) 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 "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + 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 FileReferenceInputDataSource. +func (f FileReferenceInputDataSource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", f.Properties) + objectMap["type"] = "File" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FileReferenceInputDataSource. +func (f *FileReferenceInputDataSource) 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", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &f.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &f.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FileReferenceInputDataSourceProperties. +func (f FileReferenceInputDataSourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "path", f.Path) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FileReferenceInputDataSourceProperties. +func (f *FileReferenceInputDataSourceProperties) 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", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "path": + err = unpopulate(val, "Path", &f.Path) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Function. +func (f Function) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", f.ID) + populate(objectMap, "name", f.Name) + populate(objectMap, "properties", f.Properties) + populate(objectMap, "type", f.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Function. +func (f *Function) 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", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &f.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &f.Name) + delete(rawMsg, key) + case "properties": + f.Properties, err = unmarshalFunctionPropertiesClassification(val) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &f.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FunctionBinding. +func (f FunctionBinding) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["type"] = f.Type + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FunctionBinding. +func (f *FunctionBinding) 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", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "type": + err = unpopulate(val, "Type", &f.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FunctionConfiguration. +func (f FunctionConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "binding", f.Binding) + populate(objectMap, "inputs", f.Inputs) + populate(objectMap, "output", f.Output) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FunctionConfiguration. +func (f *FunctionConfiguration) 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", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "binding": + f.Binding, err = unmarshalFunctionBindingClassification(val) + delete(rawMsg, key) + case "inputs": + err = unpopulate(val, "Inputs", &f.Inputs) + delete(rawMsg, key) + case "output": + err = unpopulate(val, "Output", &f.Output) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FunctionInput. +func (f FunctionInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "dataType", f.DataType) + populate(objectMap, "isConfigurationParameter", f.IsConfigurationParameter) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FunctionInput. +func (f *FunctionInput) 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", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dataType": + err = unpopulate(val, "DataType", &f.DataType) + delete(rawMsg, key) + case "isConfigurationParameter": + err = unpopulate(val, "IsConfigurationParameter", &f.IsConfigurationParameter) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FunctionListResult. +func (f FunctionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", f.NextLink) + populate(objectMap, "value", f.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FunctionListResult. +func (f *FunctionListResult) 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", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &f.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &f.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FunctionOutput. +func (f FunctionOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "dataType", f.DataType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FunctionOutput. +func (f *FunctionOutput) 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", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dataType": + err = unpopulate(val, "DataType", &f.DataType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FunctionProperties. +func (f FunctionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", f.Etag) + populate(objectMap, "properties", f.Properties) + objectMap["type"] = f.Type + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FunctionProperties. +func (f *FunctionProperties) 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", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &f.Etag) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &f.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &f.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FunctionRetrieveDefaultDefinitionParameters. +func (f FunctionRetrieveDefaultDefinitionParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["bindingType"] = f.BindingType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FunctionRetrieveDefaultDefinitionParameters. +func (f *FunctionRetrieveDefaultDefinitionParameters) 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", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "bindingType": + err = unpopulate(val, "BindingType", &f.BindingType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GatewayMessageBusOutputDataSource. +func (g GatewayMessageBusOutputDataSource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", g.Properties) + objectMap["type"] = "GatewayMessageBus" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayMessageBusOutputDataSource. +func (g *GatewayMessageBusOutputDataSource) 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", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &g.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &g.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GatewayMessageBusOutputDataSourceProperties. +func (g GatewayMessageBusOutputDataSourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "topic", g.Topic) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayMessageBusOutputDataSourceProperties. +func (g *GatewayMessageBusOutputDataSourceProperties) 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", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "topic": + err = unpopulate(val, "Topic", &g.Topic) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GatewayMessageBusSourceProperties. +func (g GatewayMessageBusSourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "topic", g.Topic) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayMessageBusSourceProperties. +func (g *GatewayMessageBusSourceProperties) 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", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "topic": + err = unpopulate(val, "Topic", &g.Topic) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GatewayMessageBusStreamInputDataSource. +func (g GatewayMessageBusStreamInputDataSource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", g.Properties) + objectMap["type"] = "GatewayMessageBus" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayMessageBusStreamInputDataSource. +func (g *GatewayMessageBusStreamInputDataSource) 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", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &g.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &g.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GatewayMessageBusStreamInputDataSourceProperties. +func (g GatewayMessageBusStreamInputDataSourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "topic", g.Topic) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayMessageBusStreamInputDataSourceProperties. +func (g *GatewayMessageBusStreamInputDataSourceProperties) 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", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "topic": + err = unpopulate(val, "Topic", &g.Topic) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Identity. +func (i Identity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "principalId", i.PrincipalID) + populate(objectMap, "tenantId", i.TenantID) + populate(objectMap, "type", i.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Identity. +func (i *Identity) 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", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "principalId": + err = unpopulate(val, "PrincipalID", &i.PrincipalID) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &i.TenantID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Input. +func (i Input) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", i.ID) + populate(objectMap, "name", i.Name) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "type", i.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Input. +func (i *Input) 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", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &i.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) + case "properties": + i.Properties, err = unmarshalInputPropertiesClassification(val) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type InputListResult. +func (i InputListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", i.NextLink) + populate(objectMap, "value", i.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InputListResult. +func (i *InputListResult) 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", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &i.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &i.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type InputProperties. +func (i InputProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "compression", i.Compression) + populate(objectMap, "diagnostics", i.Diagnostics) + populate(objectMap, "etag", i.Etag) + populate(objectMap, "partitionKey", i.PartitionKey) + populate(objectMap, "serialization", i.Serialization) + objectMap["type"] = i.Type + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InputProperties. +func (i *InputProperties) 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", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "compression": + err = unpopulate(val, "Compression", &i.Compression) + delete(rawMsg, key) + case "diagnostics": + err = unpopulate(val, "Diagnostics", &i.Diagnostics) + delete(rawMsg, key) + case "etag": + err = unpopulate(val, "Etag", &i.Etag) + delete(rawMsg, key) + case "partitionKey": + err = unpopulate(val, "PartitionKey", &i.PartitionKey) + delete(rawMsg, key) + case "serialization": + i.Serialization, err = unmarshalSerializationClassification(val) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IoTHubStreamInputDataSource. +func (i IoTHubStreamInputDataSource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", i.Properties) + objectMap["type"] = "Microsoft.Devices/IotHubs" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IoTHubStreamInputDataSource. +func (i *IoTHubStreamInputDataSource) 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", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &i.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IoTHubStreamInputDataSourceProperties. +func (i IoTHubStreamInputDataSourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "consumerGroupName", i.ConsumerGroupName) + populate(objectMap, "endpoint", i.Endpoint) + populate(objectMap, "iotHubNamespace", i.IotHubNamespace) + populate(objectMap, "sharedAccessPolicyKey", i.SharedAccessPolicyKey) + populate(objectMap, "sharedAccessPolicyName", i.SharedAccessPolicyName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IoTHubStreamInputDataSourceProperties. +func (i *IoTHubStreamInputDataSourceProperties) 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", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "consumerGroupName": + err = unpopulate(val, "ConsumerGroupName", &i.ConsumerGroupName) + delete(rawMsg, key) + case "endpoint": + err = unpopulate(val, "Endpoint", &i.Endpoint) + delete(rawMsg, key) + case "iotHubNamespace": + err = unpopulate(val, "IotHubNamespace", &i.IotHubNamespace) + delete(rawMsg, key) + case "sharedAccessPolicyKey": + err = unpopulate(val, "SharedAccessPolicyKey", &i.SharedAccessPolicyKey) + delete(rawMsg, key) + case "sharedAccessPolicyName": + err = unpopulate(val, "SharedAccessPolicyName", &i.SharedAccessPolicyName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JSONSerialization. +func (j JSONSerialization) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", j.Properties) + objectMap["type"] = EventSerializationTypeJSON + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JSONSerialization. +func (j *JSONSerialization) 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 "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 JSONSerializationProperties. +func (j JSONSerializationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "encoding", j.Encoding) + populate(objectMap, "format", j.Format) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JSONSerializationProperties. +func (j *JSONSerializationProperties) 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 "encoding": + err = unpopulate(val, "Encoding", &j.Encoding) + delete(rawMsg, key) + case "format": + err = unpopulate(val, "Format", &j.Format) + 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 JavaScriptFunctionBinding. +func (j JavaScriptFunctionBinding) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", j.Properties) + objectMap["type"] = "Microsoft.StreamAnalytics/JavascriptUdf" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JavaScriptFunctionBinding. +func (j *JavaScriptFunctionBinding) 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 "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 JavaScriptFunctionBindingProperties. +func (j JavaScriptFunctionBindingProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "script", j.Script) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JavaScriptFunctionBindingProperties. +func (j *JavaScriptFunctionBindingProperties) 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 "script": + err = unpopulate(val, "Script", &j.Script) + 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 JavaScriptFunctionBindingRetrievalProperties. +func (j JavaScriptFunctionBindingRetrievalProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "script", j.Script) + objectMap["udfType"] = "Scalar" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JavaScriptFunctionBindingRetrievalProperties. +func (j *JavaScriptFunctionBindingRetrievalProperties) 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 "script": + err = unpopulate(val, "Script", &j.Script) + delete(rawMsg, key) + case "udfType": + err = unpopulate(val, "UdfType", &j.UdfType) + 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 JavaScriptFunctionRetrieveDefaultDefinitionParameters. +func (j JavaScriptFunctionRetrieveDefaultDefinitionParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "bindingRetrievalProperties", j.BindingRetrievalProperties) + objectMap["bindingType"] = "Microsoft.StreamAnalytics/JavascriptUdf" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JavaScriptFunctionRetrieveDefaultDefinitionParameters. +func (j *JavaScriptFunctionRetrieveDefaultDefinitionParameters) 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 "bindingRetrievalProperties": + err = unpopulate(val, "BindingRetrievalProperties", &j.BindingRetrievalProperties) + delete(rawMsg, key) + case "bindingType": + err = unpopulate(val, "BindingType", &j.BindingType) + 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 JobStorageAccount. +func (j JobStorageAccount) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "accountKey", j.AccountKey) + populate(objectMap, "accountName", j.AccountName) + populate(objectMap, "authenticationMode", j.AuthenticationMode) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobStorageAccount. +func (j *JobStorageAccount) 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 "accountKey": + err = unpopulate(val, "AccountKey", &j.AccountKey) + delete(rawMsg, key) + case "accountName": + err = unpopulate(val, "AccountName", &j.AccountName) + delete(rawMsg, key) + case "authenticationMode": + err = unpopulate(val, "AuthenticationMode", &j.AuthenticationMode) + 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 OAuthBasedDataSourceProperties. +func (o OAuthBasedDataSourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "refreshToken", o.RefreshToken) + populate(objectMap, "tokenUserDisplayName", o.TokenUserDisplayName) + populate(objectMap, "tokenUserPrincipalName", o.TokenUserPrincipalName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OAuthBasedDataSourceProperties. +func (o *OAuthBasedDataSourceProperties) 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "refreshToken": + err = unpopulate(val, "RefreshToken", &o.RefreshToken) + delete(rawMsg, key) + case "tokenUserDisplayName": + err = unpopulate(val, "TokenUserDisplayName", &o.TokenUserDisplayName) + delete(rawMsg, key) + case "tokenUserPrincipalName": + err = unpopulate(val, "TokenUserPrincipalName", &o.TokenUserPrincipalName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "display", o.Display) + populate(objectMap, "isDataAction", o.IsDataAction) + populate(objectMap, "name", o.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Operation. +func (o *Operation) 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "display": + err = unpopulate(val, "Display", &o.Display) + delete(rawMsg, key) + case "isDataAction": + err = unpopulate(val, "IsDataAction", &o.IsDataAction) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationDisplay. +func (o OperationDisplay) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", o.Description) + populate(objectMap, "operation", o.Operation) + populate(objectMap, "provider", o.Provider) + populate(objectMap, "resource", o.Resource) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay. +func (o *OperationDisplay) 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &o.Description) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &o.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &o.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &o.Resource) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationListResult. +func (o OperationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult. +func (o *OperationListResult) 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &o.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Output. +func (o Output) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", o.ID) + populate(objectMap, "name", o.Name) + populate(objectMap, "properties", o.Properties) + populate(objectMap, "type", o.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Output. +func (o *Output) 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &o.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &o.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OutputDataSource. +func (o OutputDataSource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["type"] = o.Type + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OutputDataSource. +func (o *OutputDataSource) 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "type": + err = unpopulate(val, "Type", &o.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OutputListResult. +func (o OutputListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OutputListResult. +func (o *OutputListResult) 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &o.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OutputProperties. +func (o OutputProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "datasource", o.Datasource) + populate(objectMap, "diagnostics", o.Diagnostics) + populate(objectMap, "etag", o.Etag) + populate(objectMap, "serialization", o.Serialization) + populate(objectMap, "sizeWindow", o.SizeWindow) + populate(objectMap, "timeWindow", o.TimeWindow) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OutputProperties. +func (o *OutputProperties) 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "datasource": + o.Datasource, err = unmarshalOutputDataSourceClassification(val) + delete(rawMsg, key) + case "diagnostics": + err = unpopulate(val, "Diagnostics", &o.Diagnostics) + delete(rawMsg, key) + case "etag": + err = unpopulate(val, "Etag", &o.Etag) + delete(rawMsg, key) + case "serialization": + o.Serialization, err = unmarshalSerializationClassification(val) + delete(rawMsg, key) + case "sizeWindow": + err = unpopulate(val, "SizeWindow", &o.SizeWindow) + delete(rawMsg, key) + case "timeWindow": + err = unpopulate(val, "TimeWindow", &o.TimeWindow) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ParquetSerialization. +func (p ParquetSerialization) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", &p.Properties) + objectMap["type"] = EventSerializationTypeParquet + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ParquetSerialization. +func (p *ParquetSerialization) 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 "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 PowerBIOutputDataSource. +func (p PowerBIOutputDataSource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", p.Properties) + objectMap["type"] = "PowerBI" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PowerBIOutputDataSource. +func (p *PowerBIOutputDataSource) 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 "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 PowerBIOutputDataSourceProperties. +func (p PowerBIOutputDataSourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "authenticationMode", p.AuthenticationMode) + populate(objectMap, "dataset", p.Dataset) + populate(objectMap, "groupId", p.GroupID) + populate(objectMap, "groupName", p.GroupName) + populate(objectMap, "refreshToken", p.RefreshToken) + populate(objectMap, "table", p.Table) + populate(objectMap, "tokenUserDisplayName", p.TokenUserDisplayName) + populate(objectMap, "tokenUserPrincipalName", p.TokenUserPrincipalName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PowerBIOutputDataSourceProperties. +func (p *PowerBIOutputDataSourceProperties) 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 "authenticationMode": + err = unpopulate(val, "AuthenticationMode", &p.AuthenticationMode) + delete(rawMsg, key) + case "dataset": + err = unpopulate(val, "Dataset", &p.Dataset) + delete(rawMsg, key) + case "groupId": + err = unpopulate(val, "GroupID", &p.GroupID) + delete(rawMsg, key) + case "groupName": + err = unpopulate(val, "GroupName", &p.GroupName) + delete(rawMsg, key) + case "refreshToken": + err = unpopulate(val, "RefreshToken", &p.RefreshToken) + delete(rawMsg, key) + case "table": + err = unpopulate(val, "Table", &p.Table) + delete(rawMsg, key) + case "tokenUserDisplayName": + err = unpopulate(val, "TokenUserDisplayName", &p.TokenUserDisplayName) + delete(rawMsg, key) + case "tokenUserPrincipalName": + err = unpopulate(val, "TokenUserPrincipalName", &p.TokenUserPrincipalName) + 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 PrivateEndpoint. +func (p PrivateEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", p.Etag) + 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 PrivateEndpoint. +func (p *PrivateEndpoint) 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 "etag": + err = unpopulate(val, "Etag", &p.Etag) + delete(rawMsg, 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 PrivateEndpointListResult. +func (p PrivateEndpointListResult) 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 PrivateEndpointListResult. +func (p *PrivateEndpointListResult) 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 PrivateEndpointProperties. +func (p PrivateEndpointProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "createdDate", p.CreatedDate) + populate(objectMap, "manualPrivateLinkServiceConnections", p.ManualPrivateLinkServiceConnections) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointProperties. +func (p *PrivateEndpointProperties) 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 "createdDate": + err = unpopulate(val, "CreatedDate", &p.CreatedDate) + delete(rawMsg, key) + case "manualPrivateLinkServiceConnections": + err = unpopulate(val, "ManualPrivateLinkServiceConnections", &p.ManualPrivateLinkServiceConnections) + 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 PrivateLinkConnectionState. +func (p PrivateLinkConnectionState) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "actionsRequired", p.ActionsRequired) + populate(objectMap, "description", p.Description) + populate(objectMap, "status", p.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkConnectionState. +func (p *PrivateLinkConnectionState) 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 "actionsRequired": + err = unpopulate(val, "ActionsRequired", &p.ActionsRequired) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &p.Description) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &p.Status) + 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 PrivateLinkServiceConnection. +func (p PrivateLinkServiceConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", p.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceConnection. +func (p *PrivateLinkServiceConnection) 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 "properties": + err = unpopulate(val, "Properties", &p.Properties) + 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 PrivateLinkServiceConnectionProperties. +func (p PrivateLinkServiceConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "groupIds", p.GroupIDs) + populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) + populate(objectMap, "privateLinkServiceId", p.PrivateLinkServiceID) + populate(objectMap, "requestMessage", p.RequestMessage) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceConnectionProperties. +func (p *PrivateLinkServiceConnectionProperties) 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 "groupIds": + err = unpopulate(val, "GroupIDs", &p.GroupIDs) + delete(rawMsg, key) + case "privateLinkServiceConnectionState": + err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState) + delete(rawMsg, key) + case "privateLinkServiceId": + err = unpopulate(val, "PrivateLinkServiceID", &p.PrivateLinkServiceID) + delete(rawMsg, key) + case "requestMessage": + err = unpopulate(val, "RequestMessage", &p.RequestMessage) + 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 ProxyResource. +func (p ProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource. +func (p *ProxyResource) 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 "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 ReferenceInputDataSource. +func (r ReferenceInputDataSource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["type"] = r.Type + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ReferenceInputDataSource. +func (r *ReferenceInputDataSource) 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 "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 ReferenceInputProperties. +func (r ReferenceInputProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "compression", r.Compression) + populate(objectMap, "datasource", r.Datasource) + populate(objectMap, "diagnostics", r.Diagnostics) + populate(objectMap, "etag", r.Etag) + populate(objectMap, "partitionKey", r.PartitionKey) + populate(objectMap, "serialization", r.Serialization) + objectMap["type"] = "Reference" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ReferenceInputProperties. +func (r *ReferenceInputProperties) 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 "compression": + err = unpopulate(val, "Compression", &r.Compression) + delete(rawMsg, key) + case "datasource": + r.Datasource, err = unmarshalReferenceInputDataSourceClassification(val) + delete(rawMsg, key) + case "diagnostics": + err = unpopulate(val, "Diagnostics", &r.Diagnostics) + delete(rawMsg, key) + case "etag": + err = unpopulate(val, "Etag", &r.Etag) + delete(rawMsg, key) + case "partitionKey": + err = unpopulate(val, "PartitionKey", &r.PartitionKey) + delete(rawMsg, key) + case "serialization": + r.Serialization, err = unmarshalSerializationClassification(val) + 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 Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + 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 "name": + err = unpopulate(val, "Name", &r.Name) + 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 ResourceTestStatus. +func (r ResourceTestStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "error", r.Error) + populate(objectMap, "status", r.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceTestStatus. +func (r *ResourceTestStatus) 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 "error": + err = unpopulate(val, "Error", &r.Error) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &r.Status) + 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) + 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) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ScalarFunctionProperties. +func (s ScalarFunctionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", s.Etag) + populate(objectMap, "properties", s.Properties) + objectMap["type"] = "Scalar" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ScalarFunctionProperties. +func (s *ScalarFunctionProperties) 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 "etag": + err = unpopulate(val, "Etag", &s.Etag) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + 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 ScaleStreamingJobParameters. +func (s ScaleStreamingJobParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "streamingUnits", s.StreamingUnits) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ScaleStreamingJobParameters. +func (s *ScaleStreamingJobParameters) 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 "streamingUnits": + err = unpopulate(val, "StreamingUnits", &s.StreamingUnits) + 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 Serialization. +func (s Serialization) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["type"] = s.Type + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Serialization. +func (s *Serialization) 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 "type": + err = unpopulate(val, "Type", &s.Type) + 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 ServiceBusDataSourceProperties. +func (s ServiceBusDataSourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "authenticationMode", s.AuthenticationMode) + populate(objectMap, "serviceBusNamespace", s.ServiceBusNamespace) + populate(objectMap, "sharedAccessPolicyKey", s.SharedAccessPolicyKey) + populate(objectMap, "sharedAccessPolicyName", s.SharedAccessPolicyName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceBusDataSourceProperties. +func (s *ServiceBusDataSourceProperties) 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 "authenticationMode": + err = unpopulate(val, "AuthenticationMode", &s.AuthenticationMode) + delete(rawMsg, key) + case "serviceBusNamespace": + err = unpopulate(val, "ServiceBusNamespace", &s.ServiceBusNamespace) + delete(rawMsg, key) + case "sharedAccessPolicyKey": + err = unpopulate(val, "SharedAccessPolicyKey", &s.SharedAccessPolicyKey) + delete(rawMsg, key) + case "sharedAccessPolicyName": + err = unpopulate(val, "SharedAccessPolicyName", &s.SharedAccessPolicyName) + 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 ServiceBusQueueOutputDataSource. +func (s ServiceBusQueueOutputDataSource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", s.Properties) + objectMap["type"] = "Microsoft.ServiceBus/Queue" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceBusQueueOutputDataSource. +func (s *ServiceBusQueueOutputDataSource) 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 "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + 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 ServiceBusQueueOutputDataSourceProperties. +func (s ServiceBusQueueOutputDataSourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "authenticationMode", s.AuthenticationMode) + populate(objectMap, "propertyColumns", s.PropertyColumns) + populate(objectMap, "queueName", s.QueueName) + populate(objectMap, "serviceBusNamespace", s.ServiceBusNamespace) + populate(objectMap, "sharedAccessPolicyKey", s.SharedAccessPolicyKey) + populate(objectMap, "sharedAccessPolicyName", s.SharedAccessPolicyName) + populate(objectMap, "systemPropertyColumns", &s.SystemPropertyColumns) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceBusQueueOutputDataSourceProperties. +func (s *ServiceBusQueueOutputDataSourceProperties) 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 "authenticationMode": + err = unpopulate(val, "AuthenticationMode", &s.AuthenticationMode) + delete(rawMsg, key) + case "propertyColumns": + err = unpopulate(val, "PropertyColumns", &s.PropertyColumns) + delete(rawMsg, key) + case "queueName": + err = unpopulate(val, "QueueName", &s.QueueName) + delete(rawMsg, key) + case "serviceBusNamespace": + err = unpopulate(val, "ServiceBusNamespace", &s.ServiceBusNamespace) + delete(rawMsg, key) + case "sharedAccessPolicyKey": + err = unpopulate(val, "SharedAccessPolicyKey", &s.SharedAccessPolicyKey) + delete(rawMsg, key) + case "sharedAccessPolicyName": + err = unpopulate(val, "SharedAccessPolicyName", &s.SharedAccessPolicyName) + delete(rawMsg, key) + case "systemPropertyColumns": + err = unpopulate(val, "SystemPropertyColumns", &s.SystemPropertyColumns) + 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 ServiceBusTopicOutputDataSource. +func (s ServiceBusTopicOutputDataSource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", s.Properties) + objectMap["type"] = "Microsoft.ServiceBus/Topic" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceBusTopicOutputDataSource. +func (s *ServiceBusTopicOutputDataSource) 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 "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + 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 ServiceBusTopicOutputDataSourceProperties. +func (s ServiceBusTopicOutputDataSourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "authenticationMode", s.AuthenticationMode) + populate(objectMap, "propertyColumns", s.PropertyColumns) + populate(objectMap, "serviceBusNamespace", s.ServiceBusNamespace) + populate(objectMap, "sharedAccessPolicyKey", s.SharedAccessPolicyKey) + populate(objectMap, "sharedAccessPolicyName", s.SharedAccessPolicyName) + populate(objectMap, "systemPropertyColumns", s.SystemPropertyColumns) + populate(objectMap, "topicName", s.TopicName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceBusTopicOutputDataSourceProperties. +func (s *ServiceBusTopicOutputDataSourceProperties) 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 "authenticationMode": + err = unpopulate(val, "AuthenticationMode", &s.AuthenticationMode) + delete(rawMsg, key) + case "propertyColumns": + err = unpopulate(val, "PropertyColumns", &s.PropertyColumns) + delete(rawMsg, key) + case "serviceBusNamespace": + err = unpopulate(val, "ServiceBusNamespace", &s.ServiceBusNamespace) + delete(rawMsg, key) + case "sharedAccessPolicyKey": + err = unpopulate(val, "SharedAccessPolicyKey", &s.SharedAccessPolicyKey) + delete(rawMsg, key) + case "sharedAccessPolicyName": + err = unpopulate(val, "SharedAccessPolicyName", &s.SharedAccessPolicyName) + delete(rawMsg, key) + case "systemPropertyColumns": + err = unpopulate(val, "SystemPropertyColumns", &s.SystemPropertyColumns) + delete(rawMsg, key) + case "topicName": + err = unpopulate(val, "TopicName", &s.TopicName) + 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 StartStreamingJobParameters. +func (s StartStreamingJobParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "outputStartMode", s.OutputStartMode) + populateTimeRFC3339(objectMap, "outputStartTime", s.OutputStartTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StartStreamingJobParameters. +func (s *StartStreamingJobParameters) 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 "outputStartMode": + err = unpopulate(val, "OutputStartMode", &s.OutputStartMode) + delete(rawMsg, key) + case "outputStartTime": + err = unpopulateTimeRFC3339(val, "OutputStartTime", &s.OutputStartTime) + 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 StorageAccount. +func (s StorageAccount) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "accountKey", s.AccountKey) + populate(objectMap, "accountName", s.AccountName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StorageAccount. +func (s *StorageAccount) 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 "accountKey": + err = unpopulate(val, "AccountKey", &s.AccountKey) + delete(rawMsg, key) + case "accountName": + err = unpopulate(val, "AccountName", &s.AccountName) + 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 StreamInputDataSource. +func (s StreamInputDataSource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["type"] = s.Type + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StreamInputDataSource. +func (s *StreamInputDataSource) 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 "type": + err = unpopulate(val, "Type", &s.Type) + 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 StreamInputProperties. +func (s StreamInputProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "compression", s.Compression) + populate(objectMap, "datasource", s.Datasource) + populate(objectMap, "diagnostics", s.Diagnostics) + populate(objectMap, "etag", s.Etag) + populate(objectMap, "partitionKey", s.PartitionKey) + populate(objectMap, "serialization", s.Serialization) + objectMap["type"] = "Stream" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StreamInputProperties. +func (s *StreamInputProperties) 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 "compression": + err = unpopulate(val, "Compression", &s.Compression) + delete(rawMsg, key) + case "datasource": + s.Datasource, err = unmarshalStreamInputDataSourceClassification(val) + delete(rawMsg, key) + case "diagnostics": + err = unpopulate(val, "Diagnostics", &s.Diagnostics) + delete(rawMsg, key) + case "etag": + err = unpopulate(val, "Etag", &s.Etag) + delete(rawMsg, key) + case "partitionKey": + err = unpopulate(val, "PartitionKey", &s.PartitionKey) + delete(rawMsg, key) + case "serialization": + s.Serialization, err = unmarshalSerializationClassification(val) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + 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 StreamingJob. +func (s StreamingJob) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "identity", s.Identity) + populate(objectMap, "location", s.Location) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "tags", s.Tags) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StreamingJob. +func (s *StreamingJob) 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 "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &s.Identity) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &s.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &s.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + 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 StreamingJobListResult. +func (s StreamingJobListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StreamingJobListResult. +func (s *StreamingJobListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + 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 StreamingJobProperties. +func (s StreamingJobProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "cluster", s.Cluster) + populate(objectMap, "compatibilityLevel", s.CompatibilityLevel) + populate(objectMap, "contentStoragePolicy", s.ContentStoragePolicy) + populateTimeRFC3339(objectMap, "createdDate", s.CreatedDate) + populate(objectMap, "dataLocale", s.DataLocale) + populate(objectMap, "etag", s.Etag) + populate(objectMap, "eventsLateArrivalMaxDelayInSeconds", s.EventsLateArrivalMaxDelayInSeconds) + populate(objectMap, "eventsOutOfOrderMaxDelayInSeconds", s.EventsOutOfOrderMaxDelayInSeconds) + populate(objectMap, "eventsOutOfOrderPolicy", s.EventsOutOfOrderPolicy) + populate(objectMap, "functions", s.Functions) + populate(objectMap, "inputs", s.Inputs) + populate(objectMap, "jobId", s.JobID) + populate(objectMap, "jobState", s.JobState) + populate(objectMap, "jobStorageAccount", s.JobStorageAccount) + populate(objectMap, "jobType", s.JobType) + populateTimeRFC3339(objectMap, "lastOutputEventTime", s.LastOutputEventTime) + populate(objectMap, "outputErrorPolicy", s.OutputErrorPolicy) + populate(objectMap, "outputStartMode", s.OutputStartMode) + populateTimeRFC3339(objectMap, "outputStartTime", s.OutputStartTime) + populate(objectMap, "outputs", s.Outputs) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "sku", s.SKU) + populate(objectMap, "transformation", s.Transformation) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StreamingJobProperties. +func (s *StreamingJobProperties) 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 "cluster": + err = unpopulate(val, "Cluster", &s.Cluster) + delete(rawMsg, key) + case "compatibilityLevel": + err = unpopulate(val, "CompatibilityLevel", &s.CompatibilityLevel) + delete(rawMsg, key) + case "contentStoragePolicy": + err = unpopulate(val, "ContentStoragePolicy", &s.ContentStoragePolicy) + delete(rawMsg, key) + case "createdDate": + err = unpopulateTimeRFC3339(val, "CreatedDate", &s.CreatedDate) + delete(rawMsg, key) + case "dataLocale": + err = unpopulate(val, "DataLocale", &s.DataLocale) + delete(rawMsg, key) + case "etag": + err = unpopulate(val, "Etag", &s.Etag) + delete(rawMsg, key) + case "eventsLateArrivalMaxDelayInSeconds": + err = unpopulate(val, "EventsLateArrivalMaxDelayInSeconds", &s.EventsLateArrivalMaxDelayInSeconds) + delete(rawMsg, key) + case "eventsOutOfOrderMaxDelayInSeconds": + err = unpopulate(val, "EventsOutOfOrderMaxDelayInSeconds", &s.EventsOutOfOrderMaxDelayInSeconds) + delete(rawMsg, key) + case "eventsOutOfOrderPolicy": + err = unpopulate(val, "EventsOutOfOrderPolicy", &s.EventsOutOfOrderPolicy) + delete(rawMsg, key) + case "functions": + err = unpopulate(val, "Functions", &s.Functions) + delete(rawMsg, key) + case "inputs": + err = unpopulate(val, "Inputs", &s.Inputs) + delete(rawMsg, key) + case "jobId": + err = unpopulate(val, "JobID", &s.JobID) + delete(rawMsg, key) + case "jobState": + err = unpopulate(val, "JobState", &s.JobState) + delete(rawMsg, key) + case "jobStorageAccount": + err = unpopulate(val, "JobStorageAccount", &s.JobStorageAccount) + delete(rawMsg, key) + case "jobType": + err = unpopulate(val, "JobType", &s.JobType) + delete(rawMsg, key) + case "lastOutputEventTime": + err = unpopulateTimeRFC3339(val, "LastOutputEventTime", &s.LastOutputEventTime) + delete(rawMsg, key) + case "outputErrorPolicy": + err = unpopulate(val, "OutputErrorPolicy", &s.OutputErrorPolicy) + delete(rawMsg, key) + case "outputStartMode": + err = unpopulate(val, "OutputStartMode", &s.OutputStartMode) + delete(rawMsg, key) + case "outputStartTime": + err = unpopulateTimeRFC3339(val, "OutputStartTime", &s.OutputStartTime) + delete(rawMsg, key) + case "outputs": + err = unpopulate(val, "Outputs", &s.Outputs) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &s.SKU) + delete(rawMsg, key) + case "transformation": + err = unpopulate(val, "Transformation", &s.Transformation) + 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 SubResource. +func (s SubResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SubResource. +func (s *SubResource) 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 "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + 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 SubscriptionQuota. +func (s SubscriptionQuota) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionQuota. +func (s *SubscriptionQuota) 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 "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + 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 SubscriptionQuotaProperties. +func (s SubscriptionQuotaProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "currentCount", s.CurrentCount) + populate(objectMap, "maxCount", s.MaxCount) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionQuotaProperties. +func (s *SubscriptionQuotaProperties) 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 "currentCount": + err = unpopulate(val, "CurrentCount", &s.CurrentCount) + delete(rawMsg, key) + case "maxCount": + err = unpopulate(val, "MaxCount", &s.MaxCount) + 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 SubscriptionQuotasListResult. +func (s SubscriptionQuotasListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionQuotasListResult. +func (s *SubscriptionQuotasListResult) 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 "value": + err = unpopulate(val, "Value", &s.Value) + 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 TrackedResource. +func (t TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", t.ID) + populate(objectMap, "location", t.Location) + populate(objectMap, "name", t.Name) + populate(objectMap, "tags", t.Tags) + populate(objectMap, "type", t.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResource. +func (t *TrackedResource) 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", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &t.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &t.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &t.Name) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &t.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &t.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Transformation. +func (t Transformation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", t.ID) + populate(objectMap, "name", t.Name) + populate(objectMap, "properties", t.Properties) + populate(objectMap, "type", t.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Transformation. +func (t *Transformation) 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", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &t.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &t.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &t.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &t.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TransformationProperties. +func (t TransformationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", t.Etag) + populate(objectMap, "query", t.Query) + populate(objectMap, "streamingUnits", t.StreamingUnits) + populate(objectMap, "validStreamingUnits", t.ValidStreamingUnits) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TransformationProperties. +func (t *TransformationProperties) 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", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &t.Etag) + delete(rawMsg, key) + case "query": + err = unpopulate(val, "Query", &t.Query) + delete(rawMsg, key) + case "streamingUnits": + err = unpopulate(val, "StreamingUnits", &t.StreamingUnits) + delete(rawMsg, key) + case "validStreamingUnits": + err = unpopulate(val, "ValidStreamingUnits", &t.ValidStreamingUnits) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, 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/streamanalytics/armstreamanalytics/zz_generated_operations_client.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/operations_client.go similarity index 99% rename from sdk/resourcemanager/streamanalytics/armstreamanalytics/zz_generated_operations_client.go rename to sdk/resourcemanager/streamanalytics/armstreamanalytics/operations_client.go index b029fc977453..f478c953c318 100644 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/zz_generated_operations_client.go +++ b/sdk/resourcemanager/streamanalytics/armstreamanalytics/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 armstreamanalytics diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/zz_generated_outputs_client.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/outputs_client.go similarity index 99% rename from sdk/resourcemanager/streamanalytics/armstreamanalytics/zz_generated_outputs_client.go rename to sdk/resourcemanager/streamanalytics/armstreamanalytics/outputs_client.go index f8b5c84c1f6b..e68adba7bcbd 100644 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/zz_generated_outputs_client.go +++ b/sdk/resourcemanager/streamanalytics/armstreamanalytics/outputs_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 armstreamanalytics diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/zz_generated_polymorphic_helpers.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/polymorphic_helpers.go similarity index 96% rename from sdk/resourcemanager/streamanalytics/armstreamanalytics/zz_generated_polymorphic_helpers.go rename to sdk/resourcemanager/streamanalytics/armstreamanalytics/polymorphic_helpers.go index 5a864cafdbc4..42cdd072e0ae 100644 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/zz_generated_polymorphic_helpers.go +++ b/sdk/resourcemanager/streamanalytics/armstreamanalytics/polymorphic_helpers.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 armstreamanalytics @@ -80,6 +81,8 @@ func unmarshalOutputDataSourceClassification(rawMsg json.RawMessage) (OutputData } var b OutputDataSourceClassification switch m["type"] { + case "GatewayMessageBus": + b = &GatewayMessageBusOutputDataSource{} case "Microsoft.AzureFunction": b = &AzureFunctionOutputDataSource{} case "Microsoft.DataLake/Accounts": @@ -120,6 +123,8 @@ func unmarshalReferenceInputDataSourceClassification(rawMsg json.RawMessage) (Re } var b ReferenceInputDataSourceClassification switch m["type"] { + case "File": + b = &FileReferenceInputDataSource{} case "Microsoft.Sql/Server/Database": b = &AzureSQLReferenceInputDataSource{} case "Microsoft.Storage/Blob": @@ -164,6 +169,8 @@ func unmarshalStreamInputDataSourceClassification(rawMsg json.RawMessage) (Strea } var b StreamInputDataSourceClassification switch m["type"] { + case "GatewayMessageBus": + b = &GatewayMessageBusStreamInputDataSource{} case "Microsoft.Devices/IotHubs": b = &IoTHubStreamInputDataSource{} case "Microsoft.EventHub/EventHub": diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/zz_generated_privateendpoints_client.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/privateendpoints_client.go similarity index 99% rename from sdk/resourcemanager/streamanalytics/armstreamanalytics/zz_generated_privateendpoints_client.go rename to sdk/resourcemanager/streamanalytics/armstreamanalytics/privateendpoints_client.go index 138a40f1c1b7..449975284173 100644 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/zz_generated_privateendpoints_client.go +++ b/sdk/resourcemanager/streamanalytics/armstreamanalytics/privateendpoints_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 armstreamanalytics diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/zz_generated_response_types.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/response_types.go similarity index 99% rename from sdk/resourcemanager/streamanalytics/armstreamanalytics/zz_generated_response_types.go rename to sdk/resourcemanager/streamanalytics/armstreamanalytics/response_types.go index d1d9a9c6e6f9..a6fcb365e306 100644 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/zz_generated_response_types.go +++ b/sdk/resourcemanager/streamanalytics/armstreamanalytics/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 armstreamanalytics diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/zz_generated_streamingjobs_client.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/streamingjobs_client.go similarity index 99% rename from sdk/resourcemanager/streamanalytics/armstreamanalytics/zz_generated_streamingjobs_client.go rename to sdk/resourcemanager/streamanalytics/armstreamanalytics/streamingjobs_client.go index 947c129f40ab..b65591795b52 100644 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/zz_generated_streamingjobs_client.go +++ b/sdk/resourcemanager/streamanalytics/armstreamanalytics/streamingjobs_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 armstreamanalytics diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/zz_generated_subscriptions_client.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/subscriptions_client.go similarity index 99% rename from sdk/resourcemanager/streamanalytics/armstreamanalytics/zz_generated_subscriptions_client.go rename to sdk/resourcemanager/streamanalytics/armstreamanalytics/subscriptions_client.go index 004ed738e6b6..7a490b4c9eb3 100644 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/zz_generated_subscriptions_client.go +++ b/sdk/resourcemanager/streamanalytics/armstreamanalytics/subscriptions_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 armstreamanalytics diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/zz_generated_time_rfc3339.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/time_rfc3339.go similarity index 99% rename from sdk/resourcemanager/streamanalytics/armstreamanalytics/zz_generated_time_rfc3339.go rename to sdk/resourcemanager/streamanalytics/armstreamanalytics/time_rfc3339.go index 8bc597513125..d8131cc8ffbb 100644 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/streamanalytics/armstreamanalytics/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 armstreamanalytics diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/zz_generated_transformations_client.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/transformations_client.go similarity index 99% rename from sdk/resourcemanager/streamanalytics/armstreamanalytics/zz_generated_transformations_client.go rename to sdk/resourcemanager/streamanalytics/armstreamanalytics/transformations_client.go index cd6316489732..2bdf7165af45 100644 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/zz_generated_transformations_client.go +++ b/sdk/resourcemanager/streamanalytics/armstreamanalytics/transformations_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 armstreamanalytics diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/ze_generated_example_clusters_client_test.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/ze_generated_example_clusters_client_test.go deleted file mode 100644 index 2b00b61d7bc3..000000000000 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/ze_generated_example_clusters_client_test.go +++ /dev/null @@ -1,209 +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 armstreamanalytics_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/streamanalytics/armstreamanalytics" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/stable/2020-03-01/examples/Cluster_Create.json -func ExampleClustersClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstreamanalytics.NewClustersClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "sjrg", - "An Example Cluster", - armstreamanalytics.Cluster{ - Location: to.Ptr("North US"), - Tags: map[string]*string{ - "key": to.Ptr("value"), - }, - SKU: &armstreamanalytics.ClusterSKU{ - Name: to.Ptr(armstreamanalytics.ClusterSKUNameDefault), - Capacity: to.Ptr[int32](48), - }, - }, - &armstreamanalytics.ClustersClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: 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/streamanalytics/resource-manager/Microsoft.StreamAnalytics/stable/2020-03-01/examples/Cluster_Update.json -func ExampleClustersClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstreamanalytics.NewClustersClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "sjrg", - "testcluster", - armstreamanalytics.Cluster{ - Location: to.Ptr("Central US"), - SKU: &armstreamanalytics.ClusterSKU{ - Capacity: to.Ptr[int32](96), - }, - }, - &armstreamanalytics.ClustersClientBeginUpdateOptions{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 -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/stable/2020-03-01/examples/Cluster_Get.json -func ExampleClustersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstreamanalytics.NewClustersClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sjrg", - "testcluster", - 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/streamanalytics/resource-manager/Microsoft.StreamAnalytics/stable/2020-03-01/examples/Cluster_Delete.json -func ExampleClustersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstreamanalytics.NewClustersClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "sjrg", - "testcluster", - 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/streamanalytics/resource-manager/Microsoft.StreamAnalytics/stable/2020-03-01/examples/Cluster_ListBySubscription.json -func ExampleClustersClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstreamanalytics.NewClustersClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(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/streamanalytics/resource-manager/Microsoft.StreamAnalytics/stable/2020-03-01/examples/Cluster_ListByResourceGroup.json -func ExampleClustersClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstreamanalytics.NewClustersClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("sjrg", - 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/streamanalytics/resource-manager/Microsoft.StreamAnalytics/stable/2020-03-01/examples/Cluster_ListStreamingJobs.json -func ExampleClustersClient_NewListStreamingJobsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstreamanalytics.NewClustersClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListStreamingJobsPager("sjrg", - "testcluster", - 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/streamanalytics/armstreamanalytics/ze_generated_example_functions_client_test.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/ze_generated_example_functions_client_test.go deleted file mode 100644 index 3af3026e3b14..000000000000 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/ze_generated_example_functions_client_test.go +++ /dev/null @@ -1,226 +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 armstreamanalytics_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/streamanalytics/armstreamanalytics" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/stable/2020-03-01/examples/Function_Create_JavaScript.json -func ExampleFunctionsClient_CreateOrReplace() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstreamanalytics.NewFunctionsClient("56b5e0a9-b645-407d-99b0-c64f86013e3d", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrReplace(ctx, - "sjrg1637", - "sj8653", - "function8197", - armstreamanalytics.Function{ - Properties: &armstreamanalytics.ScalarFunctionProperties{ - Type: to.Ptr("Scalar"), - Properties: &armstreamanalytics.FunctionConfiguration{ - Binding: &armstreamanalytics.JavaScriptFunctionBinding{ - Type: to.Ptr("Microsoft.StreamAnalytics/JavascriptUdf"), - Properties: &armstreamanalytics.JavaScriptFunctionBindingProperties{ - Script: to.Ptr("function (x, y) { return x + y; }"), - }, - }, - Inputs: []*armstreamanalytics.FunctionInput{ - { - DataType: to.Ptr("Any"), - }}, - Output: &armstreamanalytics.FunctionOutput{ - DataType: to.Ptr("Any"), - }, - }, - }, - }, - &armstreamanalytics.FunctionsClientCreateOrReplaceOptions{IfMatch: nil, - IfNoneMatch: 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/streamanalytics/resource-manager/Microsoft.StreamAnalytics/stable/2020-03-01/examples/Function_Update_JavaScript.json -func ExampleFunctionsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstreamanalytics.NewFunctionsClient("56b5e0a9-b645-407d-99b0-c64f86013e3d", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "sjrg1637", - "sj8653", - "function8197", - armstreamanalytics.Function{ - Properties: &armstreamanalytics.ScalarFunctionProperties{ - Type: to.Ptr("Scalar"), - Properties: &armstreamanalytics.FunctionConfiguration{ - Binding: &armstreamanalytics.JavaScriptFunctionBinding{ - Type: to.Ptr("Microsoft.StreamAnalytics/JavascriptUdf"), - Properties: &armstreamanalytics.JavaScriptFunctionBindingProperties{ - Script: to.Ptr("function (a, b) { return a * b; }"), - }, - }, - }, - }, - }, - &armstreamanalytics.FunctionsClientUpdateOptions{IfMatch: 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/streamanalytics/resource-manager/Microsoft.StreamAnalytics/stable/2020-03-01/examples/Function_Delete.json -func ExampleFunctionsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstreamanalytics.NewFunctionsClient("56b5e0a9-b645-407d-99b0-c64f86013e3d", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "sjrg1637", - "sj8653", - "function8197", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/stable/2020-03-01/examples/Function_Get_JavaScript.json -func ExampleFunctionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstreamanalytics.NewFunctionsClient("56b5e0a9-b645-407d-99b0-c64f86013e3d", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sjrg1637", - "sj8653", - "function8197", - 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/streamanalytics/resource-manager/Microsoft.StreamAnalytics/stable/2020-03-01/examples/Function_ListByStreamingJob.json -func ExampleFunctionsClient_NewListByStreamingJobPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstreamanalytics.NewFunctionsClient("56b5e0a9-b645-407d-99b0-c64f86013e3d", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByStreamingJobPager("sjrg1637", - "sj8653", - &armstreamanalytics.FunctionsClientListByStreamingJobOptions{Select: 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/streamanalytics/resource-manager/Microsoft.StreamAnalytics/stable/2020-03-01/examples/Function_Test_JavaScript.json -func ExampleFunctionsClient_BeginTest() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstreamanalytics.NewFunctionsClient("56b5e0a9-b645-407d-99b0-c64f86013e3d", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginTest(ctx, - "sjrg1637", - "sj8653", - "function8197", - &armstreamanalytics.FunctionsClientBeginTestOptions{Function: 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/streamanalytics/resource-manager/Microsoft.StreamAnalytics/stable/2020-03-01/examples/Function_RetrieveDefaultDefinition_AzureML.json -func ExampleFunctionsClient_RetrieveDefaultDefinition() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstreamanalytics.NewFunctionsClient("56b5e0a9-b645-407d-99b0-c64f86013e3d", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.RetrieveDefaultDefinition(ctx, - "sjrg7", - "sj9093", - "function588", - &armstreamanalytics.FunctionsClientRetrieveDefaultDefinitionOptions{FunctionRetrieveDefaultDefinitionParameters: &armstreamanalytics.AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters{ - BindingType: to.Ptr("Microsoft.MachineLearning/WebService"), - BindingRetrievalProperties: &armstreamanalytics.AzureMachineLearningWebServiceFunctionBindingRetrievalProperties{ - ExecuteEndpoint: to.Ptr("someAzureMLExecuteEndpointUrl"), - UdfType: to.Ptr("Scalar"), - }, - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/ze_generated_example_inputs_client_test.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/ze_generated_example_inputs_client_test.go deleted file mode 100644 index 9d3ec8542bef..000000000000 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/ze_generated_example_inputs_client_test.go +++ /dev/null @@ -1,207 +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 armstreamanalytics_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/streamanalytics/armstreamanalytics" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/stable/2020-03-01/examples/Input_Create_Reference_Blob_CSV.json -func ExampleInputsClient_CreateOrReplace() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstreamanalytics.NewInputsClient("56b5e0a9-b645-407d-99b0-c64f86013e3d", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrReplace(ctx, - "sjrg8440", - "sj9597", - "input7225", - armstreamanalytics.Input{ - Properties: &armstreamanalytics.ReferenceInputProperties{ - Type: to.Ptr("Reference"), - Serialization: &armstreamanalytics.CSVSerialization{ - Type: to.Ptr(armstreamanalytics.EventSerializationTypeCSV), - Properties: &armstreamanalytics.CSVSerializationProperties{ - Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - FieldDelimiter: to.Ptr(","), - }, - }, - Datasource: &armstreamanalytics.BlobReferenceInputDataSource{ - Type: to.Ptr("Microsoft.Storage/Blob"), - Properties: &armstreamanalytics.BlobReferenceInputDataSourceProperties{ - Container: to.Ptr("state"), - DateFormat: to.Ptr("yyyy/MM/dd"), - PathPattern: to.Ptr("{date}/{time}"), - StorageAccounts: []*armstreamanalytics.StorageAccount{ - { - AccountKey: to.Ptr("someAccountKey=="), - AccountName: to.Ptr("someAccountName"), - }}, - TimeFormat: to.Ptr("HH"), - }, - }, - }, - }, - &armstreamanalytics.InputsClientCreateOrReplaceOptions{IfMatch: nil, - IfNoneMatch: 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/streamanalytics/resource-manager/Microsoft.StreamAnalytics/stable/2020-03-01/examples/Input_Update_Reference_Blob.json -func ExampleInputsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstreamanalytics.NewInputsClient("56b5e0a9-b645-407d-99b0-c64f86013e3d", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "sjrg8440", - "sj9597", - "input7225", - armstreamanalytics.Input{ - Properties: &armstreamanalytics.ReferenceInputProperties{ - Type: to.Ptr("Reference"), - Serialization: &armstreamanalytics.CSVSerialization{ - Type: to.Ptr(armstreamanalytics.EventSerializationTypeCSV), - Properties: &armstreamanalytics.CSVSerializationProperties{ - Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - FieldDelimiter: to.Ptr("|"), - }, - }, - Datasource: &armstreamanalytics.BlobReferenceInputDataSource{ - Type: to.Ptr("Microsoft.Storage/Blob"), - Properties: &armstreamanalytics.BlobReferenceInputDataSourceProperties{ - Container: to.Ptr("differentContainer"), - }, - }, - }, - }, - &armstreamanalytics.InputsClientUpdateOptions{IfMatch: 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/streamanalytics/resource-manager/Microsoft.StreamAnalytics/stable/2020-03-01/examples/Input_Delete.json -func ExampleInputsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstreamanalytics.NewInputsClient("56b5e0a9-b645-407d-99b0-c64f86013e3d", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "sjrg8440", - "sj9597", - "input7225", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/stable/2020-03-01/examples/Input_Get_Reference_Blob_CSV.json -func ExampleInputsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstreamanalytics.NewInputsClient("56b5e0a9-b645-407d-99b0-c64f86013e3d", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sjrg8440", - "sj9597", - "input7225", - 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/streamanalytics/resource-manager/Microsoft.StreamAnalytics/stable/2020-03-01/examples/Input_ListByStreamingJob.json -func ExampleInputsClient_NewListByStreamingJobPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstreamanalytics.NewInputsClient("56b5e0a9-b645-407d-99b0-c64f86013e3d", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByStreamingJobPager("sjrg8440", - "sj9597", - &armstreamanalytics.InputsClientListByStreamingJobOptions{Select: 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/streamanalytics/resource-manager/Microsoft.StreamAnalytics/stable/2020-03-01/examples/Input_Test.json -func ExampleInputsClient_BeginTest() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstreamanalytics.NewInputsClient("56b5e0a9-b645-407d-99b0-c64f86013e3d", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginTest(ctx, - "sjrg8440", - "sj9597", - "input7225", - &armstreamanalytics.InputsClientBeginTestOptions{Input: 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/streamanalytics/armstreamanalytics/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/ze_generated_example_operations_client_test.go deleted file mode 100644 index 6518761388a3..000000000000 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/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 armstreamanalytics_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/streamanalytics/armstreamanalytics" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/stable/2020-03-01/examples/Operation_List.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 := armstreamanalytics.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/streamanalytics/armstreamanalytics/ze_generated_example_outputs_client_test.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/ze_generated_example_outputs_client_test.go deleted file mode 100644 index 1b9ec29df4e9..000000000000 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/ze_generated_example_outputs_client_test.go +++ /dev/null @@ -1,188 +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 armstreamanalytics_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/streamanalytics/armstreamanalytics" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/stable/2020-03-01/examples/Output_Create_DocumentDB.json -func ExampleOutputsClient_CreateOrReplace() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstreamanalytics.NewOutputsClient("56b5e0a9-b645-407d-99b0-c64f86013e3d", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrReplace(ctx, - "sjrg7983", - "sj2331", - "output3022", - armstreamanalytics.Output{ - Properties: &armstreamanalytics.OutputProperties{ - Datasource: &armstreamanalytics.DocumentDbOutputDataSource{ - Type: to.Ptr("Microsoft.Storage/DocumentDB"), - Properties: &armstreamanalytics.DocumentDbOutputDataSourceProperties{ - AccountID: to.Ptr("someAccountId"), - AccountKey: to.Ptr("accountKey=="), - CollectionNamePattern: to.Ptr("collection"), - Database: to.Ptr("db01"), - DocumentID: to.Ptr("documentId"), - PartitionKey: to.Ptr("key"), - }, - }, - }, - }, - &armstreamanalytics.OutputsClientCreateOrReplaceOptions{IfMatch: nil, - IfNoneMatch: 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/streamanalytics/resource-manager/Microsoft.StreamAnalytics/stable/2020-03-01/examples/Output_Update_DocumentDB.json -func ExampleOutputsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstreamanalytics.NewOutputsClient("56b5e0a9-b645-407d-99b0-c64f86013e3d", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "sjrg7983", - "sj2331", - "output3022", - armstreamanalytics.Output{ - Properties: &armstreamanalytics.OutputProperties{ - Datasource: &armstreamanalytics.DocumentDbOutputDataSource{ - Type: to.Ptr("Microsoft.Storage/DocumentDB"), - Properties: &armstreamanalytics.DocumentDbOutputDataSourceProperties{ - PartitionKey: to.Ptr("differentPartitionKey"), - }, - }, - }, - }, - &armstreamanalytics.OutputsClientUpdateOptions{IfMatch: 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/streamanalytics/resource-manager/Microsoft.StreamAnalytics/stable/2020-03-01/examples/Output_Delete.json -func ExampleOutputsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstreamanalytics.NewOutputsClient("56b5e0a9-b645-407d-99b0-c64f86013e3d", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "sjrg2157", - "sj6458", - "output1755", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/stable/2020-03-01/examples/Output_Get_DocumentDB.json -func ExampleOutputsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstreamanalytics.NewOutputsClient("56b5e0a9-b645-407d-99b0-c64f86013e3d", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sjrg7983", - "sj2331", - "output3022", - 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/streamanalytics/resource-manager/Microsoft.StreamAnalytics/stable/2020-03-01/examples/Output_ListByStreamingJob.json -func ExampleOutputsClient_NewListByStreamingJobPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstreamanalytics.NewOutputsClient("56b5e0a9-b645-407d-99b0-c64f86013e3d", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByStreamingJobPager("sjrg2157", - "sj6458", - &armstreamanalytics.OutputsClientListByStreamingJobOptions{Select: 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/streamanalytics/resource-manager/Microsoft.StreamAnalytics/stable/2020-03-01/examples/Output_Test.json -func ExampleOutputsClient_BeginTest() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstreamanalytics.NewOutputsClient("56b5e0a9-b645-407d-99b0-c64f86013e3d", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginTest(ctx, - "sjrg2157", - "sj6458", - "output1755", - &armstreamanalytics.OutputsClientBeginTestOptions{Output: 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/streamanalytics/armstreamanalytics/ze_generated_example_privateendpoints_client_test.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/ze_generated_example_privateendpoints_client_test.go deleted file mode 100644 index ed6d58888387..000000000000 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/ze_generated_example_privateendpoints_client_test.go +++ /dev/null @@ -1,129 +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 armstreamanalytics_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/streamanalytics/armstreamanalytics" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/stable/2020-03-01/examples/PrivateEndpoint_Create.json -func ExamplePrivateEndpointsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstreamanalytics.NewPrivateEndpointsClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "sjrg", - "testcluster", - "testpe", - armstreamanalytics.PrivateEndpoint{ - Properties: &armstreamanalytics.PrivateEndpointProperties{ - ManualPrivateLinkServiceConnections: []*armstreamanalytics.PrivateLinkServiceConnection{ - { - Properties: &armstreamanalytics.PrivateLinkServiceConnectionProperties{ - GroupIDs: []*string{ - to.Ptr("groupIdFromResource")}, - PrivateLinkServiceID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls"), - }, - }}, - }, - }, - &armstreamanalytics.PrivateEndpointsClientCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: 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/streamanalytics/resource-manager/Microsoft.StreamAnalytics/stable/2020-03-01/examples/PrivateEndpoint_Get.json -func ExamplePrivateEndpointsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstreamanalytics.NewPrivateEndpointsClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sjrg", - "testcluster", - "testpe", - 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/streamanalytics/resource-manager/Microsoft.StreamAnalytics/stable/2020-03-01/examples/PrivateEndpoint_Delete.json -func ExamplePrivateEndpointsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstreamanalytics.NewPrivateEndpointsClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "sjrg", - "testcluster", - "testpe", - 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/streamanalytics/resource-manager/Microsoft.StreamAnalytics/stable/2020-03-01/examples/PrivateEndpoint_ListByCluster.json -func ExamplePrivateEndpointsClient_NewListByClusterPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstreamanalytics.NewPrivateEndpointsClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByClusterPager("sjrg", - "testcluster", - 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/streamanalytics/armstreamanalytics/ze_generated_example_streamingjobs_client_test.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/ze_generated_example_streamingjobs_client_test.go deleted file mode 100644 index 120026e064d1..000000000000 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/ze_generated_example_streamingjobs_client_test.go +++ /dev/null @@ -1,318 +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 armstreamanalytics_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/streamanalytics/armstreamanalytics" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/stable/2020-03-01/examples/StreamingJob_Create_CompleteJob.json -func ExampleStreamingJobsClient_BeginCreateOrReplace() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstreamanalytics.NewStreamingJobsClient("56b5e0a9-b645-407d-99b0-c64f86013e3d", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrReplace(ctx, - "sjrg3276", - "sj7804", - armstreamanalytics.StreamingJob{ - Location: to.Ptr("West US"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - "key3": to.Ptr("value3"), - "randomKey": to.Ptr("randomValue"), - }, - Properties: &armstreamanalytics.StreamingJobProperties{ - CompatibilityLevel: to.Ptr(armstreamanalytics.CompatibilityLevelOne0), - DataLocale: to.Ptr("en-US"), - EventsLateArrivalMaxDelayInSeconds: to.Ptr[int32](5), - EventsOutOfOrderMaxDelayInSeconds: to.Ptr[int32](0), - EventsOutOfOrderPolicy: to.Ptr(armstreamanalytics.EventsOutOfOrderPolicyDrop), - Functions: []*armstreamanalytics.Function{}, - Inputs: []*armstreamanalytics.Input{ - { - Name: to.Ptr("inputtest"), - Properties: &armstreamanalytics.StreamInputProperties{ - Type: to.Ptr("Stream"), - Serialization: &armstreamanalytics.JSONSerialization{ - Type: to.Ptr(armstreamanalytics.EventSerializationTypeJSON), - Properties: &armstreamanalytics.JSONSerializationProperties{ - Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - }, - }, - Datasource: &armstreamanalytics.BlobStreamInputDataSource{ - Type: to.Ptr("Microsoft.Storage/Blob"), - Properties: &armstreamanalytics.BlobStreamInputDataSourceProperties{ - Container: to.Ptr("containerName"), - PathPattern: to.Ptr(""), - StorageAccounts: []*armstreamanalytics.StorageAccount{ - { - AccountKey: to.Ptr("yourAccountKey=="), - AccountName: to.Ptr("yourAccountName"), - }}, - }, - }, - }, - }}, - OutputErrorPolicy: to.Ptr(armstreamanalytics.OutputErrorPolicyDrop), - Outputs: []*armstreamanalytics.Output{ - { - Name: to.Ptr("outputtest"), - Properties: &armstreamanalytics.OutputProperties{ - Datasource: &armstreamanalytics.AzureSQLDatabaseOutputDataSource{ - Type: to.Ptr("Microsoft.Sql/Server/Database"), - Properties: &armstreamanalytics.AzureSQLDatabaseOutputDataSourceProperties{ - Database: to.Ptr("databaseName"), - Password: to.Ptr("userPassword"), - Server: to.Ptr("serverName"), - Table: to.Ptr("tableName"), - User: to.Ptr(""), - }, - }, - }, - }}, - SKU: &armstreamanalytics.SKU{ - Name: to.Ptr(armstreamanalytics.SKUNameStandard), - }, - Transformation: &armstreamanalytics.Transformation{ - Name: to.Ptr("transformationtest"), - Properties: &armstreamanalytics.TransformationProperties{ - Query: to.Ptr("Select Id, Name from inputtest"), - StreamingUnits: to.Ptr[int32](1), - }, - }, - }, - }, - &armstreamanalytics.StreamingJobsClientBeginCreateOrReplaceOptions{IfMatch: nil, - IfNoneMatch: 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/streamanalytics/resource-manager/Microsoft.StreamAnalytics/stable/2020-03-01/examples/StreamingJob_Update.json -func ExampleStreamingJobsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstreamanalytics.NewStreamingJobsClient("56b5e0a9-b645-407d-99b0-c64f86013e3d", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "sjrg6936", - "sj59", - armstreamanalytics.StreamingJob{ - Properties: &armstreamanalytics.StreamingJobProperties{ - EventsLateArrivalMaxDelayInSeconds: to.Ptr[int32](13), - EventsOutOfOrderMaxDelayInSeconds: to.Ptr[int32](21), - }, - }, - &armstreamanalytics.StreamingJobsClientUpdateOptions{IfMatch: 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/streamanalytics/resource-manager/Microsoft.StreamAnalytics/stable/2020-03-01/examples/StreamingJob_Delete.json -func ExampleStreamingJobsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstreamanalytics.NewStreamingJobsClient("56b5e0a9-b645-407d-99b0-c64f86013e3d", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "sjrg6936", - "sj59", - 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/streamanalytics/resource-manager/Microsoft.StreamAnalytics/stable/2020-03-01/examples/StreamingJob_Get_NoExpand.json -func ExampleStreamingJobsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstreamanalytics.NewStreamingJobsClient("56b5e0a9-b645-407d-99b0-c64f86013e3d", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sjrg6936", - "sj59", - &armstreamanalytics.StreamingJobsClientGetOptions{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/streamanalytics/resource-manager/Microsoft.StreamAnalytics/stable/2020-03-01/examples/StreamingJob_List_ByResourceGroup_NoExpand.json -func ExampleStreamingJobsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstreamanalytics.NewStreamingJobsClient("56b5e0a9-b645-407d-99b0-c64f86013e3d", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("sjrg6936", - &armstreamanalytics.StreamingJobsClientListByResourceGroupOptions{Expand: 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/streamanalytics/resource-manager/Microsoft.StreamAnalytics/stable/2020-03-01/examples/StreamingJob_List_BySubscription_NoExpand.json -func ExampleStreamingJobsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstreamanalytics.NewStreamingJobsClient("56b5e0a9-b645-407d-99b0-c64f86013e3d", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(&armstreamanalytics.StreamingJobsClientListOptions{Expand: 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/streamanalytics/resource-manager/Microsoft.StreamAnalytics/stable/2020-03-01/examples/StreamingJob_Start_CustomTime.json -func ExampleStreamingJobsClient_BeginStart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstreamanalytics.NewStreamingJobsClient("56b5e0a9-b645-407d-99b0-c64f86013e3d", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginStart(ctx, - "sjrg6936", - "sj59", - &armstreamanalytics.StreamingJobsClientBeginStartOptions{StartJobParameters: &armstreamanalytics.StartStreamingJobParameters{ - OutputStartMode: to.Ptr(armstreamanalytics.OutputStartModeCustomTime), - OutputStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2012-12-12T12:12:12Z"); return t }()), - }, - }) - 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/streamanalytics/resource-manager/Microsoft.StreamAnalytics/stable/2020-03-01/examples/StreamingJob_Stop.json -func ExampleStreamingJobsClient_BeginStop() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstreamanalytics.NewStreamingJobsClient("56b5e0a9-b645-407d-99b0-c64f86013e3d", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginStop(ctx, - "sjrg6936", - "sj59", - 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/streamanalytics/resource-manager/Microsoft.StreamAnalytics/stable/2020-03-01/examples/StreamingJob_Scale.json -func ExampleStreamingJobsClient_BeginScale() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstreamanalytics.NewStreamingJobsClient("56b5e0a9-b645-407d-99b0-c64f86013e3d", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginScale(ctx, - "sjrg6936", - "sj59", - &armstreamanalytics.StreamingJobsClientBeginScaleOptions{ScaleJobParameters: &armstreamanalytics.ScaleStreamingJobParameters{ - StreamingUnits: to.Ptr[int32](36), - }, - }) - 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/streamanalytics/armstreamanalytics/ze_generated_example_subscriptions_client_test.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/ze_generated_example_subscriptions_client_test.go deleted file mode 100644 index d4bd8a7bd175..000000000000 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/ze_generated_example_subscriptions_client_test.go +++ /dev/null @@ -1,38 +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 armstreamanalytics_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/streamanalytics/armstreamanalytics" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/stable/2020-03-01/examples/Subscription_ListQuotas.json -func ExampleSubscriptionsClient_ListQuotas() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstreamanalytics.NewSubscriptionsClient("56b5e0a9-b645-407d-99b0-c64f86013e3d", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListQuotas(ctx, - "West US", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/ze_generated_example_transformations_client_test.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/ze_generated_example_transformations_client_test.go deleted file mode 100644 index b689a46f2e0a..000000000000 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/ze_generated_example_transformations_client_test.go +++ /dev/null @@ -1,100 +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 armstreamanalytics_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/streamanalytics/armstreamanalytics" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/stable/2020-03-01/examples/Transformation_Create.json -func ExampleTransformationsClient_CreateOrReplace() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstreamanalytics.NewTransformationsClient("56b5e0a9-b645-407d-99b0-c64f86013e3d", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrReplace(ctx, - "sjrg4423", - "sj8374", - "transformation952", - armstreamanalytics.Transformation{ - Properties: &armstreamanalytics.TransformationProperties{ - Query: to.Ptr("Select Id, Name from inputtest"), - StreamingUnits: to.Ptr[int32](6), - }, - }, - &armstreamanalytics.TransformationsClientCreateOrReplaceOptions{IfMatch: nil, - IfNoneMatch: 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/streamanalytics/resource-manager/Microsoft.StreamAnalytics/stable/2020-03-01/examples/Transformation_Update.json -func ExampleTransformationsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstreamanalytics.NewTransformationsClient("56b5e0a9-b645-407d-99b0-c64f86013e3d", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "sjrg4423", - "sj8374", - "transformation952", - armstreamanalytics.Transformation{ - Properties: &armstreamanalytics.TransformationProperties{ - Query: to.Ptr("New query"), - }, - }, - &armstreamanalytics.TransformationsClientUpdateOptions{IfMatch: 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/streamanalytics/resource-manager/Microsoft.StreamAnalytics/stable/2020-03-01/examples/Transformation_Get.json -func ExampleTransformationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstreamanalytics.NewTransformationsClient("56b5e0a9-b645-407d-99b0-c64f86013e3d", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sjrg4423", - "sj8374", - "transformation952", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/zz_generated_models_serde.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/zz_generated_models_serde.go deleted file mode 100644 index a15a371763da..000000000000 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/zz_generated_models_serde.go +++ /dev/null @@ -1,1623 +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 armstreamanalytics - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" -) - -// MarshalJSON implements the json.Marshaller interface for type AggregateFunctionProperties. -func (a AggregateFunctionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "properties", a.Properties) - objectMap["type"] = "Aggregate" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AggregateFunctionProperties. -func (a *AggregateFunctionProperties) 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 "etag": - err = unpopulate(val, "Etag", &a.Etag) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - 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 AvroSerialization. -func (a AvroSerialization) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", &a.Properties) - objectMap["type"] = EventSerializationTypeAvro - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AvroSerialization. -func (a *AvroSerialization) 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 "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - 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 AzureDataLakeStoreOutputDataSource. -func (a AzureDataLakeStoreOutputDataSource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", a.Properties) - objectMap["type"] = "Microsoft.DataLake/Accounts" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureDataLakeStoreOutputDataSource. -func (a *AzureDataLakeStoreOutputDataSource) 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 "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - 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 AzureFunctionOutputDataSource. -func (a AzureFunctionOutputDataSource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", a.Properties) - objectMap["type"] = "Microsoft.AzureFunction" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFunctionOutputDataSource. -func (a *AzureFunctionOutputDataSource) 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 "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - 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 AzureMachineLearningWebServiceFunctionBinding. -func (a AzureMachineLearningWebServiceFunctionBinding) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", a.Properties) - objectMap["type"] = "Microsoft.MachineLearning/WebService" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMachineLearningWebServiceFunctionBinding. -func (a *AzureMachineLearningWebServiceFunctionBinding) 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 "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - 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 AzureMachineLearningWebServiceFunctionBindingProperties. -func (a AzureMachineLearningWebServiceFunctionBindingProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "apiKey", a.APIKey) - populate(objectMap, "batchSize", a.BatchSize) - populate(objectMap, "endpoint", a.Endpoint) - populate(objectMap, "inputs", a.Inputs) - populate(objectMap, "outputs", a.Outputs) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters. -func (a AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "bindingRetrievalProperties", a.BindingRetrievalProperties) - objectMap["bindingType"] = "Microsoft.MachineLearning/WebService" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters. -func (a *AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters) 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 "bindingRetrievalProperties": - err = unpopulate(val, "BindingRetrievalProperties", &a.BindingRetrievalProperties) - delete(rawMsg, key) - case "bindingType": - err = unpopulate(val, "BindingType", &a.BindingType) - 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 AzureMachineLearningWebServiceInputs. -func (a AzureMachineLearningWebServiceInputs) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "columnNames", a.ColumnNames) - populate(objectMap, "name", a.Name) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type AzureSQLDatabaseOutputDataSource. -func (a AzureSQLDatabaseOutputDataSource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", a.Properties) - objectMap["type"] = "Microsoft.Sql/Server/Database" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureSQLDatabaseOutputDataSource. -func (a *AzureSQLDatabaseOutputDataSource) 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 "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - 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 AzureSQLReferenceInputDataSource. -func (a AzureSQLReferenceInputDataSource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", a.Properties) - objectMap["type"] = "Microsoft.Sql/Server/Database" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureSQLReferenceInputDataSource. -func (a *AzureSQLReferenceInputDataSource) 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 "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - 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 AzureSynapseOutputDataSource. -func (a AzureSynapseOutputDataSource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", a.Properties) - objectMap["type"] = "Microsoft.Sql/Server/DataWarehouse" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureSynapseOutputDataSource. -func (a *AzureSynapseOutputDataSource) 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 "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - 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 AzureTableOutputDataSource. -func (a AzureTableOutputDataSource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", a.Properties) - objectMap["type"] = "Microsoft.Storage/Table" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureTableOutputDataSource. -func (a *AzureTableOutputDataSource) 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 "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - 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 AzureTableOutputDataSourceProperties. -func (a AzureTableOutputDataSourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "accountKey", a.AccountKey) - populate(objectMap, "accountName", a.AccountName) - populate(objectMap, "batchSize", a.BatchSize) - populate(objectMap, "columnsToRemove", a.ColumnsToRemove) - populate(objectMap, "partitionKey", a.PartitionKey) - populate(objectMap, "rowKey", a.RowKey) - populate(objectMap, "table", a.Table) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type BlobDataSourceProperties. -func (b BlobDataSourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "authenticationMode", b.AuthenticationMode) - populate(objectMap, "container", b.Container) - populate(objectMap, "dateFormat", b.DateFormat) - populate(objectMap, "pathPattern", b.PathPattern) - populate(objectMap, "storageAccounts", b.StorageAccounts) - populate(objectMap, "timeFormat", b.TimeFormat) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type BlobOutputDataSource. -func (b BlobOutputDataSource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", b.Properties) - objectMap["type"] = "Microsoft.Storage/Blob" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BlobOutputDataSource. -func (b *BlobOutputDataSource) 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", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "properties": - err = unpopulate(val, "Properties", &b.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &b.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type BlobOutputDataSourceProperties. -func (b BlobOutputDataSourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "authenticationMode", b.AuthenticationMode) - populate(objectMap, "container", b.Container) - populate(objectMap, "dateFormat", b.DateFormat) - populate(objectMap, "pathPattern", b.PathPattern) - populate(objectMap, "storageAccounts", b.StorageAccounts) - populate(objectMap, "timeFormat", b.TimeFormat) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type BlobReferenceInputDataSource. -func (b BlobReferenceInputDataSource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", b.Properties) - objectMap["type"] = "Microsoft.Storage/Blob" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BlobReferenceInputDataSource. -func (b *BlobReferenceInputDataSource) 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", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "properties": - err = unpopulate(val, "Properties", &b.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &b.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type BlobReferenceInputDataSourceProperties. -func (b BlobReferenceInputDataSourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "authenticationMode", b.AuthenticationMode) - populate(objectMap, "container", b.Container) - populate(objectMap, "dateFormat", b.DateFormat) - populate(objectMap, "pathPattern", b.PathPattern) - populate(objectMap, "storageAccounts", b.StorageAccounts) - populate(objectMap, "timeFormat", b.TimeFormat) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type BlobStreamInputDataSource. -func (b BlobStreamInputDataSource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", b.Properties) - objectMap["type"] = "Microsoft.Storage/Blob" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BlobStreamInputDataSource. -func (b *BlobStreamInputDataSource) 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", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "properties": - err = unpopulate(val, "Properties", &b.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &b.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type BlobStreamInputDataSourceProperties. -func (b BlobStreamInputDataSourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "authenticationMode", b.AuthenticationMode) - populate(objectMap, "container", b.Container) - populate(objectMap, "dateFormat", b.DateFormat) - populate(objectMap, "pathPattern", b.PathPattern) - populate(objectMap, "sourcePartitionCount", b.SourcePartitionCount) - populate(objectMap, "storageAccounts", b.StorageAccounts) - populate(objectMap, "timeFormat", b.TimeFormat) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type CSVSerialization. -func (c CSVSerialization) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", c.Properties) - objectMap["type"] = EventSerializationTypeCSV - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CSVSerialization. -func (c *CSVSerialization) 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 "properties": - err = unpopulate(val, "Properties", &c.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - 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 Cluster. -func (c Cluster) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", c.Etag) - populate(objectMap, "id", c.ID) - populate(objectMap, "location", c.Location) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "sku", c.SKU) - populate(objectMap, "tags", c.Tags) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ClusterProperties. -func (c ClusterProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "capacityAllocated", c.CapacityAllocated) - populate(objectMap, "capacityAssigned", c.CapacityAssigned) - populate(objectMap, "clusterId", c.ClusterID) - populateTimeRFC3339(objectMap, "createdDate", c.CreatedDate) - populate(objectMap, "provisioningState", c.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterProperties. -func (c *ClusterProperties) 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 "capacityAllocated": - err = unpopulate(val, "CapacityAllocated", &c.CapacityAllocated) - delete(rawMsg, key) - case "capacityAssigned": - err = unpopulate(val, "CapacityAssigned", &c.CapacityAssigned) - delete(rawMsg, key) - case "clusterId": - err = unpopulate(val, "ClusterID", &c.ClusterID) - delete(rawMsg, key) - case "createdDate": - err = unpopulateTimeRFC3339(val, "CreatedDate", &c.CreatedDate) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) - 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 Diagnostics. -func (d Diagnostics) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "conditions", d.Conditions) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DocumentDbOutputDataSource. -func (d DocumentDbOutputDataSource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", d.Properties) - objectMap["type"] = "Microsoft.Storage/DocumentDB" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DocumentDbOutputDataSource. -func (d *DocumentDbOutputDataSource) 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 "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 EventHubOutputDataSource. -func (e EventHubOutputDataSource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", e.Properties) - objectMap["type"] = "Microsoft.ServiceBus/EventHub" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EventHubOutputDataSource. -func (e *EventHubOutputDataSource) 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 "properties": - err = unpopulate(val, "Properties", &e.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) - 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 EventHubOutputDataSourceProperties. -func (e EventHubOutputDataSourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "authenticationMode", e.AuthenticationMode) - populate(objectMap, "eventHubName", e.EventHubName) - populate(objectMap, "partitionKey", e.PartitionKey) - populate(objectMap, "propertyColumns", e.PropertyColumns) - populate(objectMap, "serviceBusNamespace", e.ServiceBusNamespace) - populate(objectMap, "sharedAccessPolicyKey", e.SharedAccessPolicyKey) - populate(objectMap, "sharedAccessPolicyName", e.SharedAccessPolicyName) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type EventHubStreamInputDataSource. -func (e EventHubStreamInputDataSource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", e.Properties) - objectMap["type"] = "Microsoft.ServiceBus/EventHub" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EventHubStreamInputDataSource. -func (e *EventHubStreamInputDataSource) 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 "properties": - err = unpopulate(val, "Properties", &e.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) - 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 EventHubV2OutputDataSource. -func (e EventHubV2OutputDataSource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", e.Properties) - objectMap["type"] = "Microsoft.EventHub/EventHub" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EventHubV2OutputDataSource. -func (e *EventHubV2OutputDataSource) 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 "properties": - err = unpopulate(val, "Properties", &e.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) - 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 EventHubV2StreamInputDataSource. -func (e EventHubV2StreamInputDataSource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", e.Properties) - objectMap["type"] = "Microsoft.EventHub/EventHub" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EventHubV2StreamInputDataSource. -func (e *EventHubV2StreamInputDataSource) 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 "properties": - err = unpopulate(val, "Properties", &e.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) - 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 Function. -func (f Function) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", f.ID) - populate(objectMap, "name", f.Name) - populate(objectMap, "properties", f.Properties) - populate(objectMap, "type", f.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Function. -func (f *Function) 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", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &f.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &f.Name) - delete(rawMsg, key) - case "properties": - f.Properties, err = unmarshalFunctionPropertiesClassification(val) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &f.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type FunctionConfiguration. -func (f FunctionConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "binding", f.Binding) - populate(objectMap, "inputs", f.Inputs) - populate(objectMap, "output", f.Output) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FunctionConfiguration. -func (f *FunctionConfiguration) 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", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "binding": - f.Binding, err = unmarshalFunctionBindingClassification(val) - delete(rawMsg, key) - case "inputs": - err = unpopulate(val, "Inputs", &f.Inputs) - delete(rawMsg, key) - case "output": - err = unpopulate(val, "Output", &f.Output) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Input. -func (i Input) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", i.ID) - populate(objectMap, "name", i.Name) - populate(objectMap, "properties", i.Properties) - populate(objectMap, "type", i.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Input. -func (i *Input) 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", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &i.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &i.Name) - delete(rawMsg, key) - case "properties": - i.Properties, err = unmarshalInputPropertiesClassification(val) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &i.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type InputProperties. -func (i InputProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "compression", i.Compression) - populate(objectMap, "diagnostics", i.Diagnostics) - populate(objectMap, "etag", i.Etag) - populate(objectMap, "partitionKey", i.PartitionKey) - populate(objectMap, "serialization", i.Serialization) - objectMap["type"] = i.Type - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type InputProperties. -func (i *InputProperties) 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", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "compression": - err = unpopulate(val, "Compression", &i.Compression) - delete(rawMsg, key) - case "diagnostics": - err = unpopulate(val, "Diagnostics", &i.Diagnostics) - delete(rawMsg, key) - case "etag": - err = unpopulate(val, "Etag", &i.Etag) - delete(rawMsg, key) - case "partitionKey": - err = unpopulate(val, "PartitionKey", &i.PartitionKey) - delete(rawMsg, key) - case "serialization": - i.Serialization, err = unmarshalSerializationClassification(val) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &i.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type IoTHubStreamInputDataSource. -func (i IoTHubStreamInputDataSource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", i.Properties) - objectMap["type"] = "Microsoft.Devices/IotHubs" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IoTHubStreamInputDataSource. -func (i *IoTHubStreamInputDataSource) 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", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "properties": - err = unpopulate(val, "Properties", &i.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &i.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type JSONSerialization. -func (j JSONSerialization) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", j.Properties) - objectMap["type"] = EventSerializationTypeJSON - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type JSONSerialization. -func (j *JSONSerialization) 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 "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 JavaScriptFunctionBinding. -func (j JavaScriptFunctionBinding) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", j.Properties) - objectMap["type"] = "Microsoft.StreamAnalytics/JavascriptUdf" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type JavaScriptFunctionBinding. -func (j *JavaScriptFunctionBinding) 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 "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 JavaScriptFunctionRetrieveDefaultDefinitionParameters. -func (j JavaScriptFunctionRetrieveDefaultDefinitionParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "bindingRetrievalProperties", j.BindingRetrievalProperties) - objectMap["bindingType"] = "Microsoft.StreamAnalytics/JavascriptUdf" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type JavaScriptFunctionRetrieveDefaultDefinitionParameters. -func (j *JavaScriptFunctionRetrieveDefaultDefinitionParameters) 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 "bindingRetrievalProperties": - err = unpopulate(val, "BindingRetrievalProperties", &j.BindingRetrievalProperties) - delete(rawMsg, key) - case "bindingType": - err = unpopulate(val, "BindingType", &j.BindingType) - 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 Output. -func (o Output) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", o.ID) - populate(objectMap, "name", o.Name) - populate(objectMap, "properties", o.Properties) - populate(objectMap, "type", o.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type OutputProperties. -func (o OutputProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "datasource", o.Datasource) - populate(objectMap, "diagnostics", o.Diagnostics) - populate(objectMap, "etag", o.Etag) - populate(objectMap, "serialization", o.Serialization) - populate(objectMap, "sizeWindow", o.SizeWindow) - populate(objectMap, "timeWindow", o.TimeWindow) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OutputProperties. -func (o *OutputProperties) 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", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "datasource": - o.Datasource, err = unmarshalOutputDataSourceClassification(val) - delete(rawMsg, key) - case "diagnostics": - err = unpopulate(val, "Diagnostics", &o.Diagnostics) - delete(rawMsg, key) - case "etag": - err = unpopulate(val, "Etag", &o.Etag) - delete(rawMsg, key) - case "serialization": - o.Serialization, err = unmarshalSerializationClassification(val) - delete(rawMsg, key) - case "sizeWindow": - err = unpopulate(val, "SizeWindow", &o.SizeWindow) - delete(rawMsg, key) - case "timeWindow": - err = unpopulate(val, "TimeWindow", &o.TimeWindow) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ParquetSerialization. -func (p ParquetSerialization) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", &p.Properties) - objectMap["type"] = EventSerializationTypeParquet - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ParquetSerialization. -func (p *ParquetSerialization) 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 "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 PowerBIOutputDataSource. -func (p PowerBIOutputDataSource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", p.Properties) - objectMap["type"] = "PowerBI" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PowerBIOutputDataSource. -func (p *PowerBIOutputDataSource) 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 "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 PrivateEndpointProperties. -func (p PrivateEndpointProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "createdDate", p.CreatedDate) - populate(objectMap, "manualPrivateLinkServiceConnections", p.ManualPrivateLinkServiceConnections) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionProperties. -func (p PrivateLinkServiceConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "groupIds", p.GroupIDs) - populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) - populate(objectMap, "privateLinkServiceId", p.PrivateLinkServiceID) - populate(objectMap, "requestMessage", p.RequestMessage) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ReferenceInputProperties. -func (r ReferenceInputProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "compression", r.Compression) - populate(objectMap, "datasource", r.Datasource) - populate(objectMap, "diagnostics", r.Diagnostics) - populate(objectMap, "etag", r.Etag) - populate(objectMap, "partitionKey", r.PartitionKey) - populate(objectMap, "serialization", r.Serialization) - objectMap["type"] = "Reference" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ReferenceInputProperties. -func (r *ReferenceInputProperties) 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 "compression": - err = unpopulate(val, "Compression", &r.Compression) - delete(rawMsg, key) - case "datasource": - r.Datasource, err = unmarshalReferenceInputDataSourceClassification(val) - delete(rawMsg, key) - case "diagnostics": - err = unpopulate(val, "Diagnostics", &r.Diagnostics) - delete(rawMsg, key) - case "etag": - err = unpopulate(val, "Etag", &r.Etag) - delete(rawMsg, key) - case "partitionKey": - err = unpopulate(val, "PartitionKey", &r.PartitionKey) - delete(rawMsg, key) - case "serialization": - r.Serialization, err = unmarshalSerializationClassification(val) - 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 ScalarFunctionProperties. -func (s ScalarFunctionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", s.Etag) - populate(objectMap, "properties", s.Properties) - objectMap["type"] = "Scalar" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ScalarFunctionProperties. -func (s *ScalarFunctionProperties) 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 "etag": - err = unpopulate(val, "Etag", &s.Etag) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) - 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 ServiceBusQueueOutputDataSource. -func (s ServiceBusQueueOutputDataSource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", s.Properties) - objectMap["type"] = "Microsoft.ServiceBus/Queue" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceBusQueueOutputDataSource. -func (s *ServiceBusQueueOutputDataSource) 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 "properties": - err = unpopulate(val, "Properties", &s.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) - 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 ServiceBusQueueOutputDataSourceProperties. -func (s ServiceBusQueueOutputDataSourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "authenticationMode", s.AuthenticationMode) - populate(objectMap, "propertyColumns", s.PropertyColumns) - populate(objectMap, "queueName", s.QueueName) - populate(objectMap, "serviceBusNamespace", s.ServiceBusNamespace) - populate(objectMap, "sharedAccessPolicyKey", s.SharedAccessPolicyKey) - populate(objectMap, "sharedAccessPolicyName", s.SharedAccessPolicyName) - populate(objectMap, "systemPropertyColumns", &s.SystemPropertyColumns) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ServiceBusTopicOutputDataSource. -func (s ServiceBusTopicOutputDataSource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", s.Properties) - objectMap["type"] = "Microsoft.ServiceBus/Topic" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceBusTopicOutputDataSource. -func (s *ServiceBusTopicOutputDataSource) 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 "properties": - err = unpopulate(val, "Properties", &s.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) - 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 ServiceBusTopicOutputDataSourceProperties. -func (s ServiceBusTopicOutputDataSourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "authenticationMode", s.AuthenticationMode) - populate(objectMap, "propertyColumns", s.PropertyColumns) - populate(objectMap, "serviceBusNamespace", s.ServiceBusNamespace) - populate(objectMap, "sharedAccessPolicyKey", s.SharedAccessPolicyKey) - populate(objectMap, "sharedAccessPolicyName", s.SharedAccessPolicyName) - populate(objectMap, "systemPropertyColumns", s.SystemPropertyColumns) - populate(objectMap, "topicName", s.TopicName) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type StartStreamingJobParameters. -func (s StartStreamingJobParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "outputStartMode", s.OutputStartMode) - populateTimeRFC3339(objectMap, "outputStartTime", s.OutputStartTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type StartStreamingJobParameters. -func (s *StartStreamingJobParameters) 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 "outputStartMode": - err = unpopulate(val, "OutputStartMode", &s.OutputStartMode) - delete(rawMsg, key) - case "outputStartTime": - err = unpopulateTimeRFC3339(val, "OutputStartTime", &s.OutputStartTime) - 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 StreamInputProperties. -func (s StreamInputProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "compression", s.Compression) - populate(objectMap, "datasource", s.Datasource) - populate(objectMap, "diagnostics", s.Diagnostics) - populate(objectMap, "etag", s.Etag) - populate(objectMap, "partitionKey", s.PartitionKey) - populate(objectMap, "serialization", s.Serialization) - objectMap["type"] = "Stream" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type StreamInputProperties. -func (s *StreamInputProperties) 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 "compression": - err = unpopulate(val, "Compression", &s.Compression) - delete(rawMsg, key) - case "datasource": - s.Datasource, err = unmarshalStreamInputDataSourceClassification(val) - delete(rawMsg, key) - case "diagnostics": - err = unpopulate(val, "Diagnostics", &s.Diagnostics) - delete(rawMsg, key) - case "etag": - err = unpopulate(val, "Etag", &s.Etag) - delete(rawMsg, key) - case "partitionKey": - err = unpopulate(val, "PartitionKey", &s.PartitionKey) - delete(rawMsg, key) - case "serialization": - s.Serialization, err = unmarshalSerializationClassification(val) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) - 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 StreamingJob. -func (s StreamingJob) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", s.ID) - populate(objectMap, "identity", s.Identity) - populate(objectMap, "location", s.Location) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "tags", s.Tags) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type StreamingJobProperties. -func (s StreamingJobProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "cluster", s.Cluster) - populate(objectMap, "compatibilityLevel", s.CompatibilityLevel) - populate(objectMap, "contentStoragePolicy", s.ContentStoragePolicy) - populateTimeRFC3339(objectMap, "createdDate", s.CreatedDate) - populate(objectMap, "dataLocale", s.DataLocale) - populate(objectMap, "etag", s.Etag) - populate(objectMap, "eventsLateArrivalMaxDelayInSeconds", s.EventsLateArrivalMaxDelayInSeconds) - populate(objectMap, "eventsOutOfOrderMaxDelayInSeconds", s.EventsOutOfOrderMaxDelayInSeconds) - populate(objectMap, "eventsOutOfOrderPolicy", s.EventsOutOfOrderPolicy) - populate(objectMap, "functions", s.Functions) - populate(objectMap, "inputs", s.Inputs) - populate(objectMap, "jobId", s.JobID) - populate(objectMap, "jobState", s.JobState) - populate(objectMap, "jobStorageAccount", s.JobStorageAccount) - populate(objectMap, "jobType", s.JobType) - populateTimeRFC3339(objectMap, "lastOutputEventTime", s.LastOutputEventTime) - populate(objectMap, "outputErrorPolicy", s.OutputErrorPolicy) - populate(objectMap, "outputStartMode", s.OutputStartMode) - populateTimeRFC3339(objectMap, "outputStartTime", s.OutputStartTime) - populate(objectMap, "outputs", s.Outputs) - populate(objectMap, "provisioningState", s.ProvisioningState) - populate(objectMap, "sku", s.SKU) - populate(objectMap, "transformation", s.Transformation) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type StreamingJobProperties. -func (s *StreamingJobProperties) 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 "cluster": - err = unpopulate(val, "Cluster", &s.Cluster) - delete(rawMsg, key) - case "compatibilityLevel": - err = unpopulate(val, "CompatibilityLevel", &s.CompatibilityLevel) - delete(rawMsg, key) - case "contentStoragePolicy": - err = unpopulate(val, "ContentStoragePolicy", &s.ContentStoragePolicy) - delete(rawMsg, key) - case "createdDate": - err = unpopulateTimeRFC3339(val, "CreatedDate", &s.CreatedDate) - delete(rawMsg, key) - case "dataLocale": - err = unpopulate(val, "DataLocale", &s.DataLocale) - delete(rawMsg, key) - case "etag": - err = unpopulate(val, "Etag", &s.Etag) - delete(rawMsg, key) - case "eventsLateArrivalMaxDelayInSeconds": - err = unpopulate(val, "EventsLateArrivalMaxDelayInSeconds", &s.EventsLateArrivalMaxDelayInSeconds) - delete(rawMsg, key) - case "eventsOutOfOrderMaxDelayInSeconds": - err = unpopulate(val, "EventsOutOfOrderMaxDelayInSeconds", &s.EventsOutOfOrderMaxDelayInSeconds) - delete(rawMsg, key) - case "eventsOutOfOrderPolicy": - err = unpopulate(val, "EventsOutOfOrderPolicy", &s.EventsOutOfOrderPolicy) - delete(rawMsg, key) - case "functions": - err = unpopulate(val, "Functions", &s.Functions) - delete(rawMsg, key) - case "inputs": - err = unpopulate(val, "Inputs", &s.Inputs) - delete(rawMsg, key) - case "jobId": - err = unpopulate(val, "JobID", &s.JobID) - delete(rawMsg, key) - case "jobState": - err = unpopulate(val, "JobState", &s.JobState) - delete(rawMsg, key) - case "jobStorageAccount": - err = unpopulate(val, "JobStorageAccount", &s.JobStorageAccount) - delete(rawMsg, key) - case "jobType": - err = unpopulate(val, "JobType", &s.JobType) - delete(rawMsg, key) - case "lastOutputEventTime": - err = unpopulateTimeRFC3339(val, "LastOutputEventTime", &s.LastOutputEventTime) - delete(rawMsg, key) - case "outputErrorPolicy": - err = unpopulate(val, "OutputErrorPolicy", &s.OutputErrorPolicy) - delete(rawMsg, key) - case "outputStartMode": - err = unpopulate(val, "OutputStartMode", &s.OutputStartMode) - delete(rawMsg, key) - case "outputStartTime": - err = unpopulateTimeRFC3339(val, "OutputStartTime", &s.OutputStartTime) - delete(rawMsg, key) - case "outputs": - err = unpopulate(val, "Outputs", &s.Outputs) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &s.SKU) - delete(rawMsg, key) - case "transformation": - err = unpopulate(val, "Transformation", &s.Transformation) - 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 TrackedResource. -func (t TrackedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", t.ID) - populate(objectMap, "location", t.Location) - populate(objectMap, "name", t.Name) - populate(objectMap, "tags", t.Tags) - populate(objectMap, "type", t.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type Transformation. -func (t Transformation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", t.ID) - populate(objectMap, "name", t.Name) - populate(objectMap, "properties", t.Properties) - populate(objectMap, "type", t.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type TransformationProperties. -func (t TransformationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", t.Etag) - populate(objectMap, "query", t.Query) - populate(objectMap, "streamingUnits", t.StreamingUnits) - populate(objectMap, "validStreamingUnits", t.ValidStreamingUnits) - 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 -}