From e83458473d7d603fac92b788220f029cd70a3136 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 12 Jul 2022 05:19:41 +0000 Subject: [PATCH] CodeGen from PR 19716 in Azure/azure-rest-api-specs Merge b694193635220431592e54aea59137a812db4886 into 432872fac1d0f8edcae98a0e8504afc0ee302710 --- .../mariadb/armmariadb/CHANGELOG.md | 4 + ..._advisors_client.go => advisors_client.go} | 1 + .../mariadb/armmariadb/autorest.md | 6 +- ...ent.go => checknameavailability_client.go} | 1 + ...ons_client.go => configurations_client.go} | 1 + ...zz_generated_constants.go => constants.go} | 3 +- ...atabases_client.go => databases_client.go} | 1 + ...ules_client.go => firewallrules_client.go} | 1 + sdk/resourcemanager/mariadb/armmariadb/go.mod | 14 +- sdk/resourcemanager/mariadb/armmariadb/go.sum | 24 +- ...=> locationbasedperformancetier_client.go} | 1 + ...edactionsessionsoperationstatus_client.go} | 1 + ...recommendedactionsessionsresult_client.go} | 1 + ..._logfiles_client.go => logfiles_client.go} | 1 + ...agement_client.go => management_client.go} | 1 + .../{zz_generated_models.go => models.go} | 1 + .../mariadb/armmariadb/models_serde.go | 3062 +++++++++++++++++ ...rations_client.go => operations_client.go} | 1 + ...phic_helpers.go => polymorphic_helpers.go} | 1 + ...o => privateendpointconnections_client.go} | 1 + ...ient.go => privatelinkresources_client.go} | 1 + ...rytexts_client.go => querytexts_client.go} | 1 + ...client.go => recommendedactions_client.go} | 1 + ...client.go => recoverableservers_client.go} | 1 + ..._replicas_client.go => replicas_client.go} | 1 + ...ed_response_types.go => response_types.go} | 1 + ...o => serverbasedperformancetier_client.go} | 1 + ...s_client.go => serverparameters_client.go} | 1 + ...ed_servers_client.go => servers_client.go} | 1 + ... => serversecurityalertpolicies_client.go} | 1 + ...erated_time_rfc3339.go => time_rfc3339.go} | 1 + ...client.go => topquerystatistics_client.go} | 1 + ...lient.go => virtualnetworkrules_client.go} | 1 + ...ics_client.go => waitstatistics_client.go} | 1 + ..._generated_example_advisors_client_test.go | 66 - ...ample_checknameavailability_client_test.go | 42 - ...ated_example_configurations_client_test.go | 100 - ...generated_example_databases_client_test.go | 125 - ...rated_example_firewallrules_client_test.go | 125 - ...ocationbasedperformancetier_client_test.go | 42 - ...tionsessionsoperationstatus_client_test.go | 39 - ...mmendedactionsessionsresult_client_test.go | 43 - ..._generated_example_logfiles_client_test.go | 43 - ...ple_mariadbmanagementclient_client_test.go | 65 - ...enerated_example_operations_client_test.go | 37 - ..._privateendpointconnections_client_test.go | 160 - ...xample_privatelinkresources_client_test.go | 66 - ...enerated_example_querytexts_client_test.go | 69 - ..._example_recommendedactions_client_test.go | 68 - ..._example_recoverableservers_client_test.go | 39 - ..._generated_example_replicas_client_test.go | 43 - ..._serverbasedperformancetier_client_test.go | 43 - ...ed_example_serverparameters_client_test.go | 44 - ...e_generated_example_servers_client_test.go | 262 -- ...serversecurityalertpolicies_client_test.go | 108 - ..._example_topquerystatistics_client_test.go | 79 - ...example_virtualnetworkrules_client_test.go | 125 - ...ated_example_waitstatistics_client_test.go | 76 - .../armmariadb/zz_generated_models_serde.go | 758 ---- 59 files changed, 3105 insertions(+), 2703 deletions(-) rename sdk/resourcemanager/mariadb/armmariadb/{zz_generated_advisors_client.go => advisors_client.go} (99%) rename sdk/resourcemanager/mariadb/armmariadb/{zz_generated_checknameavailability_client.go => checknameavailability_client.go} (99%) rename sdk/resourcemanager/mariadb/armmariadb/{zz_generated_configurations_client.go => configurations_client.go} (99%) rename sdk/resourcemanager/mariadb/armmariadb/{zz_generated_constants.go => constants.go} (99%) rename sdk/resourcemanager/mariadb/armmariadb/{zz_generated_databases_client.go => databases_client.go} (99%) rename sdk/resourcemanager/mariadb/armmariadb/{zz_generated_firewallrules_client.go => firewallrules_client.go} (99%) rename sdk/resourcemanager/mariadb/armmariadb/{zz_generated_locationbasedperformancetier_client.go => locationbasedperformancetier_client.go} (99%) rename sdk/resourcemanager/mariadb/armmariadb/{zz_generated_locationbasedrecommendedactionsessionsoperationstatus_client.go => locationbasedrecommendedactionsessionsoperationstatus_client.go} (99%) rename sdk/resourcemanager/mariadb/armmariadb/{zz_generated_locationbasedrecommendedactionsessionsresult_client.go => locationbasedrecommendedactionsessionsresult_client.go} (99%) rename sdk/resourcemanager/mariadb/armmariadb/{zz_generated_logfiles_client.go => logfiles_client.go} (99%) rename sdk/resourcemanager/mariadb/armmariadb/{zz_generated_management_client.go => management_client.go} (99%) rename sdk/resourcemanager/mariadb/armmariadb/{zz_generated_models.go => models.go} (99%) create mode 100644 sdk/resourcemanager/mariadb/armmariadb/models_serde.go rename sdk/resourcemanager/mariadb/armmariadb/{zz_generated_operations_client.go => operations_client.go} (99%) rename sdk/resourcemanager/mariadb/armmariadb/{zz_generated_polymorphic_helpers.go => polymorphic_helpers.go} (98%) rename sdk/resourcemanager/mariadb/armmariadb/{zz_generated_privateendpointconnections_client.go => privateendpointconnections_client.go} (99%) rename sdk/resourcemanager/mariadb/armmariadb/{zz_generated_privatelinkresources_client.go => privatelinkresources_client.go} (99%) rename sdk/resourcemanager/mariadb/armmariadb/{zz_generated_querytexts_client.go => querytexts_client.go} (99%) rename sdk/resourcemanager/mariadb/armmariadb/{zz_generated_recommendedactions_client.go => recommendedactions_client.go} (99%) rename sdk/resourcemanager/mariadb/armmariadb/{zz_generated_recoverableservers_client.go => recoverableservers_client.go} (99%) rename sdk/resourcemanager/mariadb/armmariadb/{zz_generated_replicas_client.go => replicas_client.go} (99%) rename sdk/resourcemanager/mariadb/armmariadb/{zz_generated_response_types.go => response_types.go} (99%) rename sdk/resourcemanager/mariadb/armmariadb/{zz_generated_serverbasedperformancetier_client.go => serverbasedperformancetier_client.go} (99%) rename sdk/resourcemanager/mariadb/armmariadb/{zz_generated_serverparameters_client.go => serverparameters_client.go} (99%) rename sdk/resourcemanager/mariadb/armmariadb/{zz_generated_servers_client.go => servers_client.go} (99%) rename sdk/resourcemanager/mariadb/armmariadb/{zz_generated_serversecurityalertpolicies_client.go => serversecurityalertpolicies_client.go} (99%) rename sdk/resourcemanager/mariadb/armmariadb/{zz_generated_time_rfc3339.go => time_rfc3339.go} (99%) rename sdk/resourcemanager/mariadb/armmariadb/{zz_generated_topquerystatistics_client.go => topquerystatistics_client.go} (99%) rename sdk/resourcemanager/mariadb/armmariadb/{zz_generated_virtualnetworkrules_client.go => virtualnetworkrules_client.go} (99%) rename sdk/resourcemanager/mariadb/armmariadb/{zz_generated_waitstatistics_client.go => waitstatistics_client.go} (99%) delete mode 100644 sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_advisors_client_test.go delete mode 100644 sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_checknameavailability_client_test.go delete mode 100644 sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_configurations_client_test.go delete mode 100644 sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_databases_client_test.go delete mode 100644 sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_firewallrules_client_test.go delete mode 100644 sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_locationbasedperformancetier_client_test.go delete mode 100644 sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_locationbasedrecommendedactionsessionsoperationstatus_client_test.go delete mode 100644 sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_locationbasedrecommendedactionsessionsresult_client_test.go delete mode 100644 sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_logfiles_client_test.go delete mode 100644 sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_mariadbmanagementclient_client_test.go delete mode 100644 sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_operations_client_test.go delete mode 100644 sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_privateendpointconnections_client_test.go delete mode 100644 sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_privatelinkresources_client_test.go delete mode 100644 sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_querytexts_client_test.go delete mode 100644 sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_recommendedactions_client_test.go delete mode 100644 sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_recoverableservers_client_test.go delete mode 100644 sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_replicas_client_test.go delete mode 100644 sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_serverbasedperformancetier_client_test.go delete mode 100644 sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_serverparameters_client_test.go delete mode 100644 sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_servers_client_test.go delete mode 100644 sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_serversecurityalertpolicies_client_test.go delete mode 100644 sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_topquerystatistics_client_test.go delete mode 100644 sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_virtualnetworkrules_client_test.go delete mode 100644 sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_waitstatistics_client_test.go delete mode 100644 sdk/resourcemanager/mariadb/armmariadb/zz_generated_models_serde.go diff --git a/sdk/resourcemanager/mariadb/armmariadb/CHANGELOG.md b/sdk/resourcemanager/mariadb/armmariadb/CHANGELOG.md index 84ef25a7ba10..abb54f8eeb3d 100644 --- a/sdk/resourcemanager/mariadb/armmariadb/CHANGELOG.md +++ b/sdk/resourcemanager/mariadb/armmariadb/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 1.0.1 (2022-07-12) +### Other Changes + + ## 1.0.0 (2022-05-17) The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mariadb/armmariadb` 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/mariadb/armmariadb/zz_generated_advisors_client.go b/sdk/resourcemanager/mariadb/armmariadb/advisors_client.go similarity index 99% rename from sdk/resourcemanager/mariadb/armmariadb/zz_generated_advisors_client.go rename to sdk/resourcemanager/mariadb/armmariadb/advisors_client.go index 88068044efc5..567461c4feff 100644 --- a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_advisors_client.go +++ b/sdk/resourcemanager/mariadb/armmariadb/advisors_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 armmariadb diff --git a/sdk/resourcemanager/mariadb/armmariadb/autorest.md b/sdk/resourcemanager/mariadb/armmariadb/autorest.md index 0ad8e82003eb..79f92d640a36 100644 --- a/sdk/resourcemanager/mariadb/armmariadb/autorest.md +++ b/sdk/resourcemanager/mariadb/armmariadb/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mariadb/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/mariadb/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/mariadb/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/mariadb/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 +module-version: 1.0.1 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_checknameavailability_client.go b/sdk/resourcemanager/mariadb/armmariadb/checknameavailability_client.go similarity index 99% rename from sdk/resourcemanager/mariadb/armmariadb/zz_generated_checknameavailability_client.go rename to sdk/resourcemanager/mariadb/armmariadb/checknameavailability_client.go index 4cba47230873..70bd2aae79c1 100644 --- a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_checknameavailability_client.go +++ b/sdk/resourcemanager/mariadb/armmariadb/checknameavailability_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 armmariadb diff --git a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_configurations_client.go b/sdk/resourcemanager/mariadb/armmariadb/configurations_client.go similarity index 99% rename from sdk/resourcemanager/mariadb/armmariadb/zz_generated_configurations_client.go rename to sdk/resourcemanager/mariadb/armmariadb/configurations_client.go index 71b749cab8b7..ef7a1e9372de 100644 --- a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_configurations_client.go +++ b/sdk/resourcemanager/mariadb/armmariadb/configurations_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 armmariadb diff --git a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_constants.go b/sdk/resourcemanager/mariadb/armmariadb/constants.go similarity index 99% rename from sdk/resourcemanager/mariadb/armmariadb/zz_generated_constants.go rename to sdk/resourcemanager/mariadb/armmariadb/constants.go index 02f7a6f903a4..b8fb968c4471 100644 --- a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_constants.go +++ b/sdk/resourcemanager/mariadb/armmariadb/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 armmariadb const ( moduleName = "armmariadb" - moduleVersion = "v1.0.0" + moduleVersion = "v1.0.1" ) // CreateMode - The mode to create a new server. diff --git a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_databases_client.go b/sdk/resourcemanager/mariadb/armmariadb/databases_client.go similarity index 99% rename from sdk/resourcemanager/mariadb/armmariadb/zz_generated_databases_client.go rename to sdk/resourcemanager/mariadb/armmariadb/databases_client.go index 2a2c30ef138c..4aae9225bddd 100644 --- a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_databases_client.go +++ b/sdk/resourcemanager/mariadb/armmariadb/databases_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 armmariadb diff --git a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_firewallrules_client.go b/sdk/resourcemanager/mariadb/armmariadb/firewallrules_client.go similarity index 99% rename from sdk/resourcemanager/mariadb/armmariadb/zz_generated_firewallrules_client.go rename to sdk/resourcemanager/mariadb/armmariadb/firewallrules_client.go index 5c04f3fbb65d..8199df4e143f 100644 --- a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_firewallrules_client.go +++ b/sdk/resourcemanager/mariadb/armmariadb/firewallrules_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 armmariadb diff --git a/sdk/resourcemanager/mariadb/armmariadb/go.mod b/sdk/resourcemanager/mariadb/armmariadb/go.mod index 07a5674b167e..7cc1b789b93a 100644 --- a/sdk/resourcemanager/mariadb/armmariadb/go.mod +++ b/sdk/resourcemanager/mariadb/armmariadb/go.mod @@ -2,20 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mariadb/armmariadb 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/mariadb/armmariadb/go.sum b/sdk/resourcemanager/mariadb/armmariadb/go.sum index ed5b814680ee..3afb578030a5 100644 --- a/sdk/resourcemanager/mariadb/armmariadb/go.sum +++ b/sdk/resourcemanager/mariadb/armmariadb/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/mariadb/armmariadb/zz_generated_locationbasedperformancetier_client.go b/sdk/resourcemanager/mariadb/armmariadb/locationbasedperformancetier_client.go similarity index 99% rename from sdk/resourcemanager/mariadb/armmariadb/zz_generated_locationbasedperformancetier_client.go rename to sdk/resourcemanager/mariadb/armmariadb/locationbasedperformancetier_client.go index 561dc8e1e155..0746c4f6b309 100644 --- a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_locationbasedperformancetier_client.go +++ b/sdk/resourcemanager/mariadb/armmariadb/locationbasedperformancetier_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 armmariadb diff --git a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_locationbasedrecommendedactionsessionsoperationstatus_client.go b/sdk/resourcemanager/mariadb/armmariadb/locationbasedrecommendedactionsessionsoperationstatus_client.go similarity index 99% rename from sdk/resourcemanager/mariadb/armmariadb/zz_generated_locationbasedrecommendedactionsessionsoperationstatus_client.go rename to sdk/resourcemanager/mariadb/armmariadb/locationbasedrecommendedactionsessionsoperationstatus_client.go index d438f119a2e8..8acf102a7735 100644 --- a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_locationbasedrecommendedactionsessionsoperationstatus_client.go +++ b/sdk/resourcemanager/mariadb/armmariadb/locationbasedrecommendedactionsessionsoperationstatus_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 armmariadb diff --git a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_locationbasedrecommendedactionsessionsresult_client.go b/sdk/resourcemanager/mariadb/armmariadb/locationbasedrecommendedactionsessionsresult_client.go similarity index 99% rename from sdk/resourcemanager/mariadb/armmariadb/zz_generated_locationbasedrecommendedactionsessionsresult_client.go rename to sdk/resourcemanager/mariadb/armmariadb/locationbasedrecommendedactionsessionsresult_client.go index f4586e9aa1b7..25327cde5d0d 100644 --- a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_locationbasedrecommendedactionsessionsresult_client.go +++ b/sdk/resourcemanager/mariadb/armmariadb/locationbasedrecommendedactionsessionsresult_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 armmariadb diff --git a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_logfiles_client.go b/sdk/resourcemanager/mariadb/armmariadb/logfiles_client.go similarity index 99% rename from sdk/resourcemanager/mariadb/armmariadb/zz_generated_logfiles_client.go rename to sdk/resourcemanager/mariadb/armmariadb/logfiles_client.go index 68e25914a9ab..f55ceccb3a79 100644 --- a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_logfiles_client.go +++ b/sdk/resourcemanager/mariadb/armmariadb/logfiles_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 armmariadb diff --git a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_management_client.go b/sdk/resourcemanager/mariadb/armmariadb/management_client.go similarity index 99% rename from sdk/resourcemanager/mariadb/armmariadb/zz_generated_management_client.go rename to sdk/resourcemanager/mariadb/armmariadb/management_client.go index 3c5e6a930bdc..4a6a9646528d 100644 --- a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_management_client.go +++ b/sdk/resourcemanager/mariadb/armmariadb/management_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 armmariadb diff --git a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_models.go b/sdk/resourcemanager/mariadb/armmariadb/models.go similarity index 99% rename from sdk/resourcemanager/mariadb/armmariadb/zz_generated_models.go rename to sdk/resourcemanager/mariadb/armmariadb/models.go index a3978ef7b1f3..efaf9d682579 100644 --- a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_models.go +++ b/sdk/resourcemanager/mariadb/armmariadb/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 armmariadb diff --git a/sdk/resourcemanager/mariadb/armmariadb/models_serde.go b/sdk/resourcemanager/mariadb/armmariadb/models_serde.go new file mode 100644 index 000000000000..80782dc9db96 --- /dev/null +++ b/sdk/resourcemanager/mariadb/armmariadb/models_serde.go @@ -0,0 +1,3062 @@ +//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 armmariadb + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" +) + +// MarshalJSON implements the json.Marshaller interface for type Advisor. +func (a Advisor) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", &a.Properties) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Advisor. +func (a *Advisor) 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 "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + 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 AdvisorsResultList. +func (a AdvisorsResultList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AdvisorsResultList. +func (a *AdvisorsResultList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CloudError. +func (c CloudError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "error", c.Error) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CloudError. +func (c *CloudError) 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 "error": + err = unpopulate(val, "Error", &c.Error) + 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 Configuration. +func (c Configuration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", c.ID) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Configuration. +func (c *Configuration) 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 "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, 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 ConfigurationListResult. +func (c ConfigurationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationListResult. +func (c *ConfigurationListResult) 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 "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 ConfigurationProperties. +func (c ConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "allowedValues", c.AllowedValues) + populate(objectMap, "dataType", c.DataType) + populate(objectMap, "defaultValue", c.DefaultValue) + populate(objectMap, "description", c.Description) + populate(objectMap, "source", c.Source) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationProperties. +func (c *ConfigurationProperties) 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 "allowedValues": + err = unpopulate(val, "AllowedValues", &c.AllowedValues) + delete(rawMsg, key) + case "dataType": + err = unpopulate(val, "DataType", &c.DataType) + delete(rawMsg, key) + case "defaultValue": + err = unpopulate(val, "DefaultValue", &c.DefaultValue) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &c.Description) + delete(rawMsg, key) + case "source": + err = unpopulate(val, "Source", &c.Source) + 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 Database. +func (d Database) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Database. +func (d *Database) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseListResult. +func (d DatabaseListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseListResult. +func (d *DatabaseListResult) 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 "value": + err = unpopulate(val, "Value", &d.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseProperties. +func (d DatabaseProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "charset", d.Charset) + populate(objectMap, "collation", d.Collation) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseProperties. +func (d *DatabaseProperties) 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 "charset": + err = unpopulate(val, "Charset", &d.Charset) + delete(rawMsg, key) + case "collation": + err = unpopulate(val, "Collation", &d.Collation) + 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 ErrorAdditionalInfo. +func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "info", &e.Info) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo. +func (e *ErrorAdditionalInfo) 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 "info": + err = unpopulate(val, "Info", &e.Info) + 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 ErrorResponse. +func (e ErrorResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "additionalInfo", e.AdditionalInfo) + 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 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 "additionalInfo": + err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) + delete(rawMsg, 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 FirewallRule. +func (f FirewallRule) 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 FirewallRule. +func (f *FirewallRule) 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": + 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 FirewallRuleListResult. +func (f FirewallRuleListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", f.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallRuleListResult. +func (f *FirewallRuleListResult) 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 "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 FirewallRuleProperties. +func (f FirewallRuleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "endIpAddress", f.EndIPAddress) + populate(objectMap, "startIpAddress", f.StartIPAddress) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallRuleProperties. +func (f *FirewallRuleProperties) 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 "endIpAddress": + err = unpopulate(val, "EndIPAddress", &f.EndIPAddress) + delete(rawMsg, key) + case "startIpAddress": + err = unpopulate(val, "StartIPAddress", &f.StartIPAddress) + 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 LogFile. +func (l LogFile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", l.ID) + populate(objectMap, "name", l.Name) + populate(objectMap, "properties", l.Properties) + populate(objectMap, "type", l.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LogFile. +func (l *LogFile) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &l.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &l.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &l.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &l.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LogFileListResult. +func (l LogFileListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LogFileListResult. +func (l *LogFileListResult) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &l.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LogFileProperties. +func (l LogFileProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "createdTime", l.CreatedTime) + populateTimeRFC3339(objectMap, "lastModifiedTime", l.LastModifiedTime) + populate(objectMap, "sizeInKB", l.SizeInKB) + populate(objectMap, "type", l.Type) + populate(objectMap, "url", l.URL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LogFileProperties. +func (l *LogFileProperties) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "createdTime": + err = unpopulateTimeRFC3339(val, "CreatedTime", &l.CreatedTime) + delete(rawMsg, key) + case "lastModifiedTime": + err = unpopulateTimeRFC3339(val, "LastModifiedTime", &l.LastModifiedTime) + delete(rawMsg, key) + case "sizeInKB": + err = unpopulate(val, "SizeInKB", &l.SizeInKB) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &l.Type) + delete(rawMsg, key) + case "url": + err = unpopulate(val, "URL", &l.URL) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NameAvailability. +func (n NameAvailability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "message", n.Message) + populate(objectMap, "nameAvailable", n.NameAvailable) + populate(objectMap, "reason", n.Reason) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NameAvailability. +func (n *NameAvailability) 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "message": + err = unpopulate(val, "Message", &n.Message) + delete(rawMsg, key) + case "nameAvailable": + err = unpopulate(val, "NameAvailable", &n.NameAvailable) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &n.Reason) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NameAvailabilityRequest. +func (n NameAvailabilityRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", n.Name) + populate(objectMap, "type", n.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NameAvailabilityRequest. +func (n *NameAvailabilityRequest) 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &n.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, 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, "name", o.Name) + populate(objectMap, "origin", o.Origin) + populate(objectMap, "properties", o.Properties) + 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 "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "origin": + err = unpopulate(val, "Origin", &o.Origin) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) + 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, "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 "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 PerformanceTierListResult. +func (p PerformanceTierListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PerformanceTierListResult. +func (p *PerformanceTierListResult) 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 "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 PerformanceTierProperties. +func (p PerformanceTierProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + populate(objectMap, "maxBackupRetentionDays", p.MaxBackupRetentionDays) + populate(objectMap, "maxLargeStorageMB", p.MaxLargeStorageMB) + populate(objectMap, "maxStorageMB", p.MaxStorageMB) + populate(objectMap, "minBackupRetentionDays", p.MinBackupRetentionDays) + populate(objectMap, "minLargeStorageMB", p.MinLargeStorageMB) + populate(objectMap, "minStorageMB", p.MinStorageMB) + populate(objectMap, "serviceLevelObjectives", p.ServiceLevelObjectives) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PerformanceTierProperties. +func (p *PerformanceTierProperties) 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 "maxBackupRetentionDays": + err = unpopulate(val, "MaxBackupRetentionDays", &p.MaxBackupRetentionDays) + delete(rawMsg, key) + case "maxLargeStorageMB": + err = unpopulate(val, "MaxLargeStorageMB", &p.MaxLargeStorageMB) + delete(rawMsg, key) + case "maxStorageMB": + err = unpopulate(val, "MaxStorageMB", &p.MaxStorageMB) + delete(rawMsg, key) + case "minBackupRetentionDays": + err = unpopulate(val, "MinBackupRetentionDays", &p.MinBackupRetentionDays) + delete(rawMsg, key) + case "minLargeStorageMB": + err = unpopulate(val, "MinLargeStorageMB", &p.MinLargeStorageMB) + delete(rawMsg, key) + case "minStorageMB": + err = unpopulate(val, "MinStorageMB", &p.MinStorageMB) + delete(rawMsg, key) + case "serviceLevelObjectives": + err = unpopulate(val, "ServiceLevelObjectives", &p.ServiceLevelObjectives) + 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 PerformanceTierServiceLevelObjectives. +func (p PerformanceTierServiceLevelObjectives) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "edition", p.Edition) + populate(objectMap, "hardwareGeneration", p.HardwareGeneration) + populate(objectMap, "id", p.ID) + populate(objectMap, "maxBackupRetentionDays", p.MaxBackupRetentionDays) + populate(objectMap, "maxStorageMB", p.MaxStorageMB) + populate(objectMap, "minBackupRetentionDays", p.MinBackupRetentionDays) + populate(objectMap, "minStorageMB", p.MinStorageMB) + populate(objectMap, "vCore", p.VCore) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PerformanceTierServiceLevelObjectives. +func (p *PerformanceTierServiceLevelObjectives) 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 "edition": + err = unpopulate(val, "Edition", &p.Edition) + delete(rawMsg, key) + case "hardwareGeneration": + err = unpopulate(val, "HardwareGeneration", &p.HardwareGeneration) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "maxBackupRetentionDays": + err = unpopulate(val, "MaxBackupRetentionDays", &p.MaxBackupRetentionDays) + delete(rawMsg, key) + case "maxStorageMB": + err = unpopulate(val, "MaxStorageMB", &p.MaxStorageMB) + delete(rawMsg, key) + case "minBackupRetentionDays": + err = unpopulate(val, "MinBackupRetentionDays", &p.MinBackupRetentionDays) + delete(rawMsg, key) + case "minStorageMB": + err = unpopulate(val, "MinStorageMB", &p.MinStorageMB) + delete(rawMsg, key) + case "vCore": + err = unpopulate(val, "VCore", &p.VCore) + 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 PrivateEndpointConnection. +func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnection. +func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult. +func (p PrivateEndpointConnectionListResult) 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 PrivateEndpointConnectionListResult. +func (p *PrivateEndpointConnectionListResult) 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 PrivateEndpointConnectionProperties. +func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "privateEndpoint", p.PrivateEndpoint) + populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) + populate(objectMap, "provisioningState", p.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionProperties. +func (p *PrivateEndpointConnectionProperties) 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 "privateEndpoint": + err = unpopulate(val, "PrivateEndpoint", &p.PrivateEndpoint) + delete(rawMsg, key) + case "privateLinkServiceConnectionState": + err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + 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 PrivateEndpointProperty. +func (p PrivateEndpointProperty) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointProperty. +func (p *PrivateEndpointProperty) 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) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource. +func (p PrivateLinkResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResource. +func (p *PrivateLinkResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult. +func (p PrivateLinkResourceListResult) 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 PrivateLinkResourceListResult. +func (p *PrivateLinkResourceListResult) 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 PrivateLinkResourceProperties. +func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "groupId", p.GroupID) + populate(objectMap, "requiredMembers", p.RequiredMembers) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceProperties. +func (p *PrivateLinkResourceProperties) 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 "groupId": + err = unpopulate(val, "GroupID", &p.GroupID) + delete(rawMsg, key) + case "requiredMembers": + err = unpopulate(val, "RequiredMembers", &p.RequiredMembers) + 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 PrivateLinkServiceConnectionStateProperty. +func (p PrivateLinkServiceConnectionStateProperty) 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 PrivateLinkServiceConnectionStateProperty. +func (p *PrivateLinkServiceConnectionStateProperty) 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 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 QueryPerformanceInsightResetDataResult. +func (q QueryPerformanceInsightResetDataResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "message", q.Message) + populate(objectMap, "status", q.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type QueryPerformanceInsightResetDataResult. +func (q *QueryPerformanceInsightResetDataResult) 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", q, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "message": + err = unpopulate(val, "Message", &q.Message) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &q.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", q, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type QueryStatistic. +func (q QueryStatistic) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", q.ID) + populate(objectMap, "name", q.Name) + populate(objectMap, "properties", q.Properties) + populate(objectMap, "type", q.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type QueryStatistic. +func (q *QueryStatistic) 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", q, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &q.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &q.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &q.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &q.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", q, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type QueryStatisticProperties. +func (q QueryStatisticProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "aggregationFunction", q.AggregationFunction) + populate(objectMap, "databaseNames", q.DatabaseNames) + populateTimeRFC3339(objectMap, "endTime", q.EndTime) + populate(objectMap, "metricDisplayName", q.MetricDisplayName) + populate(objectMap, "metricName", q.MetricName) + populate(objectMap, "metricValue", q.MetricValue) + populate(objectMap, "metricValueUnit", q.MetricValueUnit) + populate(objectMap, "queryExecutionCount", q.QueryExecutionCount) + populate(objectMap, "queryId", q.QueryID) + populateTimeRFC3339(objectMap, "startTime", q.StartTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type QueryStatisticProperties. +func (q *QueryStatisticProperties) 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", q, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "aggregationFunction": + err = unpopulate(val, "AggregationFunction", &q.AggregationFunction) + delete(rawMsg, key) + case "databaseNames": + err = unpopulate(val, "DatabaseNames", &q.DatabaseNames) + delete(rawMsg, key) + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &q.EndTime) + delete(rawMsg, key) + case "metricDisplayName": + err = unpopulate(val, "MetricDisplayName", &q.MetricDisplayName) + delete(rawMsg, key) + case "metricName": + err = unpopulate(val, "MetricName", &q.MetricName) + delete(rawMsg, key) + case "metricValue": + err = unpopulate(val, "MetricValue", &q.MetricValue) + delete(rawMsg, key) + case "metricValueUnit": + err = unpopulate(val, "MetricValueUnit", &q.MetricValueUnit) + delete(rawMsg, key) + case "queryExecutionCount": + err = unpopulate(val, "QueryExecutionCount", &q.QueryExecutionCount) + delete(rawMsg, key) + case "queryId": + err = unpopulate(val, "QueryID", &q.QueryID) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &q.StartTime) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", q, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type QueryText. +func (q QueryText) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", q.ID) + populate(objectMap, "name", q.Name) + populate(objectMap, "properties", q.Properties) + populate(objectMap, "type", q.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type QueryText. +func (q *QueryText) 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", q, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &q.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &q.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &q.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &q.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", q, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type QueryTextProperties. +func (q QueryTextProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "queryId", q.QueryID) + populate(objectMap, "queryText", q.QueryText) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type QueryTextProperties. +func (q *QueryTextProperties) 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", q, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "queryId": + err = unpopulate(val, "QueryID", &q.QueryID) + delete(rawMsg, key) + case "queryText": + err = unpopulate(val, "QueryText", &q.QueryText) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", q, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type QueryTextsResultList. +func (q QueryTextsResultList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", q.NextLink) + populate(objectMap, "value", q.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type QueryTextsResultList. +func (q *QueryTextsResultList) 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", q, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &q.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &q.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", q, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RecommendationAction. +func (r RecommendationAction) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecommendationAction. +func (r *RecommendationAction) 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 "properties": + err = unpopulate(val, "Properties", &r.Properties) + 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 RecommendationActionProperties. +func (r RecommendationActionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "actionId", r.ActionID) + populate(objectMap, "advisorName", r.AdvisorName) + populateTimeRFC3339(objectMap, "createdTime", r.CreatedTime) + populate(objectMap, "details", r.Details) + populateTimeRFC3339(objectMap, "expirationTime", r.ExpirationTime) + populate(objectMap, "reason", r.Reason) + populate(objectMap, "recommendationType", r.RecommendationType) + populate(objectMap, "sessionId", r.SessionID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecommendationActionProperties. +func (r *RecommendationActionProperties) 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 "actionId": + err = unpopulate(val, "ActionID", &r.ActionID) + delete(rawMsg, key) + case "advisorName": + err = unpopulate(val, "AdvisorName", &r.AdvisorName) + delete(rawMsg, key) + case "createdTime": + err = unpopulateTimeRFC3339(val, "CreatedTime", &r.CreatedTime) + delete(rawMsg, key) + case "details": + err = unpopulate(val, "Details", &r.Details) + delete(rawMsg, key) + case "expirationTime": + err = unpopulateTimeRFC3339(val, "ExpirationTime", &r.ExpirationTime) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &r.Reason) + delete(rawMsg, key) + case "recommendationType": + err = unpopulate(val, "RecommendationType", &r.RecommendationType) + delete(rawMsg, key) + case "sessionId": + err = unpopulate(val, "SessionID", &r.SessionID) + 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 RecommendationActionsResultList. +func (r RecommendationActionsResultList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecommendationActionsResultList. +func (r *RecommendationActionsResultList) 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 "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &r.Value) + 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 RecommendedActionSessionsOperationStatus. +func (r RecommendedActionSessionsOperationStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", r.Name) + populateTimeRFC3339(objectMap, "startTime", r.StartTime) + populate(objectMap, "status", r.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecommendedActionSessionsOperationStatus. +func (r *RecommendedActionSessionsOperationStatus) 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 "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &r.StartTime) + 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 RecoverableServerProperties. +func (r RecoverableServerProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "edition", r.Edition) + populate(objectMap, "hardwareGeneration", r.HardwareGeneration) + populate(objectMap, "lastAvailableBackupDateTime", r.LastAvailableBackupDateTime) + populate(objectMap, "serviceLevelObjective", r.ServiceLevelObjective) + populate(objectMap, "vCore", r.VCore) + populate(objectMap, "version", r.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecoverableServerProperties. +func (r *RecoverableServerProperties) 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 "edition": + err = unpopulate(val, "Edition", &r.Edition) + delete(rawMsg, key) + case "hardwareGeneration": + err = unpopulate(val, "HardwareGeneration", &r.HardwareGeneration) + delete(rawMsg, key) + case "lastAvailableBackupDateTime": + err = unpopulate(val, "LastAvailableBackupDateTime", &r.LastAvailableBackupDateTime) + delete(rawMsg, key) + case "serviceLevelObjective": + err = unpopulate(val, "ServiceLevelObjective", &r.ServiceLevelObjective) + delete(rawMsg, key) + case "vCore": + err = unpopulate(val, "VCore", &r.VCore) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &r.Version) + 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 RecoverableServerResource. +func (r RecoverableServerResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecoverableServerResource. +func (r *RecoverableServerResource) 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 "properties": + err = unpopulate(val, "Properties", &r.Properties) + 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 SKU. +func (s SKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "capacity", s.Capacity) + populate(objectMap, "family", s.Family) + populate(objectMap, "name", s.Name) + populate(objectMap, "size", s.Size) + populate(objectMap, "tier", s.Tier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SKU. +func (s *SKU) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "capacity": + err = unpopulate(val, "Capacity", &s.Capacity) + delete(rawMsg, key) + case "family": + err = unpopulate(val, "Family", &s.Family) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "size": + err = unpopulate(val, "Size", &s.Size) + delete(rawMsg, key) + case "tier": + err = unpopulate(val, "Tier", &s.Tier) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SecurityAlertPolicyProperties. +func (s SecurityAlertPolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "disabledAlerts", s.DisabledAlerts) + populate(objectMap, "emailAccountAdmins", s.EmailAccountAdmins) + populate(objectMap, "emailAddresses", s.EmailAddresses) + populate(objectMap, "retentionDays", s.RetentionDays) + populate(objectMap, "state", s.State) + populate(objectMap, "storageAccountAccessKey", s.StorageAccountAccessKey) + populate(objectMap, "storageEndpoint", s.StorageEndpoint) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityAlertPolicyProperties. +func (s *SecurityAlertPolicyProperties) 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 "disabledAlerts": + err = unpopulate(val, "DisabledAlerts", &s.DisabledAlerts) + delete(rawMsg, key) + case "emailAccountAdmins": + err = unpopulate(val, "EmailAccountAdmins", &s.EmailAccountAdmins) + delete(rawMsg, key) + case "emailAddresses": + err = unpopulate(val, "EmailAddresses", &s.EmailAddresses) + delete(rawMsg, key) + case "retentionDays": + err = unpopulate(val, "RetentionDays", &s.RetentionDays) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &s.State) + delete(rawMsg, key) + case "storageAccountAccessKey": + err = unpopulate(val, "StorageAccountAccessKey", &s.StorageAccountAccessKey) + delete(rawMsg, key) + case "storageEndpoint": + err = unpopulate(val, "StorageEndpoint", &s.StorageEndpoint) + 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 Server. +func (s Server) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "location", s.Location) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "sku", s.SKU) + populate(objectMap, "tags", s.Tags) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Server. +func (s *Server) 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 "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 "sku": + err = unpopulate(val, "SKU", &s.SKU) + 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 ServerForCreate. +func (s ServerForCreate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "location", s.Location) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "sku", s.SKU) + populate(objectMap, "tags", s.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerForCreate. +func (s *ServerForCreate) 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 "location": + err = unpopulate(val, "Location", &s.Location) + delete(rawMsg, key) + case "properties": + s.Properties, err = unmarshalServerPropertiesForCreateClassification(val) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &s.SKU) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &s.Tags) + 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 ServerListResult. +func (s ServerListResult) 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 ServerListResult. +func (s *ServerListResult) 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 ServerPrivateEndpointConnection. +func (s ServerPrivateEndpointConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "properties", s.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerPrivateEndpointConnection. +func (s *ServerPrivateEndpointConnection) 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 "properties": + err = unpopulate(val, "Properties", &s.Properties) + 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 ServerPrivateEndpointConnectionProperties. +func (s ServerPrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "privateEndpoint", s.PrivateEndpoint) + populate(objectMap, "privateLinkServiceConnectionState", s.PrivateLinkServiceConnectionState) + populate(objectMap, "provisioningState", s.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerPrivateEndpointConnectionProperties. +func (s *ServerPrivateEndpointConnectionProperties) 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 "privateEndpoint": + err = unpopulate(val, "PrivateEndpoint", &s.PrivateEndpoint) + delete(rawMsg, key) + case "privateLinkServiceConnectionState": + err = unpopulate(val, "PrivateLinkServiceConnectionState", &s.PrivateLinkServiceConnectionState) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + 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 ServerPrivateLinkServiceConnectionStateProperty. +func (s ServerPrivateLinkServiceConnectionStateProperty) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "actionsRequired", s.ActionsRequired) + populate(objectMap, "description", s.Description) + populate(objectMap, "status", s.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerPrivateLinkServiceConnectionStateProperty. +func (s *ServerPrivateLinkServiceConnectionStateProperty) 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 "actionsRequired": + err = unpopulate(val, "ActionsRequired", &s.ActionsRequired) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &s.Description) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &s.Status) + 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 ServerProperties. +func (s ServerProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "administratorLogin", s.AdministratorLogin) + populateTimeRFC3339(objectMap, "earliestRestoreDate", s.EarliestRestoreDate) + populate(objectMap, "fullyQualifiedDomainName", s.FullyQualifiedDomainName) + populate(objectMap, "masterServerId", s.MasterServerID) + populate(objectMap, "minimalTlsVersion", s.MinimalTLSVersion) + populate(objectMap, "privateEndpointConnections", s.PrivateEndpointConnections) + populate(objectMap, "publicNetworkAccess", s.PublicNetworkAccess) + populate(objectMap, "replicaCapacity", s.ReplicaCapacity) + populate(objectMap, "replicationRole", s.ReplicationRole) + populate(objectMap, "sslEnforcement", s.SSLEnforcement) + populate(objectMap, "storageProfile", s.StorageProfile) + populate(objectMap, "userVisibleState", s.UserVisibleState) + populate(objectMap, "version", s.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerProperties. +func (s *ServerProperties) 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 "administratorLogin": + err = unpopulate(val, "AdministratorLogin", &s.AdministratorLogin) + delete(rawMsg, key) + case "earliestRestoreDate": + err = unpopulateTimeRFC3339(val, "EarliestRestoreDate", &s.EarliestRestoreDate) + delete(rawMsg, key) + case "fullyQualifiedDomainName": + err = unpopulate(val, "FullyQualifiedDomainName", &s.FullyQualifiedDomainName) + delete(rawMsg, key) + case "masterServerId": + err = unpopulate(val, "MasterServerID", &s.MasterServerID) + delete(rawMsg, key) + case "minimalTlsVersion": + err = unpopulate(val, "MinimalTLSVersion", &s.MinimalTLSVersion) + delete(rawMsg, key) + case "privateEndpointConnections": + err = unpopulate(val, "PrivateEndpointConnections", &s.PrivateEndpointConnections) + delete(rawMsg, key) + case "publicNetworkAccess": + err = unpopulate(val, "PublicNetworkAccess", &s.PublicNetworkAccess) + delete(rawMsg, key) + case "replicaCapacity": + err = unpopulate(val, "ReplicaCapacity", &s.ReplicaCapacity) + delete(rawMsg, key) + case "replicationRole": + err = unpopulate(val, "ReplicationRole", &s.ReplicationRole) + delete(rawMsg, key) + case "sslEnforcement": + err = unpopulate(val, "SSLEnforcement", &s.SSLEnforcement) + delete(rawMsg, key) + case "storageProfile": + err = unpopulate(val, "StorageProfile", &s.StorageProfile) + delete(rawMsg, key) + case "userVisibleState": + err = unpopulate(val, "UserVisibleState", &s.UserVisibleState) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &s.Version) + 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 ServerPropertiesForCreate. +func (s ServerPropertiesForCreate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["createMode"] = s.CreateMode + populate(objectMap, "minimalTlsVersion", s.MinimalTLSVersion) + populate(objectMap, "publicNetworkAccess", s.PublicNetworkAccess) + populate(objectMap, "sslEnforcement", s.SSLEnforcement) + populate(objectMap, "storageProfile", s.StorageProfile) + populate(objectMap, "version", s.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerPropertiesForCreate. +func (s *ServerPropertiesForCreate) 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 "createMode": + err = unpopulate(val, "CreateMode", &s.CreateMode) + delete(rawMsg, key) + case "minimalTlsVersion": + err = unpopulate(val, "MinimalTLSVersion", &s.MinimalTLSVersion) + delete(rawMsg, key) + case "publicNetworkAccess": + err = unpopulate(val, "PublicNetworkAccess", &s.PublicNetworkAccess) + delete(rawMsg, key) + case "sslEnforcement": + err = unpopulate(val, "SSLEnforcement", &s.SSLEnforcement) + delete(rawMsg, key) + case "storageProfile": + err = unpopulate(val, "StorageProfile", &s.StorageProfile) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &s.Version) + 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 ServerPropertiesForDefaultCreate. +func (s ServerPropertiesForDefaultCreate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "administratorLogin", s.AdministratorLogin) + populate(objectMap, "administratorLoginPassword", s.AdministratorLoginPassword) + objectMap["createMode"] = CreateModeDefault + populate(objectMap, "minimalTlsVersion", s.MinimalTLSVersion) + populate(objectMap, "publicNetworkAccess", s.PublicNetworkAccess) + populate(objectMap, "sslEnforcement", s.SSLEnforcement) + populate(objectMap, "storageProfile", s.StorageProfile) + populate(objectMap, "version", s.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerPropertiesForDefaultCreate. +func (s *ServerPropertiesForDefaultCreate) 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 "administratorLogin": + err = unpopulate(val, "AdministratorLogin", &s.AdministratorLogin) + delete(rawMsg, key) + case "administratorLoginPassword": + err = unpopulate(val, "AdministratorLoginPassword", &s.AdministratorLoginPassword) + delete(rawMsg, key) + case "createMode": + err = unpopulate(val, "CreateMode", &s.CreateMode) + delete(rawMsg, key) + case "minimalTlsVersion": + err = unpopulate(val, "MinimalTLSVersion", &s.MinimalTLSVersion) + delete(rawMsg, key) + case "publicNetworkAccess": + err = unpopulate(val, "PublicNetworkAccess", &s.PublicNetworkAccess) + delete(rawMsg, key) + case "sslEnforcement": + err = unpopulate(val, "SSLEnforcement", &s.SSLEnforcement) + delete(rawMsg, key) + case "storageProfile": + err = unpopulate(val, "StorageProfile", &s.StorageProfile) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &s.Version) + 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 ServerPropertiesForGeoRestore. +func (s ServerPropertiesForGeoRestore) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["createMode"] = CreateModeGeoRestore + populate(objectMap, "minimalTlsVersion", s.MinimalTLSVersion) + populate(objectMap, "publicNetworkAccess", s.PublicNetworkAccess) + populate(objectMap, "sslEnforcement", s.SSLEnforcement) + populate(objectMap, "sourceServerId", s.SourceServerID) + populate(objectMap, "storageProfile", s.StorageProfile) + populate(objectMap, "version", s.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerPropertiesForGeoRestore. +func (s *ServerPropertiesForGeoRestore) 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 "createMode": + err = unpopulate(val, "CreateMode", &s.CreateMode) + delete(rawMsg, key) + case "minimalTlsVersion": + err = unpopulate(val, "MinimalTLSVersion", &s.MinimalTLSVersion) + delete(rawMsg, key) + case "publicNetworkAccess": + err = unpopulate(val, "PublicNetworkAccess", &s.PublicNetworkAccess) + delete(rawMsg, key) + case "sslEnforcement": + err = unpopulate(val, "SSLEnforcement", &s.SSLEnforcement) + delete(rawMsg, key) + case "sourceServerId": + err = unpopulate(val, "SourceServerID", &s.SourceServerID) + delete(rawMsg, key) + case "storageProfile": + err = unpopulate(val, "StorageProfile", &s.StorageProfile) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &s.Version) + 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 ServerPropertiesForReplica. +func (s ServerPropertiesForReplica) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["createMode"] = CreateModeReplica + populate(objectMap, "minimalTlsVersion", s.MinimalTLSVersion) + populate(objectMap, "publicNetworkAccess", s.PublicNetworkAccess) + populate(objectMap, "sslEnforcement", s.SSLEnforcement) + populate(objectMap, "sourceServerId", s.SourceServerID) + populate(objectMap, "storageProfile", s.StorageProfile) + populate(objectMap, "version", s.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerPropertiesForReplica. +func (s *ServerPropertiesForReplica) 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 "createMode": + err = unpopulate(val, "CreateMode", &s.CreateMode) + delete(rawMsg, key) + case "minimalTlsVersion": + err = unpopulate(val, "MinimalTLSVersion", &s.MinimalTLSVersion) + delete(rawMsg, key) + case "publicNetworkAccess": + err = unpopulate(val, "PublicNetworkAccess", &s.PublicNetworkAccess) + delete(rawMsg, key) + case "sslEnforcement": + err = unpopulate(val, "SSLEnforcement", &s.SSLEnforcement) + delete(rawMsg, key) + case "sourceServerId": + err = unpopulate(val, "SourceServerID", &s.SourceServerID) + delete(rawMsg, key) + case "storageProfile": + err = unpopulate(val, "StorageProfile", &s.StorageProfile) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &s.Version) + 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 ServerPropertiesForRestore. +func (s ServerPropertiesForRestore) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["createMode"] = CreateModePointInTimeRestore + populate(objectMap, "minimalTlsVersion", s.MinimalTLSVersion) + populate(objectMap, "publicNetworkAccess", s.PublicNetworkAccess) + populateTimeRFC3339(objectMap, "restorePointInTime", s.RestorePointInTime) + populate(objectMap, "sslEnforcement", s.SSLEnforcement) + populate(objectMap, "sourceServerId", s.SourceServerID) + populate(objectMap, "storageProfile", s.StorageProfile) + populate(objectMap, "version", s.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerPropertiesForRestore. +func (s *ServerPropertiesForRestore) 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 "createMode": + err = unpopulate(val, "CreateMode", &s.CreateMode) + delete(rawMsg, key) + case "minimalTlsVersion": + err = unpopulate(val, "MinimalTLSVersion", &s.MinimalTLSVersion) + delete(rawMsg, key) + case "publicNetworkAccess": + err = unpopulate(val, "PublicNetworkAccess", &s.PublicNetworkAccess) + delete(rawMsg, key) + case "restorePointInTime": + err = unpopulateTimeRFC3339(val, "RestorePointInTime", &s.RestorePointInTime) + delete(rawMsg, key) + case "sslEnforcement": + err = unpopulate(val, "SSLEnforcement", &s.SSLEnforcement) + delete(rawMsg, key) + case "sourceServerId": + err = unpopulate(val, "SourceServerID", &s.SourceServerID) + delete(rawMsg, key) + case "storageProfile": + err = unpopulate(val, "StorageProfile", &s.StorageProfile) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &s.Version) + 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 ServerSecurityAlertPolicy. +func (s ServerSecurityAlertPolicy) 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 ServerSecurityAlertPolicy. +func (s *ServerSecurityAlertPolicy) 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 ServerSecurityAlertPolicyListResult. +func (s ServerSecurityAlertPolicyListResult) 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 ServerSecurityAlertPolicyListResult. +func (s *ServerSecurityAlertPolicyListResult) 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 ServerUpdateParameters. +func (s ServerUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "sku", s.SKU) + populate(objectMap, "tags", s.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerUpdateParameters. +func (s *ServerUpdateParameters) 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 "sku": + err = unpopulate(val, "SKU", &s.SKU) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &s.Tags) + 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 ServerUpdateParametersProperties. +func (s ServerUpdateParametersProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "administratorLoginPassword", s.AdministratorLoginPassword) + populate(objectMap, "minimalTlsVersion", s.MinimalTLSVersion) + populate(objectMap, "publicNetworkAccess", s.PublicNetworkAccess) + populate(objectMap, "replicationRole", s.ReplicationRole) + populate(objectMap, "sslEnforcement", s.SSLEnforcement) + populate(objectMap, "storageProfile", s.StorageProfile) + populate(objectMap, "version", s.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerUpdateParametersProperties. +func (s *ServerUpdateParametersProperties) 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 "administratorLoginPassword": + err = unpopulate(val, "AdministratorLoginPassword", &s.AdministratorLoginPassword) + delete(rawMsg, key) + case "minimalTlsVersion": + err = unpopulate(val, "MinimalTLSVersion", &s.MinimalTLSVersion) + delete(rawMsg, key) + case "publicNetworkAccess": + err = unpopulate(val, "PublicNetworkAccess", &s.PublicNetworkAccess) + delete(rawMsg, key) + case "replicationRole": + err = unpopulate(val, "ReplicationRole", &s.ReplicationRole) + delete(rawMsg, key) + case "sslEnforcement": + err = unpopulate(val, "SSLEnforcement", &s.SSLEnforcement) + delete(rawMsg, key) + case "storageProfile": + err = unpopulate(val, "StorageProfile", &s.StorageProfile) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &s.Version) + 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 StorageProfile. +func (s StorageProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "backupRetentionDays", s.BackupRetentionDays) + populate(objectMap, "geoRedundantBackup", s.GeoRedundantBackup) + populate(objectMap, "storageAutogrow", s.StorageAutogrow) + populate(objectMap, "storageMB", s.StorageMB) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StorageProfile. +func (s *StorageProfile) 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 "backupRetentionDays": + err = unpopulate(val, "BackupRetentionDays", &s.BackupRetentionDays) + delete(rawMsg, key) + case "geoRedundantBackup": + err = unpopulate(val, "GeoRedundantBackup", &s.GeoRedundantBackup) + delete(rawMsg, key) + case "storageAutogrow": + err = unpopulate(val, "StorageAutogrow", &s.StorageAutogrow) + delete(rawMsg, key) + case "storageMB": + err = unpopulate(val, "StorageMB", &s.StorageMB) + 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 TagsObject. +func (t TagsObject) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "tags", t.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TagsObject. +func (t *TagsObject) 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 "tags": + err = unpopulate(val, "Tags", &t.Tags) + 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 TopQueryStatisticsInput. +func (t TopQueryStatisticsInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", t.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TopQueryStatisticsInput. +func (t *TopQueryStatisticsInput) 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 "properties": + err = unpopulate(val, "Properties", &t.Properties) + 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 TopQueryStatisticsInputProperties. +func (t TopQueryStatisticsInputProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "aggregationFunction", t.AggregationFunction) + populate(objectMap, "aggregationWindow", t.AggregationWindow) + populate(objectMap, "numberOfTopQueries", t.NumberOfTopQueries) + populateTimeRFC3339(objectMap, "observationEndTime", t.ObservationEndTime) + populateTimeRFC3339(objectMap, "observationStartTime", t.ObservationStartTime) + populate(objectMap, "observedMetric", t.ObservedMetric) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TopQueryStatisticsInputProperties. +func (t *TopQueryStatisticsInputProperties) 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 "aggregationFunction": + err = unpopulate(val, "AggregationFunction", &t.AggregationFunction) + delete(rawMsg, key) + case "aggregationWindow": + err = unpopulate(val, "AggregationWindow", &t.AggregationWindow) + delete(rawMsg, key) + case "numberOfTopQueries": + err = unpopulate(val, "NumberOfTopQueries", &t.NumberOfTopQueries) + delete(rawMsg, key) + case "observationEndTime": + err = unpopulateTimeRFC3339(val, "ObservationEndTime", &t.ObservationEndTime) + delete(rawMsg, key) + case "observationStartTime": + err = unpopulateTimeRFC3339(val, "ObservationStartTime", &t.ObservationStartTime) + delete(rawMsg, key) + case "observedMetric": + err = unpopulate(val, "ObservedMetric", &t.ObservedMetric) + 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 TopQueryStatisticsResultList. +func (t TopQueryStatisticsResultList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", t.NextLink) + populate(objectMap, "value", t.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TopQueryStatisticsResultList. +func (t *TopQueryStatisticsResultList) 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 "nextLink": + err = unpopulate(val, "NextLink", &t.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &t.Value) + 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 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 VirtualNetworkRule. +func (v VirtualNetworkRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", v.ID) + populate(objectMap, "name", v.Name) + populate(objectMap, "properties", v.Properties) + populate(objectMap, "type", v.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkRule. +func (v *VirtualNetworkRule) 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", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &v.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkRuleListResult. +func (v VirtualNetworkRuleListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", v.NextLink) + populate(objectMap, "value", v.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkRuleListResult. +func (v *VirtualNetworkRuleListResult) 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", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &v.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &v.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkRuleProperties. +func (v VirtualNetworkRuleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "ignoreMissingVnetServiceEndpoint", v.IgnoreMissingVnetServiceEndpoint) + populate(objectMap, "state", v.State) + populate(objectMap, "virtualNetworkSubnetId", v.VirtualNetworkSubnetID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkRuleProperties. +func (v *VirtualNetworkRuleProperties) 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", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "ignoreMissingVnetServiceEndpoint": + err = unpopulate(val, "IgnoreMissingVnetServiceEndpoint", &v.IgnoreMissingVnetServiceEndpoint) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &v.State) + delete(rawMsg, key) + case "virtualNetworkSubnetId": + err = unpopulate(val, "VirtualNetworkSubnetID", &v.VirtualNetworkSubnetID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WaitStatistic. +func (w WaitStatistic) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", w.ID) + populate(objectMap, "name", w.Name) + populate(objectMap, "properties", w.Properties) + populate(objectMap, "type", w.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WaitStatistic. +func (w *WaitStatistic) 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", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &w.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &w.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &w.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &w.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WaitStatisticProperties. +func (w WaitStatisticProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "count", w.Count) + populate(objectMap, "databaseName", w.DatabaseName) + populateTimeRFC3339(objectMap, "endTime", w.EndTime) + populate(objectMap, "eventName", w.EventName) + populate(objectMap, "eventTypeName", w.EventTypeName) + populate(objectMap, "queryId", w.QueryID) + populateTimeRFC3339(objectMap, "startTime", w.StartTime) + populate(objectMap, "totalTimeInMs", w.TotalTimeInMs) + populate(objectMap, "userId", w.UserID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WaitStatisticProperties. +func (w *WaitStatisticProperties) 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", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "count": + err = unpopulate(val, "Count", &w.Count) + delete(rawMsg, key) + case "databaseName": + err = unpopulate(val, "DatabaseName", &w.DatabaseName) + delete(rawMsg, key) + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &w.EndTime) + delete(rawMsg, key) + case "eventName": + err = unpopulate(val, "EventName", &w.EventName) + delete(rawMsg, key) + case "eventTypeName": + err = unpopulate(val, "EventTypeName", &w.EventTypeName) + delete(rawMsg, key) + case "queryId": + err = unpopulate(val, "QueryID", &w.QueryID) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &w.StartTime) + delete(rawMsg, key) + case "totalTimeInMs": + err = unpopulate(val, "TotalTimeInMs", &w.TotalTimeInMs) + delete(rawMsg, key) + case "userId": + err = unpopulate(val, "UserID", &w.UserID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WaitStatisticsInput. +func (w WaitStatisticsInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", w.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WaitStatisticsInput. +func (w *WaitStatisticsInput) 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", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &w.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WaitStatisticsInputProperties. +func (w WaitStatisticsInputProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "aggregationWindow", w.AggregationWindow) + populateTimeRFC3339(objectMap, "observationEndTime", w.ObservationEndTime) + populateTimeRFC3339(objectMap, "observationStartTime", w.ObservationStartTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WaitStatisticsInputProperties. +func (w *WaitStatisticsInputProperties) 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", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "aggregationWindow": + err = unpopulate(val, "AggregationWindow", &w.AggregationWindow) + delete(rawMsg, key) + case "observationEndTime": + err = unpopulateTimeRFC3339(val, "ObservationEndTime", &w.ObservationEndTime) + delete(rawMsg, key) + case "observationStartTime": + err = unpopulateTimeRFC3339(val, "ObservationStartTime", &w.ObservationStartTime) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WaitStatisticsResultList. +func (w WaitStatisticsResultList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", w.NextLink) + populate(objectMap, "value", w.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WaitStatisticsResultList. +func (w *WaitStatisticsResultList) 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", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &w.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &w.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, 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/mariadb/armmariadb/zz_generated_operations_client.go b/sdk/resourcemanager/mariadb/armmariadb/operations_client.go similarity index 99% rename from sdk/resourcemanager/mariadb/armmariadb/zz_generated_operations_client.go rename to sdk/resourcemanager/mariadb/armmariadb/operations_client.go index df6a12ea431d..79ca0cf07c65 100644 --- a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_operations_client.go +++ b/sdk/resourcemanager/mariadb/armmariadb/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 armmariadb diff --git a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_polymorphic_helpers.go b/sdk/resourcemanager/mariadb/armmariadb/polymorphic_helpers.go similarity index 98% rename from sdk/resourcemanager/mariadb/armmariadb/zz_generated_polymorphic_helpers.go rename to sdk/resourcemanager/mariadb/armmariadb/polymorphic_helpers.go index ad6eee99a4fb..df099d0b82eb 100644 --- a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_polymorphic_helpers.go +++ b/sdk/resourcemanager/mariadb/armmariadb/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 armmariadb diff --git a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_privateendpointconnections_client.go b/sdk/resourcemanager/mariadb/armmariadb/privateendpointconnections_client.go similarity index 99% rename from sdk/resourcemanager/mariadb/armmariadb/zz_generated_privateendpointconnections_client.go rename to sdk/resourcemanager/mariadb/armmariadb/privateendpointconnections_client.go index b5bf911023a2..deee4e094c45 100644 --- a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_privateendpointconnections_client.go +++ b/sdk/resourcemanager/mariadb/armmariadb/privateendpointconnections_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 armmariadb diff --git a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_privatelinkresources_client.go b/sdk/resourcemanager/mariadb/armmariadb/privatelinkresources_client.go similarity index 99% rename from sdk/resourcemanager/mariadb/armmariadb/zz_generated_privatelinkresources_client.go rename to sdk/resourcemanager/mariadb/armmariadb/privatelinkresources_client.go index 3ad0c5714446..f38067dd0f8b 100644 --- a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_privatelinkresources_client.go +++ b/sdk/resourcemanager/mariadb/armmariadb/privatelinkresources_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 armmariadb diff --git a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_querytexts_client.go b/sdk/resourcemanager/mariadb/armmariadb/querytexts_client.go similarity index 99% rename from sdk/resourcemanager/mariadb/armmariadb/zz_generated_querytexts_client.go rename to sdk/resourcemanager/mariadb/armmariadb/querytexts_client.go index 578140912ee8..113a210f2c27 100644 --- a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_querytexts_client.go +++ b/sdk/resourcemanager/mariadb/armmariadb/querytexts_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 armmariadb diff --git a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_recommendedactions_client.go b/sdk/resourcemanager/mariadb/armmariadb/recommendedactions_client.go similarity index 99% rename from sdk/resourcemanager/mariadb/armmariadb/zz_generated_recommendedactions_client.go rename to sdk/resourcemanager/mariadb/armmariadb/recommendedactions_client.go index 3b3e58070ec8..b530aabeaf7c 100644 --- a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_recommendedactions_client.go +++ b/sdk/resourcemanager/mariadb/armmariadb/recommendedactions_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 armmariadb diff --git a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_recoverableservers_client.go b/sdk/resourcemanager/mariadb/armmariadb/recoverableservers_client.go similarity index 99% rename from sdk/resourcemanager/mariadb/armmariadb/zz_generated_recoverableservers_client.go rename to sdk/resourcemanager/mariadb/armmariadb/recoverableservers_client.go index 8dac42ece82d..9b181fc35d7b 100644 --- a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_recoverableservers_client.go +++ b/sdk/resourcemanager/mariadb/armmariadb/recoverableservers_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 armmariadb diff --git a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_replicas_client.go b/sdk/resourcemanager/mariadb/armmariadb/replicas_client.go similarity index 99% rename from sdk/resourcemanager/mariadb/armmariadb/zz_generated_replicas_client.go rename to sdk/resourcemanager/mariadb/armmariadb/replicas_client.go index 5a686c15a8ed..f15e53c1d4e8 100644 --- a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_replicas_client.go +++ b/sdk/resourcemanager/mariadb/armmariadb/replicas_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 armmariadb diff --git a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_response_types.go b/sdk/resourcemanager/mariadb/armmariadb/response_types.go similarity index 99% rename from sdk/resourcemanager/mariadb/armmariadb/zz_generated_response_types.go rename to sdk/resourcemanager/mariadb/armmariadb/response_types.go index 204047ec4f60..8c1da6d6c84e 100644 --- a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_response_types.go +++ b/sdk/resourcemanager/mariadb/armmariadb/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 armmariadb diff --git a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_serverbasedperformancetier_client.go b/sdk/resourcemanager/mariadb/armmariadb/serverbasedperformancetier_client.go similarity index 99% rename from sdk/resourcemanager/mariadb/armmariadb/zz_generated_serverbasedperformancetier_client.go rename to sdk/resourcemanager/mariadb/armmariadb/serverbasedperformancetier_client.go index fabe5bd085ea..3da5c9799998 100644 --- a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_serverbasedperformancetier_client.go +++ b/sdk/resourcemanager/mariadb/armmariadb/serverbasedperformancetier_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 armmariadb diff --git a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_serverparameters_client.go b/sdk/resourcemanager/mariadb/armmariadb/serverparameters_client.go similarity index 99% rename from sdk/resourcemanager/mariadb/armmariadb/zz_generated_serverparameters_client.go rename to sdk/resourcemanager/mariadb/armmariadb/serverparameters_client.go index 5aba0cfd5fc4..c0b13f768b38 100644 --- a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_serverparameters_client.go +++ b/sdk/resourcemanager/mariadb/armmariadb/serverparameters_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 armmariadb diff --git a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_servers_client.go b/sdk/resourcemanager/mariadb/armmariadb/servers_client.go similarity index 99% rename from sdk/resourcemanager/mariadb/armmariadb/zz_generated_servers_client.go rename to sdk/resourcemanager/mariadb/armmariadb/servers_client.go index 071a5f8878fc..fccca4b8f93e 100644 --- a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_servers_client.go +++ b/sdk/resourcemanager/mariadb/armmariadb/servers_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 armmariadb diff --git a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_serversecurityalertpolicies_client.go b/sdk/resourcemanager/mariadb/armmariadb/serversecurityalertpolicies_client.go similarity index 99% rename from sdk/resourcemanager/mariadb/armmariadb/zz_generated_serversecurityalertpolicies_client.go rename to sdk/resourcemanager/mariadb/armmariadb/serversecurityalertpolicies_client.go index 87d39aae358a..fdc667cce637 100644 --- a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_serversecurityalertpolicies_client.go +++ b/sdk/resourcemanager/mariadb/armmariadb/serversecurityalertpolicies_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 armmariadb diff --git a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_time_rfc3339.go b/sdk/resourcemanager/mariadb/armmariadb/time_rfc3339.go similarity index 99% rename from sdk/resourcemanager/mariadb/armmariadb/zz_generated_time_rfc3339.go rename to sdk/resourcemanager/mariadb/armmariadb/time_rfc3339.go index ca2404cdb06f..cccb255573b2 100644 --- a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/mariadb/armmariadb/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 armmariadb diff --git a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_topquerystatistics_client.go b/sdk/resourcemanager/mariadb/armmariadb/topquerystatistics_client.go similarity index 99% rename from sdk/resourcemanager/mariadb/armmariadb/zz_generated_topquerystatistics_client.go rename to sdk/resourcemanager/mariadb/armmariadb/topquerystatistics_client.go index d373d79b30d5..cb879303a941 100644 --- a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_topquerystatistics_client.go +++ b/sdk/resourcemanager/mariadb/armmariadb/topquerystatistics_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 armmariadb diff --git a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_virtualnetworkrules_client.go b/sdk/resourcemanager/mariadb/armmariadb/virtualnetworkrules_client.go similarity index 99% rename from sdk/resourcemanager/mariadb/armmariadb/zz_generated_virtualnetworkrules_client.go rename to sdk/resourcemanager/mariadb/armmariadb/virtualnetworkrules_client.go index c69c5a373bec..a21198e0d347 100644 --- a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_virtualnetworkrules_client.go +++ b/sdk/resourcemanager/mariadb/armmariadb/virtualnetworkrules_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 armmariadb diff --git a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_waitstatistics_client.go b/sdk/resourcemanager/mariadb/armmariadb/waitstatistics_client.go similarity index 99% rename from sdk/resourcemanager/mariadb/armmariadb/zz_generated_waitstatistics_client.go rename to sdk/resourcemanager/mariadb/armmariadb/waitstatistics_client.go index 860f1878f1ce..16d05581c6a5 100644 --- a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_waitstatistics_client.go +++ b/sdk/resourcemanager/mariadb/armmariadb/waitstatistics_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 armmariadb diff --git a/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_advisors_client_test.go b/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_advisors_client_test.go deleted file mode 100644 index 3b3d60adec12..000000000000 --- a/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_advisors_client_test.go +++ /dev/null @@ -1,66 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armmariadb_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mariadb/armmariadb" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/AdvisorsGet.json -func ExampleAdvisorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewAdvisorsClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "testResourceGroupName", - "testServerName", - "Index", - 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/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/AdvisorsListByServer.json -func ExampleAdvisorsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewAdvisorsClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("testResourceGroupName", - "testServerName", - 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/mariadb/armmariadb/ze_generated_example_checknameavailability_client_test.go b/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_checknameavailability_client_test.go deleted file mode 100644 index 57f13270a284..000000000000 --- a/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_checknameavailability_client_test.go +++ /dev/null @@ -1,42 +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 armmariadb_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/mariadb/armmariadb" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/CheckNameAvailability.json -func ExampleCheckNameAvailabilityClient_Execute() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewCheckNameAvailabilityClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Execute(ctx, - armmariadb.NameAvailabilityRequest{ - Name: to.Ptr("name1"), - Type: to.Ptr("Microsoft.DBforMariaDB"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_configurations_client_test.go b/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_configurations_client_test.go deleted file mode 100644 index ca3b45b0b762..000000000000 --- a/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_configurations_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 armmariadb_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/mariadb/armmariadb" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/ConfigurationCreateOrUpdate.json -func ExampleConfigurationsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewConfigurationsClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "TestGroup", - "testserver", - "event_scheduler", - armmariadb.Configuration{ - Properties: &armmariadb.ConfigurationProperties{ - Source: to.Ptr("user-override"), - Value: to.Ptr("off"), - }, - }, - 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/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/ConfigurationGet.json -func ExampleConfigurationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewConfigurationsClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "TestGroup", - "testserver", - "event_scheduler", - 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/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/ConfigurationListByServer.json -func ExampleConfigurationsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewConfigurationsClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("testrg", - "mariadbtestsvc1", - 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/mariadb/armmariadb/ze_generated_example_databases_client_test.go b/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_databases_client_test.go deleted file mode 100644 index 9caa4b8169ff..000000000000 --- a/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_databases_client_test.go +++ /dev/null @@ -1,125 +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 armmariadb_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/mariadb/armmariadb" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/DatabaseCreate.json -func ExampleDatabasesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewDatabasesClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "TestGroup", - "testserver", - "db1", - armmariadb.Database{ - Properties: &armmariadb.DatabaseProperties{ - Charset: to.Ptr("utf8"), - Collation: to.Ptr("utf8_general_ci"), - }, - }, - 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/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/DatabaseDelete.json -func ExampleDatabasesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewDatabasesClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "TestGroup", - "testserver", - "db1", - 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/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/DatabaseGet.json -func ExampleDatabasesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewDatabasesClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "TestGroup", - "testserver", - "db1", - 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/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/DatabaseListByServer.json -func ExampleDatabasesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewDatabasesClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("TestGroup", - "testserver", - 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/mariadb/armmariadb/ze_generated_example_firewallrules_client_test.go b/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_firewallrules_client_test.go deleted file mode 100644 index d86a286d2d0c..000000000000 --- a/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_firewallrules_client_test.go +++ /dev/null @@ -1,125 +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 armmariadb_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/mariadb/armmariadb" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/FirewallRuleCreate.json -func ExampleFirewallRulesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewFirewallRulesClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "TestGroup", - "testserver", - "rule1", - armmariadb.FirewallRule{ - Properties: &armmariadb.FirewallRuleProperties{ - EndIPAddress: to.Ptr("255.255.255.255"), - StartIPAddress: to.Ptr("0.0.0.0"), - }, - }, - 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/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/FirewallRuleDelete.json -func ExampleFirewallRulesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewFirewallRulesClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "TestGroup", - "testserver", - "rule1", - 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/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/FirewallRuleGet.json -func ExampleFirewallRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewFirewallRulesClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "TestGroup", - "testserver", - "rule1", - 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/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/FirewallRuleListByServer.json -func ExampleFirewallRulesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewFirewallRulesClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("TestGroup", - "testserver", - 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/mariadb/armmariadb/ze_generated_example_locationbasedperformancetier_client_test.go b/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_locationbasedperformancetier_client_test.go deleted file mode 100644 index 70c427f0b2a9..000000000000 --- a/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_locationbasedperformancetier_client_test.go +++ /dev/null @@ -1,42 +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 armmariadb_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mariadb/armmariadb" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/PerformanceTiersListByLocation.json -func ExampleLocationBasedPerformanceTierClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewLocationBasedPerformanceTierClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("WestUS", - 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/mariadb/armmariadb/ze_generated_example_locationbasedrecommendedactionsessionsoperationstatus_client_test.go b/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_locationbasedrecommendedactionsessionsoperationstatus_client_test.go deleted file mode 100644 index 84337ee0255c..000000000000 --- a/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_locationbasedrecommendedactionsessionsoperationstatus_client_test.go +++ /dev/null @@ -1,39 +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 armmariadb_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mariadb/armmariadb" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/RecommendedActionSessionOperationStatus.json -func ExampleLocationBasedRecommendedActionSessionsOperationStatusClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewLocationBasedRecommendedActionSessionsOperationStatusClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "WestUS", - "aaaabbbb-cccc-dddd-0000-111122223333", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_locationbasedrecommendedactionsessionsresult_client_test.go b/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_locationbasedrecommendedactionsessionsresult_client_test.go deleted file mode 100644 index fb699c9205e3..000000000000 --- a/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_locationbasedrecommendedactionsessionsresult_client_test.go +++ /dev/null @@ -1,43 +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 armmariadb_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mariadb/armmariadb" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/RecommendedActionSessionResult.json -func ExampleLocationBasedRecommendedActionSessionsResultClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewLocationBasedRecommendedActionSessionsResultClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("WestUS", - "aaaabbbb-cccc-dddd-0000-111122223333", - 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/mariadb/armmariadb/ze_generated_example_logfiles_client_test.go b/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_logfiles_client_test.go deleted file mode 100644 index 62fb0c0fa271..000000000000 --- a/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_logfiles_client_test.go +++ /dev/null @@ -1,43 +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 armmariadb_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mariadb/armmariadb" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/LogFileListByServer.json -func ExampleLogFilesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewLogFilesClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("TestGroup", - "testserver", - 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/mariadb/armmariadb/ze_generated_example_mariadbmanagementclient_client_test.go b/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_mariadbmanagementclient_client_test.go deleted file mode 100644 index 31ea05a63a6a..000000000000 --- a/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_mariadbmanagementclient_client_test.go +++ /dev/null @@ -1,65 +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 armmariadb_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mariadb/armmariadb" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/QueryPerformanceInsightResetData.json -func ExampleManagementClient_ResetQueryPerformanceInsightData() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewManagementClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ResetQueryPerformanceInsightData(ctx, - "testResourceGroupName", - "testServerName", - 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/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/RecommendedActionSessionCreate.json -func ExampleManagementClient_BeginCreateRecommendedActionSession() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewManagementClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateRecommendedActionSession(ctx, - "testResourceGroupName", - "testServerName", - "Index", - "someDatabaseName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_operations_client_test.go deleted file mode 100644 index 56e139c03a4a..000000000000 --- a/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_operations_client_test.go +++ /dev/null @@ -1,37 +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 armmariadb_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mariadb/armmariadb" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/OperationList.json -func ExampleOperationsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewOperationsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_privateendpointconnections_client_test.go b/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_privateendpointconnections_client_test.go deleted file mode 100644 index 976772396098..000000000000 --- a/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_privateendpointconnections_client_test.go +++ /dev/null @@ -1,160 +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 armmariadb_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/mariadb/armmariadb" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/PrivateEndpointConnectionGet.json -func ExamplePrivateEndpointConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewPrivateEndpointConnectionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default", - "test-svr", - "private-endpoint-connection-name", - 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/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/PrivateEndpointConnectionUpdate.json -func ExamplePrivateEndpointConnectionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewPrivateEndpointConnectionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "Default", - "test-svr", - "private-endpoint-connection-name", - armmariadb.PrivateEndpointConnection{ - Properties: &armmariadb.PrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armmariadb.PrivateLinkServiceConnectionStateProperty{ - Description: to.Ptr("Approved by johndoe@contoso.com"), - Status: to.Ptr("Approved"), - }, - }, - }, - 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/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/PrivateEndpointConnectionDelete.json -func ExamplePrivateEndpointConnectionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewPrivateEndpointConnectionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "Default", - "test-svr", - "private-endpoint-connection-name", - 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/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/PrivateEndpointConnectionUpdateTags.json -func ExamplePrivateEndpointConnectionsClient_BeginUpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewPrivateEndpointConnectionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdateTags(ctx, - "Default", - "test-svr", - "private-endpoint-connection-name", - armmariadb.TagsObject{ - Tags: map[string]*string{ - "key1": to.Ptr("val1"), - "key2": to.Ptr("val2"), - }, - }, - 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/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/PrivateEndpointConnectionList.json -func ExamplePrivateEndpointConnectionsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewPrivateEndpointConnectionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("Default", - "test-svr", - 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/mariadb/armmariadb/ze_generated_example_privatelinkresources_client_test.go b/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_privatelinkresources_client_test.go deleted file mode 100644 index a1a0fc8703c5..000000000000 --- a/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_privatelinkresources_client_test.go +++ /dev/null @@ -1,66 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armmariadb_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mariadb/armmariadb" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/PrivateLinkResourcesList.json -func ExamplePrivateLinkResourcesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewPrivateLinkResourcesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("Default", - "test-svr", - 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/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/PrivateLinkResourcesGet.json -func ExamplePrivateLinkResourcesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewPrivateLinkResourcesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default", - "test-svr", - "plr", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_querytexts_client_test.go b/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_querytexts_client_test.go deleted file mode 100644 index 0dfcd091ccb2..000000000000 --- a/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_querytexts_client_test.go +++ /dev/null @@ -1,69 +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 armmariadb_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mariadb/armmariadb" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/QueryTextsGet.json -func ExampleQueryTextsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewQueryTextsClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "testResourceGroupName", - "testServerName", - "1", - 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/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/QueryTextsListByServer.json -func ExampleQueryTextsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewQueryTextsClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("testResourceGroupName", - "testServerName", - []string{ - "1", - "2"}, - 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/mariadb/armmariadb/ze_generated_example_recommendedactions_client_test.go b/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_recommendedactions_client_test.go deleted file mode 100644 index cf8c7412bf23..000000000000 --- a/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_recommendedactions_client_test.go +++ /dev/null @@ -1,68 +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 armmariadb_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mariadb/armmariadb" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/RecommendedActionsGet.json -func ExampleRecommendedActionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewRecommendedActionsClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "testResourceGroupName", - "testServerName", - "Index", - "Index-1", - 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/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/RecommendedActionsListByServer.json -func ExampleRecommendedActionsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewRecommendedActionsClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("testResourceGroupName", - "testServerName", - "Index", - &armmariadb.RecommendedActionsClientListByServerOptions{SessionID: 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/mariadb/armmariadb/ze_generated_example_recoverableservers_client_test.go b/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_recoverableservers_client_test.go deleted file mode 100644 index 640a921c1344..000000000000 --- a/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_recoverableservers_client_test.go +++ /dev/null @@ -1,39 +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 armmariadb_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mariadb/armmariadb" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/RecoverableServersGet.json -func ExampleRecoverableServersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewRecoverableServersClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "testrg", - "testsvc4", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_replicas_client_test.go b/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_replicas_client_test.go deleted file mode 100644 index 36d2147c8358..000000000000 --- a/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_replicas_client_test.go +++ /dev/null @@ -1,43 +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 armmariadb_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mariadb/armmariadb" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/ReplicasListByServer.json -func ExampleReplicasClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewReplicasClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("TestGroup", - "testmaster", - 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/mariadb/armmariadb/ze_generated_example_serverbasedperformancetier_client_test.go b/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_serverbasedperformancetier_client_test.go deleted file mode 100644 index ea0d210a7b3e..000000000000 --- a/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_serverbasedperformancetier_client_test.go +++ /dev/null @@ -1,43 +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 armmariadb_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mariadb/armmariadb" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/PerformanceTiersListByServer.json -func ExampleServerBasedPerformanceTierClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewServerBasedPerformanceTierClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("testrg", - "mariadbtestsvc1", - 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/mariadb/armmariadb/ze_generated_example_serverparameters_client_test.go b/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_serverparameters_client_test.go deleted file mode 100644 index fd6c9f3b1116..000000000000 --- a/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_serverparameters_client_test.go +++ /dev/null @@ -1,44 +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 armmariadb_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mariadb/armmariadb" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/ConfigurationsUpdateByServer.json -func ExampleServerParametersClient_BeginListUpdateConfigurations() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewServerParametersClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginListUpdateConfigurations(ctx, - "testrg", - "mariadbtestsvc1", - armmariadb.ConfigurationListResult{}, - 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/mariadb/armmariadb/ze_generated_example_servers_client_test.go b/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_servers_client_test.go deleted file mode 100644 index 172bd5c6c9d2..000000000000 --- a/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_servers_client_test.go +++ /dev/null @@ -1,262 +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 armmariadb_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/mariadb/armmariadb" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/ServerCreatePointInTimeRestore.json -func ExampleServersClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewServersClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, - "TargetResourceGroup", - "targetserver", - armmariadb.ServerForCreate{ - Location: to.Ptr("brazilsouth"), - Properties: &armmariadb.ServerPropertiesForRestore{ - CreateMode: to.Ptr(armmariadb.CreateModePointInTimeRestore), - RestorePointInTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-14T00:00:37.467Z"); return t }()), - SourceServerID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforMariaDB/servers/sourceserver"), - }, - SKU: &armmariadb.SKU{ - Name: to.Ptr("GP_Gen5_2"), - Capacity: to.Ptr[int32](2), - Family: to.Ptr("Gen5"), - Tier: to.Ptr(armmariadb.SKUTierGeneralPurpose), - }, - Tags: map[string]*string{ - "ElasticServer": to.Ptr("1"), - }, - }, - 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/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/ServerUpdate.json -func ExampleServersClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewServersClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "testrg", - "mariadbtestsvc4", - armmariadb.ServerUpdateParameters{ - Properties: &armmariadb.ServerUpdateParametersProperties{ - AdministratorLoginPassword: to.Ptr(""), - SSLEnforcement: to.Ptr(armmariadb.SSLEnforcementEnumDisabled), - }, - }, - 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/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/ServerDelete.json -func ExampleServersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewServersClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "TestGroup", - "testserver", - 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/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/ServerGet.json -func ExampleServersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewServersClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "testrg", - "mariadbtestsvc4", - 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/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/ServerListByResourceGroup.json -func ExampleServersClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewServersClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("testrg", - 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/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/ServerList.json -func ExampleServersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewServersClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/ServerRestart.json -func ExampleServersClient_BeginRestart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewServersClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRestart(ctx, - "TestGroup", - "testserver", - 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/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2020-01-01/examples/ServerStart.json -func ExampleServersClient_BeginStart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewServersClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginStart(ctx, - "TestGroup", - "testserver", - 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/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2020-01-01/examples/ServerStop.json -func ExampleServersClient_BeginStop() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewServersClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginStop(ctx, - "TestGroup", - "testserver", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_serversecurityalertpolicies_client_test.go b/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_serversecurityalertpolicies_client_test.go deleted file mode 100644 index 35baa6e13aaa..000000000000 --- a/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_serversecurityalertpolicies_client_test.go +++ /dev/null @@ -1,108 +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 armmariadb_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/mariadb/armmariadb" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/ServerSecurityAlertsGet.json -func ExampleServerSecurityAlertPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewServerSecurityAlertPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "securityalert-4799", - "securityalert-6440", - armmariadb.SecurityAlertPolicyNameDefault, - 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/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/ServerSecurityAlertsCreateMax.json -func ExampleServerSecurityAlertPoliciesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewServerSecurityAlertPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "securityalert-4799", - "securityalert-6440", - armmariadb.SecurityAlertPolicyNameDefault, - armmariadb.ServerSecurityAlertPolicy{ - Properties: &armmariadb.SecurityAlertPolicyProperties{ - DisabledAlerts: []*string{ - to.Ptr("Access_Anomaly"), - to.Ptr("Usage_Anomaly")}, - EmailAccountAdmins: to.Ptr(true), - EmailAddresses: []*string{ - to.Ptr("testSecurityAlert@microsoft.com")}, - RetentionDays: to.Ptr[int32](5), - State: to.Ptr(armmariadb.ServerSecurityAlertPolicyStateEnabled), - StorageAccountAccessKey: to.Ptr("sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD=="), - StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - }, - }, - 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/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/ServerSecurityAlertsListByServer.json -func ExampleServerSecurityAlertPoliciesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewServerSecurityAlertPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("securityalert-4799", - "securityalert-6440", - 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/mariadb/armmariadb/ze_generated_example_topquerystatistics_client_test.go b/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_topquerystatistics_client_test.go deleted file mode 100644 index 8d88a96d1200..000000000000 --- a/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_topquerystatistics_client_test.go +++ /dev/null @@ -1,79 +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 armmariadb_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/mariadb/armmariadb" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/TopQueryStatisticsGet.json -func ExampleTopQueryStatisticsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewTopQueryStatisticsClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "testResourceGroupName", - "testServerName", - "66-636923268000000000-636923277000000000-avg-duration", - 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/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/TopQueryStatisticsListByServer.json -func ExampleTopQueryStatisticsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewTopQueryStatisticsClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("testResourceGroupName", - "testServerName", - armmariadb.TopQueryStatisticsInput{ - Properties: &armmariadb.TopQueryStatisticsInputProperties{ - AggregationFunction: to.Ptr("avg"), - AggregationWindow: to.Ptr("PT15M"), - NumberOfTopQueries: to.Ptr[int32](5), - ObservationEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-07T20:00:00.000Z"); return t }()), - ObservationStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-01T20:00:00.000Z"); return t }()), - ObservedMetric: to.Ptr("duration"), - }, - }, - 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/mariadb/armmariadb/ze_generated_example_virtualnetworkrules_client_test.go b/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_virtualnetworkrules_client_test.go deleted file mode 100644 index 385d9f39e28e..000000000000 --- a/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_virtualnetworkrules_client_test.go +++ /dev/null @@ -1,125 +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 armmariadb_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/mariadb/armmariadb" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/VirtualNetworkRulesGet.json -func ExampleVirtualNetworkRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewVirtualNetworkRulesClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "TestGroup", - "vnet-test-svr", - "vnet-firewall-rule", - 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/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/VirtualNetworkRulesCreateOrUpdate.json -func ExampleVirtualNetworkRulesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewVirtualNetworkRulesClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "TestGroup", - "vnet-test-svr", - "vnet-firewall-rule", - armmariadb.VirtualNetworkRule{ - Properties: &armmariadb.VirtualNetworkRuleProperties{ - IgnoreMissingVnetServiceEndpoint: to.Ptr(false), - VirtualNetworkSubnetID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet"), - }, - }, - 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/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/VirtualNetworkRulesDelete.json -func ExampleVirtualNetworkRulesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewVirtualNetworkRulesClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "TestGroup", - "vnet-test-svr", - "vnet-firewall-rule", - 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/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/VirtualNetworkRulesList.json -func ExampleVirtualNetworkRulesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewVirtualNetworkRulesClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("TestGroup", - "vnet-test-svr", - 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/mariadb/armmariadb/ze_generated_example_waitstatistics_client_test.go b/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_waitstatistics_client_test.go deleted file mode 100644 index c6bfb22192b3..000000000000 --- a/sdk/resourcemanager/mariadb/armmariadb/ze_generated_example_waitstatistics_client_test.go +++ /dev/null @@ -1,76 +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 armmariadb_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/mariadb/armmariadb" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/WaitStatisticsGet.json -func ExampleWaitStatisticsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewWaitStatisticsClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "testResourceGroupName", - "testServerName", - "636927606000000000-636927615000000000-send-wait/io/socket/sql/client_connection-2--0", - 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/mariadb/resource-manager/Microsoft.DBforMariaDB/stable/2018-06-01/examples/WaitStatisticsListByServer.json -func ExampleWaitStatisticsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmariadb.NewWaitStatisticsClient("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("testResourceGroupName", - "testServerName", - armmariadb.WaitStatisticsInput{ - Properties: &armmariadb.WaitStatisticsInputProperties{ - AggregationWindow: to.Ptr("PT15M"), - ObservationEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-07T20:00:00.000Z"); return t }()), - ObservationStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-01T20:00:00.000Z"); return t }()), - }, - }, - 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/mariadb/armmariadb/zz_generated_models_serde.go b/sdk/resourcemanager/mariadb/armmariadb/zz_generated_models_serde.go deleted file mode 100644 index 127c00c3ec6a..000000000000 --- a/sdk/resourcemanager/mariadb/armmariadb/zz_generated_models_serde.go +++ /dev/null @@ -1,758 +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 armmariadb - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" -) - -// MarshalJSON implements the json.Marshaller interface for type ConfigurationListResult. -func (c ConfigurationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "value", c.Value) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type LogFileProperties. -func (l LogFileProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "createdTime", l.CreatedTime) - populateTimeRFC3339(objectMap, "lastModifiedTime", l.LastModifiedTime) - populate(objectMap, "sizeInKB", l.SizeInKB) - populate(objectMap, "type", l.Type) - populate(objectMap, "url", l.URL) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LogFileProperties. -func (l *LogFileProperties) 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", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "createdTime": - err = unpopulateTimeRFC3339(val, "CreatedTime", &l.CreatedTime) - delete(rawMsg, key) - case "lastModifiedTime": - err = unpopulateTimeRFC3339(val, "LastModifiedTime", &l.LastModifiedTime) - delete(rawMsg, key) - case "sizeInKB": - err = unpopulate(val, "SizeInKB", &l.SizeInKB) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &l.Type) - delete(rawMsg, key) - case "url": - err = unpopulate(val, "URL", &l.URL) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties. -func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "groupId", p.GroupID) - populate(objectMap, "requiredMembers", p.RequiredMembers) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type QueryStatisticProperties. -func (q QueryStatisticProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "aggregationFunction", q.AggregationFunction) - populate(objectMap, "databaseNames", q.DatabaseNames) - populateTimeRFC3339(objectMap, "endTime", q.EndTime) - populate(objectMap, "metricDisplayName", q.MetricDisplayName) - populate(objectMap, "metricName", q.MetricName) - populate(objectMap, "metricValue", q.MetricValue) - populate(objectMap, "metricValueUnit", q.MetricValueUnit) - populate(objectMap, "queryExecutionCount", q.QueryExecutionCount) - populate(objectMap, "queryId", q.QueryID) - populateTimeRFC3339(objectMap, "startTime", q.StartTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type QueryStatisticProperties. -func (q *QueryStatisticProperties) 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", q, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "aggregationFunction": - err = unpopulate(val, "AggregationFunction", &q.AggregationFunction) - delete(rawMsg, key) - case "databaseNames": - err = unpopulate(val, "DatabaseNames", &q.DatabaseNames) - delete(rawMsg, key) - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &q.EndTime) - delete(rawMsg, key) - case "metricDisplayName": - err = unpopulate(val, "MetricDisplayName", &q.MetricDisplayName) - delete(rawMsg, key) - case "metricName": - err = unpopulate(val, "MetricName", &q.MetricName) - delete(rawMsg, key) - case "metricValue": - err = unpopulate(val, "MetricValue", &q.MetricValue) - delete(rawMsg, key) - case "metricValueUnit": - err = unpopulate(val, "MetricValueUnit", &q.MetricValueUnit) - delete(rawMsg, key) - case "queryExecutionCount": - err = unpopulate(val, "QueryExecutionCount", &q.QueryExecutionCount) - delete(rawMsg, key) - case "queryId": - err = unpopulate(val, "QueryID", &q.QueryID) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &q.StartTime) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RecommendationActionProperties. -func (r RecommendationActionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "actionId", r.ActionID) - populate(objectMap, "advisorName", r.AdvisorName) - populateTimeRFC3339(objectMap, "createdTime", r.CreatedTime) - populate(objectMap, "details", r.Details) - populateTimeRFC3339(objectMap, "expirationTime", r.ExpirationTime) - populate(objectMap, "reason", r.Reason) - populate(objectMap, "recommendationType", r.RecommendationType) - populate(objectMap, "sessionId", r.SessionID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RecommendationActionProperties. -func (r *RecommendationActionProperties) 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 "actionId": - err = unpopulate(val, "ActionID", &r.ActionID) - delete(rawMsg, key) - case "advisorName": - err = unpopulate(val, "AdvisorName", &r.AdvisorName) - delete(rawMsg, key) - case "createdTime": - err = unpopulateTimeRFC3339(val, "CreatedTime", &r.CreatedTime) - delete(rawMsg, key) - case "details": - err = unpopulate(val, "Details", &r.Details) - delete(rawMsg, key) - case "expirationTime": - err = unpopulateTimeRFC3339(val, "ExpirationTime", &r.ExpirationTime) - delete(rawMsg, key) - case "reason": - err = unpopulate(val, "Reason", &r.Reason) - delete(rawMsg, key) - case "recommendationType": - err = unpopulate(val, "RecommendationType", &r.RecommendationType) - delete(rawMsg, key) - case "sessionId": - err = unpopulate(val, "SessionID", &r.SessionID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RecommendedActionSessionsOperationStatus. -func (r *RecommendedActionSessionsOperationStatus) 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 "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &r.StartTime) - 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 SecurityAlertPolicyProperties. -func (s SecurityAlertPolicyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "disabledAlerts", s.DisabledAlerts) - populate(objectMap, "emailAccountAdmins", s.EmailAccountAdmins) - populate(objectMap, "emailAddresses", s.EmailAddresses) - populate(objectMap, "retentionDays", s.RetentionDays) - populate(objectMap, "state", s.State) - populate(objectMap, "storageAccountAccessKey", s.StorageAccountAccessKey) - populate(objectMap, "storageEndpoint", s.StorageEndpoint) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type Server. -func (s Server) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", s.ID) - populate(objectMap, "location", s.Location) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "sku", s.SKU) - populate(objectMap, "tags", s.Tags) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ServerForCreate. -func (s ServerForCreate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "location", s.Location) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "sku", s.SKU) - populate(objectMap, "tags", s.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerForCreate. -func (s *ServerForCreate) 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 "location": - err = unpopulate(val, "Location", &s.Location) - delete(rawMsg, key) - case "properties": - s.Properties, err = unmarshalServerPropertiesForCreateClassification(val) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &s.SKU) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &s.Tags) - 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 ServerProperties. -func (s ServerProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "administratorLogin", s.AdministratorLogin) - populateTimeRFC3339(objectMap, "earliestRestoreDate", s.EarliestRestoreDate) - populate(objectMap, "fullyQualifiedDomainName", s.FullyQualifiedDomainName) - populate(objectMap, "masterServerId", s.MasterServerID) - populate(objectMap, "minimalTlsVersion", s.MinimalTLSVersion) - populate(objectMap, "privateEndpointConnections", s.PrivateEndpointConnections) - populate(objectMap, "publicNetworkAccess", s.PublicNetworkAccess) - populate(objectMap, "replicaCapacity", s.ReplicaCapacity) - populate(objectMap, "replicationRole", s.ReplicationRole) - populate(objectMap, "sslEnforcement", s.SSLEnforcement) - populate(objectMap, "storageProfile", s.StorageProfile) - populate(objectMap, "userVisibleState", s.UserVisibleState) - populate(objectMap, "version", s.Version) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerProperties. -func (s *ServerProperties) 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 "administratorLogin": - err = unpopulate(val, "AdministratorLogin", &s.AdministratorLogin) - delete(rawMsg, key) - case "earliestRestoreDate": - err = unpopulateTimeRFC3339(val, "EarliestRestoreDate", &s.EarliestRestoreDate) - delete(rawMsg, key) - case "fullyQualifiedDomainName": - err = unpopulate(val, "FullyQualifiedDomainName", &s.FullyQualifiedDomainName) - delete(rawMsg, key) - case "masterServerId": - err = unpopulate(val, "MasterServerID", &s.MasterServerID) - delete(rawMsg, key) - case "minimalTlsVersion": - err = unpopulate(val, "MinimalTLSVersion", &s.MinimalTLSVersion) - delete(rawMsg, key) - case "privateEndpointConnections": - err = unpopulate(val, "PrivateEndpointConnections", &s.PrivateEndpointConnections) - delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &s.PublicNetworkAccess) - delete(rawMsg, key) - case "replicaCapacity": - err = unpopulate(val, "ReplicaCapacity", &s.ReplicaCapacity) - delete(rawMsg, key) - case "replicationRole": - err = unpopulate(val, "ReplicationRole", &s.ReplicationRole) - delete(rawMsg, key) - case "sslEnforcement": - err = unpopulate(val, "SSLEnforcement", &s.SSLEnforcement) - delete(rawMsg, key) - case "storageProfile": - err = unpopulate(val, "StorageProfile", &s.StorageProfile) - delete(rawMsg, key) - case "userVisibleState": - err = unpopulate(val, "UserVisibleState", &s.UserVisibleState) - delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &s.Version) - 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 ServerPropertiesForDefaultCreate. -func (s ServerPropertiesForDefaultCreate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "administratorLogin", s.AdministratorLogin) - populate(objectMap, "administratorLoginPassword", s.AdministratorLoginPassword) - objectMap["createMode"] = CreateModeDefault - populate(objectMap, "minimalTlsVersion", s.MinimalTLSVersion) - populate(objectMap, "publicNetworkAccess", s.PublicNetworkAccess) - populate(objectMap, "sslEnforcement", s.SSLEnforcement) - populate(objectMap, "storageProfile", s.StorageProfile) - populate(objectMap, "version", s.Version) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerPropertiesForDefaultCreate. -func (s *ServerPropertiesForDefaultCreate) 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 "administratorLogin": - err = unpopulate(val, "AdministratorLogin", &s.AdministratorLogin) - delete(rawMsg, key) - case "administratorLoginPassword": - err = unpopulate(val, "AdministratorLoginPassword", &s.AdministratorLoginPassword) - delete(rawMsg, key) - case "createMode": - err = unpopulate(val, "CreateMode", &s.CreateMode) - delete(rawMsg, key) - case "minimalTlsVersion": - err = unpopulate(val, "MinimalTLSVersion", &s.MinimalTLSVersion) - delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &s.PublicNetworkAccess) - delete(rawMsg, key) - case "sslEnforcement": - err = unpopulate(val, "SSLEnforcement", &s.SSLEnforcement) - delete(rawMsg, key) - case "storageProfile": - err = unpopulate(val, "StorageProfile", &s.StorageProfile) - delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &s.Version) - 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 ServerPropertiesForGeoRestore. -func (s ServerPropertiesForGeoRestore) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["createMode"] = CreateModeGeoRestore - populate(objectMap, "minimalTlsVersion", s.MinimalTLSVersion) - populate(objectMap, "publicNetworkAccess", s.PublicNetworkAccess) - populate(objectMap, "sslEnforcement", s.SSLEnforcement) - populate(objectMap, "sourceServerId", s.SourceServerID) - populate(objectMap, "storageProfile", s.StorageProfile) - populate(objectMap, "version", s.Version) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerPropertiesForGeoRestore. -func (s *ServerPropertiesForGeoRestore) 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 "createMode": - err = unpopulate(val, "CreateMode", &s.CreateMode) - delete(rawMsg, key) - case "minimalTlsVersion": - err = unpopulate(val, "MinimalTLSVersion", &s.MinimalTLSVersion) - delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &s.PublicNetworkAccess) - delete(rawMsg, key) - case "sslEnforcement": - err = unpopulate(val, "SSLEnforcement", &s.SSLEnforcement) - delete(rawMsg, key) - case "sourceServerId": - err = unpopulate(val, "SourceServerID", &s.SourceServerID) - delete(rawMsg, key) - case "storageProfile": - err = unpopulate(val, "StorageProfile", &s.StorageProfile) - delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &s.Version) - 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 ServerPropertiesForReplica. -func (s ServerPropertiesForReplica) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["createMode"] = CreateModeReplica - populate(objectMap, "minimalTlsVersion", s.MinimalTLSVersion) - populate(objectMap, "publicNetworkAccess", s.PublicNetworkAccess) - populate(objectMap, "sslEnforcement", s.SSLEnforcement) - populate(objectMap, "sourceServerId", s.SourceServerID) - populate(objectMap, "storageProfile", s.StorageProfile) - populate(objectMap, "version", s.Version) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerPropertiesForReplica. -func (s *ServerPropertiesForReplica) 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 "createMode": - err = unpopulate(val, "CreateMode", &s.CreateMode) - delete(rawMsg, key) - case "minimalTlsVersion": - err = unpopulate(val, "MinimalTLSVersion", &s.MinimalTLSVersion) - delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &s.PublicNetworkAccess) - delete(rawMsg, key) - case "sslEnforcement": - err = unpopulate(val, "SSLEnforcement", &s.SSLEnforcement) - delete(rawMsg, key) - case "sourceServerId": - err = unpopulate(val, "SourceServerID", &s.SourceServerID) - delete(rawMsg, key) - case "storageProfile": - err = unpopulate(val, "StorageProfile", &s.StorageProfile) - delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &s.Version) - 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 ServerPropertiesForRestore. -func (s ServerPropertiesForRestore) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["createMode"] = CreateModePointInTimeRestore - populate(objectMap, "minimalTlsVersion", s.MinimalTLSVersion) - populate(objectMap, "publicNetworkAccess", s.PublicNetworkAccess) - populateTimeRFC3339(objectMap, "restorePointInTime", s.RestorePointInTime) - populate(objectMap, "sslEnforcement", s.SSLEnforcement) - populate(objectMap, "sourceServerId", s.SourceServerID) - populate(objectMap, "storageProfile", s.StorageProfile) - populate(objectMap, "version", s.Version) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerPropertiesForRestore. -func (s *ServerPropertiesForRestore) 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 "createMode": - err = unpopulate(val, "CreateMode", &s.CreateMode) - delete(rawMsg, key) - case "minimalTlsVersion": - err = unpopulate(val, "MinimalTLSVersion", &s.MinimalTLSVersion) - delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &s.PublicNetworkAccess) - delete(rawMsg, key) - case "restorePointInTime": - err = unpopulateTimeRFC3339(val, "RestorePointInTime", &s.RestorePointInTime) - delete(rawMsg, key) - case "sslEnforcement": - err = unpopulate(val, "SSLEnforcement", &s.SSLEnforcement) - delete(rawMsg, key) - case "sourceServerId": - err = unpopulate(val, "SourceServerID", &s.SourceServerID) - delete(rawMsg, key) - case "storageProfile": - err = unpopulate(val, "StorageProfile", &s.StorageProfile) - delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &s.Version) - 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 ServerUpdateParameters. -func (s ServerUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "sku", s.SKU) - populate(objectMap, "tags", s.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type TagsObject. -func (t TagsObject) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "tags", t.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type TopQueryStatisticsInputProperties. -func (t TopQueryStatisticsInputProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "aggregationFunction", t.AggregationFunction) - populate(objectMap, "aggregationWindow", t.AggregationWindow) - populate(objectMap, "numberOfTopQueries", t.NumberOfTopQueries) - populateTimeRFC3339(objectMap, "observationEndTime", t.ObservationEndTime) - populateTimeRFC3339(objectMap, "observationStartTime", t.ObservationStartTime) - populate(objectMap, "observedMetric", t.ObservedMetric) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TopQueryStatisticsInputProperties. -func (t *TopQueryStatisticsInputProperties) 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 "aggregationFunction": - err = unpopulate(val, "AggregationFunction", &t.AggregationFunction) - delete(rawMsg, key) - case "aggregationWindow": - err = unpopulate(val, "AggregationWindow", &t.AggregationWindow) - delete(rawMsg, key) - case "numberOfTopQueries": - err = unpopulate(val, "NumberOfTopQueries", &t.NumberOfTopQueries) - delete(rawMsg, key) - case "observationEndTime": - err = unpopulateTimeRFC3339(val, "ObservationEndTime", &t.ObservationEndTime) - delete(rawMsg, key) - case "observationStartTime": - err = unpopulateTimeRFC3339(val, "ObservationStartTime", &t.ObservationStartTime) - delete(rawMsg, key) - case "observedMetric": - err = unpopulate(val, "ObservedMetric", &t.ObservedMetric) - 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 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 WaitStatisticProperties. -func (w WaitStatisticProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "count", w.Count) - populate(objectMap, "databaseName", w.DatabaseName) - populateTimeRFC3339(objectMap, "endTime", w.EndTime) - populate(objectMap, "eventName", w.EventName) - populate(objectMap, "eventTypeName", w.EventTypeName) - populate(objectMap, "queryId", w.QueryID) - populateTimeRFC3339(objectMap, "startTime", w.StartTime) - populate(objectMap, "totalTimeInMs", w.TotalTimeInMs) - populate(objectMap, "userId", w.UserID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type WaitStatisticProperties. -func (w *WaitStatisticProperties) 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", w, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "count": - err = unpopulate(val, "Count", &w.Count) - delete(rawMsg, key) - case "databaseName": - err = unpopulate(val, "DatabaseName", &w.DatabaseName) - delete(rawMsg, key) - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &w.EndTime) - delete(rawMsg, key) - case "eventName": - err = unpopulate(val, "EventName", &w.EventName) - delete(rawMsg, key) - case "eventTypeName": - err = unpopulate(val, "EventTypeName", &w.EventTypeName) - delete(rawMsg, key) - case "queryId": - err = unpopulate(val, "QueryID", &w.QueryID) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &w.StartTime) - delete(rawMsg, key) - case "totalTimeInMs": - err = unpopulate(val, "TotalTimeInMs", &w.TotalTimeInMs) - delete(rawMsg, key) - case "userId": - err = unpopulate(val, "UserID", &w.UserID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type WaitStatisticsInputProperties. -func (w WaitStatisticsInputProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "aggregationWindow", w.AggregationWindow) - populateTimeRFC3339(objectMap, "observationEndTime", w.ObservationEndTime) - populateTimeRFC3339(objectMap, "observationStartTime", w.ObservationStartTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type WaitStatisticsInputProperties. -func (w *WaitStatisticsInputProperties) 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", w, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "aggregationWindow": - err = unpopulate(val, "AggregationWindow", &w.AggregationWindow) - delete(rawMsg, key) - case "observationEndTime": - err = unpopulateTimeRFC3339(val, "ObservationEndTime", &w.ObservationEndTime) - delete(rawMsg, key) - case "observationStartTime": - err = unpopulateTimeRFC3339(val, "ObservationStartTime", &w.ObservationStartTime) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, 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 -}