From e820001b532b2a414c510dc2b7f78109720ed8f5 Mon Sep 17 00:00:00 2001 From: Jiahui Peng <46921893+Alancere@users.noreply.github.com> Date: Mon, 25 Jul 2022 11:07:00 +0800 Subject: [PATCH] [Release] sdk/resourcemanager/recoveryservices/armrecoveryservices/1.1.0 generation from spec commit: 43ca5ba8c01eafc595f418a66adb6c3c09d9b965 (#18672) --- .../armrecoveryservices/CHANGELOG.md | 15 + .../armrecoveryservices/autorest.md | 6 +- .../{zz_generated_client.go => client.go} | 5 +- ...zz_generated_constants.go => constants.go} | 41 +- .../armrecoveryservices/go.mod | 4 +- .../armrecoveryservices/go.sum | 8 +- .../{zz_generated_models.go => models.go} | 20 +- .../armrecoveryservices/models_serde.go | 2186 +++++++++++++++++ ...rations_client.go => operations_client.go} | 13 +- ...t.go => operations_client_example_test.go} | 6 +- ...phic_helpers.go => polymorphic_helpers.go} | 1 + ...ient.go => privatelinkresources_client.go} | 9 +- ...ivatelinkresources_client_example_test.go} | 4 +- ...> recoveryservices_client_example_test.go} | 2 +- ...ient.go => registeredidentities_client.go} | 5 +- ...gisteredidentities_client_example_test.go} | 2 +- ..._client.go => replicationusages_client.go} | 5 +- ... replicationusages_client_example_test.go} | 2 +- ...ed_response_types.go => response_types.go} | 1 + ...erated_time_rfc3339.go => time_rfc3339.go} | 1 + ...ated_usages_client.go => usages_client.go} | 5 +- ..._test.go => usages_client_example_test.go} | 2 +- ..._client.go => vaultcertificates_client.go} | 5 +- ... vaultcertificates_client_example_test.go} | 2 +- ..._client.go => vaultextendedinfo_client.go} | 13 +- ... vaultextendedinfo_client_example_test.go} | 6 +- ...ated_vaults_client.go => vaults_client.go} | 29 +- ..._test.go => vaults_client_example_test.go} | 10 +- .../zz_generated_models_serde.go | 577 ----- 29 files changed, 2338 insertions(+), 647 deletions(-) rename sdk/resourcemanager/recoveryservices/armrecoveryservices/{zz_generated_client.go => client.go} (98%) rename sdk/resourcemanager/recoveryservices/armrecoveryservices/{zz_generated_constants.go => constants.go} (85%) rename sdk/resourcemanager/recoveryservices/armrecoveryservices/{zz_generated_models.go => models.go} (97%) create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservices/models_serde.go rename sdk/resourcemanager/recoveryservices/armrecoveryservices/{zz_generated_operations_client.go => operations_client.go} (97%) rename sdk/resourcemanager/recoveryservices/armrecoveryservices/{ze_generated_example_operations_client_test.go => operations_client_example_test.go} (94%) rename sdk/resourcemanager/recoveryservices/armrecoveryservices/{zz_generated_polymorphic_helpers.go => polymorphic_helpers.go} (98%) rename sdk/resourcemanager/recoveryservices/armrecoveryservices/{zz_generated_privatelinkresources_client.go => privatelinkresources_client.go} (97%) rename sdk/resourcemanager/recoveryservices/armrecoveryservices/{ze_generated_example_privatelinkresources_client_test.go => privatelinkresources_client_example_test.go} (94%) rename sdk/resourcemanager/recoveryservices/armrecoveryservices/{ze_generated_example_recoveryservices_client_test.go => recoveryservices_client_example_test.go} (95%) rename sdk/resourcemanager/recoveryservices/armrecoveryservices/{zz_generated_registeredidentities_client.go => registeredidentities_client.go} (97%) rename sdk/resourcemanager/recoveryservices/armrecoveryservices/{ze_generated_example_registeredidentities_client_test.go => registeredidentities_client_example_test.go} (95%) rename sdk/resourcemanager/recoveryservices/armrecoveryservices/{zz_generated_replicationusages_client.go => replicationusages_client.go} (98%) rename sdk/resourcemanager/recoveryservices/armrecoveryservices/{ze_generated_example_replicationusages_client_test.go => replicationusages_client_example_test.go} (95%) rename sdk/resourcemanager/recoveryservices/armrecoveryservices/{zz_generated_response_types.go => response_types.go} (99%) rename sdk/resourcemanager/recoveryservices/armrecoveryservices/{zz_generated_time_rfc3339.go => time_rfc3339.go} (99%) rename sdk/resourcemanager/recoveryservices/armrecoveryservices/{zz_generated_usages_client.go => usages_client.go} (98%) rename sdk/resourcemanager/recoveryservices/armrecoveryservices/{ze_generated_example_usages_client_test.go => usages_client_example_test.go} (95%) rename sdk/resourcemanager/recoveryservices/armrecoveryservices/{zz_generated_vaultcertificates_client.go => vaultcertificates_client.go} (98%) rename sdk/resourcemanager/recoveryservices/armrecoveryservices/{ze_generated_example_vaultcertificates_client_test.go => vaultcertificates_client_example_test.go} (97%) rename sdk/resourcemanager/recoveryservices/armrecoveryservices/{zz_generated_vaultextendedinfo_client.go => vaultextendedinfo_client.go} (97%) rename sdk/resourcemanager/recoveryservices/armrecoveryservices/{ze_generated_example_vaultextendedinfo_client_test.go => vaultextendedinfo_client_example_test.go} (93%) rename sdk/resourcemanager/recoveryservices/armrecoveryservices/{zz_generated_vaults_client.go => vaults_client.go} (96%) rename sdk/resourcemanager/recoveryservices/armrecoveryservices/{ze_generated_example_vaults_client_test.go => vaults_client_example_test.go} (94%) delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservices/zz_generated_models_serde.go diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/CHANGELOG.md b/sdk/resourcemanager/recoveryservices/armrecoveryservices/CHANGELOG.md index 916ae0b64f63..b1b9b9b776dc 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/CHANGELOG.md +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservices/CHANGELOG.md @@ -1,5 +1,20 @@ # Release History +## 1.1.0 (2022-07-22) +### Features Added + +- New const `StandardTierStorageRedundancyGeoRedundant` +- New const `StandardTierStorageRedundancyZoneRedundant` +- New const `CrossRegionRestoreEnabled` +- New const `CrossRegionRestoreDisabled` +- New const `StandardTierStorageRedundancyLocallyRedundant` +- New function `PossibleCrossRegionRestoreValues() []CrossRegionRestore` +- New function `PossibleStandardTierStorageRedundancyValues() []StandardTierStorageRedundancy` +- New struct `VaultPropertiesRedundancySettings` +- New field `RedundancySettings` in struct `VaultProperties` +- New field `AADAudience` in struct `ResourceCertificateAndAADDetails` + + ## 1.0.0 (2022-05-17) The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservices` is using our [next generation design principles](https://azure.github.io/azure-sdk/general_introduction.html) since version 1.0.0, which contains breaking changes. diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/autorest.md b/sdk/resourcemanager/recoveryservices/armrecoveryservices/autorest.md index ecb567f37461..7f0818fef167 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/autorest.md +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservices/autorest.md @@ -5,10 +5,10 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/recoveryservices/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/recoveryservices/resource-manager/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/43ca5ba8c01eafc595f418a66adb6c3c09d9b965/specification/recoveryservices/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/43ca5ba8c01eafc595f418a66adb6c3c09d9b965/specification/recoveryservices/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 +module-version: 1.1.0 directive: - from: vaults.json where: '$.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/operationStatus/{operationId}"].get' diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/zz_generated_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservices/client.go similarity index 98% rename from sdk/resourcemanager/recoveryservices/armrecoveryservices/zz_generated_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservices/client.go index a89081934c70..11245cbb41a7 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/zz_generated_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservices/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 armrecoveryservices @@ -58,7 +59,7 @@ func NewClient(subscriptionID string, credential azcore.TokenCredential, options // has the same SubscriptionId, Resource Name and Type or if one or more such resources exist, each of // these must be GC'd and their time of deletion be more than 24 Hours Ago // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 +// Generated from API version 2022-04-01 // resourceGroupName - The name of the resource group where the recovery services vault is present. // location - Location of the resource // input - Contains information about Resource type and Resource name @@ -98,7 +99,7 @@ func (client *Client) checkNameAvailabilityCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, input) diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/zz_generated_constants.go b/sdk/resourcemanager/recoveryservices/armrecoveryservices/constants.go similarity index 85% rename from sdk/resourcemanager/recoveryservices/armrecoveryservices/zz_generated_constants.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservices/constants.go index 5e31123c1547..33ee98a9eeff 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/zz_generated_constants.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservices/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 armrecoveryservices const ( moduleName = "armrecoveryservices" - moduleVersion = "v1.0.0" + moduleVersion = "v1.1.0" ) type AlertsState string @@ -88,6 +89,22 @@ func PossibleCreatedByTypeValues() []CreatedByType { } } +// CrossRegionRestore - Flag to show if Cross Region Restore is enabled on the Vault or not +type CrossRegionRestore string + +const ( + CrossRegionRestoreDisabled CrossRegionRestore = "Disabled" + CrossRegionRestoreEnabled CrossRegionRestore = "Enabled" +) + +// PossibleCrossRegionRestoreValues returns the possible values for the CrossRegionRestore const type. +func PossibleCrossRegionRestoreValues() []CrossRegionRestore { + return []CrossRegionRestore{ + CrossRegionRestoreDisabled, + CrossRegionRestoreEnabled, + } +} + // InfrastructureEncryptionState - Enabling/Disabling the Double Encryption state type InfrastructureEncryptionState string @@ -198,7 +215,9 @@ func PossibleResourceMoveStateValues() []ResourceMoveState { } } -// SKUName - The Sku name. +// SKUName - Name of SKU is RS0 (Recovery Services 0th version) and the tier is standard tier. They do not have affect on +// backend storage redundancy or any other vault settings. To manage storage redundancy, use +// the backupstorageconfig type SKUName string const ( @@ -214,6 +233,24 @@ func PossibleSKUNameValues() []SKUName { } } +// StandardTierStorageRedundancy - The storage redundancy setting of a vault +type StandardTierStorageRedundancy string + +const ( + StandardTierStorageRedundancyGeoRedundant StandardTierStorageRedundancy = "GeoRedundant" + StandardTierStorageRedundancyLocallyRedundant StandardTierStorageRedundancy = "LocallyRedundant" + StandardTierStorageRedundancyZoneRedundant StandardTierStorageRedundancy = "ZoneRedundant" +) + +// PossibleStandardTierStorageRedundancyValues returns the possible values for the StandardTierStorageRedundancy const type. +func PossibleStandardTierStorageRedundancyValues() []StandardTierStorageRedundancy { + return []StandardTierStorageRedundancy{ + StandardTierStorageRedundancyGeoRedundant, + StandardTierStorageRedundancyLocallyRedundant, + StandardTierStorageRedundancyZoneRedundant, + } +} + // TriggerType - The way the vault upgrade was triggered. type TriggerType string diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/go.mod b/sdk/resourcemanager/recoveryservices/armrecoveryservices/go.mod index ba26935d7ed3..99a69ab79f6c 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/go.mod +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservices/go.mod @@ -4,12 +4,12 @@ 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 + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.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/AzureAD/microsoft-authentication-library-for-go v0.5.1 // 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 diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/go.sum b/sdk/resourcemanager/recoveryservices/armrecoveryservices/go.sum index ed5b814680ee..8828b17b1853 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/go.sum +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservices/go.sum @@ -1,11 +1,11 @@ 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/azidentity v1.1.0 h1:QkAcEIAKbNL4KoFr4SathZPhDhF4mVwpBMFlYjyAqy8= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0/go.mod h1:bhXu1AjYL+wutSL/kpSq6s7733q2Rb0yuot9Zgfqa/0= 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/AzureAD/microsoft-authentication-library-for-go v0.5.1 h1:BWe8a+f/t+7KY7zH2mqygeUD0t8hNFXe08p1Pb3/jKE= +github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1/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= diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/zz_generated_models.go b/sdk/resourcemanager/recoveryservices/armrecoveryservices/models.go similarity index 97% rename from sdk/resourcemanager/recoveryservices/armrecoveryservices/zz_generated_models.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservices/models.go index de633052a1a7..6511a16f82be 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/zz_generated_models.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservices/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 armrecoveryservices @@ -495,6 +496,9 @@ type ResourceCertificateAndAADDetails struct { // REQUIRED; AAD service principal ObjectId. ServicePrincipalObjectID *string `json:"servicePrincipalObjectId,omitempty"` + // AAD audience for the resource + AADAudience *string `json:"aadAudience,omitempty"` + // The base64 encoded certificate raw data string. Certificate []byte `json:"certificate,omitempty"` @@ -638,7 +642,9 @@ func (r *ResourceCertificateDetails) GetResourceCertificateDetails() *ResourceCe // SKU - Identifies the unique system identifier for each Azure resource. type SKU struct { - // REQUIRED; The Sku name. + // REQUIRED; Name of SKU is RS0 (Recovery Services 0th version) and the tier is standard tier. They do not have affect on + // backend storage redundancy or any other vault settings. To manage storage redundancy, use + // the backupstorageconfig Name *SKUName `json:"name,omitempty"` // The sku capacity @@ -862,6 +868,9 @@ type VaultProperties struct { // The details of the latest move operation performed on the Azure Resource MoveDetails *VaultPropertiesMoveDetails `json:"moveDetails,omitempty"` + // The redundancy Settings of a Vault + RedundancySettings *VaultPropertiesRedundancySettings `json:"redundancySettings,omitempty"` + // Details for upgrading vault. UpgradeDetails *UpgradeDetails `json:"upgradeDetails,omitempty"` @@ -914,6 +923,15 @@ type VaultPropertiesMoveDetails struct { TargetResourceID *string `json:"targetResourceId,omitempty" azure:"ro"` } +// VaultPropertiesRedundancySettings - The redundancy Settings of a Vault +type VaultPropertiesRedundancySettings struct { + // READ-ONLY; Flag to show if Cross Region Restore is enabled on the Vault or not + CrossRegionRestore *CrossRegionRestore `json:"crossRegionRestore,omitempty" azure:"ro"` + + // READ-ONLY; The storage redundancy setting of a vault + StandardTierStorageRedundancy *StandardTierStorageRedundancy `json:"standardTierStorageRedundancy,omitempty" azure:"ro"` +} + // VaultUsage - Usages of a vault. type VaultUsage struct { // Current value of usage. diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/models_serde.go b/sdk/resourcemanager/recoveryservices/armrecoveryservices/models_serde.go new file mode 100644 index 000000000000..17510126ce84 --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservices/models_serde.go @@ -0,0 +1,2186 @@ +//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 armrecoveryservices + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "reflect" +) + +// MarshalJSON implements the json.Marshaller interface for type AzureMonitorAlertSettings. +func (a AzureMonitorAlertSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "alertsForAllJobFailures", a.AlertsForAllJobFailures) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMonitorAlertSettings. +func (a *AzureMonitorAlertSettings) UnmarshalJSON(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 "alertsForAllJobFailures": + err = unpopulate(val, "AlertsForAllJobFailures", &a.AlertsForAllJobFailures) + 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 CertificateRequest. +func (c CertificateRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", c.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateRequest. +func (c *CertificateRequest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityParameters. +func (c CheckNameAvailabilityParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", c.Name) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CheckNameAvailabilityParameters. +func (c *CheckNameAvailabilityParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityResult. +func (c CheckNameAvailabilityResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "message", c.Message) + populate(objectMap, "nameAvailable", c.NameAvailable) + populate(objectMap, "reason", c.Reason) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CheckNameAvailabilityResult. +func (c *CheckNameAvailabilityResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "message": + err = unpopulate(val, "Message", &c.Message) + delete(rawMsg, key) + case "nameAvailable": + err = unpopulate(val, "NameAvailable", &c.NameAvailable) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &c.Reason) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ClassicAlertSettings. +func (c ClassicAlertSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "alertsForCriticalOperations", c.AlertsForCriticalOperations) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClassicAlertSettings. +func (c *ClassicAlertSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "alertsForCriticalOperations": + err = unpopulate(val, "AlertsForCriticalOperations", &c.AlertsForCriticalOperations) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ClientDiscoveryDisplay. +func (c ClientDiscoveryDisplay) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", c.Description) + populate(objectMap, "operation", c.Operation) + populate(objectMap, "provider", c.Provider) + populate(objectMap, "resource", c.Resource) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClientDiscoveryDisplay. +func (c *ClientDiscoveryDisplay) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &c.Description) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &c.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &c.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &c.Resource) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ClientDiscoveryForLogSpecification. +func (c ClientDiscoveryForLogSpecification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "blobDuration", c.BlobDuration) + populate(objectMap, "displayName", c.DisplayName) + populate(objectMap, "name", c.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClientDiscoveryForLogSpecification. +func (c *ClientDiscoveryForLogSpecification) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "blobDuration": + err = unpopulate(val, "BlobDuration", &c.BlobDuration) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &c.DisplayName) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ClientDiscoveryForProperties. +func (c ClientDiscoveryForProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "serviceSpecification", c.ServiceSpecification) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClientDiscoveryForProperties. +func (c *ClientDiscoveryForProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "serviceSpecification": + err = unpopulate(val, "ServiceSpecification", &c.ServiceSpecification) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ClientDiscoveryForServiceSpecification. +func (c ClientDiscoveryForServiceSpecification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "logSpecifications", c.LogSpecifications) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClientDiscoveryForServiceSpecification. +func (c *ClientDiscoveryForServiceSpecification) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "logSpecifications": + err = unpopulate(val, "LogSpecifications", &c.LogSpecifications) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ClientDiscoveryResponse. +func (c ClientDiscoveryResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClientDiscoveryResponse. +func (c *ClientDiscoveryResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ClientDiscoveryValueForSingleAPI. +func (c ClientDiscoveryValueForSingleAPI) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "display", c.Display) + populate(objectMap, "name", c.Name) + populate(objectMap, "origin", c.Origin) + populate(objectMap, "properties", c.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClientDiscoveryValueForSingleAPI. +func (c *ClientDiscoveryValueForSingleAPI) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "display": + err = unpopulate(val, "Display", &c.Display) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "origin": + err = unpopulate(val, "Origin", &c.Origin) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CloudError. +func (c CloudError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "error", c.Error) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CloudError. +func (c *CloudError) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "error": + err = unpopulate(val, "Error", &c.Error) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CmkKekIdentity. +func (c CmkKekIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "useSystemAssignedIdentity", c.UseSystemAssignedIdentity) + populate(objectMap, "userAssignedIdentity", c.UserAssignedIdentity) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CmkKekIdentity. +func (c *CmkKekIdentity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "useSystemAssignedIdentity": + err = unpopulate(val, "UseSystemAssignedIdentity", &c.UseSystemAssignedIdentity) + delete(rawMsg, key) + case "userAssignedIdentity": + err = unpopulate(val, "UserAssignedIdentity", &c.UserAssignedIdentity) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CmkKeyVaultProperties. +func (c CmkKeyVaultProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "keyUri", c.KeyURI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CmkKeyVaultProperties. +func (c *CmkKeyVaultProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "keyUri": + err = unpopulate(val, "KeyURI", &c.KeyURI) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Error. +func (e Error) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "additionalInfo", e.AdditionalInfo) + populate(objectMap, "code", e.Code) + populate(objectMap, "details", e.Details) + populate(objectMap, "message", e.Message) + populate(objectMap, "target", e.Target) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Error. +func (e *Error) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "additionalInfo": + err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) + delete(rawMsg, key) + case "code": + err = unpopulate(val, "Code", &e.Code) + delete(rawMsg, key) + case "details": + err = unpopulate(val, "Details", &e.Details) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &e.Message) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &e.Target) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo. +func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "info", &e.Info) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo. +func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "info": + err = unpopulate(val, "Info", &e.Info) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IdentityData. +func (i IdentityData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "principalId", i.PrincipalID) + populate(objectMap, "tenantId", i.TenantID) + populate(objectMap, "type", i.Type) + populate(objectMap, "userAssignedIdentities", i.UserAssignedIdentities) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IdentityData. +func (i *IdentityData) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "principalId": + err = unpopulate(val, "PrincipalID", &i.PrincipalID) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &i.TenantID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + delete(rawMsg, key) + case "userAssignedIdentities": + err = unpopulate(val, "UserAssignedIdentities", &i.UserAssignedIdentities) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobsSummary. +func (j JobsSummary) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "failedJobs", j.FailedJobs) + populate(objectMap, "inProgressJobs", j.InProgressJobs) + populate(objectMap, "suspendedJobs", j.SuspendedJobs) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobsSummary. +func (j *JobsSummary) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "failedJobs": + err = unpopulate(val, "FailedJobs", &j.FailedJobs) + delete(rawMsg, key) + case "inProgressJobs": + err = unpopulate(val, "InProgressJobs", &j.InProgressJobs) + delete(rawMsg, key) + case "suspendedJobs": + err = unpopulate(val, "SuspendedJobs", &j.SuspendedJobs) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MonitoringSettings. +func (m MonitoringSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "azureMonitorAlertSettings", m.AzureMonitorAlertSettings) + populate(objectMap, "classicAlertSettings", m.ClassicAlertSettings) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MonitoringSettings. +func (m *MonitoringSettings) UnmarshalJSON(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 "azureMonitorAlertSettings": + err = unpopulate(val, "AzureMonitorAlertSettings", &m.AzureMonitorAlertSettings) + delete(rawMsg, key) + case "classicAlertSettings": + err = unpopulate(val, "ClassicAlertSettings", &m.ClassicAlertSettings) + 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 MonitoringSummary. +func (m MonitoringSummary) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "deprecatedProviderCount", m.DeprecatedProviderCount) + populate(objectMap, "eventsCount", m.EventsCount) + populate(objectMap, "supportedProviderCount", m.SupportedProviderCount) + populate(objectMap, "unHealthyProviderCount", m.UnHealthyProviderCount) + populate(objectMap, "unHealthyVmCount", m.UnHealthyVMCount) + populate(objectMap, "unsupportedProviderCount", m.UnsupportedProviderCount) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MonitoringSummary. +func (m *MonitoringSummary) UnmarshalJSON(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 "deprecatedProviderCount": + err = unpopulate(val, "DeprecatedProviderCount", &m.DeprecatedProviderCount) + delete(rawMsg, key) + case "eventsCount": + err = unpopulate(val, "EventsCount", &m.EventsCount) + delete(rawMsg, key) + case "supportedProviderCount": + err = unpopulate(val, "SupportedProviderCount", &m.SupportedProviderCount) + delete(rawMsg, key) + case "unHealthyProviderCount": + err = unpopulate(val, "UnHealthyProviderCount", &m.UnHealthyProviderCount) + delete(rawMsg, key) + case "unHealthyVmCount": + err = unpopulate(val, "UnHealthyVMCount", &m.UnHealthyVMCount) + delete(rawMsg, key) + case "unsupportedProviderCount": + err = unpopulate(val, "UnsupportedProviderCount", &m.UnsupportedProviderCount) + 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 NameInfo. +func (n NameInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "localizedValue", n.LocalizedValue) + populate(objectMap, "value", n.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NameInfo. +func (n *NameInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "localizedValue": + err = unpopulate(val, "LocalizedValue", &n.LocalizedValue) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &n.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationResource. +func (o OperationResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "endTime", o.EndTime) + populate(objectMap, "error", o.Error) + populate(objectMap, "id", o.ID) + populate(objectMap, "name", o.Name) + populateTimeRFC3339(objectMap, "startTime", o.StartTime) + populate(objectMap, "status", o.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationResource. +func (o *OperationResource) UnmarshalJSON(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 "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &o.EndTime) + delete(rawMsg, key) + case "error": + err = unpopulate(val, "Error", &o.Error) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &o.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &o.StartTime) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &o.Status) + 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 PatchTrackedResource. +func (p PatchTrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", p.Etag) + populate(objectMap, "id", p.ID) + populate(objectMap, "location", p.Location) + populate(objectMap, "name", p.Name) + populate(objectMap, "tags", p.Tags) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PatchTrackedResource. +func (p *PatchTrackedResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &p.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &p.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &p.Tags) + 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 PatchVault. +func (p PatchVault) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", p.Etag) + populate(objectMap, "id", p.ID) + populate(objectMap, "identity", p.Identity) + populate(objectMap, "location", p.Location) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "sku", p.SKU) + populate(objectMap, "tags", p.Tags) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PatchVault. +func (p *PatchVault) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &p.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &p.Identity) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &p.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &p.SKU) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &p.Tags) + 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 PrivateEndpoint. +func (p PrivateEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpoint. +func (p *PrivateEndpoint) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection. +func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "privateEndpoint", p.PrivateEndpoint) + populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) + populate(objectMap, "provisioningState", p.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnection. +func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "privateEndpoint": + err = unpopulate(val, "PrivateEndpoint", &p.PrivateEndpoint) + delete(rawMsg, key) + case "privateLinkServiceConnectionState": + err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionVaultProperties. +func (p PrivateEndpointConnectionVaultProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + populate(objectMap, "location", p.Location) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionVaultProperties. +func (p *PrivateEndpointConnectionVaultProperties) UnmarshalJSON(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 "location": + err = unpopulate(val, "Location", &p.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource. +func (p PrivateLinkResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResource. +func (p *PrivateLinkResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties. +func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "groupId", p.GroupID) + populate(objectMap, "requiredMembers", p.RequiredMembers) + populate(objectMap, "requiredZoneNames", p.RequiredZoneNames) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceProperties. +func (p *PrivateLinkResourceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "groupId": + err = unpopulate(val, "GroupID", &p.GroupID) + delete(rawMsg, key) + case "requiredMembers": + err = unpopulate(val, "RequiredMembers", &p.RequiredMembers) + delete(rawMsg, key) + case "requiredZoneNames": + err = unpopulate(val, "RequiredZoneNames", &p.RequiredZoneNames) + 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 PrivateLinkResources. +func (p PrivateLinkResources) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResources. +func (p *PrivateLinkResources) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &p.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionState. +func (p PrivateLinkServiceConnectionState) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "actionsRequired", p.ActionsRequired) + populate(objectMap, "description", p.Description) + populate(objectMap, "status", p.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceConnectionState. +func (p *PrivateLinkServiceConnectionState) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "actionsRequired": + err = unpopulate(val, "ActionsRequired", &p.ActionsRequired) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &p.Description) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &p.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RawCertificateData. +func (r RawCertificateData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "authType", r.AuthType) + populateByteArray(objectMap, "certificate", r.Certificate, runtime.Base64StdFormat) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RawCertificateData. +func (r *RawCertificateData) UnmarshalJSON(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 "authType": + err = unpopulate(val, "AuthType", &r.AuthType) + delete(rawMsg, key) + case "certificate": + err = runtime.DecodeByteArray(string(val), &r.Certificate, runtime.Base64StdFormat) + 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 ReplicationUsage. +func (r ReplicationUsage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "jobsSummary", r.JobsSummary) + populate(objectMap, "monitoringSummary", r.MonitoringSummary) + populate(objectMap, "protectedItemCount", r.ProtectedItemCount) + populate(objectMap, "recoveryPlanCount", r.RecoveryPlanCount) + populate(objectMap, "recoveryServicesProviderAuthType", r.RecoveryServicesProviderAuthType) + populate(objectMap, "registeredServersCount", r.RegisteredServersCount) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicationUsage. +func (r *ReplicationUsage) UnmarshalJSON(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 "jobsSummary": + err = unpopulate(val, "JobsSummary", &r.JobsSummary) + delete(rawMsg, key) + case "monitoringSummary": + err = unpopulate(val, "MonitoringSummary", &r.MonitoringSummary) + delete(rawMsg, key) + case "protectedItemCount": + err = unpopulate(val, "ProtectedItemCount", &r.ProtectedItemCount) + delete(rawMsg, key) + case "recoveryPlanCount": + err = unpopulate(val, "RecoveryPlanCount", &r.RecoveryPlanCount) + delete(rawMsg, key) + case "recoveryServicesProviderAuthType": + err = unpopulate(val, "RecoveryServicesProviderAuthType", &r.RecoveryServicesProviderAuthType) + delete(rawMsg, key) + case "registeredServersCount": + err = unpopulate(val, "RegisteredServersCount", &r.RegisteredServersCount) + 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 ReplicationUsageList. +func (r ReplicationUsageList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicationUsageList. +func (r *ReplicationUsageList) UnmarshalJSON(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 "value": + err = unpopulate(val, "Value", &r.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", r.Etag) + 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 "etag": + err = unpopulate(val, "Etag", &r.Etag) + delete(rawMsg, 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 ResourceCertificateAndAADDetails. +func (r ResourceCertificateAndAADDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "aadAudience", r.AADAudience) + populate(objectMap, "aadAuthority", r.AADAuthority) + populate(objectMap, "aadTenantId", r.AADTenantID) + objectMap["authType"] = "AzureActiveDirectory" + populate(objectMap, "azureManagementEndpointAudience", r.AzureManagementEndpointAudience) + populateByteArray(objectMap, "certificate", r.Certificate, runtime.Base64StdFormat) + populate(objectMap, "friendlyName", r.FriendlyName) + populate(objectMap, "issuer", r.Issuer) + populate(objectMap, "resourceId", r.ResourceID) + populate(objectMap, "servicePrincipalClientId", r.ServicePrincipalClientID) + populate(objectMap, "servicePrincipalObjectId", r.ServicePrincipalObjectID) + populate(objectMap, "serviceResourceId", r.ServiceResourceID) + populate(objectMap, "subject", r.Subject) + populate(objectMap, "thumbprint", r.Thumbprint) + populateTimeRFC3339(objectMap, "validFrom", r.ValidFrom) + populateTimeRFC3339(objectMap, "validTo", r.ValidTo) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceCertificateAndAADDetails. +func (r *ResourceCertificateAndAADDetails) UnmarshalJSON(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 "aadAudience": + err = unpopulate(val, "AADAudience", &r.AADAudience) + delete(rawMsg, key) + case "aadAuthority": + err = unpopulate(val, "AADAuthority", &r.AADAuthority) + delete(rawMsg, key) + case "aadTenantId": + err = unpopulate(val, "AADTenantID", &r.AADTenantID) + delete(rawMsg, key) + case "authType": + err = unpopulate(val, "AuthType", &r.AuthType) + delete(rawMsg, key) + case "azureManagementEndpointAudience": + err = unpopulate(val, "AzureManagementEndpointAudience", &r.AzureManagementEndpointAudience) + delete(rawMsg, key) + case "certificate": + err = runtime.DecodeByteArray(string(val), &r.Certificate, runtime.Base64StdFormat) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &r.FriendlyName) + delete(rawMsg, key) + case "issuer": + err = unpopulate(val, "Issuer", &r.Issuer) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &r.ResourceID) + delete(rawMsg, key) + case "servicePrincipalClientId": + err = unpopulate(val, "ServicePrincipalClientID", &r.ServicePrincipalClientID) + delete(rawMsg, key) + case "servicePrincipalObjectId": + err = unpopulate(val, "ServicePrincipalObjectID", &r.ServicePrincipalObjectID) + delete(rawMsg, key) + case "serviceResourceId": + err = unpopulate(val, "ServiceResourceID", &r.ServiceResourceID) + delete(rawMsg, key) + case "subject": + err = unpopulate(val, "Subject", &r.Subject) + delete(rawMsg, key) + case "thumbprint": + err = unpopulate(val, "Thumbprint", &r.Thumbprint) + delete(rawMsg, key) + case "validFrom": + err = unpopulateTimeRFC3339(val, "ValidFrom", &r.ValidFrom) + delete(rawMsg, key) + case "validTo": + err = unpopulateTimeRFC3339(val, "ValidTo", &r.ValidTo) + 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 ResourceCertificateAndAcsDetails. +func (r ResourceCertificateAndAcsDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["authType"] = "AccessControlService" + populateByteArray(objectMap, "certificate", r.Certificate, runtime.Base64StdFormat) + populate(objectMap, "friendlyName", r.FriendlyName) + populate(objectMap, "globalAcsHostName", r.GlobalAcsHostName) + populate(objectMap, "globalAcsNamespace", r.GlobalAcsNamespace) + populate(objectMap, "globalAcsRPRealm", r.GlobalAcsRPRealm) + populate(objectMap, "issuer", r.Issuer) + populate(objectMap, "resourceId", r.ResourceID) + populate(objectMap, "subject", r.Subject) + populate(objectMap, "thumbprint", r.Thumbprint) + populateTimeRFC3339(objectMap, "validFrom", r.ValidFrom) + populateTimeRFC3339(objectMap, "validTo", r.ValidTo) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceCertificateAndAcsDetails. +func (r *ResourceCertificateAndAcsDetails) UnmarshalJSON(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 "authType": + err = unpopulate(val, "AuthType", &r.AuthType) + delete(rawMsg, key) + case "certificate": + err = runtime.DecodeByteArray(string(val), &r.Certificate, runtime.Base64StdFormat) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &r.FriendlyName) + delete(rawMsg, key) + case "globalAcsHostName": + err = unpopulate(val, "GlobalAcsHostName", &r.GlobalAcsHostName) + delete(rawMsg, key) + case "globalAcsNamespace": + err = unpopulate(val, "GlobalAcsNamespace", &r.GlobalAcsNamespace) + delete(rawMsg, key) + case "globalAcsRPRealm": + err = unpopulate(val, "GlobalAcsRPRealm", &r.GlobalAcsRPRealm) + delete(rawMsg, key) + case "issuer": + err = unpopulate(val, "Issuer", &r.Issuer) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &r.ResourceID) + delete(rawMsg, key) + case "subject": + err = unpopulate(val, "Subject", &r.Subject) + delete(rawMsg, key) + case "thumbprint": + err = unpopulate(val, "Thumbprint", &r.Thumbprint) + delete(rawMsg, key) + case "validFrom": + err = unpopulateTimeRFC3339(val, "ValidFrom", &r.ValidFrom) + delete(rawMsg, key) + case "validTo": + err = unpopulateTimeRFC3339(val, "ValidTo", &r.ValidTo) + 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 ResourceCertificateDetails. +func (r ResourceCertificateDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["authType"] = r.AuthType + populateByteArray(objectMap, "certificate", r.Certificate, runtime.Base64StdFormat) + populate(objectMap, "friendlyName", r.FriendlyName) + populate(objectMap, "issuer", r.Issuer) + populate(objectMap, "resourceId", r.ResourceID) + populate(objectMap, "subject", r.Subject) + populate(objectMap, "thumbprint", r.Thumbprint) + populateTimeRFC3339(objectMap, "validFrom", r.ValidFrom) + populateTimeRFC3339(objectMap, "validTo", r.ValidTo) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceCertificateDetails. +func (r *ResourceCertificateDetails) UnmarshalJSON(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 "authType": + err = unpopulate(val, "AuthType", &r.AuthType) + delete(rawMsg, key) + case "certificate": + err = runtime.DecodeByteArray(string(val), &r.Certificate, runtime.Base64StdFormat) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &r.FriendlyName) + delete(rawMsg, key) + case "issuer": + err = unpopulate(val, "Issuer", &r.Issuer) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &r.ResourceID) + delete(rawMsg, key) + case "subject": + err = unpopulate(val, "Subject", &r.Subject) + delete(rawMsg, key) + case "thumbprint": + err = unpopulate(val, "Thumbprint", &r.Thumbprint) + delete(rawMsg, key) + case "validFrom": + err = unpopulateTimeRFC3339(val, "ValidFrom", &r.ValidFrom) + delete(rawMsg, key) + case "validTo": + err = unpopulateTimeRFC3339(val, "ValidTo", &r.ValidTo) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SKU. +func (s SKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "capacity", s.Capacity) + populate(objectMap, "family", s.Family) + populate(objectMap, "name", s.Name) + populate(objectMap, "size", s.Size) + populate(objectMap, "tier", s.Tier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SKU. +func (s *SKU) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "capacity": + err = unpopulate(val, "Capacity", &s.Capacity) + delete(rawMsg, key) + case "family": + err = unpopulate(val, "Family", &s.Family) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "size": + err = unpopulate(val, "Size", &s.Size) + delete(rawMsg, key) + case "tier": + err = unpopulate(val, "Tier", &s.Tier) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type 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, "etag", t.Etag) + 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 "etag": + err = unpopulate(val, "Etag", &t.Etag) + delete(rawMsg, 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 UpgradeDetails. +func (u UpgradeDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "endTimeUtc", u.EndTimeUTC) + populateTimeRFC3339(objectMap, "lastUpdatedTimeUtc", u.LastUpdatedTimeUTC) + populate(objectMap, "message", u.Message) + populate(objectMap, "operationId", u.OperationID) + populate(objectMap, "previousResourceId", u.PreviousResourceID) + populateTimeRFC3339(objectMap, "startTimeUtc", u.StartTimeUTC) + populate(objectMap, "status", u.Status) + populate(objectMap, "triggerType", u.TriggerType) + populate(objectMap, "upgradedResourceId", u.UpgradedResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UpgradeDetails. +func (u *UpgradeDetails) UnmarshalJSON(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 "endTimeUtc": + err = unpopulateTimeRFC3339(val, "EndTimeUTC", &u.EndTimeUTC) + delete(rawMsg, key) + case "lastUpdatedTimeUtc": + err = unpopulateTimeRFC3339(val, "LastUpdatedTimeUTC", &u.LastUpdatedTimeUTC) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &u.Message) + delete(rawMsg, key) + case "operationId": + err = unpopulate(val, "OperationID", &u.OperationID) + delete(rawMsg, key) + case "previousResourceId": + err = unpopulate(val, "PreviousResourceID", &u.PreviousResourceID) + delete(rawMsg, key) + case "startTimeUtc": + err = unpopulateTimeRFC3339(val, "StartTimeUTC", &u.StartTimeUTC) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &u.Status) + delete(rawMsg, key) + case "triggerType": + err = unpopulate(val, "TriggerType", &u.TriggerType) + delete(rawMsg, key) + case "upgradedResourceId": + err = unpopulate(val, "UpgradedResourceID", &u.UpgradedResourceID) + 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 UserIdentity. +func (u UserIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "clientId", u.ClientID) + populate(objectMap, "principalId", u.PrincipalID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserIdentity. +func (u *UserIdentity) UnmarshalJSON(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 "clientId": + err = unpopulate(val, "ClientID", &u.ClientID) + delete(rawMsg, key) + case "principalId": + err = unpopulate(val, "PrincipalID", &u.PrincipalID) + 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 Vault. +func (v Vault) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", v.Etag) + populate(objectMap, "id", v.ID) + populate(objectMap, "identity", v.Identity) + populate(objectMap, "location", v.Location) + populate(objectMap, "name", v.Name) + populate(objectMap, "properties", v.Properties) + populate(objectMap, "sku", v.SKU) + populate(objectMap, "systemData", v.SystemData) + populate(objectMap, "tags", v.Tags) + populate(objectMap, "type", v.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Vault. +func (v *Vault) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &v.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &v.Identity) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &v.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &v.SKU) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &v.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &v.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &v.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VaultCertificateResponse. +func (v VaultCertificateResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", v.ID) + populate(objectMap, "name", v.Name) + populate(objectMap, "properties", v.Properties) + populate(objectMap, "type", v.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VaultCertificateResponse. +func (v *VaultCertificateResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "properties": + v.Properties, err = unmarshalResourceCertificateDetailsClassification(val) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &v.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VaultExtendedInfo. +func (v VaultExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "algorithm", v.Algorithm) + populate(objectMap, "encryptionKey", v.EncryptionKey) + populate(objectMap, "encryptionKeyThumbprint", v.EncryptionKeyThumbprint) + populate(objectMap, "integrityKey", v.IntegrityKey) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VaultExtendedInfo. +func (v *VaultExtendedInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "algorithm": + err = unpopulate(val, "Algorithm", &v.Algorithm) + delete(rawMsg, key) + case "encryptionKey": + err = unpopulate(val, "EncryptionKey", &v.EncryptionKey) + delete(rawMsg, key) + case "encryptionKeyThumbprint": + err = unpopulate(val, "EncryptionKeyThumbprint", &v.EncryptionKeyThumbprint) + delete(rawMsg, key) + case "integrityKey": + err = unpopulate(val, "IntegrityKey", &v.IntegrityKey) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VaultExtendedInfoResource. +func (v VaultExtendedInfoResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", v.Etag) + populate(objectMap, "id", v.ID) + populate(objectMap, "name", v.Name) + populate(objectMap, "properties", v.Properties) + populate(objectMap, "type", v.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VaultExtendedInfoResource. +func (v *VaultExtendedInfoResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &v.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &v.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VaultList. +func (v VaultList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", v.NextLink) + populate(objectMap, "value", v.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VaultList. +func (v *VaultList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &v.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &v.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VaultProperties. +func (v VaultProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "backupStorageVersion", v.BackupStorageVersion) + populate(objectMap, "encryption", v.Encryption) + populate(objectMap, "monitoringSettings", v.MonitoringSettings) + populate(objectMap, "moveDetails", v.MoveDetails) + populate(objectMap, "moveState", v.MoveState) + populate(objectMap, "privateEndpointConnections", v.PrivateEndpointConnections) + populate(objectMap, "privateEndpointStateForBackup", v.PrivateEndpointStateForBackup) + populate(objectMap, "privateEndpointStateForSiteRecovery", v.PrivateEndpointStateForSiteRecovery) + populate(objectMap, "provisioningState", v.ProvisioningState) + populate(objectMap, "redundancySettings", v.RedundancySettings) + populate(objectMap, "upgradeDetails", v.UpgradeDetails) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VaultProperties. +func (v *VaultProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "backupStorageVersion": + err = unpopulate(val, "BackupStorageVersion", &v.BackupStorageVersion) + delete(rawMsg, key) + case "encryption": + err = unpopulate(val, "Encryption", &v.Encryption) + delete(rawMsg, key) + case "monitoringSettings": + err = unpopulate(val, "MonitoringSettings", &v.MonitoringSettings) + delete(rawMsg, key) + case "moveDetails": + err = unpopulate(val, "MoveDetails", &v.MoveDetails) + delete(rawMsg, key) + case "moveState": + err = unpopulate(val, "MoveState", &v.MoveState) + delete(rawMsg, key) + case "privateEndpointConnections": + err = unpopulate(val, "PrivateEndpointConnections", &v.PrivateEndpointConnections) + delete(rawMsg, key) + case "privateEndpointStateForBackup": + err = unpopulate(val, "PrivateEndpointStateForBackup", &v.PrivateEndpointStateForBackup) + delete(rawMsg, key) + case "privateEndpointStateForSiteRecovery": + err = unpopulate(val, "PrivateEndpointStateForSiteRecovery", &v.PrivateEndpointStateForSiteRecovery) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) + delete(rawMsg, key) + case "redundancySettings": + err = unpopulate(val, "RedundancySettings", &v.RedundancySettings) + delete(rawMsg, key) + case "upgradeDetails": + err = unpopulate(val, "UpgradeDetails", &v.UpgradeDetails) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VaultPropertiesEncryption. +func (v VaultPropertiesEncryption) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "infrastructureEncryption", v.InfrastructureEncryption) + populate(objectMap, "kekIdentity", v.KekIdentity) + populate(objectMap, "keyVaultProperties", v.KeyVaultProperties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VaultPropertiesEncryption. +func (v *VaultPropertiesEncryption) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "infrastructureEncryption": + err = unpopulate(val, "InfrastructureEncryption", &v.InfrastructureEncryption) + delete(rawMsg, key) + case "kekIdentity": + err = unpopulate(val, "KekIdentity", &v.KekIdentity) + delete(rawMsg, key) + case "keyVaultProperties": + err = unpopulate(val, "KeyVaultProperties", &v.KeyVaultProperties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VaultPropertiesMoveDetails. +func (v VaultPropertiesMoveDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "completionTimeUtc", v.CompletionTimeUTC) + populate(objectMap, "operationId", v.OperationID) + populate(objectMap, "sourceResourceId", v.SourceResourceID) + populateTimeRFC3339(objectMap, "startTimeUtc", v.StartTimeUTC) + populate(objectMap, "targetResourceId", v.TargetResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VaultPropertiesMoveDetails. +func (v *VaultPropertiesMoveDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "completionTimeUtc": + err = unpopulateTimeRFC3339(val, "CompletionTimeUTC", &v.CompletionTimeUTC) + delete(rawMsg, key) + case "operationId": + err = unpopulate(val, "OperationID", &v.OperationID) + delete(rawMsg, key) + case "sourceResourceId": + err = unpopulate(val, "SourceResourceID", &v.SourceResourceID) + delete(rawMsg, key) + case "startTimeUtc": + err = unpopulateTimeRFC3339(val, "StartTimeUTC", &v.StartTimeUTC) + delete(rawMsg, key) + case "targetResourceId": + err = unpopulate(val, "TargetResourceID", &v.TargetResourceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VaultPropertiesRedundancySettings. +func (v VaultPropertiesRedundancySettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "crossRegionRestore", v.CrossRegionRestore) + populate(objectMap, "standardTierStorageRedundancy", v.StandardTierStorageRedundancy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VaultPropertiesRedundancySettings. +func (v *VaultPropertiesRedundancySettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "crossRegionRestore": + err = unpopulate(val, "CrossRegionRestore", &v.CrossRegionRestore) + delete(rawMsg, key) + case "standardTierStorageRedundancy": + err = unpopulate(val, "StandardTierStorageRedundancy", &v.StandardTierStorageRedundancy) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VaultUsage. +func (v VaultUsage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "currentValue", v.CurrentValue) + populate(objectMap, "limit", v.Limit) + populate(objectMap, "name", v.Name) + populateTimeRFC3339(objectMap, "nextResetTime", v.NextResetTime) + populate(objectMap, "quotaPeriod", v.QuotaPeriod) + populate(objectMap, "unit", v.Unit) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VaultUsage. +func (v *VaultUsage) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "currentValue": + err = unpopulate(val, "CurrentValue", &v.CurrentValue) + delete(rawMsg, key) + case "limit": + err = unpopulate(val, "Limit", &v.Limit) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "nextResetTime": + err = unpopulateTimeRFC3339(val, "NextResetTime", &v.NextResetTime) + delete(rawMsg, key) + case "quotaPeriod": + err = unpopulate(val, "QuotaPeriod", &v.QuotaPeriod) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &v.Unit) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VaultUsageList. +func (v VaultUsageList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", v.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VaultUsageList. +func (v *VaultUsageList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &v.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, 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 populateByteArray(m map[string]interface{}, k string, b []byte, f runtime.Base64Encoding) { + if azcore.IsNullValue(b) { + m[k] = nil + } else if len(b) == 0 { + return + } else { + m[k] = runtime.EncodeByteArray(b, f) + } +} + +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/recoveryservices/armrecoveryservices/zz_generated_operations_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservices/operations_client.go similarity index 97% rename from sdk/resourcemanager/recoveryservices/armrecoveryservices/zz_generated_operations_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservices/operations_client.go index a654eecb7890..d2a98dbddf2d 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/zz_generated_operations_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservices/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 armrecoveryservices @@ -56,7 +57,7 @@ func NewOperationsClient(subscriptionID string, credential azcore.TokenCredentia // GetOperationResult - Gets the operation result for a resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 +// Generated from API version 2022-04-01 // resourceGroupName - The name of the resource group where the recovery services vault is present. // vaultName - The name of the recovery services vault. // options - OperationsClientGetOperationResultOptions contains the optional parameters for the OperationsClient.GetOperationResult @@ -100,7 +101,7 @@ func (client *OperationsClient) getOperationResultCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -117,7 +118,7 @@ func (client *OperationsClient) getOperationResultHandleResponse(resp *http.Resp // NewListPager - Returns the list of available operations. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 +// Generated from API version 2022-04-01 // options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -155,7 +156,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -172,7 +173,7 @@ func (client *OperationsClient) listHandleResponse(resp *http.Response) (Operati // OperationStatusGet - Gets the operation status for a resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 +// Generated from API version 2022-04-01 // resourceGroupName - The name of the resource group where the recovery services vault is present. // vaultName - The name of the recovery services vault. // options - OperationsClientOperationStatusGetOptions contains the optional parameters for the OperationsClient.OperationStatusGet @@ -216,7 +217,7 @@ func (client *OperationsClient) operationStatusGetCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservices/operations_client_example_test.go similarity index 94% rename from sdk/resourcemanager/recoveryservices/armrecoveryservices/ze_generated_example_operations_client_test.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservices/operations_client_example_test.go index b548a44f180a..fa76294c0ea0 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/ze_generated_example_operations_client_test.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservices/operations_client_example_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservices" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-03-01/examples/ListOperations.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-04-01/examples/ListOperations.json func ExampleOperationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -40,7 +40,7 @@ func ExampleOperationsClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-03-01/examples/GetOperationStatus.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-04-01/examples/GetOperationStatus.json func ExampleOperationsClient_OperationStatusGet() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -63,7 +63,7 @@ func ExampleOperationsClient_OperationStatusGet() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-03-01/examples/GetOperationResult.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-04-01/examples/GetOperationResult.json func ExampleOperationsClient_GetOperationResult() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/zz_generated_polymorphic_helpers.go b/sdk/resourcemanager/recoveryservices/armrecoveryservices/polymorphic_helpers.go similarity index 98% rename from sdk/resourcemanager/recoveryservices/armrecoveryservices/zz_generated_polymorphic_helpers.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservices/polymorphic_helpers.go index 1f03bb87146f..277349592490 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/zz_generated_polymorphic_helpers.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservices/polymorphic_helpers.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armrecoveryservices diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/zz_generated_privatelinkresources_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservices/privatelinkresources_client.go similarity index 97% rename from sdk/resourcemanager/recoveryservices/armrecoveryservices/zz_generated_privatelinkresources_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservices/privatelinkresources_client.go index 68613e9e3413..7d5902776bef 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/zz_generated_privatelinkresources_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservices/privatelinkresources_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armrecoveryservices @@ -56,7 +57,7 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke // Get - Returns a specified private link resource that need to be created for Backup and SiteRecovery // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 +// Generated from API version 2022-04-01 // resourceGroupName - The name of the resource group where the recovery services vault is present. // vaultName - The name of the recovery services vault. // options - PrivateLinkResourcesClientGetOptions contains the optional parameters for the PrivateLinkResourcesClient.Get @@ -100,7 +101,7 @@ func (client *PrivateLinkResourcesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -117,7 +118,7 @@ func (client *PrivateLinkResourcesClient) getHandleResponse(resp *http.Response) // NewListPager - Returns the list of private link resources that need to be created for Backup and SiteRecovery // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 +// Generated from API version 2022-04-01 // resourceGroupName - The name of the resource group where the recovery services vault is present. // vaultName - The name of the recovery services vault. // options - PrivateLinkResourcesClientListOptions contains the optional parameters for the PrivateLinkResourcesClient.List @@ -170,7 +171,7 @@ func (client *PrivateLinkResourcesClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/ze_generated_example_privatelinkresources_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservices/privatelinkresources_client_example_test.go similarity index 94% rename from sdk/resourcemanager/recoveryservices/armrecoveryservices/ze_generated_example_privatelinkresources_client_test.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservices/privatelinkresources_client_example_test.go index 461de54511d6..c6058ac09faa 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/ze_generated_example_privatelinkresources_client_test.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservices/privatelinkresources_client_example_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservices" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-03-01/examples/ListPrivateLinkResources.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-04-01/examples/ListPrivateLinkResources.json func ExamplePrivateLinkResourcesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -42,7 +42,7 @@ func ExamplePrivateLinkResourcesClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-03-01/examples/GetPrivateLinkResources.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-04-01/examples/GetPrivateLinkResources.json func ExamplePrivateLinkResourcesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/ze_generated_example_recoveryservices_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservices/recoveryservices_client_example_test.go similarity index 95% rename from sdk/resourcemanager/recoveryservices/armrecoveryservices/ze_generated_example_recoveryservices_client_test.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservices/recoveryservices_client_example_test.go index eb50746c4d42..0e511ad7b14e 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/ze_generated_example_recoveryservices_client_test.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservices/recoveryservices_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservices" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-03-01/examples/CheckNameAvailability_Available.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-04-01/examples/CheckNameAvailability_Available.json func ExampleClient_CheckNameAvailability() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/zz_generated_registeredidentities_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservices/registeredidentities_client.go similarity index 97% rename from sdk/resourcemanager/recoveryservices/armrecoveryservices/zz_generated_registeredidentities_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservices/registeredidentities_client.go index 23335674c7f1..a16a0adb1225 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/zz_generated_registeredidentities_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservices/registeredidentities_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 armrecoveryservices @@ -56,7 +57,7 @@ func NewRegisteredIdentitiesClient(subscriptionID string, credential azcore.Toke // Delete - Unregisters the given container from your Recovery Services vault. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 +// Generated from API version 2022-04-01 // resourceGroupName - The name of the resource group where the recovery services vault is present. // vaultName - The name of the recovery services vault. // identityName - Name of the protection container to unregister. @@ -101,7 +102,7 @@ func (client *RegisteredIdentitiesClient) deleteCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-04-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/ze_generated_example_registeredidentities_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservices/registeredidentities_client_example_test.go similarity index 95% rename from sdk/resourcemanager/recoveryservices/armrecoveryservices/ze_generated_example_registeredidentities_client_test.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservices/registeredidentities_client_example_test.go index eea97de665d8..64f3865125f9 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/ze_generated_example_registeredidentities_client_test.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservices/registeredidentities_client_example_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservices" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-03-01/examples/DeleteRegisteredIdentities.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-04-01/examples/DeleteRegisteredIdentities.json func ExampleRegisteredIdentitiesClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/zz_generated_replicationusages_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservices/replicationusages_client.go similarity index 98% rename from sdk/resourcemanager/recoveryservices/armrecoveryservices/zz_generated_replicationusages_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservices/replicationusages_client.go index 74c851077635..3b038b78524c 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/zz_generated_replicationusages_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservices/replicationusages_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 armrecoveryservices @@ -56,7 +57,7 @@ func NewReplicationUsagesClient(subscriptionID string, credential azcore.TokenCr // NewListPager - Fetches the replication usages of the vault. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 +// Generated from API version 2022-04-01 // resourceGroupName - The name of the resource group where the recovery services vault is present. // vaultName - The name of the recovery services vault. // options - ReplicationUsagesClientListOptions contains the optional parameters for the ReplicationUsagesClient.List method. @@ -102,7 +103,7 @@ func (client *ReplicationUsagesClient) listCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/ze_generated_example_replicationusages_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservices/replicationusages_client_example_test.go similarity index 95% rename from sdk/resourcemanager/recoveryservices/armrecoveryservices/ze_generated_example_replicationusages_client_test.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservices/replicationusages_client_example_test.go index f0ad4deabc3f..683af3323bb0 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/ze_generated_example_replicationusages_client_test.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservices/replicationusages_client_example_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservices" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-03-01/examples/ListReplicationUsages.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-04-01/examples/ListReplicationUsages.json func ExampleReplicationUsagesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/zz_generated_response_types.go b/sdk/resourcemanager/recoveryservices/armrecoveryservices/response_types.go similarity index 99% rename from sdk/resourcemanager/recoveryservices/armrecoveryservices/zz_generated_response_types.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservices/response_types.go index fc56935a060d..c782d98d6330 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/zz_generated_response_types.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservices/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 armrecoveryservices diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/zz_generated_time_rfc3339.go b/sdk/resourcemanager/recoveryservices/armrecoveryservices/time_rfc3339.go similarity index 99% rename from sdk/resourcemanager/recoveryservices/armrecoveryservices/zz_generated_time_rfc3339.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservices/time_rfc3339.go index 8dcfbf5d65b7..9fa74ddca7ae 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservices/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 armrecoveryservices diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/zz_generated_usages_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservices/usages_client.go similarity index 98% rename from sdk/resourcemanager/recoveryservices/armrecoveryservices/zz_generated_usages_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservices/usages_client.go index 46fc5163e652..b235f0132500 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/zz_generated_usages_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservices/usages_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 armrecoveryservices @@ -56,7 +57,7 @@ func NewUsagesClient(subscriptionID string, credential azcore.TokenCredential, o // NewListByVaultsPager - Fetches the usages of the vault. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 +// Generated from API version 2022-04-01 // resourceGroupName - The name of the resource group where the recovery services vault is present. // vaultName - The name of the recovery services vault. // options - UsagesClientListByVaultsOptions contains the optional parameters for the UsagesClient.ListByVaults method. @@ -102,7 +103,7 @@ func (client *UsagesClient) listByVaultsCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/ze_generated_example_usages_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservices/usages_client_example_test.go similarity index 95% rename from sdk/resourcemanager/recoveryservices/armrecoveryservices/ze_generated_example_usages_client_test.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservices/usages_client_example_test.go index 01822f8d4446..ed094c74971a 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/ze_generated_example_usages_client_test.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservices/usages_client_example_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservices" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-03-01/examples/ListUsages.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-04-01/examples/ListUsages.json func ExampleUsagesClient_NewListByVaultsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/zz_generated_vaultcertificates_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservices/vaultcertificates_client.go similarity index 98% rename from sdk/resourcemanager/recoveryservices/armrecoveryservices/zz_generated_vaultcertificates_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservices/vaultcertificates_client.go index 0bbfc3e9fee7..fa28d638a327 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/zz_generated_vaultcertificates_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservices/vaultcertificates_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 armrecoveryservices @@ -56,7 +57,7 @@ func NewVaultCertificatesClient(subscriptionID string, credential azcore.TokenCr // Create - Uploads a certificate for a resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 +// Generated from API version 2022-04-01 // resourceGroupName - The name of the resource group where the recovery services vault is present. // vaultName - The name of the recovery services vault. // certificateName - Certificate friendly name. @@ -102,7 +103,7 @@ func (client *VaultCertificatesClient) createCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, certificateRequest) diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/ze_generated_example_vaultcertificates_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservices/vaultcertificates_client_example_test.go similarity index 97% rename from sdk/resourcemanager/recoveryservices/armrecoveryservices/ze_generated_example_vaultcertificates_client_test.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservices/vaultcertificates_client_example_test.go index a03b574af027..205379e99453 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/ze_generated_example_vaultcertificates_client_test.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservices/vaultcertificates_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservices" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-03-01/examples/PUTVaultCred.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-04-01/examples/PUTVaultCred.json func ExampleVaultCertificatesClient_Create() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/zz_generated_vaultextendedinfo_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservices/vaultextendedinfo_client.go similarity index 97% rename from sdk/resourcemanager/recoveryservices/armrecoveryservices/zz_generated_vaultextendedinfo_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservices/vaultextendedinfo_client.go index 717baf26bef2..f82f62417526 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/zz_generated_vaultextendedinfo_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservices/vaultextendedinfo_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 armrecoveryservices @@ -56,7 +57,7 @@ func NewVaultExtendedInfoClient(subscriptionID string, credential azcore.TokenCr // CreateOrUpdate - Create vault extended info. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 +// Generated from API version 2022-04-01 // resourceGroupName - The name of the resource group where the recovery services vault is present. // vaultName - The name of the recovery services vault. // resourceExtendedInfoDetails - Details of ResourceExtendedInfo @@ -97,7 +98,7 @@ func (client *VaultExtendedInfoClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, resourceExtendedInfoDetails) @@ -114,7 +115,7 @@ func (client *VaultExtendedInfoClient) createOrUpdateHandleResponse(resp *http.R // Get - Get the vault extended info. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 +// Generated from API version 2022-04-01 // resourceGroupName - The name of the resource group where the recovery services vault is present. // vaultName - The name of the recovery services vault. // options - VaultExtendedInfoClientGetOptions contains the optional parameters for the VaultExtendedInfoClient.Get method. @@ -153,7 +154,7 @@ func (client *VaultExtendedInfoClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -170,7 +171,7 @@ func (client *VaultExtendedInfoClient) getHandleResponse(resp *http.Response) (V // Update - Update vault extended info. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 +// Generated from API version 2022-04-01 // resourceGroupName - The name of the resource group where the recovery services vault is present. // vaultName - The name of the recovery services vault. // resourceExtendedInfoDetails - Details of ResourceExtendedInfo @@ -211,7 +212,7 @@ func (client *VaultExtendedInfoClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, resourceExtendedInfoDetails) diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/ze_generated_example_vaultextendedinfo_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservices/vaultextendedinfo_client_example_test.go similarity index 93% rename from sdk/resourcemanager/recoveryservices/armrecoveryservices/ze_generated_example_vaultextendedinfo_client_test.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservices/vaultextendedinfo_client_example_test.go index 8a4238ea33ed..301fe5541898 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/ze_generated_example_vaultextendedinfo_client_test.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservices/vaultextendedinfo_client_example_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservices" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-03-01/examples/GETVaultExtendedInfo.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-04-01/examples/GETVaultExtendedInfo.json func ExampleVaultExtendedInfoClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -38,7 +38,7 @@ func ExampleVaultExtendedInfoClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-03-01/examples/UpdateVaultExtendedInfo.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-04-01/examples/UpdateVaultExtendedInfo.json func ExampleVaultExtendedInfoClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -61,7 +61,7 @@ func ExampleVaultExtendedInfoClient_CreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-03-01/examples/UpdateVaultExtendedInfo.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-04-01/examples/UpdateVaultExtendedInfo.json func ExampleVaultExtendedInfoClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/zz_generated_vaults_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservices/vaults_client.go similarity index 96% rename from sdk/resourcemanager/recoveryservices/armrecoveryservices/zz_generated_vaults_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservices/vaults_client.go index a3669dc5e1ec..c6455524be2c 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/zz_generated_vaults_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservices/vaults_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 armrecoveryservices @@ -56,7 +57,7 @@ func NewVaultsClient(subscriptionID string, credential azcore.TokenCredential, o // BeginCreateOrUpdate - Creates or updates a Recovery Services vault. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 +// Generated from API version 2022-04-01 // resourceGroupName - The name of the resource group where the recovery services vault is present. // vaultName - The name of the recovery services vault. // vault - Recovery Services Vault to be created. @@ -76,7 +77,7 @@ func (client *VaultsClient) BeginCreateOrUpdate(ctx context.Context, resourceGro // CreateOrUpdate - Creates or updates a Recovery Services vault. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 +// Generated from API version 2022-04-01 func (client *VaultsClient) createOrUpdate(ctx context.Context, resourceGroupName string, vaultName string, vault Vault, options *VaultsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, vaultName, vault, options) if err != nil { @@ -112,7 +113,7 @@ func (client *VaultsClient) createOrUpdateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, vault) @@ -120,7 +121,7 @@ func (client *VaultsClient) createOrUpdateCreateRequest(ctx context.Context, res // Delete - Deletes a vault. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 +// Generated from API version 2022-04-01 // resourceGroupName - The name of the resource group where the recovery services vault is present. // vaultName - The name of the recovery services vault. // options - VaultsClientDeleteOptions contains the optional parameters for the VaultsClient.Delete method. @@ -159,7 +160,7 @@ func (client *VaultsClient) deleteCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -167,7 +168,7 @@ func (client *VaultsClient) deleteCreateRequest(ctx context.Context, resourceGro // Get - Get the Vault details. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 +// Generated from API version 2022-04-01 // resourceGroupName - The name of the resource group where the recovery services vault is present. // vaultName - The name of the recovery services vault. // options - VaultsClientGetOptions contains the optional parameters for the VaultsClient.Get method. @@ -206,7 +207,7 @@ func (client *VaultsClient) getCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -223,7 +224,7 @@ func (client *VaultsClient) getHandleResponse(resp *http.Response) (VaultsClient // NewListByResourceGroupPager - Retrieve a list of Vaults. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 +// Generated from API version 2022-04-01 // resourceGroupName - The name of the resource group where the recovery services vault is present. // options - VaultsClientListByResourceGroupOptions contains the optional parameters for the VaultsClient.ListByResourceGroup // method. @@ -271,7 +272,7 @@ func (client *VaultsClient) listByResourceGroupCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -288,7 +289,7 @@ func (client *VaultsClient) listByResourceGroupHandleResponse(resp *http.Respons // NewListBySubscriptionIDPager - Fetches all the resources of the specified type in the subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 +// Generated from API version 2022-04-01 // options - VaultsClientListBySubscriptionIDOptions contains the optional parameters for the VaultsClient.ListBySubscriptionID // method. func (client *VaultsClient) NewListBySubscriptionIDPager(options *VaultsClientListBySubscriptionIDOptions) *runtime.Pager[VaultsClientListBySubscriptionIDResponse] { @@ -331,7 +332,7 @@ func (client *VaultsClient) listBySubscriptionIDCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -348,7 +349,7 @@ func (client *VaultsClient) listBySubscriptionIDHandleResponse(resp *http.Respon // BeginUpdate - Updates the vault. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 +// Generated from API version 2022-04-01 // resourceGroupName - The name of the resource group where the recovery services vault is present. // vaultName - The name of the recovery services vault. // vault - Recovery Services Vault to be created. @@ -367,7 +368,7 @@ func (client *VaultsClient) BeginUpdate(ctx context.Context, resourceGroupName s // Update - Updates the vault. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 +// Generated from API version 2022-04-01 func (client *VaultsClient) update(ctx context.Context, resourceGroupName string, vaultName string, vault PatchVault, options *VaultsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, vaultName, vault, options) if err != nil { @@ -403,7 +404,7 @@ func (client *VaultsClient) updateCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, vault) diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/ze_generated_example_vaults_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservices/vaults_client_example_test.go similarity index 94% rename from sdk/resourcemanager/recoveryservices/armrecoveryservices/ze_generated_example_vaults_client_test.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservices/vaults_client_example_test.go index e144cde146db..3b62506a466b 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/ze_generated_example_vaults_client_test.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservices/vaults_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservices" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-03-01/examples/ListResources.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-04-01/examples/ListResources.json func ExampleVaultsClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -42,7 +42,7 @@ func ExampleVaultsClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-03-01/examples/GETVault.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-04-01/examples/GETVault.json func ExampleVaultsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -64,7 +64,7 @@ func ExampleVaultsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-03-01/examples/PUTVault.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-04-01/examples/PUTVault.json func ExampleVaultsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -100,7 +100,7 @@ func ExampleVaultsClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-03-01/examples/DeleteVault.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-04-01/examples/DeleteVault.json func ExampleVaultsClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -120,7 +120,7 @@ func ExampleVaultsClient_Delete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-03-01/examples/PATCHVault.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-04-01/examples/PATCHVault.json func ExampleVaultsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/zz_generated_models_serde.go b/sdk/resourcemanager/recoveryservices/armrecoveryservices/zz_generated_models_serde.go deleted file mode 100644 index 7ee372a2a1a6..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/zz_generated_models_serde.go +++ /dev/null @@ -1,577 +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 armrecoveryservices - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "reflect" -) - -// MarshalJSON implements the json.Marshaller interface for type IdentityData. -func (i IdentityData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "principalId", i.PrincipalID) - populate(objectMap, "tenantId", i.TenantID) - populate(objectMap, "type", i.Type) - populate(objectMap, "userAssignedIdentities", i.UserAssignedIdentities) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationResource. -func (o *OperationResource) UnmarshalJSON(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 "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &o.EndTime) - delete(rawMsg, key) - case "error": - err = unpopulate(val, "Error", &o.Error) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &o.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &o.Name) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &o.StartTime) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &o.Status) - 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 PatchTrackedResource. -func (p PatchTrackedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", p.Etag) - populate(objectMap, "id", p.ID) - populate(objectMap, "location", p.Location) - populate(objectMap, "name", p.Name) - populate(objectMap, "tags", p.Tags) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type PatchVault. -func (p PatchVault) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", p.Etag) - populate(objectMap, "id", p.ID) - populate(objectMap, "identity", p.Identity) - populate(objectMap, "location", p.Location) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "sku", p.SKU) - populate(objectMap, "tags", p.Tags) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type RawCertificateData. -func (r RawCertificateData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "authType", r.AuthType) - populateByteArray(objectMap, "certificate", r.Certificate, runtime.Base64StdFormat) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RawCertificateData. -func (r *RawCertificateData) UnmarshalJSON(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 "authType": - err = unpopulate(val, "AuthType", &r.AuthType) - delete(rawMsg, key) - case "certificate": - err = runtime.DecodeByteArray(string(val), &r.Certificate, runtime.Base64StdFormat) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceCertificateAndAADDetails. -func (r *ResourceCertificateAndAADDetails) UnmarshalJSON(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 "aadAuthority": - err = unpopulate(val, "AADAuthority", &r.AADAuthority) - delete(rawMsg, key) - case "aadTenantId": - err = unpopulate(val, "AADTenantID", &r.AADTenantID) - delete(rawMsg, key) - case "authType": - err = unpopulate(val, "AuthType", &r.AuthType) - delete(rawMsg, key) - case "azureManagementEndpointAudience": - err = unpopulate(val, "AzureManagementEndpointAudience", &r.AzureManagementEndpointAudience) - delete(rawMsg, key) - case "certificate": - err = runtime.DecodeByteArray(string(val), &r.Certificate, runtime.Base64StdFormat) - delete(rawMsg, key) - case "friendlyName": - err = unpopulate(val, "FriendlyName", &r.FriendlyName) - delete(rawMsg, key) - case "issuer": - err = unpopulate(val, "Issuer", &r.Issuer) - delete(rawMsg, key) - case "resourceId": - err = unpopulate(val, "ResourceID", &r.ResourceID) - delete(rawMsg, key) - case "servicePrincipalClientId": - err = unpopulate(val, "ServicePrincipalClientID", &r.ServicePrincipalClientID) - delete(rawMsg, key) - case "servicePrincipalObjectId": - err = unpopulate(val, "ServicePrincipalObjectID", &r.ServicePrincipalObjectID) - delete(rawMsg, key) - case "serviceResourceId": - err = unpopulate(val, "ServiceResourceID", &r.ServiceResourceID) - delete(rawMsg, key) - case "subject": - err = unpopulate(val, "Subject", &r.Subject) - delete(rawMsg, key) - case "thumbprint": - err = unpopulate(val, "Thumbprint", &r.Thumbprint) - delete(rawMsg, key) - case "validFrom": - err = unpopulateTimeRFC3339(val, "ValidFrom", &r.ValidFrom) - delete(rawMsg, key) - case "validTo": - err = unpopulateTimeRFC3339(val, "ValidTo", &r.ValidTo) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceCertificateAndAcsDetails. -func (r *ResourceCertificateAndAcsDetails) UnmarshalJSON(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 "authType": - err = unpopulate(val, "AuthType", &r.AuthType) - delete(rawMsg, key) - case "certificate": - err = runtime.DecodeByteArray(string(val), &r.Certificate, runtime.Base64StdFormat) - delete(rawMsg, key) - case "friendlyName": - err = unpopulate(val, "FriendlyName", &r.FriendlyName) - delete(rawMsg, key) - case "globalAcsHostName": - err = unpopulate(val, "GlobalAcsHostName", &r.GlobalAcsHostName) - delete(rawMsg, key) - case "globalAcsNamespace": - err = unpopulate(val, "GlobalAcsNamespace", &r.GlobalAcsNamespace) - delete(rawMsg, key) - case "globalAcsRPRealm": - err = unpopulate(val, "GlobalAcsRPRealm", &r.GlobalAcsRPRealm) - delete(rawMsg, key) - case "issuer": - err = unpopulate(val, "Issuer", &r.Issuer) - delete(rawMsg, key) - case "resourceId": - err = unpopulate(val, "ResourceID", &r.ResourceID) - delete(rawMsg, key) - case "subject": - err = unpopulate(val, "Subject", &r.Subject) - delete(rawMsg, key) - case "thumbprint": - err = unpopulate(val, "Thumbprint", &r.Thumbprint) - delete(rawMsg, key) - case "validFrom": - err = unpopulateTimeRFC3339(val, "ValidFrom", &r.ValidFrom) - delete(rawMsg, key) - case "validTo": - err = unpopulateTimeRFC3339(val, "ValidTo", &r.ValidTo) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceCertificateDetails. -func (r *ResourceCertificateDetails) UnmarshalJSON(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 "authType": - err = unpopulate(val, "AuthType", &r.AuthType) - delete(rawMsg, key) - case "certificate": - err = runtime.DecodeByteArray(string(val), &r.Certificate, runtime.Base64StdFormat) - delete(rawMsg, key) - case "friendlyName": - err = unpopulate(val, "FriendlyName", &r.FriendlyName) - delete(rawMsg, key) - case "issuer": - err = unpopulate(val, "Issuer", &r.Issuer) - delete(rawMsg, key) - case "resourceId": - err = unpopulate(val, "ResourceID", &r.ResourceID) - delete(rawMsg, key) - case "subject": - err = unpopulate(val, "Subject", &r.Subject) - delete(rawMsg, key) - case "thumbprint": - err = unpopulate(val, "Thumbprint", &r.Thumbprint) - delete(rawMsg, key) - case "validFrom": - err = unpopulateTimeRFC3339(val, "ValidFrom", &r.ValidFrom) - delete(rawMsg, key) - case "validTo": - err = unpopulateTimeRFC3339(val, "ValidTo", &r.ValidTo) - 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 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, "etag", t.Etag) - 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 UpgradeDetails. -func (u UpgradeDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "endTimeUtc", u.EndTimeUTC) - populateTimeRFC3339(objectMap, "lastUpdatedTimeUtc", u.LastUpdatedTimeUTC) - populate(objectMap, "message", u.Message) - populate(objectMap, "operationId", u.OperationID) - populate(objectMap, "previousResourceId", u.PreviousResourceID) - populateTimeRFC3339(objectMap, "startTimeUtc", u.StartTimeUTC) - populate(objectMap, "status", u.Status) - populate(objectMap, "triggerType", u.TriggerType) - populate(objectMap, "upgradedResourceId", u.UpgradedResourceID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UpgradeDetails. -func (u *UpgradeDetails) UnmarshalJSON(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 "endTimeUtc": - err = unpopulateTimeRFC3339(val, "EndTimeUTC", &u.EndTimeUTC) - delete(rawMsg, key) - case "lastUpdatedTimeUtc": - err = unpopulateTimeRFC3339(val, "LastUpdatedTimeUTC", &u.LastUpdatedTimeUTC) - delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &u.Message) - delete(rawMsg, key) - case "operationId": - err = unpopulate(val, "OperationID", &u.OperationID) - delete(rawMsg, key) - case "previousResourceId": - err = unpopulate(val, "PreviousResourceID", &u.PreviousResourceID) - delete(rawMsg, key) - case "startTimeUtc": - err = unpopulateTimeRFC3339(val, "StartTimeUTC", &u.StartTimeUTC) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &u.Status) - delete(rawMsg, key) - case "triggerType": - err = unpopulate(val, "TriggerType", &u.TriggerType) - delete(rawMsg, key) - case "upgradedResourceId": - err = unpopulate(val, "UpgradedResourceID", &u.UpgradedResourceID) - 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 Vault. -func (v Vault) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", v.Etag) - populate(objectMap, "id", v.ID) - populate(objectMap, "identity", v.Identity) - populate(objectMap, "location", v.Location) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "sku", v.SKU) - populate(objectMap, "systemData", v.SystemData) - populate(objectMap, "tags", v.Tags) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VaultCertificateResponse. -func (v *VaultCertificateResponse) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - v.Properties, err = unmarshalResourceCertificateDetailsClassification(val) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VaultExtendedInfoResource. -func (v VaultExtendedInfoResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", v.Etag) - populate(objectMap, "id", v.ID) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VaultProperties. -func (v VaultProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "backupStorageVersion", v.BackupStorageVersion) - populate(objectMap, "encryption", v.Encryption) - populate(objectMap, "monitoringSettings", v.MonitoringSettings) - populate(objectMap, "moveDetails", v.MoveDetails) - populate(objectMap, "moveState", v.MoveState) - populate(objectMap, "privateEndpointConnections", v.PrivateEndpointConnections) - populate(objectMap, "privateEndpointStateForBackup", v.PrivateEndpointStateForBackup) - populate(objectMap, "privateEndpointStateForSiteRecovery", v.PrivateEndpointStateForSiteRecovery) - populate(objectMap, "provisioningState", v.ProvisioningState) - populate(objectMap, "upgradeDetails", v.UpgradeDetails) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VaultPropertiesMoveDetails. -func (v VaultPropertiesMoveDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "completionTimeUtc", v.CompletionTimeUTC) - populate(objectMap, "operationId", v.OperationID) - populate(objectMap, "sourceResourceId", v.SourceResourceID) - populateTimeRFC3339(objectMap, "startTimeUtc", v.StartTimeUTC) - populate(objectMap, "targetResourceId", v.TargetResourceID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VaultPropertiesMoveDetails. -func (v *VaultPropertiesMoveDetails) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "completionTimeUtc": - err = unpopulateTimeRFC3339(val, "CompletionTimeUTC", &v.CompletionTimeUTC) - delete(rawMsg, key) - case "operationId": - err = unpopulate(val, "OperationID", &v.OperationID) - delete(rawMsg, key) - case "sourceResourceId": - err = unpopulate(val, "SourceResourceID", &v.SourceResourceID) - delete(rawMsg, key) - case "startTimeUtc": - err = unpopulateTimeRFC3339(val, "StartTimeUTC", &v.StartTimeUTC) - delete(rawMsg, key) - case "targetResourceId": - err = unpopulate(val, "TargetResourceID", &v.TargetResourceID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VaultUsage. -func (v *VaultUsage) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "currentValue": - err = unpopulate(val, "CurrentValue", &v.CurrentValue) - delete(rawMsg, key) - case "limit": - err = unpopulate(val, "Limit", &v.Limit) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "nextResetTime": - err = unpopulateTimeRFC3339(val, "NextResetTime", &v.NextResetTime) - delete(rawMsg, key) - case "quotaPeriod": - err = unpopulate(val, "QuotaPeriod", &v.QuotaPeriod) - delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &v.Unit) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, 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 populateByteArray(m map[string]interface{}, k string, b []byte, f runtime.Base64Encoding) { - if azcore.IsNullValue(b) { - m[k] = nil - } else if len(b) == 0 { - return - } else { - m[k] = runtime.EncodeByteArray(b, f) - } -} - -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 -}