From 3e32b3d43df8c9fd3c84a1908a4def13ca908f08 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 26 Apr 2022 06:21:17 +0000 Subject: [PATCH] CodeGen from PR 18624 in Azure/azure-rest-api-specs Dev dataprotection microsoft.data protection 2022 03 31 preview (#18624) * Adds base for updating Microsoft.DataProtection from version preview/2022-02-01-preview to version 2022-03-31-preview * Updates readme * Updates API version in new specs and examples * Changes from 2022-03-01 * Adding extension routing API * Prettier fix * Undo unintentional changes * Revert "Prettier fix" This reverts commit 3ac4c11592e7bba2297d14d0183ced1c444c2103. * Adding autoheal settings * Adding x-ms-parameter-location * Fixing example resourceId and extension resource path Co-authored-by: chandrasekarendran <59728024+chandrasekarendran@users.noreply.github.com> --- .../armdataprotection/CHANGELOG.md | 19 + .../armdataprotection/autorest.md | 6 +- .../dataprotection/armdataprotection/go.mod | 16 +- .../dataprotection/armdataprotection/go.sum | 33 +- ...ted_example_backupinstances_client_test.go | 570 ------------------ ...ated_example_backuppolicies_client_test.go | 196 ------ ...backupvaultoperationresults_client_test.go | 40 -- ...erated_example_backupvaults_client_test.go | 224 ------- ...ated_example_dataprotection_client_test.go | 43 -- ...le_dataprotectionoperations_client_test.go | 42 -- ...enerated_example_exportjobs_client_test.go | 43 -- ...e_exportjobsoperationresult_client_test.go | 40 -- .../ze_generated_example_jobs_client_test.go | 67 -- ...ted_example_operationresult_client_test.go | 39 -- ...ted_example_operationstatus_client_test.go | 39 -- ...ionstatusbackupvaultcontext_client_test.go | 40 -- ...nstatusresourcegroupcontext_client_test.go | 39 -- ...ated_example_recoverypoints_client_test.go | 71 --- ...ated_example_resourceguards_client_test.go | 466 -------------- ...xample_restorabletimeranges_client_test.go | 46 -- .../zz_generated_backupinstances_client.go | 30 +- ..._backupinstancesextensionrouting_client.go | 112 ++++ .../zz_generated_backuppolicies_client.go | 8 +- ...ated_backupvaultoperationresults_client.go | 2 +- .../zz_generated_backupvaults_client.go | 14 +- .../armdataprotection/zz_generated_client.go | 2 +- .../zz_generated_constants.go | 17 +- .../zz_generated_exportjobs_client.go | 2 +- ...erated_exportjobsoperationresult_client.go | 2 +- .../zz_generated_jobs_client.go | 4 +- .../armdataprotection/zz_generated_models.go | 36 +- .../zz_generated_models_serde.go | 84 +++ .../zz_generated_operationresult_client.go | 2 +- .../zz_generated_operations_client.go | 2 +- .../zz_generated_operationstatus_client.go | 2 +- ...perationstatusbackupvaultcontext_client.go | 2 +- ...rationstatusresourcegroupcontext_client.go | 2 +- .../zz_generated_polymorphic_helpers.go | 4 + .../zz_generated_recoverypoints_client.go | 4 +- .../zz_generated_resourceguards_client.go | 36 +- .../zz_generated_response_types.go | 5 + ...z_generated_restorabletimeranges_client.go | 2 +- 42 files changed, 345 insertions(+), 2108 deletions(-) delete mode 100644 sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_backupinstances_client_test.go delete mode 100644 sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_backuppolicies_client_test.go delete mode 100644 sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_backupvaultoperationresults_client_test.go delete mode 100644 sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_backupvaults_client_test.go delete mode 100644 sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_dataprotection_client_test.go delete mode 100644 sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_dataprotectionoperations_client_test.go delete mode 100644 sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_exportjobs_client_test.go delete mode 100644 sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_exportjobsoperationresult_client_test.go delete mode 100644 sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_jobs_client_test.go delete mode 100644 sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_operationresult_client_test.go delete mode 100644 sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_operationstatus_client_test.go delete mode 100644 sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_operationstatusbackupvaultcontext_client_test.go delete mode 100644 sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_operationstatusresourcegroupcontext_client_test.go delete mode 100644 sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_recoverypoints_client_test.go delete mode 100644 sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_resourceguards_client_test.go delete mode 100644 sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_restorabletimeranges_client_test.go create mode 100644 sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_backupinstancesextensionrouting_client.go diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/CHANGELOG.md b/sdk/resourcemanager/dataprotection/armdataprotection/CHANGELOG.md index d597045ef3f0..955171d33393 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/CHANGELOG.md +++ b/sdk/resourcemanager/dataprotection/armdataprotection/CHANGELOG.md @@ -1,5 +1,24 @@ # Release History +## 0.5.0 (2022-04-26) +### Features Added + +- New const `AutoHealStatusOff` +- New const `AutoHealStatusOn` +- New function `*KubernetesPVRestoreCriteria.UnmarshalJSON([]byte) error` +- New function `*KubernetesPVRestoreCriteria.GetItemLevelRestoreCriteria() *ItemLevelRestoreCriteria` +- New function `KubernetesStorageClassRestoreCriteria.MarshalJSON() ([]byte, error)` +- New function `*KubernetesStorageClassRestoreCriteria.UnmarshalJSON([]byte) error` +- New function `*KubernetesStorageClassRestoreCriteria.GetItemLevelRestoreCriteria() *ItemLevelRestoreCriteria` +- New function `PossibleAutoHealStatusValues() []AutoHealStatus` +- New function `KubernetesPVRestoreCriteria.MarshalJSON() ([]byte, error)` +- New struct `AutoHealSettings` +- New struct `BackupInstancesExtensionRoutingClientListOptions` +- New struct `BackupInstancesExtensionRoutingClientListResponse` +- New struct `KubernetesPVRestoreCriteria` +- New struct `KubernetesStorageClassRestoreCriteria` + + ## 0.4.0 (2022-04-15) ### Breaking Changes diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/autorest.md b/sdk/resourcemanager/dataprotection/armdataprotection/autorest.md index 2c548263b6d2..683c99517eb4 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/autorest.md +++ b/sdk/resourcemanager/dataprotection/armdataprotection/autorest.md @@ -5,8 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/cc26f1d28c939bbcde00a29aa8958b3eebb10cea/specification/dataprotection/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/cc26f1d28c939bbcde00a29aa8958b3eebb10cea/specification/dataprotection/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/dataprotection/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/dataprotection/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.4.0 +module-version: 0.5.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/go.mod b/sdk/resourcemanager/dataprotection/armdataprotection/go.mod index ba47db8ba01e..7bd099a71998 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/go.mod +++ b/sdk/resourcemanager/dataprotection/armdataprotection/go.mod @@ -2,20 +2,10 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armd go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 // indirect - github.com/golang-jwt/jwt v3.2.1+incompatible // indirect - github.com/google/uuid v1.1.1 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect - golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 // indirect - golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f // indirect - golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 // indirect - golang.org/x/text v0.3.7 // indirect + golang.org/x/net v0.0.0-20210610132358-84b48f89b13b // indirect + golang.org/x/text v0.3.6 // indirect ) diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/go.sum b/sdk/resourcemanager/dataprotection/armdataprotection/go.sum index 56d1c32628ae..a7eaa30576c1 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/go.sum +++ b/sdk/resourcemanager/dataprotection/armdataprotection/go.sum @@ -1,26 +1,11 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0 h1:D7l5jspkc4kwBYRWoZE4DQnu6LVpLwDsMZjBKS4wZLQ= github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0/go.mod h1:w5pDIZuawUmY3Bj4tVx3Xb8KS96ToB0j315w9rqpAg0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0 h1:NVS/4LOQfkBpk+B1VopIzv1ptmYeEskA8w/3K/w7vjo= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0/go.mod h1:RG0cZndeZM17StwohYclmcXSr4oOJ8b1I5hB8llIc6Y= github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1 h1:sLZ/Y+P/5RRtsXWylBjB5lkgixYfm0MQPiwrSX//JSo= github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -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/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= -github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= -github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= -github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -28,26 +13,20 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNmw2api+jEfxLoykJVice/E= -golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f h1:OfiFi4JbukWwe3lzw+xunroH1mnC1e2Gy5cxNJApiSY= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210610132358-84b48f89b13b h1:k+E048sYJHyVnsr1GDrRZWQ32D2C7lWs9JRc0bel53A= +golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 h1:id054HUawV2/6IGm2IV8KZQjqtwAOo2CYlOToYqa0d0= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_backupinstances_client_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_backupinstances_client_test.go deleted file mode 100644 index 8345289db9c4..000000000000 --- a/sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_backupinstances_client_test.go +++ /dev/null @@ -1,570 +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 armdataprotection_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/BackupInstanceOperations/ListBackupInstances.json -func ExampleBackupInstancesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewBackupInstancesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("", - "", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/BackupInstanceOperations/GetBackupInstance.json -func ExampleBackupInstancesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewBackupInstancesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/BackupInstanceOperations/PutBackupInstance.json -func ExampleBackupInstancesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewBackupInstancesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "", - "", - "", - armdataprotection.BackupInstanceResource{ - Properties: &armdataprotection.BackupInstance{ - DataSourceInfo: &armdataprotection.Datasource{ - DatasourceType: to.Ptr(""), - ObjectType: to.Ptr(""), - ResourceID: to.Ptr(""), - ResourceLocation: to.Ptr(""), - ResourceName: to.Ptr(""), - ResourceType: to.Ptr(""), - ResourceURI: to.Ptr(""), - }, - DataSourceSetInfo: &armdataprotection.DatasourceSet{ - DatasourceType: to.Ptr(""), - ObjectType: to.Ptr(""), - ResourceID: to.Ptr(""), - ResourceLocation: to.Ptr(""), - ResourceName: to.Ptr(""), - ResourceType: to.Ptr(""), - ResourceURI: to.Ptr(""), - }, - DatasourceAuthCredentials: &armdataprotection.SecretStoreBasedAuthCredentials{ - ObjectType: to.Ptr(""), - SecretStoreResource: &armdataprotection.SecretStoreResource{ - SecretStoreType: to.Ptr(armdataprotection.SecretStoreTypeAzureKeyVault), - URI: to.Ptr(""), - }, - }, - FriendlyName: to.Ptr(""), - ObjectType: to.Ptr(""), - PolicyInfo: &armdataprotection.PolicyInfo{ - PolicyID: to.Ptr(""), - PolicyParameters: &armdataprotection.PolicyParameters{ - DataStoreParametersList: []armdataprotection.DataStoreParametersClassification{ - &armdataprotection.AzureOperationalStoreParameters{ - DataStoreType: to.Ptr(armdataprotection.DataStoreTypesOperationalStore), - ObjectType: to.Ptr(""), - ResourceGroupID: to.Ptr(""), - }}, - }, - }, - ValidationType: to.Ptr(armdataprotection.ValidationTypeShallowValidation), - }, - }, - &armdataprotection.BackupInstancesClientBeginCreateOrUpdateOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/BackupInstanceOperations/DeleteBackupInstance.json -func ExampleBackupInstancesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewBackupInstancesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "", - "", - "", - &armdataprotection.BackupInstancesClientBeginDeleteOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/BackupInstanceOperations/TriggerBackup.json -func ExampleBackupInstancesClient_BeginAdhocBackup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewBackupInstancesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginAdhocBackup(ctx, - "", - "", - "", - armdataprotection.TriggerBackupRequest{ - BackupRuleOptions: &armdataprotection.AdHocBackupRuleOptions{ - RuleName: to.Ptr(""), - TriggerOption: &armdataprotection.AdhocBackupTriggerOption{ - RetentionTagOverride: to.Ptr(""), - }, - }, - }, - &armdataprotection.BackupInstancesClientBeginAdhocBackupOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/BackupInstanceOperations/ValidateForBackup.json -func ExampleBackupInstancesClient_BeginValidateForBackup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewBackupInstancesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginValidateForBackup(ctx, - "", - "", - armdataprotection.ValidateForBackupRequest{ - BackupInstance: &armdataprotection.BackupInstance{ - DataSourceInfo: &armdataprotection.Datasource{ - DatasourceType: to.Ptr(""), - ObjectType: to.Ptr(""), - ResourceID: to.Ptr(""), - ResourceLocation: to.Ptr(""), - ResourceName: to.Ptr(""), - ResourceType: to.Ptr(""), - ResourceURI: to.Ptr(""), - }, - DataSourceSetInfo: &armdataprotection.DatasourceSet{ - DatasourceType: to.Ptr(""), - ObjectType: to.Ptr(""), - ResourceID: to.Ptr(""), - ResourceLocation: to.Ptr(""), - ResourceName: to.Ptr(""), - ResourceType: to.Ptr(""), - ResourceURI: to.Ptr(""), - }, - DatasourceAuthCredentials: &armdataprotection.SecretStoreBasedAuthCredentials{ - ObjectType: to.Ptr(""), - SecretStoreResource: &armdataprotection.SecretStoreResource{ - SecretStoreType: to.Ptr(armdataprotection.SecretStoreTypeAzureKeyVault), - URI: to.Ptr(""), - }, - }, - FriendlyName: to.Ptr(""), - ObjectType: to.Ptr(""), - PolicyInfo: &armdataprotection.PolicyInfo{ - PolicyID: to.Ptr(""), - }, - }, - }, - &armdataprotection.BackupInstancesClientBeginValidateForBackupOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/BackupInstanceOperations/GetBackupInstanceOperationResult.json -func ExampleBackupInstancesClient_GetBackupInstanceOperationResult() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewBackupInstancesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetBackupInstanceOperationResult(ctx, - "", - "", - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/BackupInstanceOperations/TriggerRehydrate.json -func ExampleBackupInstancesClient_BeginTriggerRehydrate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewBackupInstancesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginTriggerRehydrate(ctx, - "", - "", - "", - armdataprotection.AzureBackupRehydrationRequest{ - RecoveryPointID: to.Ptr(""), - RehydrationPriority: to.Ptr(armdataprotection.RehydrationPriorityHigh), - RehydrationRetentionDuration: to.Ptr(""), - }, - &armdataprotection.BackupInstancesClientBeginTriggerRehydrateOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/BackupInstanceOperations/TriggerRestore.json -func ExampleBackupInstancesClient_BeginTriggerRestore() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewBackupInstancesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginTriggerRestore(ctx, - "", - "", - "", - &armdataprotection.AzureBackupRecoveryPointBasedRestoreRequest{ - ObjectType: to.Ptr(""), - RestoreTargetInfo: &armdataprotection.RestoreTargetInfo{ - ObjectType: to.Ptr(""), - RecoveryOption: to.Ptr(armdataprotection.RecoveryOptionFailIfExists), - RestoreLocation: to.Ptr(""), - DatasourceAuthCredentials: &armdataprotection.SecretStoreBasedAuthCredentials{ - ObjectType: to.Ptr(""), - SecretStoreResource: &armdataprotection.SecretStoreResource{ - SecretStoreType: to.Ptr(armdataprotection.SecretStoreTypeAzureKeyVault), - URI: to.Ptr(""), - }, - }, - DatasourceInfo: &armdataprotection.Datasource{ - DatasourceType: to.Ptr(""), - ObjectType: to.Ptr(""), - ResourceID: to.Ptr(""), - ResourceLocation: to.Ptr(""), - ResourceName: to.Ptr(""), - ResourceType: to.Ptr(""), - ResourceURI: to.Ptr(""), - }, - DatasourceSetInfo: &armdataprotection.DatasourceSet{ - DatasourceType: to.Ptr(""), - ObjectType: to.Ptr(""), - ResourceID: to.Ptr(""), - ResourceLocation: to.Ptr(""), - ResourceName: to.Ptr(""), - ResourceType: to.Ptr(""), - ResourceURI: to.Ptr(""), - }, - }, - SourceDataStoreType: to.Ptr(armdataprotection.SourceDataStoreTypeVaultStore), - SourceResourceID: to.Ptr(""), - RecoveryPointID: to.Ptr(""), - }, - &armdataprotection.BackupInstancesClientBeginTriggerRestoreOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/BackupInstanceOperations/ResumeBackups.json -func ExampleBackupInstancesClient_BeginResumeBackups() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewBackupInstancesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginResumeBackups(ctx, - "", - "", - "", - &armdataprotection.BackupInstancesClientBeginResumeBackupsOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/BackupInstanceOperations/ResumeProtection.json -func ExampleBackupInstancesClient_BeginResumeProtection() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewBackupInstancesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginResumeProtection(ctx, - "", - "", - "", - &armdataprotection.BackupInstancesClientBeginResumeProtectionOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/BackupInstanceOperations/StopProtection.json -func ExampleBackupInstancesClient_BeginStopProtection() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewBackupInstancesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginStopProtection(ctx, - "", - "", - "", - &armdataprotection.BackupInstancesClientBeginStopProtectionOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/BackupInstanceOperations/SuspendBackups.json -func ExampleBackupInstancesClient_BeginSuspendBackups() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewBackupInstancesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginSuspendBackups(ctx, - "", - "", - "", - &armdataprotection.BackupInstancesClientBeginSuspendBackupsOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/BackupInstanceOperations/SyncBackupInstance.json -func ExampleBackupInstancesClient_BeginSyncBackupInstance() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewBackupInstancesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginSyncBackupInstance(ctx, - "", - "", - "", - armdataprotection.SyncBackupInstanceRequest{ - SyncType: to.Ptr(armdataprotection.SyncTypeDefault), - }, - &armdataprotection.BackupInstancesClientBeginSyncBackupInstanceOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/BackupInstanceOperations/ValidateRestore.json -func ExampleBackupInstancesClient_BeginValidateForRestore() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewBackupInstancesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginValidateForRestore(ctx, - "", - "", - "", - armdataprotection.ValidateRestoreRequestObject{ - RestoreRequestObject: &armdataprotection.AzureBackupRecoveryPointBasedRestoreRequest{ - ObjectType: to.Ptr(""), - RestoreTargetInfo: &armdataprotection.RestoreTargetInfo{ - ObjectType: to.Ptr(""), - RecoveryOption: to.Ptr(armdataprotection.RecoveryOptionFailIfExists), - RestoreLocation: to.Ptr(""), - DatasourceAuthCredentials: &armdataprotection.SecretStoreBasedAuthCredentials{ - ObjectType: to.Ptr(""), - SecretStoreResource: &armdataprotection.SecretStoreResource{ - SecretStoreType: to.Ptr(armdataprotection.SecretStoreTypeAzureKeyVault), - URI: to.Ptr(""), - }, - }, - DatasourceInfo: &armdataprotection.Datasource{ - DatasourceType: to.Ptr(""), - ObjectType: to.Ptr(""), - ResourceID: to.Ptr(""), - ResourceLocation: to.Ptr(""), - ResourceName: to.Ptr(""), - ResourceType: to.Ptr(""), - ResourceURI: to.Ptr(""), - }, - DatasourceSetInfo: &armdataprotection.DatasourceSet{ - DatasourceType: to.Ptr(""), - ObjectType: to.Ptr(""), - ResourceID: to.Ptr(""), - ResourceLocation: to.Ptr(""), - ResourceName: to.Ptr(""), - ResourceType: to.Ptr(""), - ResourceURI: to.Ptr(""), - }, - }, - SourceDataStoreType: to.Ptr(armdataprotection.SourceDataStoreTypeVaultStore), - SourceResourceID: to.Ptr(""), - RecoveryPointID: to.Ptr(""), - }, - }, - &armdataprotection.BackupInstancesClientBeginValidateForRestoreOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_backuppolicies_client_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_backuppolicies_client_test.go deleted file mode 100644 index 073872848a54..000000000000 --- a/sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_backuppolicies_client_test.go +++ /dev/null @@ -1,196 +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 armdataprotection_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/PolicyCRUD/ListBackupPolicy.json -func ExampleBackupPoliciesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewBackupPoliciesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("", - "", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/PolicyCRUD/GetBackupPolicy.json -func ExampleBackupPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewBackupPoliciesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/PolicyCRUD/CreateOrUpdateBackupPolicy.json -func ExampleBackupPoliciesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewBackupPoliciesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "", - "", - "", - armdataprotection.BaseBackupPolicyResource{ - Properties: &armdataprotection.BackupPolicy{ - DatasourceTypes: []*string{ - to.Ptr("OssDB")}, - ObjectType: to.Ptr(""), - PolicyRules: []armdataprotection.BasePolicyRuleClassification{ - &armdataprotection.AzureBackupRule{ - Name: to.Ptr(""), - ObjectType: to.Ptr(""), - BackupParameters: &armdataprotection.AzureBackupParams{ - ObjectType: to.Ptr(""), - BackupType: to.Ptr(""), - }, - DataStore: &armdataprotection.DataStoreInfoBase{ - DataStoreType: to.Ptr(armdataprotection.DataStoreTypesVaultStore), - ObjectType: to.Ptr(""), - }, - Trigger: &armdataprotection.ScheduleBasedTriggerContext{ - ObjectType: to.Ptr(""), - Schedule: &armdataprotection.BackupSchedule{ - RepeatingTimeIntervals: []*string{ - to.Ptr("R/2019-11-20T08:00:00-08:00/P1W")}, - }, - TaggingCriteria: []*armdataprotection.TaggingCriteria{ - { - IsDefault: to.Ptr(true), - TagInfo: &armdataprotection.RetentionTag{ - TagName: to.Ptr(""), - }, - TaggingPriority: to.Ptr[int64](99), - }, - { - Criteria: []armdataprotection.BackupCriteriaClassification{ - &armdataprotection.ScheduleBasedBackupCriteria{ - ObjectType: to.Ptr(""), - DaysOfTheWeek: []*armdataprotection.DayOfWeek{ - to.Ptr(armdataprotection.DayOfWeekSunday)}, - ScheduleTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-01T13:00:00Z"); return t }())}, - }}, - IsDefault: to.Ptr(false), - TagInfo: &armdataprotection.RetentionTag{ - TagName: to.Ptr(""), - }, - TaggingPriority: to.Ptr[int64](20), - }}, - }, - }, - &armdataprotection.AzureRetentionRule{ - Name: to.Ptr(""), - ObjectType: to.Ptr(""), - IsDefault: to.Ptr(true), - Lifecycles: []*armdataprotection.SourceLifeCycle{ - { - DeleteAfter: &armdataprotection.AbsoluteDeleteOption{ - Duration: to.Ptr(""), - ObjectType: to.Ptr(""), - }, - SourceDataStore: &armdataprotection.DataStoreInfoBase{ - DataStoreType: to.Ptr(armdataprotection.DataStoreTypesVaultStore), - ObjectType: to.Ptr(""), - }, - }}, - }, - &armdataprotection.AzureRetentionRule{ - Name: to.Ptr(""), - ObjectType: to.Ptr(""), - IsDefault: to.Ptr(false), - Lifecycles: []*armdataprotection.SourceLifeCycle{ - { - DeleteAfter: &armdataprotection.AbsoluteDeleteOption{ - Duration: to.Ptr(""), - ObjectType: to.Ptr(""), - }, - SourceDataStore: &armdataprotection.DataStoreInfoBase{ - DataStoreType: to.Ptr(armdataprotection.DataStoreTypesVaultStore), - ObjectType: to.Ptr(""), - }, - }}, - }}, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/PolicyCRUD/DeleteBackupPolicy.json -func ExampleBackupPoliciesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewBackupPoliciesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_backupvaultoperationresults_client_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_backupvaultoperationresults_client_test.go deleted file mode 100644 index d1b848a5e7f8..000000000000 --- a/sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_backupvaultoperationresults_client_test.go +++ /dev/null @@ -1,40 +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 armdataprotection_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/VaultCRUD/GetOperationResultPatch.json -func ExampleBackupVaultOperationResultsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewBackupVaultOperationResultsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_backupvaults_client_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_backupvaults_client_test.go deleted file mode 100644 index 920f3d9383ec..000000000000 --- a/sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_backupvaults_client_test.go +++ /dev/null @@ -1,224 +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 armdataprotection_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/VaultCRUD/GetBackupVaultsInSubscription.json -func ExampleBackupVaultsClient_NewGetInSubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewBackupVaultsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewGetInSubscriptionPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/VaultCRUD/GetBackupVaultsInResourceGroup.json -func ExampleBackupVaultsClient_NewGetInResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewBackupVaultsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewGetInResourceGroupPager("", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/VaultCRUD/GetBackupVault.json -func ExampleBackupVaultsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewBackupVaultsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/VaultCRUD/PutBackupVault.json -func ExampleBackupVaultsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewBackupVaultsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "", - "", - armdataprotection.BackupVaultResource{ - Identity: &armdataprotection.DppIdentityDetails{ - Type: to.Ptr(""), - }, - Location: to.Ptr(""), - Tags: map[string]*string{ - "key1": to.Ptr("val1"), - }, - Properties: &armdataprotection.BackupVault{ - MonitoringSettings: &armdataprotection.MonitoringSettings{ - AzureMonitorAlertSettings: &armdataprotection.AzureMonitorAlertSettings{ - AlertsForAllJobFailures: to.Ptr(armdataprotection.AlertsStateEnabled), - }, - }, - StorageSettings: []*armdataprotection.StorageSetting{ - { - Type: to.Ptr(armdataprotection.StorageSettingTypesLocallyRedundant), - DatastoreType: to.Ptr(armdataprotection.StorageSettingStoreTypesVaultStore), - }}, - }, - }, - &armdataprotection.BackupVaultsClientBeginCreateOrUpdateOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/VaultCRUD/DeleteBackupVault.json -func ExampleBackupVaultsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewBackupVaultsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/VaultCRUD/PatchBackupVault.json -func ExampleBackupVaultsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewBackupVaultsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "", - "", - armdataprotection.PatchResourceRequestInput{ - Properties: &armdataprotection.PatchBackupVaultInput{ - MonitoringSettings: &armdataprotection.MonitoringSettings{ - AzureMonitorAlertSettings: &armdataprotection.AzureMonitorAlertSettings{ - AlertsForAllJobFailures: to.Ptr(armdataprotection.AlertsStateEnabled), - }, - }, - }, - Tags: map[string]*string{ - "newKey": to.Ptr("newVal"), - }, - }, - &armdataprotection.BackupVaultsClientBeginUpdateOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/VaultCRUD/CheckBackupVaultsNameAvailability.json -func ExampleBackupVaultsClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewBackupVaultsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CheckNameAvailability(ctx, - "", - "", - armdataprotection.CheckNameAvailabilityRequest{ - Name: to.Ptr(""), - Type: to.Ptr(""), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_dataprotection_client_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_dataprotection_client_test.go deleted file mode 100644 index a517463b12d9..000000000000 --- a/sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_dataprotection_client_test.go +++ /dev/null @@ -1,43 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataprotection_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/CheckfeatureSupport.json -func ExampleClient_CheckFeatureSupport() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CheckFeatureSupport(ctx, - "", - &armdataprotection.FeatureValidationRequest{ - ObjectType: to.Ptr(""), - FeatureType: to.Ptr(armdataprotection.FeatureTypeDataSourceType), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_dataprotectionoperations_client_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_dataprotectionoperations_client_test.go deleted file mode 100644 index 119483066473..000000000000 --- a/sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_dataprotectionoperations_client_test.go +++ /dev/null @@ -1,42 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataprotection_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/Operations/List.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewOperationsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_exportjobs_client_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_exportjobs_client_test.go deleted file mode 100644 index 863a2659dd46..000000000000 --- a/sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_exportjobs_client_test.go +++ /dev/null @@ -1,43 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataprotection_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/JobCRUD/TriggerExportJobs.json -func ExampleExportJobsClient_BeginTrigger() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewExportJobsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginTrigger(ctx, - "", - "", - &armdataprotection.ExportJobsClientBeginTriggerOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_exportjobsoperationresult_client_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_exportjobsoperationresult_client_test.go deleted file mode 100644 index 27d4337f582c..000000000000 --- a/sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_exportjobsoperationresult_client_test.go +++ /dev/null @@ -1,40 +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 armdataprotection_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/JobCRUD/GetExportJobsOperationResult.json -func ExampleExportJobsOperationResultClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewExportJobsOperationResultClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_jobs_client_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_jobs_client_test.go deleted file mode 100644 index 6f2f6876e276..000000000000 --- a/sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_jobs_client_test.go +++ /dev/null @@ -1,67 +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 armdataprotection_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/JobCRUD/ListJobs.json -func ExampleJobsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewJobsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("", - "", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/JobCRUD/GetJob.json -func ExampleJobsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewJobsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_operationresult_client_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_operationresult_client_test.go deleted file mode 100644 index c35d16ed22ad..000000000000 --- a/sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_operationresult_client_test.go +++ /dev/null @@ -1,39 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataprotection_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/GetOperationResult.json -func ExampleOperationResultClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewOperationResultClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_operationstatus_client_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_operationstatus_client_test.go deleted file mode 100644 index 1ad306a55fa2..000000000000 --- a/sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_operationstatus_client_test.go +++ /dev/null @@ -1,39 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataprotection_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/GetOperationStatus.json -func ExampleOperationStatusClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewOperationStatusClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_operationstatusbackupvaultcontext_client_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_operationstatusbackupvaultcontext_client_test.go deleted file mode 100644 index cd9bccd9f04b..000000000000 --- a/sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_operationstatusbackupvaultcontext_client_test.go +++ /dev/null @@ -1,40 +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 armdataprotection_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/GetOperationStatusVaultContext.json -func ExampleOperationStatusBackupVaultContextClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewOperationStatusBackupVaultContextClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_operationstatusresourcegroupcontext_client_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_operationstatusresourcegroupcontext_client_test.go deleted file mode 100644 index e4465b3b6823..000000000000 --- a/sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_operationstatusresourcegroupcontext_client_test.go +++ /dev/null @@ -1,39 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataprotection_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/GetOperationStatusRGContext.json -func ExampleOperationStatusResourceGroupContextClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewOperationStatusResourceGroupContextClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_recoverypoints_client_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_recoverypoints_client_test.go deleted file mode 100644 index 2b2f1c4d09e5..000000000000 --- a/sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_recoverypoints_client_test.go +++ /dev/null @@ -1,71 +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 armdataprotection_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/BackupInstanceOperations/ListRecoveryPoints.json -func ExampleRecoveryPointsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewRecoveryPointsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("", - "", - "", - &armdataprotection.RecoveryPointsClientListOptions{Filter: nil, - SkipToken: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/BackupInstanceOperations/GetRecoveryPoint.json -func ExampleRecoveryPointsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewRecoveryPointsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "", - "", - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_resourceguards_client_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_resourceguards_client_test.go deleted file mode 100644 index 6011f8a7f779..000000000000 --- a/sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_resourceguards_client_test.go +++ /dev/null @@ -1,466 +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 armdataprotection_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/ResourceGuardCRUD/GetResourceGuardsInSubscription.json -func ExampleResourceGuardsClient_NewGetResourcesInSubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewResourceGuardsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewGetResourcesInSubscriptionPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/ResourceGuardCRUD/GetResourceGuardsInResourceGroup.json -func ExampleResourceGuardsClient_NewGetResourcesInResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewResourceGuardsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewGetResourcesInResourceGroupPager("", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/ResourceGuardCRUD/PutResourceGuard.json -func ExampleResourceGuardsClient_Put() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewResourceGuardsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Put(ctx, - "", - "", - armdataprotection.ResourceGuardResource{ - Location: to.Ptr(""), - Tags: map[string]*string{ - "key1": to.Ptr("val1"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/ResourceGuardCRUD/GetResourceGuard.json -func ExampleResourceGuardsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewResourceGuardsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/ResourceGuardCRUD/DeleteResourceGuard.json -func ExampleResourceGuardsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewResourceGuardsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/ResourceGuardCRUD/PatchResourceGuard.json -func ExampleResourceGuardsClient_Patch() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewResourceGuardsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Patch(ctx, - "", - "", - armdataprotection.PatchResourceRequestInput{ - Tags: map[string]*string{ - "newKey": to.Ptr("newVal"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/ResourceGuardCRUD/ListDisableSoftDeleteRequests.json -func ExampleResourceGuardsClient_NewGetDisableSoftDeleteRequestsObjectsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewResourceGuardsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewGetDisableSoftDeleteRequestsObjectsPager("", - "", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/ResourceGuardCRUD/ListDeleteResourceGuardProxyRequests.json -func ExampleResourceGuardsClient_NewGetDeleteResourceGuardProxyRequestsObjectsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewResourceGuardsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewGetDeleteResourceGuardProxyRequestsObjectsPager("", - "", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/ResourceGuardCRUD/ListBackupSecurityPINRequests.json -func ExampleResourceGuardsClient_NewGetBackupSecurityPINRequestsObjectsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewResourceGuardsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewGetBackupSecurityPINRequestsObjectsPager("", - "", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/ResourceGuardCRUD/ListDeleteProtectedItemRequests.json -func ExampleResourceGuardsClient_NewGetDeleteProtectedItemRequestsObjectsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewResourceGuardsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewGetDeleteProtectedItemRequestsObjectsPager("", - "", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/ResourceGuardCRUD/ListUpdateProtectionPolicyRequests.json -func ExampleResourceGuardsClient_NewGetUpdateProtectionPolicyRequestsObjectsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewResourceGuardsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewGetUpdateProtectionPolicyRequestsObjectsPager("", - "", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/ResourceGuardCRUD/ListUpdateProtectedItemRequests.json -func ExampleResourceGuardsClient_NewGetUpdateProtectedItemRequestsObjectsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewResourceGuardsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewGetUpdateProtectedItemRequestsObjectsPager("", - "", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/ResourceGuardCRUD/GetDefaultDisableSoftDeleteRequests.json -func ExampleResourceGuardsClient_GetDefaultDisableSoftDeleteRequestsObject() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewResourceGuardsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetDefaultDisableSoftDeleteRequestsObject(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/ResourceGuardCRUD/GetDefaultDeleteResourceGuardProxyRequests.json -func ExampleResourceGuardsClient_GetDefaultDeleteResourceGuardProxyRequestsObject() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewResourceGuardsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetDefaultDeleteResourceGuardProxyRequestsObject(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/ResourceGuardCRUD/GetDefaultBackupSecurityPINRequests.json -func ExampleResourceGuardsClient_GetDefaultBackupSecurityPINRequestsObject() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewResourceGuardsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetDefaultBackupSecurityPINRequestsObject(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/ResourceGuardCRUD/GetDefaultDeleteProtectedItemRequests.json -func ExampleResourceGuardsClient_GetDefaultDeleteProtectedItemRequestsObject() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewResourceGuardsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetDefaultDeleteProtectedItemRequestsObject(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/ResourceGuardCRUD/GetDefaultUpdateProtectionPolicyRequests.json -func ExampleResourceGuardsClient_GetDefaultUpdateProtectionPolicyRequestsObject() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewResourceGuardsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetDefaultUpdateProtectionPolicyRequestsObject(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/ResourceGuardCRUD/GetDefaultUpdateProtectedItemRequests.json -func ExampleResourceGuardsClient_GetDefaultUpdateProtectedItemRequestsObject() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewResourceGuardsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetDefaultUpdateProtectedItemRequestsObject(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_restorabletimeranges_client_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_restorabletimeranges_client_test.go deleted file mode 100644 index 1e52851690c1..000000000000 --- a/sdk/resourcemanager/dataprotection/armdataprotection/ze_generated_example_restorabletimeranges_client_test.go +++ /dev/null @@ -1,46 +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 armdataprotection_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/preview/2022-02-01-preview/examples/BackupInstanceOperations/FindRestorableTimeRanges.json -func ExampleRestorableTimeRangesClient_Find() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewRestorableTimeRangesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Find(ctx, - "", - "", - "", - armdataprotection.AzureBackupFindRestorableTimeRangesRequest{ - EndTime: to.Ptr(""), - SourceDataStoreType: to.Ptr(armdataprotection.RestoreSourceDataStoreTypeOperationalStore), - StartTime: to.Ptr(""), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_backupinstances_client.go b/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_backupinstances_client.go index bf70dfe1ab55..c62370e35c12 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_backupinstances_client.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_backupinstances_client.go @@ -115,7 +115,7 @@ func (client *BackupInstancesClient) adhocBackupCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, parameters) @@ -182,7 +182,7 @@ func (client *BackupInstancesClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, parameters) @@ -248,7 +248,7 @@ func (client *BackupInstancesClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -299,7 +299,7 @@ func (client *BackupInstancesClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -363,7 +363,7 @@ func (client *BackupInstancesClient) getBackupInstanceOperationResultCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -431,7 +431,7 @@ func (client *BackupInstancesClient) listCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -505,7 +505,7 @@ func (client *BackupInstancesClient) resumeBackupsCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -570,7 +570,7 @@ func (client *BackupInstancesClient) resumeProtectionCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -635,7 +635,7 @@ func (client *BackupInstancesClient) stopProtectionCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -700,7 +700,7 @@ func (client *BackupInstancesClient) suspendBackupsCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -768,7 +768,7 @@ func (client *BackupInstancesClient) syncBackupInstanceCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, parameters) @@ -834,7 +834,7 @@ func (client *BackupInstancesClient) triggerRehydrateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, parameters) @@ -901,7 +901,7 @@ func (client *BackupInstancesClient) triggerRestoreCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, parameters) @@ -963,7 +963,7 @@ func (client *BackupInstancesClient) validateForBackupCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, parameters) @@ -1030,7 +1030,7 @@ func (client *BackupInstancesClient) validateForRestoreCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_backupinstancesextensionrouting_client.go b/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_backupinstancesextensionrouting_client.go new file mode 100644 index 000000000000..9cf28aa071d4 --- /dev/null +++ b/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_backupinstancesextensionrouting_client.go @@ -0,0 +1,112 @@ +//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 armdataprotection + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// BackupInstancesExtensionRoutingClient contains the methods for the BackupInstancesExtensionRouting group. +// Don't use this type directly, use NewBackupInstancesExtensionRoutingClient() instead. +type BackupInstancesExtensionRoutingClient struct { + host string + pl runtime.Pipeline +} + +// NewBackupInstancesExtensionRoutingClient creates a new instance of BackupInstancesExtensionRoutingClient with the specified values. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewBackupInstancesExtensionRoutingClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*BackupInstancesExtensionRoutingClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &BackupInstancesExtensionRoutingClient{ + host: ep, + pl: pl, + } + return client, nil +} + +// NewListPager - Gets a list backup instances associated with a tracked resource +// If the operation fails it returns an *azcore.ResponseError type. +// resourceID - ARM path of the resource to be protected using Microsoft.DataProtection +// options - BackupInstancesExtensionRoutingClientListOptions contains the optional parameters for the BackupInstancesExtensionRoutingClient.List +// method. +func (client *BackupInstancesExtensionRoutingClient) NewListPager(resourceID string, options *BackupInstancesExtensionRoutingClientListOptions) *runtime.Pager[BackupInstancesExtensionRoutingClientListResponse] { + return runtime.NewPager(runtime.PageProcessor[BackupInstancesExtensionRoutingClientListResponse]{ + More: func(page BackupInstancesExtensionRoutingClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *BackupInstancesExtensionRoutingClientListResponse) (BackupInstancesExtensionRoutingClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceID, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return BackupInstancesExtensionRoutingClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return BackupInstancesExtensionRoutingClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return BackupInstancesExtensionRoutingClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *BackupInstancesExtensionRoutingClient) listCreateRequest(ctx context.Context, resourceID string, options *BackupInstancesExtensionRoutingClientListOptions) (*policy.Request, error) { + urlPath := "/{resourceId}/providers/Microsoft.DataProtection/backupInstances" + if resourceID == "" { + return nil, errors.New("parameter resourceID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceId}", url.PathEscape(resourceID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-31-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listHandleResponse handles the List response. +func (client *BackupInstancesExtensionRoutingClient) listHandleResponse(resp *http.Response) (BackupInstancesExtensionRoutingClientListResponse, error) { + result := BackupInstancesExtensionRoutingClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.BackupInstanceResourceList); err != nil { + return BackupInstancesExtensionRoutingClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_backuppolicies_client.go b/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_backuppolicies_client.go index e80f16b1d9c4..2814e37ae343 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_backuppolicies_client.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_backuppolicies_client.go @@ -101,7 +101,7 @@ func (client *BackupPoliciesClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, parameters) @@ -160,7 +160,7 @@ func (client *BackupPoliciesClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -210,7 +210,7 @@ func (client *BackupPoliciesClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -278,7 +278,7 @@ func (client *BackupPoliciesClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_backupvaultoperationresults_client.go b/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_backupvaultoperationresults_client.go index 25c3fbad797c..6db56f5a8145 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_backupvaultoperationresults_client.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_backupvaultoperationresults_client.go @@ -100,7 +100,7 @@ func (client *BackupVaultOperationResultsClient) getCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_backupvaults_client.go b/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_backupvaults_client.go index 55950ccb1588..e9b5d721863b 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_backupvaults_client.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_backupvaults_client.go @@ -96,7 +96,7 @@ func (client *BackupVaultsClient) checkNameAvailabilityCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, parameters) @@ -167,7 +167,7 @@ func (client *BackupVaultsClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, parameters) @@ -213,7 +213,7 @@ func (client *BackupVaultsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -259,7 +259,7 @@ func (client *BackupVaultsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -323,7 +323,7 @@ func (client *BackupVaultsClient) getInResourceGroupCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -382,7 +382,7 @@ func (client *BackupVaultsClient) getInSubscriptionCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -453,7 +453,7 @@ func (client *BackupVaultsClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_client.go b/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_client.go index 6260cb9bebd8..0b29d073b2a6 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_client.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_client.go @@ -89,7 +89,7 @@ func (client *Client) checkFeatureSupportCreateRequest(ctx context.Context, loca return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_constants.go b/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_constants.go index f50a0f656b69..6965863cba67 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_constants.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_constants.go @@ -10,7 +10,7 @@ package armdataprotection const ( moduleName = "armdataprotection" - moduleVersion = "v0.4.0" + moduleVersion = "v0.5.0" ) type AbsoluteMarker string @@ -49,6 +49,21 @@ func PossibleAlertsStateValues() []AlertsState { } } +type AutoHealStatus string + +const ( + AutoHealStatusOff AutoHealStatus = "Off" + AutoHealStatusOn AutoHealStatus = "On" +) + +// PossibleAutoHealStatusValues returns the possible values for the AutoHealStatus const type. +func PossibleAutoHealStatusValues() []AutoHealStatus { + return []AutoHealStatus{ + AutoHealStatusOff, + AutoHealStatusOn, + } +} + // CreatedByType - The type of identity that created the resource. type CreatedByType string diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_exportjobs_client.go b/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_exportjobs_client.go index 582afcd96661..d48aec139b5a 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_exportjobs_client.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_exportjobs_client.go @@ -110,7 +110,7 @@ func (client *ExportJobsClient) triggerCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_exportjobsoperationresult_client.go b/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_exportjobsoperationresult_client.go index 445c3e9faf7c..0e27fe1e4bac 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_exportjobsoperationresult_client.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_exportjobsoperationresult_client.go @@ -102,7 +102,7 @@ func (client *ExportJobsOperationResultClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_jobs_client.go b/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_jobs_client.go index 4380fb15b556..c643ab060ed2 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_jobs_client.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_jobs_client.go @@ -99,7 +99,7 @@ func (client *JobsClient) getCreateRequest(ctx context.Context, resourceGroupNam return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -167,7 +167,7 @@ func (client *JobsClient) listCreateRequest(ctx context.Context, resourceGroupNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_models.go b/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_models.go index 2cec59a54a9b..a07774384b5c 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_models.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_models.go @@ -63,6 +63,10 @@ type AuthCredentials struct { ObjectType *string `json:"objectType,omitempty"` } +type AutoHealSettings struct { + AutoHealStatus *AutoHealStatus `json:"autoHealStatus,omitempty"` +} + // AzureBackupDiscreteRecoveryPoint - Azure backup discrete RecoveryPoint type AzureBackupDiscreteRecoveryPoint struct { // REQUIRED @@ -632,6 +636,12 @@ type BackupInstancesClientListOptions struct { // placeholder for future optional parameters } +// BackupInstancesExtensionRoutingClientListOptions contains the optional parameters for the BackupInstancesExtensionRoutingClient.List +// method. +type BackupInstancesExtensionRoutingClientListOptions struct { + // placeholder for future optional parameters +} + // BackupParametersClassification provides polymorphic access to related types. // Call the interface's GetBackupParameters() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: @@ -1317,7 +1327,7 @@ type InnerError struct { // ItemLevelRestoreCriteriaClassification provides polymorphic access to related types. // Call the interface's GetItemLevelRestoreCriteria() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: -// - *ItemLevelRestoreCriteria, *RangeBasedItemLevelRestoreCriteria +// - *ItemLevelRestoreCriteria, *KubernetesPVRestoreCriteria, *KubernetesStorageClassRestoreCriteria, *RangeBasedItemLevelRestoreCriteria type ItemLevelRestoreCriteriaClassification interface { // GetItemLevelRestoreCriteria returns the ItemLevelRestoreCriteria content of the underlying type. GetItemLevelRestoreCriteria() *ItemLevelRestoreCriteria @@ -1405,6 +1415,30 @@ type JobsClientListOptions struct { // placeholder for future optional parameters } +// KubernetesPVRestoreCriteria - Item Level kubernetes persistent volume target info for restore operation +type KubernetesPVRestoreCriteria struct { + // REQUIRED; Type of the specific object - used for deserializing + ObjectType *string `json:"objectType,omitempty"` + + // Selected persistent volume claim name + Name *string `json:"name,omitempty"` + + // Selected storage class name for restore operation + StorageClassName *string `json:"storageClassName,omitempty"` +} + +// KubernetesStorageClassRestoreCriteria - Item Level kubernetes storage class target info for restore operation +type KubernetesStorageClassRestoreCriteria struct { + // REQUIRED; Type of the specific object - used for deserializing + ObjectType *string `json:"objectType,omitempty"` + + // Provisioner of the storage class + Provisioner *string `json:"provisioner,omitempty"` + + // Selected storage class name + SelectedStorageClassName *string `json:"selectedStorageClassName,omitempty"` +} + // MonitoringSettings - Monitoring Settings type MonitoringSettings struct { // Settings for Azure Monitor based alerts diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_models_serde.go b/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_models_serde.go index 1e2e90543e4e..19855607daa5 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_models_serde.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_models_serde.go @@ -1397,6 +1397,90 @@ func (j JobSubTask) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// GetItemLevelRestoreCriteria implements the ItemLevelRestoreCriteriaClassification interface for type KubernetesPVRestoreCriteria. +func (k *KubernetesPVRestoreCriteria) GetItemLevelRestoreCriteria() *ItemLevelRestoreCriteria { + return &ItemLevelRestoreCriteria{ + ObjectType: k.ObjectType, + } +} + +// MarshalJSON implements the json.Marshaller interface for type KubernetesPVRestoreCriteria. +func (k KubernetesPVRestoreCriteria) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", k.Name) + objectMap["objectType"] = "KubernetesPVRestoreCriteria" + populate(objectMap, "storageClassName", k.StorageClassName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KubernetesPVRestoreCriteria. +func (k *KubernetesPVRestoreCriteria) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, &k.Name) + delete(rawMsg, key) + case "objectType": + err = unpopulate(val, &k.ObjectType) + delete(rawMsg, key) + case "storageClassName": + err = unpopulate(val, &k.StorageClassName) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetItemLevelRestoreCriteria implements the ItemLevelRestoreCriteriaClassification interface for type KubernetesStorageClassRestoreCriteria. +func (k *KubernetesStorageClassRestoreCriteria) GetItemLevelRestoreCriteria() *ItemLevelRestoreCriteria { + return &ItemLevelRestoreCriteria{ + ObjectType: k.ObjectType, + } +} + +// MarshalJSON implements the json.Marshaller interface for type KubernetesStorageClassRestoreCriteria. +func (k KubernetesStorageClassRestoreCriteria) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["objectType"] = "KubernetesStorageClassRestoreCriteria" + populate(objectMap, "provisioner", k.Provisioner) + populate(objectMap, "selectedStorageClassName", k.SelectedStorageClassName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KubernetesStorageClassRestoreCriteria. +func (k *KubernetesStorageClassRestoreCriteria) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "objectType": + err = unpopulate(val, &k.ObjectType) + delete(rawMsg, key) + case "provisioner": + err = unpopulate(val, &k.Provisioner) + delete(rawMsg, key) + case "selectedStorageClassName": + err = unpopulate(val, &k.SelectedStorageClassName) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + // GetOperationExtendedInfo implements the OperationExtendedInfoClassification interface for type OperationExtendedInfo. func (o *OperationExtendedInfo) GetOperationExtendedInfo() *OperationExtendedInfo { return o } diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_operationresult_client.go b/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_operationresult_client.go index 0b8c0cc222e8..603d2729a82c 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_operationresult_client.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_operationresult_client.go @@ -93,7 +93,7 @@ func (client *OperationResultClient) getCreateRequest(ctx context.Context, opera return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_operations_client.go b/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_operations_client.go index 089e9be01f57..a89b24be7f09 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_operations_client.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_operations_client.go @@ -87,7 +87,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_operationstatus_client.go b/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_operationstatus_client.go index fef39b62875c..dd88e30d76cc 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_operationstatus_client.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_operationstatus_client.go @@ -92,7 +92,7 @@ func (client *OperationStatusClient) getCreateRequest(ctx context.Context, locat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_operationstatusbackupvaultcontext_client.go b/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_operationstatusbackupvaultcontext_client.go index 55cf3c95ead8..bc0b92d0ad8d 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_operationstatusbackupvaultcontext_client.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_operationstatusbackupvaultcontext_client.go @@ -99,7 +99,7 @@ func (client *OperationStatusBackupVaultContextClient) getCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_operationstatusresourcegroupcontext_client.go b/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_operationstatusresourcegroupcontext_client.go index fbb429b713a4..683afc6e4a3b 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_operationstatusresourcegroupcontext_client.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_operationstatusresourcegroupcontext_client.go @@ -94,7 +94,7 @@ func (client *OperationStatusResourceGroupContextClient) getCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_polymorphic_helpers.go b/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_polymorphic_helpers.go index adce0b8fc4dc..d1bce9802899 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_polymorphic_helpers.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_polymorphic_helpers.go @@ -285,6 +285,10 @@ func unmarshalItemLevelRestoreCriteriaClassification(rawMsg json.RawMessage) (It } var b ItemLevelRestoreCriteriaClassification switch m["objectType"] { + case "KubernetesPVRestoreCriteria": + b = &KubernetesPVRestoreCriteria{} + case "KubernetesStorageClassRestoreCriteria": + b = &KubernetesStorageClassRestoreCriteria{} case "RangeBasedItemLevelRestoreCriteria": b = &RangeBasedItemLevelRestoreCriteria{} default: diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_recoverypoints_client.go b/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_recoverypoints_client.go index 42e6560ae6f3..e40a1d5d3df4 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_recoverypoints_client.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_recoverypoints_client.go @@ -103,7 +103,7 @@ func (client *RecoveryPointsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -176,7 +176,7 @@ func (client *RecoveryPointsClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_resourceguards_client.go b/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_resourceguards_client.go index 5baf49255724..832014ffc736 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_resourceguards_client.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_resourceguards_client.go @@ -94,7 +94,7 @@ func (client *ResourceGuardsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -140,7 +140,7 @@ func (client *ResourceGuardsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -209,7 +209,7 @@ func (client *ResourceGuardsClient) getBackupSecurityPINRequestsObjectsCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -269,7 +269,7 @@ func (client *ResourceGuardsClient) getDefaultBackupSecurityPINRequestsObjectCre return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -329,7 +329,7 @@ func (client *ResourceGuardsClient) getDefaultDeleteProtectedItemRequestsObjectC return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -389,7 +389,7 @@ func (client *ResourceGuardsClient) getDefaultDeleteResourceGuardProxyRequestsOb return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -449,7 +449,7 @@ func (client *ResourceGuardsClient) getDefaultDisableSoftDeleteRequestsObjectCre return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -509,7 +509,7 @@ func (client *ResourceGuardsClient) getDefaultUpdateProtectedItemRequestsObjectC return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -569,7 +569,7 @@ func (client *ResourceGuardsClient) getDefaultUpdateProtectionPolicyRequestsObje return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -638,7 +638,7 @@ func (client *ResourceGuardsClient) getDeleteProtectedItemRequestsObjectsCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -707,7 +707,7 @@ func (client *ResourceGuardsClient) getDeleteResourceGuardProxyRequestsObjectsCr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -776,7 +776,7 @@ func (client *ResourceGuardsClient) getDisableSoftDeleteRequestsObjectsCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -840,7 +840,7 @@ func (client *ResourceGuardsClient) getResourcesInResourceGroupCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -899,7 +899,7 @@ func (client *ResourceGuardsClient) getResourcesInSubscriptionCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -968,7 +968,7 @@ func (client *ResourceGuardsClient) getUpdateProtectedItemRequestsObjectsCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -1037,7 +1037,7 @@ func (client *ResourceGuardsClient) getUpdateProtectionPolicyRequestsObjectsCrea return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -1093,7 +1093,7 @@ func (client *ResourceGuardsClient) patchCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, parameters) @@ -1149,7 +1149,7 @@ func (client *ResourceGuardsClient) putCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_response_types.go b/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_response_types.go index 0f419420f600..324c093f81d8 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_response_types.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_response_types.go @@ -83,6 +83,11 @@ type BackupInstancesClientValidateForRestoreResponse struct { OperationJobExtendedInfo } +// BackupInstancesExtensionRoutingClientListResponse contains the response from method BackupInstancesExtensionRoutingClient.List. +type BackupInstancesExtensionRoutingClientListResponse struct { + BackupInstanceResourceList +} + // BackupPoliciesClientCreateOrUpdateResponse contains the response from method BackupPoliciesClient.CreateOrUpdate. type BackupPoliciesClientCreateOrUpdateResponse struct { BaseBackupPolicyResource diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_restorabletimeranges_client.go b/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_restorabletimeranges_client.go index 315e31b1c732..b9120056d4b1 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_restorabletimeranges_client.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/zz_generated_restorabletimeranges_client.go @@ -101,7 +101,7 @@ func (client *RestorableTimeRangesClient) findCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2022-03-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, parameters)