From db1fcda230736875001d0f97189f357e1259fc20 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 12 Aug 2022 00:23:45 +0000 Subject: [PATCH] CodeGen from PR 20209 in Azure/azure-rest-api-specs Merge bc2fc3c154ad12a7950ed99510428fcd89167ea5 into f3e0d432c99590d7bf8a444944368f90e53800da --- .../armsqlvirtualmachine/CHANGELOG.md | 20 + .../armsqlvirtualmachine/autorest.md | 6 +- ...o => availabilitygrouplisteners_client.go} | 21 +- ...zz_generated_constants.go => constants.go} | 33 +- .../armsqlvirtualmachine/go.mod | 14 +- .../armsqlvirtualmachine/go.sum | 24 +- ...ated_groups_client.go => groups_client.go} | 31 +- .../{zz_generated_models.go => models.go} | 53 +- .../armsqlvirtualmachine/models_serde.go | 1697 +++++++++++++++++ ...rations_client.go => operations_client.go} | 5 +- ...ed_response_types.go => response_types.go} | 1 + ...client.go => sqlvirtualmachines_client.go} | 47 +- ...erated_time_rfc3339.go => time_rfc3339.go} | 1 + ..._availabilitygrouplisteners_client_test.go | 137 -- ...enerated_example_operations_client_test.go | 41 - ...ple_sqlvirtualmachinegroups_client_test.go | 189 -- ..._example_sqlvirtualmachines_client_test.go | 230 --- .../zz_generated_models_serde.go | 206 -- 18 files changed, 1860 insertions(+), 896 deletions(-) rename sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/{zz_generated_availabilitygrouplisteners_client.go => availabilitygrouplisteners_client.go} (97%) rename sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/{zz_generated_constants.go => constants.go} (93%) rename sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/{zz_generated_groups_client.go => groups_client.go} (96%) rename sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/{zz_generated_models.go => models.go} (93%) create mode 100644 sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/models_serde.go rename sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/{zz_generated_operations_client.go => operations_client.go} (97%) rename sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/{zz_generated_response_types.go => response_types.go} (99%) rename sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/{zz_generated_sqlvirtualmachines_client.go => sqlvirtualmachines_client.go} (96%) rename sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/{zz_generated_time_rfc3339.go => time_rfc3339.go} (99%) delete mode 100644 sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/ze_generated_example_availabilitygrouplisteners_client_test.go delete mode 100644 sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/ze_generated_example_operations_client_test.go delete mode 100644 sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/ze_generated_example_sqlvirtualmachinegroups_client_test.go delete mode 100644 sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/ze_generated_example_sqlvirtualmachines_client_test.go delete mode 100644 sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/zz_generated_models_serde.go diff --git a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/CHANGELOG.md b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/CHANGELOG.md index 11d0c0b9c965..e570d363f084 100644 --- a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/CHANGELOG.md +++ b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/CHANGELOG.md @@ -1,5 +1,25 @@ # Release History +## 0.7.0 (2022-08-12) +### Features Added + +- New const `LeastPrivilegeModeEnabled` +- New const `ClusterSubnetTypeMultiSubnet` +- New const `ClusterSubnetTypeSingleSubnet` +- New function `PossibleLeastPrivilegeModeValues() []LeastPrivilegeMode` +- New function `PossibleClusterSubnetTypeValues() []ClusterSubnetType` +- New struct `MultiSubnetIPConfiguration` +- New field `MultiSubnetIPConfigurations` in struct `AvailabilityGroupListenerProperties` +- New field `IsIfiEnabled` in struct `SQLInstanceSettings` +- New field `IsLpimEnabled` in struct `SQLInstanceSettings` +- New field `PersistFolderPath` in struct `SQLTempDbSettings` +- New field `PersistFolder` in struct `SQLTempDbSettings` +- New field `WsfcStaticIP` in struct `Properties` +- New field `EnableAutomaticUpgrade` in struct `Properties` +- New field `LeastPrivilegeMode` in struct `Properties` +- New field `ClusterSubnetType` in struct `WsfcDomainProfile` + + ## 0.6.0 (2022-06-02) ### Breaking Changes diff --git a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/autorest.md b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/autorest.md index 9dcec750daf3..bd432df2a923 100644 --- a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/autorest.md +++ b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/autorest.md @@ -5,8 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/cfe4dc8393d283e59cc6af4fceaf2c70eaee31a9/specification/sqlvirtualmachine/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/cfe4dc8393d283e59cc6af4fceaf2c70eaee31a9/specification/sqlvirtualmachine/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/sqlvirtualmachine/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/sqlvirtualmachine/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.6.0 +module-version: 0.7.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/zz_generated_availabilitygrouplisteners_client.go b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/availabilitygrouplisteners_client.go similarity index 97% rename from sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/zz_generated_availabilitygrouplisteners_client.go rename to sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/availabilitygrouplisteners_client.go index 2c5b05b723f8..697dd6e74a60 100644 --- a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/zz_generated_availabilitygrouplisteners_client.go +++ b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/availabilitygrouplisteners_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 armsqlvirtualmachine @@ -56,7 +57,7 @@ func NewAvailabilityGroupListenersClient(subscriptionID string, credential azcor // BeginCreateOrUpdate - Creates or updates an availability group listener. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview +// Generated from API version 2022-07-01-preview // resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource // Manager API or the portal. // sqlVirtualMachineGroupName - Name of the SQL virtual machine group. @@ -78,7 +79,7 @@ func (client *AvailabilityGroupListenersClient) BeginCreateOrUpdate(ctx context. // CreateOrUpdate - Creates or updates an availability group listener. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview +// Generated from API version 2022-07-01-preview func (client *AvailabilityGroupListenersClient) createOrUpdate(ctx context.Context, resourceGroupName string, sqlVirtualMachineGroupName string, availabilityGroupListenerName string, parameters AvailabilityGroupListener, options *AvailabilityGroupListenersClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, sqlVirtualMachineGroupName, availabilityGroupListenerName, parameters, options) if err != nil { @@ -118,7 +119,7 @@ func (client *AvailabilityGroupListenersClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -126,7 +127,7 @@ func (client *AvailabilityGroupListenersClient) createOrUpdateCreateRequest(ctx // BeginDelete - Deletes an availability group listener. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview +// Generated from API version 2022-07-01-preview // resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource // Manager API or the portal. // sqlVirtualMachineGroupName - Name of the SQL virtual machine group. @@ -147,7 +148,7 @@ func (client *AvailabilityGroupListenersClient) BeginDelete(ctx context.Context, // Delete - Deletes an availability group listener. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview +// Generated from API version 2022-07-01-preview func (client *AvailabilityGroupListenersClient) deleteOperation(ctx context.Context, resourceGroupName string, sqlVirtualMachineGroupName string, availabilityGroupListenerName string, options *AvailabilityGroupListenersClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, sqlVirtualMachineGroupName, availabilityGroupListenerName, options) if err != nil { @@ -187,14 +188,14 @@ func (client *AvailabilityGroupListenersClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets an availability group listener. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview +// Generated from API version 2022-07-01-preview // resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource // Manager API or the portal. // sqlVirtualMachineGroupName - Name of the SQL virtual machine group. @@ -243,7 +244,7 @@ func (client *AvailabilityGroupListenersClient) getCreateRequest(ctx context.Con if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -260,7 +261,7 @@ func (client *AvailabilityGroupListenersClient) getHandleResponse(resp *http.Res // NewListByGroupPager - Lists all availability group listeners in a SQL virtual machine group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview +// Generated from API version 2022-07-01-preview // resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource // Manager API or the portal. // sqlVirtualMachineGroupName - Name of the SQL virtual machine group. @@ -314,7 +315,7 @@ func (client *AvailabilityGroupListenersClient) listByGroupCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/zz_generated_constants.go b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/constants.go similarity index 93% rename from sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/zz_generated_constants.go rename to sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/constants.go index fef9143b0991..906f96e8d36a 100644 --- a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/zz_generated_constants.go +++ b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/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 armsqlvirtualmachine const ( moduleName = "armsqlvirtualmachine" - moduleVersion = "v0.6.0" + moduleVersion = "v0.7.0" ) // AssessmentDayOfWeek - Day of the week to run assessment. @@ -109,6 +110,22 @@ func PossibleClusterManagerTypeValues() []ClusterManagerType { } } +// ClusterSubnetType - Cluster subnet type. +type ClusterSubnetType string + +const ( + ClusterSubnetTypeMultiSubnet ClusterSubnetType = "MultiSubnet" + ClusterSubnetTypeSingleSubnet ClusterSubnetType = "SingleSubnet" +) + +// PossibleClusterSubnetTypeValues returns the possible values for the ClusterSubnetType const type. +func PossibleClusterSubnetTypeValues() []ClusterSubnetType { + return []ClusterSubnetType{ + ClusterSubnetTypeMultiSubnet, + ClusterSubnetTypeSingleSubnet, + } +} + // Commit - Replica commit mode in availability group. type Commit string @@ -258,6 +275,20 @@ func PossibleIdentityTypeValues() []IdentityType { } } +// LeastPrivilegeMode - SQL IaaS Agent least privilege mode. +type LeastPrivilegeMode string + +const ( + LeastPrivilegeModeEnabled LeastPrivilegeMode = "Enabled" +) + +// PossibleLeastPrivilegeModeValues returns the possible values for the LeastPrivilegeMode const type. +func PossibleLeastPrivilegeModeValues() []LeastPrivilegeMode { + return []LeastPrivilegeMode{ + LeastPrivilegeModeEnabled, + } +} + // OperationOrigin - The intended executor of the operation. type OperationOrigin string diff --git a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/go.mod b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/go.mod index 7384dd046efe..c422025ad953 100644 --- a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/go.mod +++ b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/go.mod @@ -2,20 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sqlvirtualmachine/a go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 // indirect - github.com/golang-jwt/jwt v3.2.1+incompatible // indirect - github.com/google/uuid v1.1.1 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect - golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect golang.org/x/text v0.3.7 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/go.sum b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/go.sum index ed5b814680ee..3afb578030a5 100644 --- a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/go.sum +++ b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/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/sqlvirtualmachine/armsqlvirtualmachine/zz_generated_groups_client.go b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/groups_client.go similarity index 96% rename from sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/zz_generated_groups_client.go rename to sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/groups_client.go index f7abf683b20e..368c4f0a3953 100644 --- a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/zz_generated_groups_client.go +++ b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/groups_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 armsqlvirtualmachine @@ -56,7 +57,7 @@ func NewGroupsClient(subscriptionID string, credential azcore.TokenCredential, o // BeginCreateOrUpdate - Creates or updates a SQL virtual machine group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview +// Generated from API version 2022-07-01-preview // resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource // Manager API or the portal. // sqlVirtualMachineGroupName - Name of the SQL virtual machine group. @@ -77,7 +78,7 @@ func (client *GroupsClient) BeginCreateOrUpdate(ctx context.Context, resourceGro // CreateOrUpdate - Creates or updates a SQL virtual machine group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview +// Generated from API version 2022-07-01-preview func (client *GroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, sqlVirtualMachineGroupName string, parameters Group, options *GroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, sqlVirtualMachineGroupName, parameters, options) if err != nil { @@ -113,7 +114,7 @@ func (client *GroupsClient) createOrUpdateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -121,7 +122,7 @@ func (client *GroupsClient) createOrUpdateCreateRequest(ctx context.Context, res // BeginDelete - Deletes a SQL virtual machine group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview +// Generated from API version 2022-07-01-preview // resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource // Manager API or the portal. // sqlVirtualMachineGroupName - Name of the SQL virtual machine group. @@ -140,7 +141,7 @@ func (client *GroupsClient) BeginDelete(ctx context.Context, resourceGroupName s // Delete - Deletes a SQL virtual machine group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview +// Generated from API version 2022-07-01-preview func (client *GroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, sqlVirtualMachineGroupName string, options *GroupsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, sqlVirtualMachineGroupName, options) if err != nil { @@ -176,14 +177,14 @@ func (client *GroupsClient) deleteCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets a SQL virtual machine group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview +// Generated from API version 2022-07-01-preview // resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource // Manager API or the portal. // sqlVirtualMachineGroupName - Name of the SQL virtual machine group. @@ -223,7 +224,7 @@ func (client *GroupsClient) getCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -240,7 +241,7 @@ func (client *GroupsClient) getHandleResponse(resp *http.Response) (GroupsClient // NewListPager - Gets all SQL virtual machine groups in a subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview +// Generated from API version 2022-07-01-preview // options - GroupsClientListOptions contains the optional parameters for the GroupsClient.List method. func (client *GroupsClient) NewListPager(options *GroupsClientListOptions) *runtime.Pager[GroupsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[GroupsClientListResponse]{ @@ -282,7 +283,7 @@ func (client *GroupsClient) listCreateRequest(ctx context.Context, options *Grou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -299,7 +300,7 @@ func (client *GroupsClient) listHandleResponse(resp *http.Response) (GroupsClien // NewListByResourceGroupPager - Gets all SQL virtual machine groups in a resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview +// Generated from API version 2022-07-01-preview // resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource // Manager API or the portal. // options - GroupsClientListByResourceGroupOptions contains the optional parameters for the GroupsClient.ListByResourceGroup @@ -348,7 +349,7 @@ func (client *GroupsClient) listByResourceGroupCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -365,7 +366,7 @@ func (client *GroupsClient) listByResourceGroupHandleResponse(resp *http.Respons // BeginUpdate - Updates SQL virtual machine group tags. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview +// Generated from API version 2022-07-01-preview // resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource // Manager API or the portal. // sqlVirtualMachineGroupName - Name of the SQL virtual machine group. @@ -385,7 +386,7 @@ func (client *GroupsClient) BeginUpdate(ctx context.Context, resourceGroupName s // Update - Updates SQL virtual machine group tags. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview +// Generated from API version 2022-07-01-preview func (client *GroupsClient) update(ctx context.Context, resourceGroupName string, sqlVirtualMachineGroupName string, parameters GroupUpdate, options *GroupsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, sqlVirtualMachineGroupName, parameters, options) if err != nil { @@ -421,7 +422,7 @@ func (client *GroupsClient) updateCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/zz_generated_models.go b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/models.go similarity index 93% rename from sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/zz_generated_models.go rename to sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/models.go index 233df085f47d..56c02709aaa9 100644 --- a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/zz_generated_models.go +++ b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/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 armsqlvirtualmachine @@ -18,8 +19,8 @@ type AdditionalFeaturesServerConfigurations struct { // AgConfiguration - Availability group configuration. type AgConfiguration struct { - // READ-ONLY; Replica configurations. - Replicas []*AgReplica `json:"replicas,omitempty" azure:"ro"` + // Replica configurations. + Replicas []*AgReplica `json:"replicas,omitempty"` } // AgReplica - Availability group replica configuration. @@ -153,6 +154,9 @@ type AvailabilityGroupListenerProperties struct { // List of load balancer configurations for an availability group listener. LoadBalancerConfigurations []*LoadBalancerConfiguration `json:"loadBalancerConfigurations,omitempty"` + // List of multi subnet IP configurations for an AG listener. + MultiSubnetIPConfigurations []*MultiSubnetIPConfiguration `json:"multiSubnetIpConfigurations,omitempty"` + // Listener port. Port *int32 `json:"port,omitempty"` @@ -329,6 +333,15 @@ type LoadBalancerConfiguration struct { SQLVirtualMachineInstances []*string `json:"sqlVirtualMachineInstances,omitempty"` } +// MultiSubnetIPConfiguration - Multi subnet ip configuration for an availability group listener. +type MultiSubnetIPConfiguration struct { + // REQUIRED; Private IP address. + PrivateIPAddress *PrivateIPAddress `json:"privateIpAddress,omitempty"` + + // REQUIRED; SQL virtual machine instance resource id that are enrolled into the availability group listener. + SQLVirtualMachineInstance *string `json:"sqlVirtualMachineInstance,omitempty"` +} + // Operation - SQL REST API operation definition. type Operation struct { // READ-ONLY; The localized display information for this particular operation / action. @@ -393,9 +406,15 @@ type Properties struct { // Auto patching settings for applying critical security updates to SQL virtual machine. AutoPatchingSettings *AutoPatchingSettings `json:"autoPatchingSettings,omitempty"` + // Enable automatic upgrade of Sql IaaS extension Agent. + EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` + // Key vault credential settings. KeyVaultCredentialSettings *KeyVaultCredentialSettings `json:"keyVaultCredentialSettings,omitempty"` + // SQL IaaS Agent least privilege mode. + LeastPrivilegeMode *LeastPrivilegeMode `json:"leastPrivilegeMode,omitempty"` + // SQL image offer. Examples include SQL2016-WS2016, SQL2017-WS2016. SQLImageOffer *string `json:"sqlImageOffer,omitempty"` @@ -423,6 +442,9 @@ type Properties struct { // Domain credentials for setting up Windows Server Failover Cluster for SQL availability group. WsfcDomainCredentials *WsfcDomainCredentials `json:"wsfcDomainCredentials,omitempty"` + // Domain credentials for setting up Windows Server Failover Cluster for SQL availability group. + WsfcStaticIP *string `json:"wsfcStaticIp,omitempty"` + // READ-ONLY; Provisioning state to track the async operation status. ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` } @@ -484,6 +506,12 @@ type SQLInstanceSettings struct { // SQL Server Collation. Collation *string `json:"collation,omitempty"` + // SQL Server IFI. + IsIfiEnabled *bool `json:"isIfiEnabled,omitempty"` + + // SQL Server LPIM. + IsLpimEnabled *bool `json:"isLpimEnabled,omitempty"` + // SQL Server Optimize for Adhoc workloads. IsOptimizeForAdHocWorkloadsEnabled *bool `json:"isOptimizeForAdHocWorkloadsEnabled,omitempty"` @@ -518,27 +546,34 @@ type SQLStorageUpdateSettings struct { StartingDeviceID *int32 `json:"startingDeviceId,omitempty"` } +// SQLTempDbSettings - Set tempDb storage settings for SQL Server. type SQLTempDbSettings struct { - // SQL Server default file count + // SQL Server tempdb data file count DataFileCount *int32 `json:"dataFileCount,omitempty"` - // SQL Server default file size + // SQL Server tempdb data file size DataFileSize *int32 `json:"dataFileSize,omitempty"` - // SQL Server default file autoGrowth size + // SQL Server tempdb data file autoGrowth size DataGrowth *int32 `json:"dataGrowth,omitempty"` // SQL Server default file path DefaultFilePath *string `json:"defaultFilePath,omitempty"` - // SQL Server default file size + // SQL Server tempdb log file size LogFileSize *int32 `json:"logFileSize,omitempty"` - // SQL Server default file autoGrowth size + // SQL Server tempdb log file autoGrowth size LogGrowth *int32 `json:"logGrowth,omitempty"` // Logical Unit Numbers for the disks. Luns []*int32 `json:"luns,omitempty"` + + // SQL Server tempdb persist folder choice + PersistFolder *bool `json:"persistFolder,omitempty"` + + // SQL Server tempdb persist folder location + PersistFolderPath *string `json:"persistFolderPath,omitempty"` } // SQLVirtualMachine - A SQL virtual machine. @@ -632,6 +667,7 @@ type SQLWorkloadTypeUpdateSettings struct { SQLWorkloadType *SQLWorkloadType `json:"sqlWorkloadType,omitempty"` } +// Schedule - Set assessment schedule for SQL Server. type Schedule struct { // Day of the week to run assessment. DayOfWeek *AssessmentDayOfWeek `json:"dayOfWeek,omitempty"` @@ -755,6 +791,9 @@ type WsfcDomainProfile struct { // in the cluster. ClusterOperatorAccount *string `json:"clusterOperatorAccount,omitempty"` + // Cluster subnet type. + ClusterSubnetType *ClusterSubnetType `json:"clusterSubnetType,omitempty"` + // Fully qualified name of the domain. DomainFqdn *string `json:"domainFqdn,omitempty"` diff --git a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/models_serde.go b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/models_serde.go new file mode 100644 index 000000000000..53492e659043 --- /dev/null +++ b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/models_serde.go @@ -0,0 +1,1697 @@ +//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 armsqlvirtualmachine + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" +) + +// MarshalJSON implements the json.Marshaller interface for type AdditionalFeaturesServerConfigurations. +func (a AdditionalFeaturesServerConfigurations) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "isRServicesEnabled", a.IsRServicesEnabled) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AdditionalFeaturesServerConfigurations. +func (a *AdditionalFeaturesServerConfigurations) UnmarshalJSON(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 "isRServicesEnabled": + err = unpopulate(val, "IsRServicesEnabled", &a.IsRServicesEnabled) + 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 AgConfiguration. +func (a AgConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "replicas", a.Replicas) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AgConfiguration. +func (a *AgConfiguration) UnmarshalJSON(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 "replicas": + err = unpopulate(val, "Replicas", &a.Replicas) + 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 AgReplica. +func (a AgReplica) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "commit", a.Commit) + populate(objectMap, "failover", a.Failover) + populate(objectMap, "readableSecondary", a.ReadableSecondary) + populate(objectMap, "role", a.Role) + populate(objectMap, "sqlVirtualMachineInstanceId", a.SQLVirtualMachineInstanceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AgReplica. +func (a *AgReplica) UnmarshalJSON(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 "commit": + err = unpopulate(val, "Commit", &a.Commit) + delete(rawMsg, key) + case "failover": + err = unpopulate(val, "Failover", &a.Failover) + delete(rawMsg, key) + case "readableSecondary": + err = unpopulate(val, "ReadableSecondary", &a.ReadableSecondary) + delete(rawMsg, key) + case "role": + err = unpopulate(val, "Role", &a.Role) + delete(rawMsg, key) + case "sqlVirtualMachineInstanceId": + err = unpopulate(val, "SQLVirtualMachineInstanceID", &a.SQLVirtualMachineInstanceID) + 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 AssessmentSettings. +func (a AssessmentSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "enable", a.Enable) + populate(objectMap, "runImmediately", a.RunImmediately) + populate(objectMap, "schedule", a.Schedule) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AssessmentSettings. +func (a *AssessmentSettings) UnmarshalJSON(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 "enable": + err = unpopulate(val, "Enable", &a.Enable) + delete(rawMsg, key) + case "runImmediately": + err = unpopulate(val, "RunImmediately", &a.RunImmediately) + delete(rawMsg, key) + case "schedule": + err = unpopulate(val, "Schedule", &a.Schedule) + 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 AutoBackupSettings. +func (a AutoBackupSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "backupScheduleType", a.BackupScheduleType) + populate(objectMap, "backupSystemDbs", a.BackupSystemDbs) + populate(objectMap, "daysOfWeek", a.DaysOfWeek) + populate(objectMap, "enable", a.Enable) + populate(objectMap, "enableEncryption", a.EnableEncryption) + populate(objectMap, "fullBackupFrequency", a.FullBackupFrequency) + populate(objectMap, "fullBackupStartTime", a.FullBackupStartTime) + populate(objectMap, "fullBackupWindowHours", a.FullBackupWindowHours) + populate(objectMap, "logBackupFrequency", a.LogBackupFrequency) + populate(objectMap, "password", a.Password) + populate(objectMap, "retentionPeriod", a.RetentionPeriod) + populate(objectMap, "storageAccessKey", a.StorageAccessKey) + populate(objectMap, "storageAccountUrl", a.StorageAccountURL) + populate(objectMap, "storageContainerName", a.StorageContainerName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AutoBackupSettings. +func (a *AutoBackupSettings) UnmarshalJSON(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 "backupScheduleType": + err = unpopulate(val, "BackupScheduleType", &a.BackupScheduleType) + delete(rawMsg, key) + case "backupSystemDbs": + err = unpopulate(val, "BackupSystemDbs", &a.BackupSystemDbs) + delete(rawMsg, key) + case "daysOfWeek": + err = unpopulate(val, "DaysOfWeek", &a.DaysOfWeek) + delete(rawMsg, key) + case "enable": + err = unpopulate(val, "Enable", &a.Enable) + delete(rawMsg, key) + case "enableEncryption": + err = unpopulate(val, "EnableEncryption", &a.EnableEncryption) + delete(rawMsg, key) + case "fullBackupFrequency": + err = unpopulate(val, "FullBackupFrequency", &a.FullBackupFrequency) + delete(rawMsg, key) + case "fullBackupStartTime": + err = unpopulate(val, "FullBackupStartTime", &a.FullBackupStartTime) + delete(rawMsg, key) + case "fullBackupWindowHours": + err = unpopulate(val, "FullBackupWindowHours", &a.FullBackupWindowHours) + delete(rawMsg, key) + case "logBackupFrequency": + err = unpopulate(val, "LogBackupFrequency", &a.LogBackupFrequency) + delete(rawMsg, key) + case "password": + err = unpopulate(val, "Password", &a.Password) + delete(rawMsg, key) + case "retentionPeriod": + err = unpopulate(val, "RetentionPeriod", &a.RetentionPeriod) + delete(rawMsg, key) + case "storageAccessKey": + err = unpopulate(val, "StorageAccessKey", &a.StorageAccessKey) + delete(rawMsg, key) + case "storageAccountUrl": + err = unpopulate(val, "StorageAccountURL", &a.StorageAccountURL) + delete(rawMsg, key) + case "storageContainerName": + err = unpopulate(val, "StorageContainerName", &a.StorageContainerName) + 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 AutoPatchingSettings. +func (a AutoPatchingSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "dayOfWeek", a.DayOfWeek) + populate(objectMap, "enable", a.Enable) + populate(objectMap, "maintenanceWindowDuration", a.MaintenanceWindowDuration) + populate(objectMap, "maintenanceWindowStartingHour", a.MaintenanceWindowStartingHour) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AutoPatchingSettings. +func (a *AutoPatchingSettings) UnmarshalJSON(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 "dayOfWeek": + err = unpopulate(val, "DayOfWeek", &a.DayOfWeek) + delete(rawMsg, key) + case "enable": + err = unpopulate(val, "Enable", &a.Enable) + delete(rawMsg, key) + case "maintenanceWindowDuration": + err = unpopulate(val, "MaintenanceWindowDuration", &a.MaintenanceWindowDuration) + delete(rawMsg, key) + case "maintenanceWindowStartingHour": + err = unpopulate(val, "MaintenanceWindowStartingHour", &a.MaintenanceWindowStartingHour) + 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 AvailabilityGroupListener. +func (a AvailabilityGroupListener) 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, "systemData", a.SystemData) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AvailabilityGroupListener. +func (a *AvailabilityGroupListener) UnmarshalJSON(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 "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) + 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 AvailabilityGroupListenerListResult. +func (a AvailabilityGroupListenerListResult) 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 AvailabilityGroupListenerListResult. +func (a *AvailabilityGroupListenerListResult) UnmarshalJSON(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 AvailabilityGroupListenerProperties. +func (a AvailabilityGroupListenerProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "availabilityGroupConfiguration", a.AvailabilityGroupConfiguration) + populate(objectMap, "availabilityGroupName", a.AvailabilityGroupName) + populate(objectMap, "createDefaultAvailabilityGroupIfNotExist", a.CreateDefaultAvailabilityGroupIfNotExist) + populate(objectMap, "loadBalancerConfigurations", a.LoadBalancerConfigurations) + populate(objectMap, "multiSubnetIpConfigurations", a.MultiSubnetIPConfigurations) + populate(objectMap, "port", a.Port) + populate(objectMap, "provisioningState", a.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AvailabilityGroupListenerProperties. +func (a *AvailabilityGroupListenerProperties) UnmarshalJSON(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 "availabilityGroupConfiguration": + err = unpopulate(val, "AvailabilityGroupConfiguration", &a.AvailabilityGroupConfiguration) + delete(rawMsg, key) + case "availabilityGroupName": + err = unpopulate(val, "AvailabilityGroupName", &a.AvailabilityGroupName) + delete(rawMsg, key) + case "createDefaultAvailabilityGroupIfNotExist": + err = unpopulate(val, "CreateDefaultAvailabilityGroupIfNotExist", &a.CreateDefaultAvailabilityGroupIfNotExist) + delete(rawMsg, key) + case "loadBalancerConfigurations": + err = unpopulate(val, "LoadBalancerConfigurations", &a.LoadBalancerConfigurations) + delete(rawMsg, key) + case "multiSubnetIpConfigurations": + err = unpopulate(val, "MultiSubnetIPConfigurations", &a.MultiSubnetIPConfigurations) + delete(rawMsg, key) + case "port": + err = unpopulate(val, "Port", &a.Port) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + 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 Group. +func (g Group) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", g.ID) + populate(objectMap, "location", g.Location) + populate(objectMap, "name", g.Name) + populate(objectMap, "properties", g.Properties) + populate(objectMap, "systemData", g.SystemData) + populate(objectMap, "tags", g.Tags) + populate(objectMap, "type", g.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Group. +func (g *Group) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &g.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &g.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &g.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &g.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &g.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &g.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &g.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GroupListResult. +func (g GroupListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", g.NextLink) + populate(objectMap, "value", g.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GroupListResult. +func (g *GroupListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &g.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &g.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GroupProperties. +func (g GroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "clusterConfiguration", g.ClusterConfiguration) + populate(objectMap, "clusterManagerType", g.ClusterManagerType) + populate(objectMap, "provisioningState", g.ProvisioningState) + populate(objectMap, "sqlImageOffer", g.SQLImageOffer) + populate(objectMap, "sqlImageSku", g.SQLImageSKU) + populate(objectMap, "scaleType", g.ScaleType) + populate(objectMap, "wsfcDomainProfile", g.WsfcDomainProfile) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GroupProperties. +func (g *GroupProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clusterConfiguration": + err = unpopulate(val, "ClusterConfiguration", &g.ClusterConfiguration) + delete(rawMsg, key) + case "clusterManagerType": + err = unpopulate(val, "ClusterManagerType", &g.ClusterManagerType) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &g.ProvisioningState) + delete(rawMsg, key) + case "sqlImageOffer": + err = unpopulate(val, "SQLImageOffer", &g.SQLImageOffer) + delete(rawMsg, key) + case "sqlImageSku": + err = unpopulate(val, "SQLImageSKU", &g.SQLImageSKU) + delete(rawMsg, key) + case "scaleType": + err = unpopulate(val, "ScaleType", &g.ScaleType) + delete(rawMsg, key) + case "wsfcDomainProfile": + err = unpopulate(val, "WsfcDomainProfile", &g.WsfcDomainProfile) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GroupUpdate. +func (g GroupUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "tags", g.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GroupUpdate. +func (g *GroupUpdate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "tags": + err = unpopulate(val, "Tags", &g.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type KeyVaultCredentialSettings. +func (k KeyVaultCredentialSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "azureKeyVaultUrl", k.AzureKeyVaultURL) + populate(objectMap, "credentialName", k.CredentialName) + populate(objectMap, "enable", k.Enable) + populate(objectMap, "servicePrincipalName", k.ServicePrincipalName) + populate(objectMap, "servicePrincipalSecret", k.ServicePrincipalSecret) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultCredentialSettings. +func (k *KeyVaultCredentialSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "azureKeyVaultUrl": + err = unpopulate(val, "AzureKeyVaultURL", &k.AzureKeyVaultURL) + delete(rawMsg, key) + case "credentialName": + err = unpopulate(val, "CredentialName", &k.CredentialName) + delete(rawMsg, key) + case "enable": + err = unpopulate(val, "Enable", &k.Enable) + delete(rawMsg, key) + case "servicePrincipalName": + err = unpopulate(val, "ServicePrincipalName", &k.ServicePrincipalName) + delete(rawMsg, key) + case "servicePrincipalSecret": + err = unpopulate(val, "ServicePrincipalSecret", &k.ServicePrincipalSecret) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ListResult. +func (l ListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ListResult. +func (l *ListResult) UnmarshalJSON(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 "nextLink": + err = unpopulate(val, "NextLink", &l.NextLink) + delete(rawMsg, 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 LoadBalancerConfiguration. +func (l LoadBalancerConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "loadBalancerResourceId", l.LoadBalancerResourceID) + populate(objectMap, "privateIpAddress", l.PrivateIPAddress) + populate(objectMap, "probePort", l.ProbePort) + populate(objectMap, "publicIpAddressResourceId", l.PublicIPAddressResourceID) + populate(objectMap, "sqlVirtualMachineInstances", l.SQLVirtualMachineInstances) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancerConfiguration. +func (l *LoadBalancerConfiguration) UnmarshalJSON(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 "loadBalancerResourceId": + err = unpopulate(val, "LoadBalancerResourceID", &l.LoadBalancerResourceID) + delete(rawMsg, key) + case "privateIpAddress": + err = unpopulate(val, "PrivateIPAddress", &l.PrivateIPAddress) + delete(rawMsg, key) + case "probePort": + err = unpopulate(val, "ProbePort", &l.ProbePort) + delete(rawMsg, key) + case "publicIpAddressResourceId": + err = unpopulate(val, "PublicIPAddressResourceID", &l.PublicIPAddressResourceID) + delete(rawMsg, key) + case "sqlVirtualMachineInstances": + err = unpopulate(val, "SQLVirtualMachineInstances", &l.SQLVirtualMachineInstances) + 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 MultiSubnetIPConfiguration. +func (m MultiSubnetIPConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "privateIpAddress", m.PrivateIPAddress) + populate(objectMap, "sqlVirtualMachineInstance", m.SQLVirtualMachineInstance) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MultiSubnetIPConfiguration. +func (m *MultiSubnetIPConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "privateIpAddress": + err = unpopulate(val, "PrivateIPAddress", &m.PrivateIPAddress) + delete(rawMsg, key) + case "sqlVirtualMachineInstance": + err = unpopulate(val, "SQLVirtualMachineInstance", &m.SQLVirtualMachineInstance) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, 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, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult. +func (o *OperationListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &o.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateIPAddress. +func (p PrivateIPAddress) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "ipAddress", p.IPAddress) + populate(objectMap, "subnetResourceId", p.SubnetResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateIPAddress. +func (p *PrivateIPAddress) UnmarshalJSON(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 "ipAddress": + err = unpopulate(val, "IPAddress", &p.IPAddress) + delete(rawMsg, key) + case "subnetResourceId": + err = unpopulate(val, "SubnetResourceID", &p.SubnetResourceID) + 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 Properties. +func (p Properties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "assessmentSettings", p.AssessmentSettings) + populate(objectMap, "autoBackupSettings", p.AutoBackupSettings) + populate(objectMap, "autoPatchingSettings", p.AutoPatchingSettings) + populate(objectMap, "enableAutomaticUpgrade", p.EnableAutomaticUpgrade) + populate(objectMap, "keyVaultCredentialSettings", p.KeyVaultCredentialSettings) + populate(objectMap, "leastPrivilegeMode", p.LeastPrivilegeMode) + populate(objectMap, "provisioningState", p.ProvisioningState) + populate(objectMap, "sqlImageOffer", p.SQLImageOffer) + populate(objectMap, "sqlImageSku", p.SQLImageSKU) + populate(objectMap, "sqlManagement", p.SQLManagement) + populate(objectMap, "sqlServerLicenseType", p.SQLServerLicenseType) + populate(objectMap, "sqlVirtualMachineGroupResourceId", p.SQLVirtualMachineGroupResourceID) + populate(objectMap, "serverConfigurationsManagementSettings", p.ServerConfigurationsManagementSettings) + populate(objectMap, "storageConfigurationSettings", p.StorageConfigurationSettings) + populate(objectMap, "virtualMachineResourceId", p.VirtualMachineResourceID) + populate(objectMap, "wsfcDomainCredentials", p.WsfcDomainCredentials) + populate(objectMap, "wsfcStaticIp", p.WsfcStaticIP) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Properties. +func (p *Properties) UnmarshalJSON(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 "assessmentSettings": + err = unpopulate(val, "AssessmentSettings", &p.AssessmentSettings) + delete(rawMsg, key) + case "autoBackupSettings": + err = unpopulate(val, "AutoBackupSettings", &p.AutoBackupSettings) + delete(rawMsg, key) + case "autoPatchingSettings": + err = unpopulate(val, "AutoPatchingSettings", &p.AutoPatchingSettings) + delete(rawMsg, key) + case "enableAutomaticUpgrade": + err = unpopulate(val, "EnableAutomaticUpgrade", &p.EnableAutomaticUpgrade) + delete(rawMsg, key) + case "keyVaultCredentialSettings": + err = unpopulate(val, "KeyVaultCredentialSettings", &p.KeyVaultCredentialSettings) + delete(rawMsg, key) + case "leastPrivilegeMode": + err = unpopulate(val, "LeastPrivilegeMode", &p.LeastPrivilegeMode) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + delete(rawMsg, key) + case "sqlImageOffer": + err = unpopulate(val, "SQLImageOffer", &p.SQLImageOffer) + delete(rawMsg, key) + case "sqlImageSku": + err = unpopulate(val, "SQLImageSKU", &p.SQLImageSKU) + delete(rawMsg, key) + case "sqlManagement": + err = unpopulate(val, "SQLManagement", &p.SQLManagement) + delete(rawMsg, key) + case "sqlServerLicenseType": + err = unpopulate(val, "SQLServerLicenseType", &p.SQLServerLicenseType) + delete(rawMsg, key) + case "sqlVirtualMachineGroupResourceId": + err = unpopulate(val, "SQLVirtualMachineGroupResourceID", &p.SQLVirtualMachineGroupResourceID) + delete(rawMsg, key) + case "serverConfigurationsManagementSettings": + err = unpopulate(val, "ServerConfigurationsManagementSettings", &p.ServerConfigurationsManagementSettings) + delete(rawMsg, key) + case "storageConfigurationSettings": + err = unpopulate(val, "StorageConfigurationSettings", &p.StorageConfigurationSettings) + delete(rawMsg, key) + case "virtualMachineResourceId": + err = unpopulate(val, "VirtualMachineResourceID", &p.VirtualMachineResourceID) + delete(rawMsg, key) + case "wsfcDomainCredentials": + err = unpopulate(val, "WsfcDomainCredentials", &p.WsfcDomainCredentials) + delete(rawMsg, key) + case "wsfcStaticIp": + err = unpopulate(val, "WsfcStaticIP", &p.WsfcStaticIP) + 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 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 ResourceIdentity. +func (r ResourceIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "principalId", r.PrincipalID) + populate(objectMap, "tenantId", r.TenantID) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceIdentity. +func (r *ResourceIdentity) UnmarshalJSON(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 "principalId": + err = unpopulate(val, "PrincipalID", &r.PrincipalID) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &r.TenantID) + 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 SQLConnectivityUpdateSettings. +func (s SQLConnectivityUpdateSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "connectivityType", s.ConnectivityType) + populate(objectMap, "port", s.Port) + populate(objectMap, "sqlAuthUpdatePassword", s.SQLAuthUpdatePassword) + populate(objectMap, "sqlAuthUpdateUserName", s.SQLAuthUpdateUserName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SQLConnectivityUpdateSettings. +func (s *SQLConnectivityUpdateSettings) UnmarshalJSON(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 "connectivityType": + err = unpopulate(val, "ConnectivityType", &s.ConnectivityType) + delete(rawMsg, key) + case "port": + err = unpopulate(val, "Port", &s.Port) + delete(rawMsg, key) + case "sqlAuthUpdatePassword": + err = unpopulate(val, "SQLAuthUpdatePassword", &s.SQLAuthUpdatePassword) + delete(rawMsg, key) + case "sqlAuthUpdateUserName": + err = unpopulate(val, "SQLAuthUpdateUserName", &s.SQLAuthUpdateUserName) + 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 SQLInstanceSettings. +func (s SQLInstanceSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "collation", s.Collation) + populate(objectMap, "isIfiEnabled", s.IsIfiEnabled) + populate(objectMap, "isLpimEnabled", s.IsLpimEnabled) + populate(objectMap, "isOptimizeForAdHocWorkloadsEnabled", s.IsOptimizeForAdHocWorkloadsEnabled) + populate(objectMap, "maxDop", s.MaxDop) + populate(objectMap, "maxServerMemoryMB", s.MaxServerMemoryMB) + populate(objectMap, "minServerMemoryMB", s.MinServerMemoryMB) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SQLInstanceSettings. +func (s *SQLInstanceSettings) UnmarshalJSON(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 "collation": + err = unpopulate(val, "Collation", &s.Collation) + delete(rawMsg, key) + case "isIfiEnabled": + err = unpopulate(val, "IsIfiEnabled", &s.IsIfiEnabled) + delete(rawMsg, key) + case "isLpimEnabled": + err = unpopulate(val, "IsLpimEnabled", &s.IsLpimEnabled) + delete(rawMsg, key) + case "isOptimizeForAdHocWorkloadsEnabled": + err = unpopulate(val, "IsOptimizeForAdHocWorkloadsEnabled", &s.IsOptimizeForAdHocWorkloadsEnabled) + delete(rawMsg, key) + case "maxDop": + err = unpopulate(val, "MaxDop", &s.MaxDop) + delete(rawMsg, key) + case "maxServerMemoryMB": + err = unpopulate(val, "MaxServerMemoryMB", &s.MaxServerMemoryMB) + delete(rawMsg, key) + case "minServerMemoryMB": + err = unpopulate(val, "MinServerMemoryMB", &s.MinServerMemoryMB) + 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 SQLStorageSettings. +func (s SQLStorageSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "defaultFilePath", s.DefaultFilePath) + populate(objectMap, "luns", s.Luns) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SQLStorageSettings. +func (s *SQLStorageSettings) UnmarshalJSON(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 "defaultFilePath": + err = unpopulate(val, "DefaultFilePath", &s.DefaultFilePath) + delete(rawMsg, key) + case "luns": + err = unpopulate(val, "Luns", &s.Luns) + 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 SQLStorageUpdateSettings. +func (s SQLStorageUpdateSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "diskConfigurationType", s.DiskConfigurationType) + populate(objectMap, "diskCount", s.DiskCount) + populate(objectMap, "startingDeviceId", s.StartingDeviceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SQLStorageUpdateSettings. +func (s *SQLStorageUpdateSettings) UnmarshalJSON(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 "diskConfigurationType": + err = unpopulate(val, "DiskConfigurationType", &s.DiskConfigurationType) + delete(rawMsg, key) + case "diskCount": + err = unpopulate(val, "DiskCount", &s.DiskCount) + delete(rawMsg, key) + case "startingDeviceId": + err = unpopulate(val, "StartingDeviceID", &s.StartingDeviceID) + 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 SQLTempDbSettings. +func (s SQLTempDbSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "dataFileCount", s.DataFileCount) + populate(objectMap, "dataFileSize", s.DataFileSize) + populate(objectMap, "dataGrowth", s.DataGrowth) + populate(objectMap, "defaultFilePath", s.DefaultFilePath) + populate(objectMap, "logFileSize", s.LogFileSize) + populate(objectMap, "logGrowth", s.LogGrowth) + populate(objectMap, "luns", s.Luns) + populate(objectMap, "persistFolder", s.PersistFolder) + populate(objectMap, "persistFolderPath", s.PersistFolderPath) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SQLTempDbSettings. +func (s *SQLTempDbSettings) UnmarshalJSON(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 "dataFileCount": + err = unpopulate(val, "DataFileCount", &s.DataFileCount) + delete(rawMsg, key) + case "dataFileSize": + err = unpopulate(val, "DataFileSize", &s.DataFileSize) + delete(rawMsg, key) + case "dataGrowth": + err = unpopulate(val, "DataGrowth", &s.DataGrowth) + delete(rawMsg, key) + case "defaultFilePath": + err = unpopulate(val, "DefaultFilePath", &s.DefaultFilePath) + delete(rawMsg, key) + case "logFileSize": + err = unpopulate(val, "LogFileSize", &s.LogFileSize) + delete(rawMsg, key) + case "logGrowth": + err = unpopulate(val, "LogGrowth", &s.LogGrowth) + delete(rawMsg, key) + case "luns": + err = unpopulate(val, "Luns", &s.Luns) + delete(rawMsg, key) + case "persistFolder": + err = unpopulate(val, "PersistFolder", &s.PersistFolder) + delete(rawMsg, key) + case "persistFolderPath": + err = unpopulate(val, "PersistFolderPath", &s.PersistFolderPath) + 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 SQLVirtualMachine. +func (s SQLVirtualMachine) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "identity", s.Identity) + populate(objectMap, "location", s.Location) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "tags", s.Tags) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SQLVirtualMachine. +func (s *SQLVirtualMachine) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &s.Identity) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &s.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + 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 SQLWorkloadTypeUpdateSettings. +func (s SQLWorkloadTypeUpdateSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "sqlWorkloadType", s.SQLWorkloadType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SQLWorkloadTypeUpdateSettings. +func (s *SQLWorkloadTypeUpdateSettings) UnmarshalJSON(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 "sqlWorkloadType": + err = unpopulate(val, "SQLWorkloadType", &s.SQLWorkloadType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Schedule. +func (s Schedule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "dayOfWeek", s.DayOfWeek) + populate(objectMap, "enable", s.Enable) + populate(objectMap, "monthlyOccurrence", s.MonthlyOccurrence) + populate(objectMap, "startTime", s.StartTime) + populate(objectMap, "weeklyInterval", s.WeeklyInterval) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Schedule. +func (s *Schedule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dayOfWeek": + err = unpopulate(val, "DayOfWeek", &s.DayOfWeek) + delete(rawMsg, key) + case "enable": + err = unpopulate(val, "Enable", &s.Enable) + delete(rawMsg, key) + case "monthlyOccurrence": + err = unpopulate(val, "MonthlyOccurrence", &s.MonthlyOccurrence) + delete(rawMsg, key) + case "startTime": + err = unpopulate(val, "StartTime", &s.StartTime) + delete(rawMsg, key) + case "weeklyInterval": + err = unpopulate(val, "WeeklyInterval", &s.WeeklyInterval) + 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 ServerConfigurationsManagementSettings. +func (s ServerConfigurationsManagementSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "additionalFeaturesServerConfigurations", s.AdditionalFeaturesServerConfigurations) + populate(objectMap, "sqlConnectivityUpdateSettings", s.SQLConnectivityUpdateSettings) + populate(objectMap, "sqlInstanceSettings", s.SQLInstanceSettings) + populate(objectMap, "sqlStorageUpdateSettings", s.SQLStorageUpdateSettings) + populate(objectMap, "sqlWorkloadTypeUpdateSettings", s.SQLWorkloadTypeUpdateSettings) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerConfigurationsManagementSettings. +func (s *ServerConfigurationsManagementSettings) UnmarshalJSON(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 "additionalFeaturesServerConfigurations": + err = unpopulate(val, "AdditionalFeaturesServerConfigurations", &s.AdditionalFeaturesServerConfigurations) + delete(rawMsg, key) + case "sqlConnectivityUpdateSettings": + err = unpopulate(val, "SQLConnectivityUpdateSettings", &s.SQLConnectivityUpdateSettings) + delete(rawMsg, key) + case "sqlInstanceSettings": + err = unpopulate(val, "SQLInstanceSettings", &s.SQLInstanceSettings) + delete(rawMsg, key) + case "sqlStorageUpdateSettings": + err = unpopulate(val, "SQLStorageUpdateSettings", &s.SQLStorageUpdateSettings) + delete(rawMsg, key) + case "sqlWorkloadTypeUpdateSettings": + err = unpopulate(val, "SQLWorkloadTypeUpdateSettings", &s.SQLWorkloadTypeUpdateSettings) + 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 StorageConfigurationSettings. +func (s StorageConfigurationSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "diskConfigurationType", s.DiskConfigurationType) + populate(objectMap, "sqlDataSettings", s.SQLDataSettings) + populate(objectMap, "sqlLogSettings", s.SQLLogSettings) + populate(objectMap, "sqlSystemDbOnDataDisk", s.SQLSystemDbOnDataDisk) + populate(objectMap, "sqlTempDbSettings", s.SQLTempDbSettings) + populate(objectMap, "storageWorkloadType", s.StorageWorkloadType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StorageConfigurationSettings. +func (s *StorageConfigurationSettings) UnmarshalJSON(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 "diskConfigurationType": + err = unpopulate(val, "DiskConfigurationType", &s.DiskConfigurationType) + delete(rawMsg, key) + case "sqlDataSettings": + err = unpopulate(val, "SQLDataSettings", &s.SQLDataSettings) + delete(rawMsg, key) + case "sqlLogSettings": + err = unpopulate(val, "SQLLogSettings", &s.SQLLogSettings) + delete(rawMsg, key) + case "sqlSystemDbOnDataDisk": + err = unpopulate(val, "SQLSystemDbOnDataDisk", &s.SQLSystemDbOnDataDisk) + delete(rawMsg, key) + case "sqlTempDbSettings": + err = unpopulate(val, "SQLTempDbSettings", &s.SQLTempDbSettings) + delete(rawMsg, key) + case "storageWorkloadType": + err = unpopulate(val, "StorageWorkloadType", &s.StorageWorkloadType) + 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 SystemData. +func (s SystemData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populate(objectMap, "createdBy", s.CreatedBy) + populate(objectMap, "createdByType", s.CreatedByType) + populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) + populate(objectMap, "lastModifiedBy", s.LastModifiedBy) + populate(objectMap, "lastModifiedByType", s.LastModifiedByType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. +func (s *SystemData) UnmarshalJSON(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 "createdAt": + err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, "CreatedBy", &s.CreatedBy) + delete(rawMsg, key) + case "createdByType": + err = unpopulate(val, "CreatedByType", &s.CreatedByType) + delete(rawMsg, key) + case "lastModifiedAt": + err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) + delete(rawMsg, key) + case "lastModifiedBy": + err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) + delete(rawMsg, key) + case "lastModifiedByType": + err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TrackedResource. +func (t TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", t.ID) + populate(objectMap, "location", t.Location) + populate(objectMap, "name", t.Name) + populate(objectMap, "tags", t.Tags) + populate(objectMap, "type", t.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResource. +func (t *TrackedResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &t.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &t.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &t.Name) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &t.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &t.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Update. +func (u Update) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "tags", u.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Update. +func (u *Update) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "tags": + err = unpopulate(val, "Tags", &u.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WsfcDomainCredentials. +func (w WsfcDomainCredentials) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "clusterBootstrapAccountPassword", w.ClusterBootstrapAccountPassword) + populate(objectMap, "clusterOperatorAccountPassword", w.ClusterOperatorAccountPassword) + populate(objectMap, "sqlServiceAccountPassword", w.SQLServiceAccountPassword) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WsfcDomainCredentials. +func (w *WsfcDomainCredentials) UnmarshalJSON(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 "clusterBootstrapAccountPassword": + err = unpopulate(val, "ClusterBootstrapAccountPassword", &w.ClusterBootstrapAccountPassword) + delete(rawMsg, key) + case "clusterOperatorAccountPassword": + err = unpopulate(val, "ClusterOperatorAccountPassword", &w.ClusterOperatorAccountPassword) + delete(rawMsg, key) + case "sqlServiceAccountPassword": + err = unpopulate(val, "SQLServiceAccountPassword", &w.SQLServiceAccountPassword) + 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 WsfcDomainProfile. +func (w WsfcDomainProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "clusterBootstrapAccount", w.ClusterBootstrapAccount) + populate(objectMap, "clusterOperatorAccount", w.ClusterOperatorAccount) + populate(objectMap, "clusterSubnetType", w.ClusterSubnetType) + populate(objectMap, "domainFqdn", w.DomainFqdn) + populate(objectMap, "fileShareWitnessPath", w.FileShareWitnessPath) + populate(objectMap, "ouPath", w.OuPath) + populate(objectMap, "sqlServiceAccount", w.SQLServiceAccount) + populate(objectMap, "storageAccountPrimaryKey", w.StorageAccountPrimaryKey) + populate(objectMap, "storageAccountUrl", w.StorageAccountURL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WsfcDomainProfile. +func (w *WsfcDomainProfile) UnmarshalJSON(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 "clusterBootstrapAccount": + err = unpopulate(val, "ClusterBootstrapAccount", &w.ClusterBootstrapAccount) + delete(rawMsg, key) + case "clusterOperatorAccount": + err = unpopulate(val, "ClusterOperatorAccount", &w.ClusterOperatorAccount) + delete(rawMsg, key) + case "clusterSubnetType": + err = unpopulate(val, "ClusterSubnetType", &w.ClusterSubnetType) + delete(rawMsg, key) + case "domainFqdn": + err = unpopulate(val, "DomainFqdn", &w.DomainFqdn) + delete(rawMsg, key) + case "fileShareWitnessPath": + err = unpopulate(val, "FileShareWitnessPath", &w.FileShareWitnessPath) + delete(rawMsg, key) + case "ouPath": + err = unpopulate(val, "OuPath", &w.OuPath) + delete(rawMsg, key) + case "sqlServiceAccount": + err = unpopulate(val, "SQLServiceAccount", &w.SQLServiceAccount) + delete(rawMsg, key) + case "storageAccountPrimaryKey": + err = unpopulate(val, "StorageAccountPrimaryKey", &w.StorageAccountPrimaryKey) + delete(rawMsg, key) + case "storageAccountUrl": + err = unpopulate(val, "StorageAccountURL", &w.StorageAccountURL) + 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/sqlvirtualmachine/armsqlvirtualmachine/zz_generated_operations_client.go b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/operations_client.go similarity index 97% rename from sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/zz_generated_operations_client.go rename to sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/operations_client.go index f443e17840bf..3ba5d4578a1c 100644 --- a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/zz_generated_operations_client.go +++ b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/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 armsqlvirtualmachine @@ -50,7 +51,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Lists all of the available SQL Virtual Machine Rest API operations. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview +// Generated from API version 2022-07-01-preview // options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -88,7 +89,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/zz_generated_response_types.go b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/response_types.go similarity index 99% rename from sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/zz_generated_response_types.go rename to sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/response_types.go index a3be98d03325..51b028b96de8 100644 --- a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/zz_generated_response_types.go +++ b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/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 armsqlvirtualmachine diff --git a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/zz_generated_sqlvirtualmachines_client.go b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/sqlvirtualmachines_client.go similarity index 96% rename from sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/zz_generated_sqlvirtualmachines_client.go rename to sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/sqlvirtualmachines_client.go index ba2ca90fc559..e1e844fda756 100644 --- a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/zz_generated_sqlvirtualmachines_client.go +++ b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/sqlvirtualmachines_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 armsqlvirtualmachine @@ -56,7 +57,7 @@ func NewSQLVirtualMachinesClient(subscriptionID string, credential azcore.TokenC // BeginCreateOrUpdate - Creates or updates a SQL virtual machine. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview +// Generated from API version 2022-07-01-preview // resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource // Manager API or the portal. // sqlVirtualMachineName - Name of the SQL virtual machine. @@ -77,7 +78,7 @@ func (client *SQLVirtualMachinesClient) BeginCreateOrUpdate(ctx context.Context, // CreateOrUpdate - Creates or updates a SQL virtual machine. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview +// Generated from API version 2022-07-01-preview func (client *SQLVirtualMachinesClient) createOrUpdate(ctx context.Context, resourceGroupName string, sqlVirtualMachineName string, parameters SQLVirtualMachine, options *SQLVirtualMachinesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, sqlVirtualMachineName, parameters, options) if err != nil { @@ -113,7 +114,7 @@ func (client *SQLVirtualMachinesClient) createOrUpdateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -121,7 +122,7 @@ func (client *SQLVirtualMachinesClient) createOrUpdateCreateRequest(ctx context. // BeginDelete - Deletes a SQL virtual machine. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview +// Generated from API version 2022-07-01-preview // resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource // Manager API or the portal. // sqlVirtualMachineName - Name of the SQL virtual machine. @@ -141,7 +142,7 @@ func (client *SQLVirtualMachinesClient) BeginDelete(ctx context.Context, resourc // Delete - Deletes a SQL virtual machine. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview +// Generated from API version 2022-07-01-preview func (client *SQLVirtualMachinesClient) deleteOperation(ctx context.Context, resourceGroupName string, sqlVirtualMachineName string, options *SQLVirtualMachinesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, sqlVirtualMachineName, options) if err != nil { @@ -177,14 +178,14 @@ func (client *SQLVirtualMachinesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets a SQL virtual machine. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview +// Generated from API version 2022-07-01-preview // resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource // Manager API or the portal. // sqlVirtualMachineName - Name of the SQL virtual machine. @@ -227,7 +228,7 @@ func (client *SQLVirtualMachinesClient) getCreateRequest(ctx context.Context, re if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -244,7 +245,7 @@ func (client *SQLVirtualMachinesClient) getHandleResponse(resp *http.Response) ( // NewListPager - Gets all SQL virtual machines in a subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview +// Generated from API version 2022-07-01-preview // options - SQLVirtualMachinesClientListOptions contains the optional parameters for the SQLVirtualMachinesClient.List method. func (client *SQLVirtualMachinesClient) NewListPager(options *SQLVirtualMachinesClientListOptions) *runtime.Pager[SQLVirtualMachinesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[SQLVirtualMachinesClientListResponse]{ @@ -286,7 +287,7 @@ func (client *SQLVirtualMachinesClient) listCreateRequest(ctx context.Context, o return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -303,7 +304,7 @@ func (client *SQLVirtualMachinesClient) listHandleResponse(resp *http.Response) // NewListByResourceGroupPager - Gets all SQL virtual machines in a resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview +// Generated from API version 2022-07-01-preview // resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource // Manager API or the portal. // options - SQLVirtualMachinesClientListByResourceGroupOptions contains the optional parameters for the SQLVirtualMachinesClient.ListByResourceGroup @@ -352,7 +353,7 @@ func (client *SQLVirtualMachinesClient) listByResourceGroupCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -369,7 +370,7 @@ func (client *SQLVirtualMachinesClient) listByResourceGroupHandleResponse(resp * // NewListBySQLVMGroupPager - Gets the list of sql virtual machines in a SQL virtual machine group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview +// Generated from API version 2022-07-01-preview // resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource // Manager API or the portal. // sqlVirtualMachineGroupName - Name of the SQL virtual machine group. @@ -423,7 +424,7 @@ func (client *SQLVirtualMachinesClient) listBySQLVMGroupCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -440,7 +441,7 @@ func (client *SQLVirtualMachinesClient) listBySQLVMGroupHandleResponse(resp *htt // BeginRedeploy - Uninstalls and reinstalls the SQL Iaas Extension. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview +// Generated from API version 2022-07-01-preview // resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource // Manager API or the portal. // sqlVirtualMachineName - Name of the SQL virtual machine. @@ -460,7 +461,7 @@ func (client *SQLVirtualMachinesClient) BeginRedeploy(ctx context.Context, resou // Redeploy - Uninstalls and reinstalls the SQL Iaas Extension. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview +// Generated from API version 2022-07-01-preview func (client *SQLVirtualMachinesClient) redeploy(ctx context.Context, resourceGroupName string, sqlVirtualMachineName string, options *SQLVirtualMachinesClientBeginRedeployOptions) (*http.Response, error) { req, err := client.redeployCreateRequest(ctx, resourceGroupName, sqlVirtualMachineName, options) if err != nil { @@ -496,14 +497,14 @@ func (client *SQLVirtualMachinesClient) redeployCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // BeginStartAssessment - Starts Assessment on SQL virtual machine. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview +// Generated from API version 2022-07-01-preview // resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource // Manager API or the portal. // sqlVirtualMachineName - Name of the SQL virtual machine. @@ -523,7 +524,7 @@ func (client *SQLVirtualMachinesClient) BeginStartAssessment(ctx context.Context // StartAssessment - Starts Assessment on SQL virtual machine. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview +// Generated from API version 2022-07-01-preview func (client *SQLVirtualMachinesClient) startAssessment(ctx context.Context, resourceGroupName string, sqlVirtualMachineName string, options *SQLVirtualMachinesClientBeginStartAssessmentOptions) (*http.Response, error) { req, err := client.startAssessmentCreateRequest(ctx, resourceGroupName, sqlVirtualMachineName, options) if err != nil { @@ -559,14 +560,14 @@ func (client *SQLVirtualMachinesClient) startAssessmentCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // BeginUpdate - Updates a SQL virtual machine. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview +// Generated from API version 2022-07-01-preview // resourceGroupName - Name of the resource group that contains the resource. You can obtain this value from the Azure Resource // Manager API or the portal. // sqlVirtualMachineName - Name of the SQL virtual machine. @@ -587,7 +588,7 @@ func (client *SQLVirtualMachinesClient) BeginUpdate(ctx context.Context, resourc // Update - Updates a SQL virtual machine. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview +// Generated from API version 2022-07-01-preview func (client *SQLVirtualMachinesClient) update(ctx context.Context, resourceGroupName string, sqlVirtualMachineName string, parameters Update, options *SQLVirtualMachinesClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, sqlVirtualMachineName, parameters, options) if err != nil { @@ -623,7 +624,7 @@ func (client *SQLVirtualMachinesClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/zz_generated_time_rfc3339.go b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/time_rfc3339.go similarity index 99% rename from sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/zz_generated_time_rfc3339.go rename to sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/time_rfc3339.go index e36acb76f88d..6680b2257477 100644 --- a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/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 armsqlvirtualmachine diff --git a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/ze_generated_example_availabilitygrouplisteners_client_test.go b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/ze_generated_example_availabilitygrouplisteners_client_test.go deleted file mode 100644 index 37d72a73ab88..000000000000 --- a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/ze_generated_example_availabilitygrouplisteners_client_test.go +++ /dev/null @@ -1,137 +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 armsqlvirtualmachine_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/sqlvirtualmachine/armsqlvirtualmachine" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2021-11-01-preview/examples/GetAvailabilityGroupListener.json -func ExampleAvailabilityGroupListenersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsqlvirtualmachine.NewAvailabilityGroupListenersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "testrg", - "testvmgroup", - "agl-test", - &armsqlvirtualmachine.AvailabilityGroupListenersClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2021-11-01-preview/examples/CreateOrUpdateAvailabilityGroupListener.json -func ExampleAvailabilityGroupListenersClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsqlvirtualmachine.NewAvailabilityGroupListenersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "testrg", - "testvmgroup", - "agl-test", - armsqlvirtualmachine.AvailabilityGroupListener{ - Properties: &armsqlvirtualmachine.AvailabilityGroupListenerProperties{ - AvailabilityGroupName: to.Ptr("ag-test"), - LoadBalancerConfigurations: []*armsqlvirtualmachine.LoadBalancerConfiguration{ - { - LoadBalancerResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb-test"), - PrivateIPAddress: &armsqlvirtualmachine.PrivateIPAddress{ - IPAddress: to.Ptr("10.1.0.112"), - SubnetResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/default"), - }, - ProbePort: to.Ptr[int32](59983), - SQLVirtualMachineInstances: []*string{ - to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm2"), - to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm3")}, - }}, - Port: to.Ptr[int32](1433), - }, - }, - 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/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2021-11-01-preview/examples/DeleteAvailabilityGroupListener.json -func ExampleAvailabilityGroupListenersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsqlvirtualmachine.NewAvailabilityGroupListenersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "testrg", - "testvmgroup", - "agl-test", - 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/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2021-11-01-preview/examples/ListByGroupAvailabilityGroupListener.json -func ExampleAvailabilityGroupListenersClient_NewListByGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsqlvirtualmachine.NewAvailabilityGroupListenersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByGroupPager("testrg", - "testvmgroup", - 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/sqlvirtualmachine/armsqlvirtualmachine/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/ze_generated_example_operations_client_test.go deleted file mode 100644 index 6a858f8c55e4..000000000000 --- a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/ze_generated_example_operations_client_test.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsqlvirtualmachine_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2021-11-01-preview/examples/ListOperation.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsqlvirtualmachine.NewOperationsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/ze_generated_example_sqlvirtualmachinegroups_client_test.go b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/ze_generated_example_sqlvirtualmachinegroups_client_test.go deleted file mode 100644 index 91d18d676952..000000000000 --- a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/ze_generated_example_sqlvirtualmachinegroups_client_test.go +++ /dev/null @@ -1,189 +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 armsqlvirtualmachine_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/sqlvirtualmachine/armsqlvirtualmachine" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2021-11-01-preview/examples/GetSqlVirtualMachineGroup.json -func ExampleGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsqlvirtualmachine.NewGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "testrg", - "testvmgroup", - 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/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2021-11-01-preview/examples/CreateOrUpdateSqlVirtualMachineGroup.json -func ExampleGroupsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsqlvirtualmachine.NewGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "testrg", - "testvmgroup", - armsqlvirtualmachine.Group{ - Location: to.Ptr("northeurope"), - Tags: map[string]*string{ - "mytag": to.Ptr("myval"), - }, - Properties: &armsqlvirtualmachine.GroupProperties{ - SQLImageOffer: to.Ptr("SQL2016-WS2016"), - SQLImageSKU: to.Ptr(armsqlvirtualmachine.SQLVMGroupImageSKUEnterprise), - WsfcDomainProfile: &armsqlvirtualmachine.WsfcDomainProfile{ - ClusterBootstrapAccount: to.Ptr("testrpadmin"), - ClusterOperatorAccount: to.Ptr("testrp@testdomain.com"), - DomainFqdn: to.Ptr("testdomain.com"), - OuPath: to.Ptr("OU=WSCluster,DC=testdomain,DC=com"), - SQLServiceAccount: to.Ptr("sqlservice@testdomain.com"), - StorageAccountPrimaryKey: to.Ptr(""), - StorageAccountURL: to.Ptr("https://storgact.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/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2021-11-01-preview/examples/DeleteSqlVirtualMachineGroup.json -func ExampleGroupsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsqlvirtualmachine.NewGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "testrg", - "testvmgroup", - 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/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2021-11-01-preview/examples/UpdateSqlVirtualMachineGroup.json -func ExampleGroupsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsqlvirtualmachine.NewGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "testrg", - "testvmgroup", - armsqlvirtualmachine.GroupUpdate{ - Tags: map[string]*string{ - "mytag": to.Ptr("myval"), - }, - }, - 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/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2021-11-01-preview/examples/ListByResourceGroupSqlVirtualMachineGroup.json -func ExampleGroupsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsqlvirtualmachine.NewGroupsClient("00000000-1111-2222-3333-444444444444", 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/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2021-11-01-preview/examples/ListSubscriptionSqlVirtualMachineGroup.json -func ExampleGroupsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsqlvirtualmachine.NewGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/ze_generated_example_sqlvirtualmachines_client_test.go b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/ze_generated_example_sqlvirtualmachines_client_test.go deleted file mode 100644 index 95a3015930b1..000000000000 --- a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/ze_generated_example_sqlvirtualmachines_client_test.go +++ /dev/null @@ -1,230 +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 armsqlvirtualmachine_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/sqlvirtualmachine/armsqlvirtualmachine" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2021-11-01-preview/examples/ListSubscriptionSqlVirtualMachine.json -func ExampleSQLVirtualMachinesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsqlvirtualmachine.NewSQLVirtualMachinesClient("00000000-1111-2222-3333-444444444444", 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/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2021-11-01-preview/examples/RedeploySqlVirtualMachine.json -func ExampleSQLVirtualMachinesClient_BeginRedeploy() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsqlvirtualmachine.NewSQLVirtualMachinesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRedeploy(ctx, - "testrg", - "testvm", - 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/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2021-11-01-preview/examples/GetSqlVirtualMachine.json -func ExampleSQLVirtualMachinesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsqlvirtualmachine.NewSQLVirtualMachinesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "testrg", - "testvm", - &armsqlvirtualmachine.SQLVirtualMachinesClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2021-11-01-preview/examples/CreateOrUpdateVirtualMachineWithVMGroup.json -func ExampleSQLVirtualMachinesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsqlvirtualmachine.NewSQLVirtualMachinesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "testrg", - "testvm", - armsqlvirtualmachine.SQLVirtualMachine{ - Location: to.Ptr("northeurope"), - Properties: &armsqlvirtualmachine.Properties{ - SQLVirtualMachineGroupResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/testvmgroup"), - VirtualMachineResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachines/testvm2"), - WsfcDomainCredentials: &armsqlvirtualmachine.WsfcDomainCredentials{ - ClusterBootstrapAccountPassword: to.Ptr(""), - ClusterOperatorAccountPassword: to.Ptr(""), - SQLServiceAccountPassword: to.Ptr(""), - }, - }, - }, - 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/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2021-11-01-preview/examples/DeleteSqlVirtualMachine.json -func ExampleSQLVirtualMachinesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsqlvirtualmachine.NewSQLVirtualMachinesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "testrg", - "testvm1", - 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/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2021-11-01-preview/examples/UpdateSqlVirtualMachine.json -func ExampleSQLVirtualMachinesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsqlvirtualmachine.NewSQLVirtualMachinesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "testrg", - "testvm", - armsqlvirtualmachine.Update{ - Tags: map[string]*string{ - "mytag": to.Ptr("myval"), - }, - }, - 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/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2021-11-01-preview/examples/ListByResourceGroupSqlVirtualMachine.json -func ExampleSQLVirtualMachinesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsqlvirtualmachine.NewSQLVirtualMachinesClient("00000000-1111-2222-3333-444444444444", 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/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/preview/2021-11-01-preview/examples/StartAssessmentOnSqlVirtualMachine.json -func ExampleSQLVirtualMachinesClient_BeginStartAssessment() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsqlvirtualmachine.NewSQLVirtualMachinesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginStartAssessment(ctx, - "testrg", - "testvm", - 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/sqlvirtualmachine/armsqlvirtualmachine/zz_generated_models_serde.go b/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/zz_generated_models_serde.go deleted file mode 100644 index 3e7b54b42bdc..000000000000 --- a/sdk/resourcemanager/sqlvirtualmachine/armsqlvirtualmachine/zz_generated_models_serde.go +++ /dev/null @@ -1,206 +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 armsqlvirtualmachine - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" -) - -// MarshalJSON implements the json.Marshaller interface for type AgConfiguration. -func (a AgConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "replicas", a.Replicas) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type AutoBackupSettings. -func (a AutoBackupSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "backupScheduleType", a.BackupScheduleType) - populate(objectMap, "backupSystemDbs", a.BackupSystemDbs) - populate(objectMap, "daysOfWeek", a.DaysOfWeek) - populate(objectMap, "enable", a.Enable) - populate(objectMap, "enableEncryption", a.EnableEncryption) - populate(objectMap, "fullBackupFrequency", a.FullBackupFrequency) - populate(objectMap, "fullBackupStartTime", a.FullBackupStartTime) - populate(objectMap, "fullBackupWindowHours", a.FullBackupWindowHours) - populate(objectMap, "logBackupFrequency", a.LogBackupFrequency) - populate(objectMap, "password", a.Password) - populate(objectMap, "retentionPeriod", a.RetentionPeriod) - populate(objectMap, "storageAccessKey", a.StorageAccessKey) - populate(objectMap, "storageAccountUrl", a.StorageAccountURL) - populate(objectMap, "storageContainerName", a.StorageContainerName) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type AvailabilityGroupListenerProperties. -func (a AvailabilityGroupListenerProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "availabilityGroupConfiguration", a.AvailabilityGroupConfiguration) - populate(objectMap, "availabilityGroupName", a.AvailabilityGroupName) - populate(objectMap, "createDefaultAvailabilityGroupIfNotExist", a.CreateDefaultAvailabilityGroupIfNotExist) - populate(objectMap, "loadBalancerConfigurations", a.LoadBalancerConfigurations) - populate(objectMap, "port", a.Port) - populate(objectMap, "provisioningState", a.ProvisioningState) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type Group. -func (g Group) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", g.ID) - populate(objectMap, "location", g.Location) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "systemData", g.SystemData) - populate(objectMap, "tags", g.Tags) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type GroupUpdate. -func (g GroupUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "tags", g.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type LoadBalancerConfiguration. -func (l LoadBalancerConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "loadBalancerResourceId", l.LoadBalancerResourceID) - populate(objectMap, "privateIpAddress", l.PrivateIPAddress) - populate(objectMap, "probePort", l.ProbePort) - populate(objectMap, "publicIpAddressResourceId", l.PublicIPAddressResourceID) - populate(objectMap, "sqlVirtualMachineInstances", l.SQLVirtualMachineInstances) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SQLStorageSettings. -func (s SQLStorageSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "defaultFilePath", s.DefaultFilePath) - populate(objectMap, "luns", s.Luns) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SQLTempDbSettings. -func (s SQLTempDbSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dataFileCount", s.DataFileCount) - populate(objectMap, "dataFileSize", s.DataFileSize) - populate(objectMap, "dataGrowth", s.DataGrowth) - populate(objectMap, "defaultFilePath", s.DefaultFilePath) - populate(objectMap, "logFileSize", s.LogFileSize) - populate(objectMap, "logGrowth", s.LogGrowth) - populate(objectMap, "luns", s.Luns) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SQLVirtualMachine. -func (s SQLVirtualMachine) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", s.ID) - populate(objectMap, "identity", s.Identity) - populate(objectMap, "location", s.Location) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "systemData", s.SystemData) - populate(objectMap, "tags", s.Tags) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SystemData. -func (s SystemData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) - populate(objectMap, "createdBy", s.CreatedBy) - populate(objectMap, "createdByType", s.CreatedByType) - populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) - populate(objectMap, "lastModifiedBy", s.LastModifiedBy) - populate(objectMap, "lastModifiedByType", s.LastModifiedByType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. -func (s *SystemData) UnmarshalJSON(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 "createdAt": - err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) - delete(rawMsg, key) - case "createdBy": - err = unpopulate(val, "CreatedBy", &s.CreatedBy) - delete(rawMsg, key) - case "createdByType": - err = unpopulate(val, "CreatedByType", &s.CreatedByType) - delete(rawMsg, key) - case "lastModifiedAt": - err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) - delete(rawMsg, key) - case "lastModifiedBy": - err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) - delete(rawMsg, key) - case "lastModifiedByType": - err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type TrackedResource. -func (t TrackedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", t.ID) - populate(objectMap, "location", t.Location) - populate(objectMap, "name", t.Name) - populate(objectMap, "tags", t.Tags) - populate(objectMap, "type", t.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type Update. -func (u Update) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "tags", u.Tags) - return json.Marshal(objectMap) -} - -func populate(m map[string]interface{}, k string, v interface{}) { - if v == nil { - return - } else if azcore.IsNullValue(v) { - m[k] = nil - } else if !reflect.ValueOf(v).IsNil() { - m[k] = v - } -} - -func unpopulate(data json.RawMessage, fn string, v interface{}) error { - if data == nil { - return nil - } - if err := json.Unmarshal(data, v); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - return nil -}