diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/CHANGELOG.md b/sdk/resourcemanager/dataprotection/armdataprotection/CHANGELOG.md index e07ff5dd8d55..4f6d364ba223 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/CHANGELOG.md +++ b/sdk/resourcemanager/dataprotection/armdataprotection/CHANGELOG.md @@ -1,5 +1,23 @@ # Release History +## 2.1.0 (2023-02-24) +### Features Added + +- New function `NewDppResourceGuardProxyClient(string, azcore.TokenCredential, *arm.ClientOptions) (*DppResourceGuardProxyClient, error)` +- New function `*DppResourceGuardProxyClient.CreateOrUpdate(context.Context, string, string, string, ResourceGuardProxyBaseResource, *DppResourceGuardProxyClientCreateOrUpdateOptions) (DppResourceGuardProxyClientCreateOrUpdateResponse, error)` +- New function `*DppResourceGuardProxyClient.Delete(context.Context, string, string, string, *DppResourceGuardProxyClientDeleteOptions) (DppResourceGuardProxyClientDeleteResponse, error)` +- New function `*DppResourceGuardProxyClient.Get(context.Context, string, string, string, *DppResourceGuardProxyClientGetOptions) (DppResourceGuardProxyClientGetResponse, error)` +- New function `*DppResourceGuardProxyClient.NewListPager(string, string, *DppResourceGuardProxyClientListOptions) *runtime.Pager[DppResourceGuardProxyClientListResponse]` +- New function `*DppResourceGuardProxyClient.UnlockDelete(context.Context, string, string, string, UnlockDeleteRequest, *DppResourceGuardProxyClientUnlockDeleteOptions) (DppResourceGuardProxyClientUnlockDeleteResponse, error)` +- New struct `DppResourceGuardProxyClient` +- New struct `ResourceGuardOperationDetail` +- New struct `ResourceGuardProxyBase` +- New struct `ResourceGuardProxyBaseResource` +- New struct `ResourceGuardProxyBaseResourceList` +- New struct `UnlockDeleteRequest` +- New struct `UnlockDeleteResponse` + + ## 2.0.0 (2023-02-24) ### Breaking Changes diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/autorest.md b/sdk/resourcemanager/dataprotection/armdataprotection/autorest.md index 8655eee76069..ef921f501db0 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/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/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: 2.0.0 +module-version: 2.1.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/backupinstances_client_example_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/backupinstances_client_example_test.go deleted file mode 100644 index 14c40273c4ff..000000000000 --- a/sdk/resourcemanager/dataprotection/armdataprotection/backupinstances_client_example_test.go +++ /dev/null @@ -1,791 +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. -// DO NOT EDIT. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("04cf684a-d41f-4550-9f70-7708a3a2283b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("000pikumar", "PratikPrivatePreviewVault1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.BackupInstanceResourceList = armdataprotection.BackupInstanceResourceList{ - // Value: []*armdataprotection.BackupInstanceResource{ - // { - // Name: to.Ptr("harshitbi2"), - // Type: to.Ptr("Microsoft.DataProtection/backupVaults/backupInstances"), - // ID: to.Ptr("/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/000pikumar/providers/Microsoft.DataProtection/backupVaults/PratikPrivatePreviewVault1/backupInstances/harshitbi2"), - // Tags: map[string]*string{ - // "key1": to.Ptr("val1"), - // }, - // Properties: &armdataprotection.BackupInstance{ - // DataSourceInfo: &armdataprotection.Datasource{ - // DatasourceType: to.Ptr("OssDB"), - // ObjectType: to.Ptr("Datasource"), - // ResourceID: to.Ptr("/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest/databases/testdb"), - // ResourceLocation: to.Ptr(""), - // ResourceName: to.Ptr("testdb"), - // ResourceType: to.Ptr("OssDB"), - // ResourceURI: to.Ptr(""), - // }, - // DataSourceSetInfo: &armdataprotection.DatasourceSet{ - // DatasourceType: to.Ptr("OssDB"), - // ObjectType: to.Ptr("DatasourceSet"), - // ResourceID: to.Ptr("/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest"), - // ResourceLocation: to.Ptr(""), - // ResourceName: to.Ptr("viveksipgtest"), - // ResourceType: to.Ptr("OssDB"), - // ResourceURI: to.Ptr(""), - // }, - // FriendlyName: to.Ptr("harshitbi2"), - // ObjectType: to.Ptr("BackupInstance"), - // PolicyInfo: &armdataprotection.PolicyInfo{ - // PolicyID: to.Ptr("/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/000pikumar/providers/Microsoft.DataProtection/backupVaults/PratikPrivatePreviewVault1/backupPolicies/PratikPolicy1"), - // PolicyVersion: to.Ptr("3.2"), - // }, - // ProtectionStatus: &armdataprotection.ProtectionStatusDetails{ - // Status: to.Ptr(armdataprotection.Status("NotProtected")), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("04cf684a-d41f-4550-9f70-7708a3a2283b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "000pikumar", "PratikPrivatePreviewVault1", "testInstance1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BackupInstanceResource = armdataprotection.BackupInstanceResource{ - // Name: to.Ptr("harshitbi2"), - // Type: to.Ptr("Microsoft.DataProtection/backupVaults/backupInstances"), - // ID: to.Ptr("/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/000pikumar/providers/Microsoft.DataProtection/backupVaults/PratikPrivatePreviewVault1/backupInstances/harshitbi2"), - // Tags: map[string]*string{ - // "key1": to.Ptr("val1"), - // }, - // Properties: &armdataprotection.BackupInstance{ - // DataSourceInfo: &armdataprotection.Datasource{ - // DatasourceType: to.Ptr("OssDB"), - // ObjectType: to.Ptr("Datasource"), - // ResourceID: to.Ptr("/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest/databases/testdb"), - // ResourceLocation: to.Ptr(""), - // ResourceName: to.Ptr("testdb"), - // ResourceType: to.Ptr("OssDB"), - // ResourceURI: to.Ptr(""), - // }, - // DataSourceSetInfo: &armdataprotection.DatasourceSet{ - // DatasourceType: to.Ptr("OssDB"), - // ObjectType: to.Ptr("DatasourceSet"), - // ResourceID: to.Ptr("/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest"), - // ResourceLocation: to.Ptr(""), - // ResourceName: to.Ptr("viveksipgtest"), - // ResourceType: to.Ptr("OssDB"), - // ResourceURI: to.Ptr(""), - // }, - // FriendlyName: to.Ptr("harshitbi2"), - // ObjectType: to.Ptr("BackupInstance"), - // PolicyInfo: &armdataprotection.PolicyInfo{ - // PolicyID: to.Ptr("/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/000pikumar/providers/Microsoft.DataProtection/backupVaults/PratikPrivatePreviewVault1/backupPolicies/PratikPolicy1"), - // PolicyVersion: to.Ptr("3.2"), - // }, - // ProtectionStatus: &armdataprotection.ProtectionStatusDetails{ - // Status: to.Ptr(armdataprotection.Status("NotProtected")), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("04cf684a-d41f-4550-9f70-7708a3a2283b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, "000pikumar", "PratikPrivatePreviewVault1", "testInstance1", armdataprotection.BackupInstanceResource{ - Tags: map[string]*string{ - "key1": to.Ptr("val1"), - }, - Properties: &armdataprotection.BackupInstance{ - DataSourceInfo: &armdataprotection.Datasource{ - DatasourceType: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"), - ObjectType: to.Ptr("Datasource"), - ResourceID: to.Ptr("/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest/databases/testdb"), - ResourceLocation: to.Ptr(""), - ResourceName: to.Ptr("testdb"), - ResourceType: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"), - ResourceURI: to.Ptr(""), - }, - DataSourceSetInfo: &armdataprotection.DatasourceSet{ - DatasourceType: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"), - ObjectType: to.Ptr("DatasourceSet"), - ResourceID: to.Ptr("/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest"), - ResourceLocation: to.Ptr(""), - ResourceName: to.Ptr("viveksipgtest"), - ResourceType: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - ResourceURI: to.Ptr(""), - }, - DatasourceAuthCredentials: &armdataprotection.SecretStoreBasedAuthCredentials{ - ObjectType: to.Ptr("SecretStoreBasedAuthCredentials"), - SecretStoreResource: &armdataprotection.SecretStoreResource{ - SecretStoreType: to.Ptr(armdataprotection.SecretStoreTypeAzureKeyVault), - URI: to.Ptr("https://samplevault.vault.azure.net/secrets/credentials"), - }, - }, - FriendlyName: to.Ptr("harshitbi2"), - ObjectType: to.Ptr("BackupInstance"), - PolicyInfo: &armdataprotection.PolicyInfo{ - PolicyID: to.Ptr("/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/000pikumar/providers/Microsoft.DataProtection/Backupvaults/PratikPrivatePreviewVault1/backupPolicies/PratikPolicy1"), - PolicyParameters: &armdataprotection.PolicyParameters{ - DataStoreParametersList: []armdataprotection.DataStoreParametersClassification{ - &armdataprotection.AzureOperationalStoreParameters{ - DataStoreType: to.Ptr(armdataprotection.DataStoreTypesOperationalStore), - ObjectType: to.Ptr("AzureOperationalStoreParameters"), - ResourceGroupID: to.Ptr("/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest"), - }}, - }, - }, - ValidationType: to.Ptr(armdataprotection.ValidationTypeShallowValidation), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BackupInstanceResource = armdataprotection.BackupInstanceResource{ - // Name: to.Ptr("harshitbi2"), - // Type: to.Ptr("Microsoft.DataProtection/backupVaults/backupInstances"), - // ID: to.Ptr("/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/000pikumar/providers/Microsoft.DataProtection/backupVaults/PratikPrivatePreviewVault1/backupInstances/harshitbi2"), - // Tags: map[string]*string{ - // "key1": to.Ptr("val1"), - // }, - // Properties: &armdataprotection.BackupInstance{ - // DataSourceInfo: &armdataprotection.Datasource{ - // DatasourceType: to.Ptr("OssDB"), - // ObjectType: to.Ptr("Datasource"), - // ResourceID: to.Ptr("/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest/databases/testdb"), - // ResourceLocation: to.Ptr(""), - // ResourceName: to.Ptr("testdb"), - // ResourceType: to.Ptr("OssDB"), - // ResourceURI: to.Ptr(""), - // }, - // DataSourceSetInfo: &armdataprotection.DatasourceSet{ - // DatasourceType: to.Ptr("OssDB"), - // ObjectType: to.Ptr("DatasourceSet"), - // ResourceID: to.Ptr("/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest"), - // ResourceLocation: to.Ptr(""), - // ResourceName: to.Ptr("viveksipgtest"), - // ResourceType: to.Ptr("OssDB"), - // ResourceURI: to.Ptr(""), - // }, - // FriendlyName: to.Ptr("harshitbi2"), - // ObjectType: to.Ptr("BackupInstance"), - // PolicyInfo: &armdataprotection.PolicyInfo{ - // PolicyID: to.Ptr("/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/000pikumar/providers/Microsoft.DataProtection/backupVaults/PratikPrivatePreviewVault1/backupPolicies/PratikPolicy1"), - // PolicyParameters: &armdataprotection.PolicyParameters{ - // DataStoreParametersList: []armdataprotection.DataStoreParametersClassification{ - // &armdataprotection.AzureOperationalStoreParameters{ - // DataStoreType: to.Ptr(armdataprotection.DataStoreTypesOperationalStore), - // ObjectType: to.Ptr("AzureOperationalStoreParameters"), - // ResourceGroupID: to.Ptr("/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest"), - // }}, - // }, - // PolicyVersion: to.Ptr("3.2"), - // }, - // ProtectionStatus: &armdataprotection.ProtectionStatusDetails{ - // Status: to.Ptr(armdataprotection.Status("NotProtected")), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("04cf684a-d41f-4550-9f70-7708a3a2283b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, "000pikumar", "PratikPrivatePreviewVault1", "testInstance1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("04cf684a-d41f-4550-9f70-7708a3a2283b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginAdhocBackup(ctx, "000pikumar", "PratikPrivatePreviewVault1", "testInstance1", armdataprotection.TriggerBackupRequest{ - BackupRuleOptions: &armdataprotection.AdHocBackupRuleOptions{ - RuleName: to.Ptr("BackupWeekly"), - TriggerOption: &armdataprotection.AdhocBackupTriggerOption{ - RetentionTagOverride: to.Ptr("yearly"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperationJobExtendedInfo = armdataprotection.OperationJobExtendedInfo{ - // ObjectType: to.Ptr("OperationJobExtendedInfo"), - // JobID: to.Ptr("c60cb49-63e8-4b21-b9bd-26277b3fdfae"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("04cf684a-d41f-4550-9f70-7708a3a2283b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginValidateForBackup(ctx, "000pikumar", "PratikPrivatePreviewVault1", armdataprotection.ValidateForBackupRequest{ - BackupInstance: &armdataprotection.BackupInstance{ - DataSourceInfo: &armdataprotection.Datasource{ - DatasourceType: to.Ptr("OssDB"), - ObjectType: to.Ptr("Datasource"), - ResourceID: to.Ptr("/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest/databases/testdb"), - ResourceLocation: to.Ptr(""), - ResourceName: to.Ptr("testdb"), - ResourceType: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"), - ResourceURI: to.Ptr(""), - }, - DataSourceSetInfo: &armdataprotection.DatasourceSet{ - DatasourceType: to.Ptr("OssDB"), - ObjectType: to.Ptr("DatasourceSet"), - ResourceID: to.Ptr("/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest"), - ResourceLocation: to.Ptr(""), - ResourceName: to.Ptr("viveksipgtest"), - ResourceType: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - ResourceURI: to.Ptr(""), - }, - DatasourceAuthCredentials: &armdataprotection.SecretStoreBasedAuthCredentials{ - ObjectType: to.Ptr("SecretStoreBasedAuthCredentials"), - SecretStoreResource: &armdataprotection.SecretStoreResource{ - SecretStoreType: to.Ptr(armdataprotection.SecretStoreTypeAzureKeyVault), - URI: to.Ptr("https://samplevault.vault.azure.net/secrets/credentials"), - }, - }, - FriendlyName: to.Ptr("harshitbi2"), - ObjectType: to.Ptr("BackupInstance"), - PolicyInfo: &armdataprotection.PolicyInfo{ - PolicyID: to.Ptr("/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/000pikumar/providers/Microsoft.DataProtection/Backupvaults/PratikPrivatePreviewVault1/backupPolicies/PratikPolicy1"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperationJobExtendedInfo = armdataprotection.OperationJobExtendedInfo{ - // ObjectType: to.Ptr("OperationJobExtendedInfo"), - // JobID: to.Ptr("c60cb49-63e8-4b21-b9bd-26277b3fdfae"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("04cf684a-d41f-4550-9f70-7708a3a2283b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetBackupInstanceOperationResult(ctx, "SampleResourceGroup", "swaggerExample", "testInstance1", "YWUzNDFkMzQtZmM5OS00MmUyLWEzNDMtZGJkMDIxZjlmZjgzOzdmYzBiMzhmLTc2NmItNDM5NS05OWQ1LTVmOGEzNzg4MWQzNA==", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BackupInstanceResource = armdataprotection.BackupInstanceResource{ - // Name: to.Ptr("testInstance1"), - // Type: to.Ptr("Microsoft.DataProtection/backupVaults/backupInstances"), - // ID: to.Ptr("/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/SampleResourceGroup/providers/Microsoft.DataProtection/backupVaults/swaggerExample/backupInstances/testInstance1"), - // Properties: &armdataprotection.BackupInstance{ - // DataSourceInfo: &armdataprotection.Datasource{ - // DatasourceType: to.Ptr("OssDB"), - // ObjectType: to.Ptr("Datasource"), - // ResourceID: to.Ptr("/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest/databases/testdb"), - // ResourceLocation: to.Ptr(""), - // ResourceName: to.Ptr("testdb"), - // ResourceType: to.Ptr("OssDB"), - // ResourceURI: to.Ptr(""), - // }, - // DataSourceSetInfo: &armdataprotection.DatasourceSet{ - // DatasourceType: to.Ptr("OssDB"), - // ObjectType: to.Ptr("DatasourceSet"), - // ResourceID: to.Ptr("/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest"), - // ResourceLocation: to.Ptr(""), - // ResourceName: to.Ptr("viveksipgtest"), - // ResourceType: to.Ptr("OssDB"), - // ResourceURI: to.Ptr(""), - // }, - // FriendlyName: to.Ptr("testInstance1"), - // ObjectType: to.Ptr("BackupInstance"), - // PolicyInfo: &armdataprotection.PolicyInfo{ - // PolicyID: to.Ptr("/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/SampleResourceGroup/providers/Microsoft.DataProtection/backupVaults/swaggerExample/backupPolicies/PratikPolicy1"), - // PolicyVersion: to.Ptr("3.2"), - // }, - // ProtectionStatus: &armdataprotection.ProtectionStatusDetails{ - // Status: to.Ptr(armdataprotection.StatusConfiguringProtection), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("04cf684a-d41f-4550-9f70-7708a3a2283b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginTriggerRehydrate(ctx, "000pikumar", "PratikPrivatePreviewVault1", "testInstance1", armdataprotection.AzureBackupRehydrationRequest{ - RecoveryPointID: to.Ptr("hardcodedRP"), - RehydrationPriority: to.Ptr(armdataprotection.RehydrationPriorityHigh), - RehydrationRetentionDuration: to.Ptr("7D"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/BackupInstanceOperations/TriggerRestore.json -func ExampleBackupInstancesClient_BeginTriggerRestore_triggerRestore() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewBackupInstancesClient("04cf684a-d41f-4550-9f70-7708a3a2283b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginTriggerRestore(ctx, "000pikumar", "PratikPrivatePreviewVault1", "testInstance1", &armdataprotection.AzureBackupRecoveryPointBasedRestoreRequest{ - ObjectType: to.Ptr("AzureBackupRecoveryPointBasedRestoreRequest"), - RestoreTargetInfo: &armdataprotection.RestoreTargetInfo{ - ObjectType: to.Ptr("RestoreTargetInfo"), - RecoveryOption: to.Ptr(armdataprotection.RecoveryOptionFailIfExists), - RestoreLocation: to.Ptr("southeastasia"), - DatasourceAuthCredentials: &armdataprotection.SecretStoreBasedAuthCredentials{ - ObjectType: to.Ptr("SecretStoreBasedAuthCredentials"), - SecretStoreResource: &armdataprotection.SecretStoreResource{ - SecretStoreType: to.Ptr(armdataprotection.SecretStoreTypeAzureKeyVault), - URI: to.Ptr("https://samplevault.vault.azure.net/secrets/credentials"), - }, - }, - DatasourceInfo: &armdataprotection.Datasource{ - DatasourceType: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"), - ObjectType: to.Ptr("Datasource"), - ResourceID: to.Ptr("/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest/databases/targetdb"), - ResourceLocation: to.Ptr(""), - ResourceName: to.Ptr("targetdb"), - ResourceType: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"), - ResourceURI: to.Ptr(""), - }, - DatasourceSetInfo: &armdataprotection.DatasourceSet{ - DatasourceType: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"), - ObjectType: to.Ptr("DatasourceSet"), - ResourceID: to.Ptr("/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest"), - ResourceLocation: to.Ptr(""), - ResourceName: to.Ptr("viveksipgtest"), - ResourceType: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - ResourceURI: to.Ptr(""), - }, - }, - SourceDataStoreType: to.Ptr(armdataprotection.SourceDataStoreTypeVaultStore), - SourceResourceID: to.Ptr("/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest/databases/testdb"), - RecoveryPointID: to.Ptr("hardcodedRP"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperationJobExtendedInfo = armdataprotection.OperationJobExtendedInfo{ - // ObjectType: to.Ptr("OperationJobExtendedInfo"), - // JobID: to.Ptr("c60cb49-63e8-4b21-b9bd-26277b3fdfae"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/BackupInstanceOperations/TriggerRestoreAsFiles.json -func ExampleBackupInstancesClient_BeginTriggerRestore_triggerRestoreAsFiles() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewBackupInstancesClient("04cf684a-d41f-4550-9f70-7708a3a2283b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginTriggerRestore(ctx, "000pikumar", "PrivatePreviewVault1", "testInstance1", &armdataprotection.AzureBackupRecoveryPointBasedRestoreRequest{ - ObjectType: to.Ptr("AzureBackupRecoveryPointBasedRestoreRequest"), - RestoreTargetInfo: &armdataprotection.RestoreFilesTargetInfo{ - ObjectType: to.Ptr("RestoreFilesTargetInfo"), - RecoveryOption: to.Ptr(armdataprotection.RecoveryOptionFailIfExists), - RestoreLocation: to.Ptr("southeastasia"), - TargetDetails: &armdataprotection.TargetDetails{ - FilePrefix: to.Ptr("restoredblob"), - RestoreTargetLocationType: to.Ptr(armdataprotection.RestoreTargetLocationTypeAzureBlobs), - URL: to.Ptr("https://teststorage.blob.core.windows.net/restoretest"), - }, - }, - SourceDataStoreType: to.Ptr(armdataprotection.SourceDataStoreTypeVaultStore), - SourceResourceID: to.Ptr("/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest/databases/testdb"), - RecoveryPointID: to.Ptr("hardcodedRP"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperationJobExtendedInfo = armdataprotection.OperationJobExtendedInfo{ - // ObjectType: to.Ptr("OperationJobExtendedInfo"), - // JobID: to.Ptr("c60cb49-63e8-4b21-b9bd-26277b3fdfae"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/BackupInstanceOperations/TriggerRestoreWithRehydration.json -func ExampleBackupInstancesClient_BeginTriggerRestore_triggerRestoreWithRehydration() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewBackupInstancesClient("04cf684a-d41f-4550-9f70-7708a3a2283b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginTriggerRestore(ctx, "000pikumar", "PratikPrivatePreviewVault1", "testInstance1", &armdataprotection.AzureBackupRestoreWithRehydrationRequest{ - ObjectType: to.Ptr("AzureBackupRestoreWithRehydrationRequest"), - RestoreTargetInfo: &armdataprotection.RestoreTargetInfo{ - ObjectType: to.Ptr("RestoreTargetInfo"), - RecoveryOption: to.Ptr(armdataprotection.RecoveryOptionFailIfExists), - RestoreLocation: to.Ptr("southeastasia"), - DatasourceInfo: &armdataprotection.Datasource{ - DatasourceType: to.Ptr("OssDB"), - ObjectType: to.Ptr("Datasource"), - ResourceID: to.Ptr("/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest/databases/testdb"), - ResourceLocation: to.Ptr(""), - ResourceName: to.Ptr("testdb"), - ResourceType: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"), - ResourceURI: to.Ptr(""), - }, - DatasourceSetInfo: &armdataprotection.DatasourceSet{ - DatasourceType: to.Ptr("OssDB"), - ObjectType: to.Ptr("DatasourceSet"), - ResourceID: to.Ptr("/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest"), - ResourceLocation: to.Ptr(""), - ResourceName: to.Ptr("viveksipgtest"), - ResourceType: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - ResourceURI: to.Ptr(""), - }, - }, - SourceDataStoreType: to.Ptr(armdataprotection.SourceDataStoreTypeVaultStore), - SourceResourceID: to.Ptr("/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest/databases/testdb"), - RecoveryPointID: to.Ptr("hardcodedRP"), - RehydrationPriority: to.Ptr(armdataprotection.RehydrationPriorityHigh), - RehydrationRetentionDuration: to.Ptr("7D"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperationJobExtendedInfo = armdataprotection.OperationJobExtendedInfo{ - // ObjectType: to.Ptr("OperationJobExtendedInfo"), - // JobID: to.Ptr("c60cb49-63e8-4b21-b9bd-26277b3fdfae"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("04cf684a-d41f-4550-9f70-7708a3a2283b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginResumeBackups(ctx, "testrg", "testvault", "testbi", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("04cf684a-d41f-4550-9f70-7708a3a2283b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginResumeProtection(ctx, "testrg", "testvault", "testbi", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("04cf684a-d41f-4550-9f70-7708a3a2283b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginStopProtection(ctx, "testrg", "testvault", "testbi", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("04cf684a-d41f-4550-9f70-7708a3a2283b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginSuspendBackups(ctx, "testrg", "testvault", "testbi", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("04cf684a-d41f-4550-9f70-7708a3a2283b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginSyncBackupInstance(ctx, "testrg", "testvault", "testbi", armdataprotection.SyncBackupInstanceRequest{ - SyncType: to.Ptr(armdataprotection.SyncTypeDefault), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("04cf684a-d41f-4550-9f70-7708a3a2283b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginValidateForRestore(ctx, "000pikumar", "PratikPrivatePreviewVault1", "testInstance1", armdataprotection.ValidateRestoreRequestObject{ - RestoreRequestObject: &armdataprotection.AzureBackupRecoveryPointBasedRestoreRequest{ - ObjectType: to.Ptr("AzureBackupRecoveryPointBasedRestoreRequest"), - RestoreTargetInfo: &armdataprotection.RestoreTargetInfo{ - ObjectType: to.Ptr("RestoreTargetInfo"), - RecoveryOption: to.Ptr(armdataprotection.RecoveryOptionFailIfExists), - RestoreLocation: to.Ptr("southeastasia"), - DatasourceAuthCredentials: &armdataprotection.SecretStoreBasedAuthCredentials{ - ObjectType: to.Ptr("SecretStoreBasedAuthCredentials"), - SecretStoreResource: &armdataprotection.SecretStoreResource{ - SecretStoreType: to.Ptr(armdataprotection.SecretStoreTypeAzureKeyVault), - URI: to.Ptr("https://samplevault.vault.azure.net/secrets/credentials"), - }, - }, - DatasourceInfo: &armdataprotection.Datasource{ - DatasourceType: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"), - ObjectType: to.Ptr("Datasource"), - ResourceID: to.Ptr("/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest/databases/targetdb"), - ResourceLocation: to.Ptr(""), - ResourceName: to.Ptr("targetdb"), - ResourceType: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"), - ResourceURI: to.Ptr(""), - }, - DatasourceSetInfo: &armdataprotection.DatasourceSet{ - DatasourceType: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"), - ObjectType: to.Ptr("DatasourceSet"), - ResourceID: to.Ptr("/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest"), - ResourceLocation: to.Ptr(""), - ResourceName: to.Ptr("viveksipgtest"), - ResourceType: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - ResourceURI: to.Ptr(""), - }, - }, - SourceDataStoreType: to.Ptr(armdataprotection.SourceDataStoreTypeVaultStore), - SourceResourceID: to.Ptr("/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest/databases/testdb"), - RecoveryPointID: to.Ptr("hardcodedRP"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperationJobExtendedInfo = armdataprotection.OperationJobExtendedInfo{ - // ObjectType: to.Ptr("OperationJobExtendedInfo"), - // JobID: to.Ptr("c60cb49-63e8-4b21-b9bd-26277b3fdfae"), - // } -} diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/backuppolicies_client_example_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/backuppolicies_client_example_test.go deleted file mode 100644 index 7f2224e21f22..000000000000 --- a/sdk/resourcemanager/dataprotection/armdataprotection/backuppolicies_client_example_test.go +++ /dev/null @@ -1,448 +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. -// DO NOT EDIT. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("04cf684a-d41f-4550-9f70-7708a3a2283b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("000pikumar", "PrivatePreviewVault", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.BaseBackupPolicyResourceList = armdataprotection.BaseBackupPolicyResourceList{ - // Value: []*armdataprotection.BaseBackupPolicyResource{ - // { - // Name: to.Ptr("OSSDBPolicy"), - // Type: to.Ptr("Microsoft.DataProtection/backupVaults/backupPolicies"), - // ID: to.Ptr("/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/000pikumar/providers/Microsoft.DataProtection/backupVaults/PrivatePreviewVault/backupPolicies/OSSDBPolicy"), - // Properties: &armdataprotection.BackupPolicy{ - // DatasourceTypes: []*string{ - // to.Ptr("OssDB")}, - // ObjectType: to.Ptr("BackupPolicy"), - // PolicyRules: []armdataprotection.BasePolicyRuleClassification{ - // &armdataprotection.AzureBackupRule{ - // Name: to.Ptr("BackupWeekly"), - // ObjectType: to.Ptr("AzureBackupRule"), - // BackupParameters: &armdataprotection.AzureBackupParams{ - // ObjectType: to.Ptr("AzureBackupParams"), - // BackupType: to.Ptr("Full"), - // }, - // DataStore: &armdataprotection.DataStoreInfoBase{ - // DataStoreType: to.Ptr(armdataprotection.DataStoreTypesVaultStore), - // ObjectType: to.Ptr("DataStoreInfoBase"), - // }, - // Trigger: &armdataprotection.ScheduleBasedTriggerContext{ - // ObjectType: to.Ptr("ScheduleBasedTriggerContext"), - // 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{ - // ID: to.Ptr("Default_"), - // TagName: to.Ptr("Default"), - // }, - // TaggingPriority: to.Ptr[int64](99), - // }, - // { - // Criteria: []armdataprotection.BackupCriteriaClassification{ - // &armdataprotection.ScheduleBasedBackupCriteria{ - // ObjectType: to.Ptr("ScheduleBasedBackupCriteria"), - // 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{ - // ID: to.Ptr("Weekly_"), - // TagName: to.Ptr("Weekly"), - // }, - // TaggingPriority: to.Ptr[int64](20), - // }}, - // }, - // }, - // &armdataprotection.AzureRetentionRule{ - // Name: to.Ptr("Default"), - // ObjectType: to.Ptr("AzureRetentionRule"), - // IsDefault: to.Ptr(true), - // Lifecycles: []*armdataprotection.SourceLifeCycle{ - // { - // DeleteAfter: &armdataprotection.AbsoluteDeleteOption{ - // Duration: to.Ptr("P1W"), - // ObjectType: to.Ptr("AbsoluteDeleteOption"), - // }, - // SourceDataStore: &armdataprotection.DataStoreInfoBase{ - // DataStoreType: to.Ptr(armdataprotection.DataStoreTypesVaultStore), - // ObjectType: to.Ptr("DataStoreInfoBase"), - // }, - // }}, - // }, - // &armdataprotection.AzureRetentionRule{ - // Name: to.Ptr("Weekly"), - // ObjectType: to.Ptr("AzureRetentionRule"), - // IsDefault: to.Ptr(false), - // Lifecycles: []*armdataprotection.SourceLifeCycle{ - // { - // DeleteAfter: &armdataprotection.AbsoluteDeleteOption{ - // Duration: to.Ptr("P12W"), - // ObjectType: to.Ptr("AbsoluteDeleteOption"), - // }, - // SourceDataStore: &armdataprotection.DataStoreInfoBase{ - // DataStoreType: to.Ptr(armdataprotection.DataStoreTypesVaultStore), - // ObjectType: to.Ptr("DataStoreInfoBase"), - // }, - // }}, - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("04cf684a-d41f-4550-9f70-7708a3a2283b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "000pikumar", "PrivatePreviewVault", "OSSDBPolicy", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BaseBackupPolicyResource = armdataprotection.BaseBackupPolicyResource{ - // Name: to.Ptr("OSSDBPolicy"), - // Type: to.Ptr("Microsoft.DataProtection/backupVaults/backupPolicies"), - // ID: to.Ptr("/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/000pikumar/providers/Microsoft.DataProtection/backupVaults/PrivatePreviewVault/backupPolicies/OSSDBPolicy"), - // Properties: &armdataprotection.BackupPolicy{ - // DatasourceTypes: []*string{ - // to.Ptr("OssDB")}, - // ObjectType: to.Ptr("BackupPolicy"), - // PolicyRules: []armdataprotection.BasePolicyRuleClassification{ - // &armdataprotection.AzureBackupRule{ - // Name: to.Ptr("BackupWeekly"), - // ObjectType: to.Ptr("AzureBackupRule"), - // BackupParameters: &armdataprotection.AzureBackupParams{ - // ObjectType: to.Ptr("AzureBackupParams"), - // BackupType: to.Ptr("Full"), - // }, - // DataStore: &armdataprotection.DataStoreInfoBase{ - // DataStoreType: to.Ptr(armdataprotection.DataStoreTypesVaultStore), - // ObjectType: to.Ptr("DataStoreInfoBase"), - // }, - // Trigger: &armdataprotection.ScheduleBasedTriggerContext{ - // ObjectType: to.Ptr("ScheduleBasedTriggerContext"), - // 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{ - // ID: to.Ptr("Default_"), - // TagName: to.Ptr("Default"), - // }, - // TaggingPriority: to.Ptr[int64](99), - // }, - // { - // Criteria: []armdataprotection.BackupCriteriaClassification{ - // &armdataprotection.ScheduleBasedBackupCriteria{ - // ObjectType: to.Ptr("ScheduleBasedBackupCriteria"), - // 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{ - // ID: to.Ptr("Weekly_"), - // TagName: to.Ptr("Weekly"), - // }, - // TaggingPriority: to.Ptr[int64](20), - // }}, - // }, - // }, - // &armdataprotection.AzureRetentionRule{ - // Name: to.Ptr("Default"), - // ObjectType: to.Ptr("AzureRetentionRule"), - // IsDefault: to.Ptr(true), - // Lifecycles: []*armdataprotection.SourceLifeCycle{ - // { - // DeleteAfter: &armdataprotection.AbsoluteDeleteOption{ - // Duration: to.Ptr("P1W"), - // ObjectType: to.Ptr("AbsoluteDeleteOption"), - // }, - // SourceDataStore: &armdataprotection.DataStoreInfoBase{ - // DataStoreType: to.Ptr(armdataprotection.DataStoreTypesVaultStore), - // ObjectType: to.Ptr("DataStoreInfoBase"), - // }, - // }}, - // }, - // &armdataprotection.AzureRetentionRule{ - // Name: to.Ptr("Weekly"), - // ObjectType: to.Ptr("AzureRetentionRule"), - // IsDefault: to.Ptr(false), - // Lifecycles: []*armdataprotection.SourceLifeCycle{ - // { - // DeleteAfter: &armdataprotection.AbsoluteDeleteOption{ - // Duration: to.Ptr("P12W"), - // ObjectType: to.Ptr("AbsoluteDeleteOption"), - // }, - // SourceDataStore: &armdataprotection.DataStoreInfoBase{ - // DataStoreType: to.Ptr(armdataprotection.DataStoreTypesVaultStore), - // ObjectType: to.Ptr("DataStoreInfoBase"), - // }, - // }}, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("04cf684a-d41f-4550-9f70-7708a3a2283b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, "000pikumar", "PrivatePreviewVault", "OSSDBPolicy", armdataprotection.BaseBackupPolicyResource{ - Properties: &armdataprotection.BackupPolicy{ - DatasourceTypes: []*string{ - to.Ptr("OssDB")}, - ObjectType: to.Ptr("BackupPolicy"), - PolicyRules: []armdataprotection.BasePolicyRuleClassification{ - &armdataprotection.AzureBackupRule{ - Name: to.Ptr("BackupWeekly"), - ObjectType: to.Ptr("AzureBackupRule"), - BackupParameters: &armdataprotection.AzureBackupParams{ - ObjectType: to.Ptr("AzureBackupParams"), - BackupType: to.Ptr("Full"), - }, - DataStore: &armdataprotection.DataStoreInfoBase{ - DataStoreType: to.Ptr(armdataprotection.DataStoreTypesVaultStore), - ObjectType: to.Ptr("DataStoreInfoBase"), - }, - Trigger: &armdataprotection.ScheduleBasedTriggerContext{ - ObjectType: to.Ptr("ScheduleBasedTriggerContext"), - 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("Default"), - }, - TaggingPriority: to.Ptr[int64](99), - }, - { - Criteria: []armdataprotection.BackupCriteriaClassification{ - &armdataprotection.ScheduleBasedBackupCriteria{ - ObjectType: to.Ptr("ScheduleBasedBackupCriteria"), - 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("Weekly"), - }, - TaggingPriority: to.Ptr[int64](20), - }}, - }, - }, - &armdataprotection.AzureRetentionRule{ - Name: to.Ptr("Default"), - ObjectType: to.Ptr("AzureRetentionRule"), - IsDefault: to.Ptr(true), - Lifecycles: []*armdataprotection.SourceLifeCycle{ - { - DeleteAfter: &armdataprotection.AbsoluteDeleteOption{ - Duration: to.Ptr("P1W"), - ObjectType: to.Ptr("AbsoluteDeleteOption"), - }, - SourceDataStore: &armdataprotection.DataStoreInfoBase{ - DataStoreType: to.Ptr(armdataprotection.DataStoreTypesVaultStore), - ObjectType: to.Ptr("DataStoreInfoBase"), - }, - }}, - }, - &armdataprotection.AzureRetentionRule{ - Name: to.Ptr("Weekly"), - ObjectType: to.Ptr("AzureRetentionRule"), - IsDefault: to.Ptr(false), - Lifecycles: []*armdataprotection.SourceLifeCycle{ - { - DeleteAfter: &armdataprotection.AbsoluteDeleteOption{ - Duration: to.Ptr("P12W"), - ObjectType: to.Ptr("AbsoluteDeleteOption"), - }, - SourceDataStore: &armdataprotection.DataStoreInfoBase{ - DataStoreType: to.Ptr(armdataprotection.DataStoreTypesVaultStore), - ObjectType: to.Ptr("DataStoreInfoBase"), - }, - }}, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BaseBackupPolicyResource = armdataprotection.BaseBackupPolicyResource{ - // Name: to.Ptr("OSSDBPolicy"), - // Type: to.Ptr("Microsoft.DataProtection/backupVaults/backupPolicies"), - // ID: to.Ptr("/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/000pikumar/providers/Microsoft.DataProtection/backupVaults/PrivatePreviewVault/backupPolicies/OSSDBPolicy"), - // Properties: &armdataprotection.BackupPolicy{ - // DatasourceTypes: []*string{ - // to.Ptr("OssDB")}, - // ObjectType: to.Ptr("BackupPolicy"), - // PolicyRules: []armdataprotection.BasePolicyRuleClassification{ - // &armdataprotection.AzureBackupRule{ - // Name: to.Ptr("BackupWeekly"), - // ObjectType: to.Ptr("AzureBackupRule"), - // BackupParameters: &armdataprotection.AzureBackupParams{ - // ObjectType: to.Ptr("AzureBackupParams"), - // BackupType: to.Ptr("Full"), - // }, - // DataStore: &armdataprotection.DataStoreInfoBase{ - // DataStoreType: to.Ptr(armdataprotection.DataStoreTypesVaultStore), - // ObjectType: to.Ptr("DataStoreInfoBase"), - // }, - // Trigger: &armdataprotection.ScheduleBasedTriggerContext{ - // ObjectType: to.Ptr("ScheduleBasedTriggerContext"), - // 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{ - // ID: to.Ptr("Default_"), - // TagName: to.Ptr("Default"), - // }, - // TaggingPriority: to.Ptr[int64](99), - // }, - // { - // Criteria: []armdataprotection.BackupCriteriaClassification{ - // &armdataprotection.ScheduleBasedBackupCriteria{ - // ObjectType: to.Ptr("ScheduleBasedBackupCriteria"), - // 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{ - // ID: to.Ptr("Weekly_"), - // TagName: to.Ptr("Weekly"), - // }, - // TaggingPriority: to.Ptr[int64](20), - // }}, - // }, - // }, - // &armdataprotection.AzureRetentionRule{ - // Name: to.Ptr("Default"), - // ObjectType: to.Ptr("AzureRetentionRule"), - // IsDefault: to.Ptr(true), - // Lifecycles: []*armdataprotection.SourceLifeCycle{ - // { - // DeleteAfter: &armdataprotection.AbsoluteDeleteOption{ - // Duration: to.Ptr("P1W"), - // ObjectType: to.Ptr("AbsoluteDeleteOption"), - // }, - // SourceDataStore: &armdataprotection.DataStoreInfoBase{ - // DataStoreType: to.Ptr(armdataprotection.DataStoreTypesVaultStore), - // ObjectType: to.Ptr("DataStoreInfoBase"), - // }, - // }}, - // }, - // &armdataprotection.AzureRetentionRule{ - // Name: to.Ptr("Weekly"), - // ObjectType: to.Ptr("AzureRetentionRule"), - // IsDefault: to.Ptr(false), - // Lifecycles: []*armdataprotection.SourceLifeCycle{ - // { - // DeleteAfter: &armdataprotection.AbsoluteDeleteOption{ - // Duration: to.Ptr("P12W"), - // ObjectType: to.Ptr("AbsoluteDeleteOption"), - // }, - // SourceDataStore: &armdataprotection.DataStoreInfoBase{ - // DataStoreType: to.Ptr(armdataprotection.DataStoreTypesVaultStore), - // ObjectType: to.Ptr("DataStoreInfoBase"), - // }, - // }}, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("04cf684a-d41f-4550-9f70-7708a3a2283b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, "000pikumar", "PrivatePreviewVault", "OSSDBPolicy", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/backupvaultoperationresults_client_example_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/backupvaultoperationresults_client_example_test.go deleted file mode 100644 index 1934beabd4c3..000000000000 --- a/sdk/resourcemanager/dataprotection/armdataprotection/backupvaultoperationresults_client_example_test.go +++ /dev/null @@ -1,58 +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. -// DO NOT EDIT. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("04cf684a-d41f-4550-9f70-7708a3a2283b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "SampleResourceGroup", "swaggerExample", "YWUzNDFkMzQtZmM5OS00MmUyLWEzNDMtZGJkMDIxZjlmZjgzOzdmYzBiMzhmLTc2NmItNDM5NS05OWQ1LTVmOGEzNzg4MWQzNA==", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BackupVaultResource = armdataprotection.BackupVaultResource{ - // Name: to.Ptr("swaggerExample"), - // Type: to.Ptr("Microsoft.DataProtection/Backupvaults"), - // ID: to.Ptr("/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/SampleResourceGroup/providers/Microsoft.DataProtection/Backupvaults/swaggerExample"), - // Location: to.Ptr("WestUS"), - // Tags: map[string]*string{ - // "key1": to.Ptr("val1"), - // }, - // Identity: &armdataprotection.DppIdentityDetails{ - // Type: to.Ptr("None"), - // }, - // Properties: &armdataprotection.BackupVault{ - // ProvisioningState: to.Ptr(armdataprotection.ProvisioningStateSucceeded), - // StorageSettings: []*armdataprotection.StorageSetting{ - // { - // Type: to.Ptr(armdataprotection.StorageSettingTypesLocallyRedundant), - // DatastoreType: to.Ptr(armdataprotection.StorageSettingStoreTypesVaultStore), - // }}, - // }, - // } -} diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/backupvaults_client_example_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/backupvaults_client_example_test.go deleted file mode 100644 index 5a4bb5614f30..000000000000 --- a/sdk/resourcemanager/dataprotection/armdataprotection/backupvaults_client_example_test.go +++ /dev/null @@ -1,493 +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. -// DO NOT EDIT. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewGetInSubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.BackupVaultResourceList = armdataprotection.BackupVaultResourceList{ - // Value: []*armdataprotection.BackupVaultResource{ - // { - // Name: to.Ptr("ExampleVault1"), - // Type: to.Ptr("Microsoft.DataProtection/BackupVaults"), - // ID: to.Ptr("/subscriptions/0b352192-dcac-4cc7-992e-a96190ccc68c/resourceGroups/SampleResourceGroup2/providers/Microsoft.DataProtection/BackupVaults/ExampleVault1"), - // Location: to.Ptr("WestUS"), - // Tags: map[string]*string{ - // "key1": to.Ptr("val1"), - // }, - // Identity: &armdataprotection.DppIdentityDetails{ - // Type: to.Ptr("None"), - // }, - // Properties: &armdataprotection.BackupVault{ - // ProvisioningState: to.Ptr(armdataprotection.ProvisioningStateSucceeded), - // StorageSettings: []*armdataprotection.StorageSetting{ - // { - // Type: to.Ptr(armdataprotection.StorageSettingTypesLocallyRedundant), - // DatastoreType: to.Ptr(armdataprotection.StorageSettingStoreTypesVaultStore), - // }}, - // }, - // }, - // { - // Name: to.Ptr("ExampleVault2"), - // Type: to.Ptr("Microsoft.DataProtection/BackupVaults"), - // ID: to.Ptr("/subscriptions/0b352192-dcac-4cc7-992e-a96190ccc68c/resourceGroups/SampleResourceGroup/providers/Microsoft.DataProtection/BackupVaults/ExampleVault2"), - // Location: to.Ptr("WestUS"), - // Tags: map[string]*string{ - // "key1": to.Ptr("val1"), - // }, - // Identity: &armdataprotection.DppIdentityDetails{ - // Type: to.Ptr("None"), - // }, - // Properties: &armdataprotection.BackupVault{ - // ProvisioningState: to.Ptr(armdataprotection.ProvisioningStateSucceeded), - // StorageSettings: []*armdataprotection.StorageSetting{ - // { - // Type: to.Ptr(armdataprotection.StorageSettingTypesLocallyRedundant), - // DatastoreType: to.Ptr(armdataprotection.StorageSettingStoreTypesVaultStore), - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewGetInResourceGroupPager("SampleResourceGroup", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.BackupVaultResourceList = armdataprotection.BackupVaultResourceList{ - // Value: []*armdataprotection.BackupVaultResource{ - // { - // Name: to.Ptr("ExampleVault1"), - // Type: to.Ptr("Microsoft.DataProtection/BackupVaults"), - // ID: to.Ptr("/subscriptions/0b352192-dcac-4cc7-992e-a96190ccc68c/resourceGroups/SampleResourceGroup/providers/Microsoft.DataProtection/BackupVaults/ExampleVault1"), - // Location: to.Ptr("WestUS"), - // Tags: map[string]*string{ - // "key1": to.Ptr("val1"), - // }, - // Identity: &armdataprotection.DppIdentityDetails{ - // Type: to.Ptr("None"), - // }, - // Properties: &armdataprotection.BackupVault{ - // ProvisioningState: to.Ptr(armdataprotection.ProvisioningStateSucceeded), - // StorageSettings: []*armdataprotection.StorageSetting{ - // { - // Type: to.Ptr(armdataprotection.StorageSettingTypesLocallyRedundant), - // DatastoreType: to.Ptr(armdataprotection.StorageSettingStoreTypesVaultStore), - // }}, - // }, - // }, - // { - // Name: to.Ptr("ExampleVault2"), - // Type: to.Ptr("Microsoft.DataProtection/BackupVaults"), - // ID: to.Ptr("/subscriptions/0b352192-dcac-4cc7-992e-a96190ccc68c/resourceGroups/SampleResourceGroup/providers/Microsoft.DataProtection/BackupVaults/ExampleVault2"), - // Location: to.Ptr("WestUS"), - // Tags: map[string]*string{ - // "key1": to.Ptr("val1"), - // }, - // Identity: &armdataprotection.DppIdentityDetails{ - // Type: to.Ptr("SystemAssigned"), - // PrincipalID: to.Ptr("c009b9a0-0024-417c-83cd-025d3776045d"), - // TenantID: to.Ptr("83abe5cd-bcc3-441a-bd86-e6a75360cecc"), - // }, - // Properties: &armdataprotection.BackupVault{ - // MonitoringSettings: &armdataprotection.MonitoringSettings{ - // AzureMonitorAlertSettings: &armdataprotection.AzureMonitorAlertSettings{ - // AlertsForAllJobFailures: to.Ptr(armdataprotection.AlertsStateEnabled), - // }, - // }, - // ProvisioningState: to.Ptr(armdataprotection.ProvisioningStateSucceeded), - // StorageSettings: []*armdataprotection.StorageSetting{ - // { - // Type: to.Ptr(armdataprotection.StorageSettingTypesLocallyRedundant), - // DatastoreType: to.Ptr(armdataprotection.StorageSettingStoreTypesVaultStore), - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/VaultCRUD/GetBackupVault.json -func ExampleBackupVaultsClient_Get_getBackupVault() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewBackupVaultsClient("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "SampleResourceGroup", "swaggerExample", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BackupVaultResource = armdataprotection.BackupVaultResource{ - // Name: to.Ptr("swaggerExample"), - // Type: to.Ptr("Microsoft.DataProtection/Backupvaults"), - // ID: to.Ptr("/subscriptions/0b352192-dcac-4cc7-992e-a96190ccc68c/resourceGroups/SampleResourceGroup/providers/Microsoft.DataProtection/Backupvaults/swaggerExample"), - // Location: to.Ptr("WestUS"), - // Tags: map[string]*string{ - // "key1": to.Ptr("val1"), - // }, - // Identity: &armdataprotection.DppIdentityDetails{ - // Type: to.Ptr("None"), - // }, - // Properties: &armdataprotection.BackupVault{ - // MonitoringSettings: &armdataprotection.MonitoringSettings{ - // AzureMonitorAlertSettings: &armdataprotection.AzureMonitorAlertSettings{ - // AlertsForAllJobFailures: to.Ptr(armdataprotection.AlertsStateEnabled), - // }, - // }, - // ProvisioningState: to.Ptr(armdataprotection.ProvisioningStateSucceeded), - // StorageSettings: []*armdataprotection.StorageSetting{ - // { - // Type: to.Ptr(armdataprotection.StorageSettingTypesLocallyRedundant), - // DatastoreType: to.Ptr(armdataprotection.StorageSettingStoreTypesVaultStore), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/VaultCRUD/GetBackupVaultWithMSI.json -func ExampleBackupVaultsClient_Get_getBackupVaultWithMsi() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewBackupVaultsClient("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "SampleResourceGroup", "swaggerExample", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BackupVaultResource = armdataprotection.BackupVaultResource{ - // Name: to.Ptr("swaggerExample"), - // Type: to.Ptr("Microsoft.DataProtection/Backupvaults"), - // ID: to.Ptr("/subscriptions/0b352192-dcac-4cc7-992e-a96190ccc68c/resourceGroups/SampleResourceGroup/providers/Microsoft.DataProtection/Backupvaults/swaggerExample"), - // Location: to.Ptr("WestUS"), - // Tags: map[string]*string{ - // "key1": to.Ptr("val1"), - // }, - // Identity: &armdataprotection.DppIdentityDetails{ - // Type: to.Ptr("SystemAssigned"), - // PrincipalID: to.Ptr("c009b9a0-0024-417c-83cd-025d3776045d"), - // TenantID: to.Ptr("83abe5cd-bcc3-441a-bd86-e6a75360cecc"), - // }, - // Properties: &armdataprotection.BackupVault{ - // ProvisioningState: to.Ptr(armdataprotection.ProvisioningStateSucceeded), - // StorageSettings: []*armdataprotection.StorageSetting{ - // { - // Type: to.Ptr(armdataprotection.StorageSettingTypesLocallyRedundant), - // DatastoreType: to.Ptr(armdataprotection.StorageSettingStoreTypesVaultStore), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/VaultCRUD/PutBackupVault.json -func ExampleBackupVaultsClient_BeginCreateOrUpdate_createBackupVault() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewBackupVaultsClient("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, "SampleResourceGroup", "swaggerExample", armdataprotection.BackupVaultResource{ - Location: to.Ptr("WestUS"), - Tags: map[string]*string{ - "key1": to.Ptr("val1"), - }, - Identity: &armdataprotection.DppIdentityDetails{ - Type: to.Ptr("None"), - }, - 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), - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BackupVaultResource = armdataprotection.BackupVaultResource{ - // Name: to.Ptr("swaggerExample"), - // Type: to.Ptr("Microsoft.DataProtection/Backupvaults"), - // ID: to.Ptr("/subscriptions/0b352192-dcac-4cc7-992e-a96190ccc68c/resourceGroups/SampleResourceGroup/providers/Microsoft.DataProtection/Backupvaults/swaggerExample"), - // Location: to.Ptr("WestUS"), - // Tags: map[string]*string{ - // "key1": to.Ptr("val1"), - // }, - // Identity: &armdataprotection.DppIdentityDetails{ - // Type: to.Ptr("None"), - // }, - // Properties: &armdataprotection.BackupVault{ - // MonitoringSettings: &armdataprotection.MonitoringSettings{ - // AzureMonitorAlertSettings: &armdataprotection.AzureMonitorAlertSettings{ - // AlertsForAllJobFailures: to.Ptr(armdataprotection.AlertsStateEnabled), - // }, - // }, - // ProvisioningState: to.Ptr(armdataprotection.ProvisioningStateSucceeded), - // StorageSettings: []*armdataprotection.StorageSetting{ - // { - // Type: to.Ptr(armdataprotection.StorageSettingTypesLocallyRedundant), - // DatastoreType: to.Ptr(armdataprotection.StorageSettingStoreTypesVaultStore), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/VaultCRUD/PutBackupVaultWithMSI.json -func ExampleBackupVaultsClient_BeginCreateOrUpdate_createBackupVaultWithMsi() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewBackupVaultsClient("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, "SampleResourceGroup", "swaggerExample", armdataprotection.BackupVaultResource{ - Location: to.Ptr("WestUS"), - Tags: map[string]*string{ - "key1": to.Ptr("val1"), - }, - Identity: &armdataprotection.DppIdentityDetails{ - Type: to.Ptr("systemAssigned"), - }, - 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), - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BackupVaultResource = armdataprotection.BackupVaultResource{ - // Name: to.Ptr("swaggerExample"), - // Type: to.Ptr("Microsoft.DataProtection/Backupvaults"), - // ID: to.Ptr("/subscriptions/0b352192-dcac-4cc7-992e-a96190ccc68c/resourceGroups/SampleResourceGroup/providers/Microsoft.DataProtection/Backupvaults/swaggerExample"), - // Location: to.Ptr("WestUS"), - // Tags: map[string]*string{ - // "key1": to.Ptr("val1"), - // }, - // Identity: &armdataprotection.DppIdentityDetails{ - // Type: to.Ptr("SystemAssigned"), - // PrincipalID: to.Ptr("c009b9a0-0024-417c-83cd-025d3776045d"), - // TenantID: to.Ptr("83abe5cd-bcc3-441a-bd86-e6a75360cecc"), - // }, - // Properties: &armdataprotection.BackupVault{ - // MonitoringSettings: &armdataprotection.MonitoringSettings{ - // AzureMonitorAlertSettings: &armdataprotection.AzureMonitorAlertSettings{ - // AlertsForAllJobFailures: to.Ptr(armdataprotection.AlertsStateEnabled), - // }, - // }, - // ProvisioningState: to.Ptr(armdataprotection.ProvisioningStateSucceeded), - // StorageSettings: []*armdataprotection.StorageSetting{ - // { - // Type: to.Ptr(armdataprotection.StorageSettingTypesLocallyRedundant), - // DatastoreType: to.Ptr(armdataprotection.StorageSettingStoreTypesVaultStore), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/VaultCRUD/DeleteBackupVault.json -func ExampleBackupVaultsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewBackupVaultsClient("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, "SampleResourceGroup", "swaggerExample", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, "SampleResourceGroup", "swaggerExample", armdataprotection.PatchResourceRequestInput{ - Properties: &armdataprotection.PatchBackupVaultInput{ - MonitoringSettings: &armdataprotection.MonitoringSettings{ - AzureMonitorAlertSettings: &armdataprotection.AzureMonitorAlertSettings{ - AlertsForAllJobFailures: to.Ptr(armdataprotection.AlertsStateEnabled), - }, - }, - }, - Tags: map[string]*string{ - "newKey": to.Ptr("newVal"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BackupVaultResource = armdataprotection.BackupVaultResource{ - // Name: to.Ptr("swaggerExample"), - // Type: to.Ptr("Microsoft.DataProtection/Backupvaults"), - // ID: to.Ptr("/subscriptions/0b352192-dcac-4cc7-992e-a96190ccc68c/resourceGroups/SampleResourceGroup/providers/Microsoft.DataProtection/Backupvaults/swaggerExample"), - // Location: to.Ptr("WestUS"), - // Tags: map[string]*string{ - // "newKey": to.Ptr("newVal"), - // }, - // Properties: &armdataprotection.BackupVault{ - // MonitoringSettings: &armdataprotection.MonitoringSettings{ - // AzureMonitorAlertSettings: &armdataprotection.AzureMonitorAlertSettings{ - // AlertsForAllJobFailures: to.Ptr(armdataprotection.AlertsStateEnabled), - // }, - // }, - // ProvisioningState: to.Ptr(armdataprotection.ProvisioningStateSucceeded), - // StorageSettings: []*armdataprotection.StorageSetting{ - // { - // Type: to.Ptr(armdataprotection.StorageSettingTypesLocallyRedundant), - // DatastoreType: to.Ptr(armdataprotection.StorageSettingStoreTypesVaultStore), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CheckNameAvailability(ctx, "SampleResourceGroup", "westus", armdataprotection.CheckNameAvailabilityRequest{ - Name: to.Ptr("swaggerExample"), - Type: to.Ptr("Microsoft.DataProtection/BackupVaults"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CheckNameAvailabilityResult = armdataprotection.CheckNameAvailabilityResult{ - // NameAvailable: to.Ptr(true), - // } -} diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/client_example_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/client_example_test.go deleted file mode 100644 index 0eac43d67eee..000000000000 --- a/sdk/resourcemanager/dataprotection/armdataprotection/client_example_test.go +++ /dev/null @@ -1,61 +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. -// DO NOT EDIT. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CheckFeatureSupport(ctx, "WestUS", &armdataprotection.FeatureValidationRequest{ - ObjectType: to.Ptr("FeatureValidationRequest"), - FeatureType: to.Ptr(armdataprotection.FeatureTypeDataSourceType), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armdataprotection.ClientCheckFeatureSupportResponse{ - // FeatureValidationResponseBaseClassification: &armdataprotection.FeatureValidationResponse{ - // ObjectType: to.Ptr("FeatureValidationResponse"), - // FeatureType: to.Ptr(armdataprotection.FeatureTypeDataSourceType), - // Features: []*armdataprotection.SupportedFeature{ - // { - // ExposureControlledFeatures: []*string{ - // }, - // FeatureName: to.Ptr("Microsoft.Storage/storageAccounts/blobServices"), - // SupportStatus: to.Ptr(armdataprotection.FeatureSupportStatusPrivatePreview), - // }, - // { - // ExposureControlledFeatures: []*string{ - // }, - // FeatureName: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"), - // SupportStatus: to.Ptr(armdataprotection.FeatureSupportStatusPublicPreview), - // }}, - // }, - // } -} diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/constants.go b/sdk/resourcemanager/dataprotection/armdataprotection/constants.go index b50052f5e6a2..fb3c2367cea9 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/constants.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/constants.go @@ -11,7 +11,7 @@ package armdataprotection const ( moduleName = "armdataprotection" - moduleVersion = "v2.0.0" + moduleVersion = "v2.1.0" ) type AbsoluteMarker string diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/deletedbackupinstances_client_example_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/deletedbackupinstances_client_example_test.go deleted file mode 100644 index b8ffa84fb60f..000000000000 --- a/sdk/resourcemanager/dataprotection/armdataprotection/deletedbackupinstances_client_example_test.go +++ /dev/null @@ -1,167 +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. -// DO NOT EDIT. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/DeletedBackupInstanceOperations/ListDeletedBackupInstances.json -func ExampleDeletedBackupInstancesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewDeletedBackupInstancesClient("04cf684a-d41f-4550-9f70-7708a3a2283b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("000pikumar", "PratikPrivatePreviewVault1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DeletedBackupInstanceResourceList = armdataprotection.DeletedBackupInstanceResourceList{ - // Value: []*armdataprotection.DeletedBackupInstanceResource{ - // { - // Name: to.Ptr("testInstance1"), - // Type: to.Ptr("Microsoft.DataProtection/backupVaults/deletedBackupInstances"), - // ID: to.Ptr("/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/000pikumar/providers/Microsoft.DataProtection/backupVaults/PratikPrivatePreviewVault1/deletedBackupInstances/testInstance1"), - // Properties: &armdataprotection.DeletedBackupInstance{ - // DataSourceInfo: &armdataprotection.Datasource{ - // DatasourceType: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"), - // ObjectType: to.Ptr("Datasource"), - // ResourceID: to.Ptr("/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest/databases/testdb"), - // ResourceLocation: to.Ptr(""), - // ResourceName: to.Ptr("testdb"), - // ResourceType: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"), - // ResourceURI: to.Ptr(""), - // }, - // DataSourceSetInfo: &armdataprotection.DatasourceSet{ - // DatasourceType: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"), - // ObjectType: to.Ptr("DatasourceSet"), - // ResourceID: to.Ptr("/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest"), - // ResourceLocation: to.Ptr(""), - // ResourceName: to.Ptr("viveksipgtest"), - // ResourceType: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ResourceURI: to.Ptr(""), - // }, - // FriendlyName: to.Ptr("testInstance1"), - // ObjectType: to.Ptr("DeletedBackupInstance"), - // PolicyInfo: &armdataprotection.PolicyInfo{ - // PolicyID: to.Ptr("/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/000pikumar/providers/Microsoft.DataProtection/backupVaults/PratikPrivatePreviewVault1/backupPolicies/PratikPolicy1"), - // }, - // ProtectionStatus: &armdataprotection.ProtectionStatusDetails{ - // Status: to.Ptr(armdataprotection.StatusSoftDeleted), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // DeletionInfo: &armdataprotection.DeletionInfo{ - // BillingEndDate: to.Ptr("2022-05-06T00:00:36.6660445Z"), - // DeleteActivityID: to.Ptr("1e9ec790-d198-4efb-bbd7-e4669d5351a4"), - // DeletionTime: to.Ptr("2022-05-04T00:00:36.6660445Z"), - // ScheduledPurgeTime: to.Ptr("2022-05-20T00:00:36.6660445Z"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/DeletedBackupInstanceOperations/GetDeletedBackupInstance.json -func ExampleDeletedBackupInstancesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewDeletedBackupInstancesClient("04cf684a-d41f-4550-9f70-7708a3a2283b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "000pikumar", "PratikPrivatePreviewVault1", "testInstance1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DeletedBackupInstanceResource = armdataprotection.DeletedBackupInstanceResource{ - // Name: to.Ptr("testInstance1"), - // Type: to.Ptr("Microsoft.DataProtection/backupVaults/deletedBackupInstances"), - // ID: to.Ptr("/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/000pikumar/providers/Microsoft.DataProtection/backupVaults/PratikPrivatePreviewVault1/deletedBackupInstances/testInstance1"), - // Properties: &armdataprotection.DeletedBackupInstance{ - // DataSourceInfo: &armdataprotection.Datasource{ - // DatasourceType: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"), - // ObjectType: to.Ptr("Datasource"), - // ResourceID: to.Ptr("/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest/databases/testdb"), - // ResourceLocation: to.Ptr(""), - // ResourceName: to.Ptr("testdb"), - // ResourceType: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"), - // ResourceURI: to.Ptr(""), - // }, - // DataSourceSetInfo: &armdataprotection.DatasourceSet{ - // DatasourceType: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"), - // ObjectType: to.Ptr("DatasourceSet"), - // ResourceID: to.Ptr("/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest"), - // ResourceLocation: to.Ptr(""), - // ResourceName: to.Ptr("viveksipgtest"), - // ResourceType: to.Ptr("Microsoft.DBforPostgreSQL/servers"), - // ResourceURI: to.Ptr(""), - // }, - // FriendlyName: to.Ptr("testInstance1"), - // ObjectType: to.Ptr("DeletedBackupInstance"), - // PolicyInfo: &armdataprotection.PolicyInfo{ - // PolicyID: to.Ptr("/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/000pikumar/providers/Microsoft.DataProtection/backupVaults/PratikPrivatePreviewVault1/backupPolicies/PratikPolicy1"), - // }, - // ProtectionStatus: &armdataprotection.ProtectionStatusDetails{ - // Status: to.Ptr(armdataprotection.StatusSoftDeleted), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // DeletionInfo: &armdataprotection.DeletionInfo{ - // BillingEndDate: to.Ptr("2022-05-06T00:00:36.6660445Z"), - // DeleteActivityID: to.Ptr("1e9ec790-d198-4efb-bbd7-e4669d5351a4"), - // DeletionTime: to.Ptr("2022-05-04T00:00:36.6660445Z"), - // ScheduledPurgeTime: to.Ptr("2022-05-20T00:00:36.6660445Z"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/DeletedBackupInstanceOperations/UndeleteDeletedBackupInstance.json -func ExampleDeletedBackupInstancesClient_BeginUndelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataprotection.NewDeletedBackupInstancesClient("04cf684a-d41f-4550-9f70-7708a3a2283b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUndelete(ctx, "testrg", "testvault", "testbi", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/dppresourceguardproxy_client.go b/sdk/resourcemanager/dataprotection/armdataprotection/dppresourceguardproxy_client.go new file mode 100644 index 000000000000..ac5cf6c4b068 --- /dev/null +++ b/sdk/resourcemanager/dataprotection/armdataprotection/dppresourceguardproxy_client.go @@ -0,0 +1,356 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package 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" +) + +// DppResourceGuardProxyClient contains the methods for the DppResourceGuardProxy group. +// Don't use this type directly, use NewDppResourceGuardProxyClient() instead. +type DppResourceGuardProxyClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewDppResourceGuardProxyClient creates a new instance of DppResourceGuardProxyClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewDppResourceGuardProxyClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DppResourceGuardProxyClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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 := &DppResourceGuardProxyClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// CreateOrUpdate - Creates or Updates a ResourceGuardProxy +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - vaultName - The name of the backup vault. +// - resourceGuardProxyName - name of the resource guard proxy +// - parameters - Request body for operation +// - options - DppResourceGuardProxyClientCreateOrUpdateOptions contains the optional parameters for the DppResourceGuardProxyClient.CreateOrUpdate +// method. +func (client *DppResourceGuardProxyClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, vaultName string, resourceGuardProxyName string, parameters ResourceGuardProxyBaseResource, options *DppResourceGuardProxyClientCreateOrUpdateOptions) (DppResourceGuardProxyClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, vaultName, resourceGuardProxyName, parameters, options) + if err != nil { + return DppResourceGuardProxyClientCreateOrUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DppResourceGuardProxyClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DppResourceGuardProxyClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *DppResourceGuardProxyClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, vaultName string, resourceGuardProxyName string, parameters ResourceGuardProxyBaseResource, options *DppResourceGuardProxyClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupResourceGuardProxies/{resourceGuardProxyName}" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if vaultName == "" { + return nil, errors.New("parameter vaultName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vaultName}", url.PathEscape(vaultName)) + if resourceGuardProxyName == "" { + return nil, errors.New("parameter resourceGuardProxyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGuardProxyName}", url.PathEscape(resourceGuardProxyName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *DppResourceGuardProxyClient) createOrUpdateHandleResponse(resp *http.Response) (DppResourceGuardProxyClientCreateOrUpdateResponse, error) { + result := DppResourceGuardProxyClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ResourceGuardProxyBaseResource); err != nil { + return DppResourceGuardProxyClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Deletes the ResourceGuardProxy +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - vaultName - The name of the backup vault. +// - resourceGuardProxyName - name of the resource guard proxy +// - options - DppResourceGuardProxyClientDeleteOptions contains the optional parameters for the DppResourceGuardProxyClient.Delete +// method. +func (client *DppResourceGuardProxyClient) Delete(ctx context.Context, resourceGroupName string, vaultName string, resourceGuardProxyName string, options *DppResourceGuardProxyClientDeleteOptions) (DppResourceGuardProxyClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, vaultName, resourceGuardProxyName, options) + if err != nil { + return DppResourceGuardProxyClientDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DppResourceGuardProxyClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return DppResourceGuardProxyClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return DppResourceGuardProxyClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *DppResourceGuardProxyClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, vaultName string, resourceGuardProxyName string, options *DppResourceGuardProxyClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupResourceGuardProxies/{resourceGuardProxyName}" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if vaultName == "" { + return nil, errors.New("parameter vaultName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vaultName}", url.PathEscape(vaultName)) + if resourceGuardProxyName == "" { + return nil, errors.New("parameter resourceGuardProxyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGuardProxyName}", url.PathEscape(resourceGuardProxyName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Returns the ResourceGuardProxy object associated with the vault, and that matches the name in the request +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - vaultName - The name of the backup vault. +// - resourceGuardProxyName - name of the resource guard proxy +// - options - DppResourceGuardProxyClientGetOptions contains the optional parameters for the DppResourceGuardProxyClient.Get +// method. +func (client *DppResourceGuardProxyClient) Get(ctx context.Context, resourceGroupName string, vaultName string, resourceGuardProxyName string, options *DppResourceGuardProxyClientGetOptions) (DppResourceGuardProxyClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, vaultName, resourceGuardProxyName, options) + if err != nil { + return DppResourceGuardProxyClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DppResourceGuardProxyClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DppResourceGuardProxyClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *DppResourceGuardProxyClient) getCreateRequest(ctx context.Context, resourceGroupName string, vaultName string, resourceGuardProxyName string, options *DppResourceGuardProxyClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupResourceGuardProxies/{resourceGuardProxyName}" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if vaultName == "" { + return nil, errors.New("parameter vaultName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vaultName}", url.PathEscape(vaultName)) + if resourceGuardProxyName == "" { + return nil, errors.New("parameter resourceGuardProxyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGuardProxyName}", url.PathEscape(resourceGuardProxyName)) + 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", "2023-01-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *DppResourceGuardProxyClient) getHandleResponse(resp *http.Response) (DppResourceGuardProxyClientGetResponse, error) { + result := DppResourceGuardProxyClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ResourceGuardProxyBaseResource); err != nil { + return DppResourceGuardProxyClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Returns the list of ResourceGuardProxies associated with the vault +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - vaultName - The name of the backup vault. +// - options - DppResourceGuardProxyClientListOptions contains the optional parameters for the DppResourceGuardProxyClient.NewListPager +// method. +func (client *DppResourceGuardProxyClient) NewListPager(resourceGroupName string, vaultName string, options *DppResourceGuardProxyClientListOptions) *runtime.Pager[DppResourceGuardProxyClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[DppResourceGuardProxyClientListResponse]{ + More: func(page DppResourceGuardProxyClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *DppResourceGuardProxyClientListResponse) (DppResourceGuardProxyClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, vaultName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return DppResourceGuardProxyClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DppResourceGuardProxyClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DppResourceGuardProxyClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *DppResourceGuardProxyClient) listCreateRequest(ctx context.Context, resourceGroupName string, vaultName string, options *DppResourceGuardProxyClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupResourceGuardProxies" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if vaultName == "" { + return nil, errors.New("parameter vaultName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vaultName}", url.PathEscape(vaultName)) + 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", "2023-01-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *DppResourceGuardProxyClient) listHandleResponse(resp *http.Response) (DppResourceGuardProxyClientListResponse, error) { + result := DppResourceGuardProxyClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ResourceGuardProxyBaseResourceList); err != nil { + return DppResourceGuardProxyClientListResponse{}, err + } + return result, nil +} + +// UnlockDelete - UnlockDelete call for ResourceGuardProxy, executed before one can delete it +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - vaultName - The name of the backup vault. +// - resourceGuardProxyName - name of the resource guard proxy +// - parameters - Request body for operation +// - options - DppResourceGuardProxyClientUnlockDeleteOptions contains the optional parameters for the DppResourceGuardProxyClient.UnlockDelete +// method. +func (client *DppResourceGuardProxyClient) UnlockDelete(ctx context.Context, resourceGroupName string, vaultName string, resourceGuardProxyName string, parameters UnlockDeleteRequest, options *DppResourceGuardProxyClientUnlockDeleteOptions) (DppResourceGuardProxyClientUnlockDeleteResponse, error) { + req, err := client.unlockDeleteCreateRequest(ctx, resourceGroupName, vaultName, resourceGuardProxyName, parameters, options) + if err != nil { + return DppResourceGuardProxyClientUnlockDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DppResourceGuardProxyClientUnlockDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DppResourceGuardProxyClientUnlockDeleteResponse{}, runtime.NewResponseError(resp) + } + return client.unlockDeleteHandleResponse(resp) +} + +// unlockDeleteCreateRequest creates the UnlockDelete request. +func (client *DppResourceGuardProxyClient) unlockDeleteCreateRequest(ctx context.Context, resourceGroupName string, vaultName string, resourceGuardProxyName string, parameters UnlockDeleteRequest, options *DppResourceGuardProxyClientUnlockDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupResourceGuardProxies/{resourceGuardProxyName}/unlockDelete" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if vaultName == "" { + return nil, errors.New("parameter vaultName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vaultName}", url.PathEscape(vaultName)) + if resourceGuardProxyName == "" { + return nil, errors.New("parameter resourceGuardProxyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGuardProxyName}", url.PathEscape(resourceGuardProxyName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// unlockDeleteHandleResponse handles the UnlockDelete response. +func (client *DppResourceGuardProxyClient) unlockDeleteHandleResponse(resp *http.Response) (DppResourceGuardProxyClientUnlockDeleteResponse, error) { + result := DppResourceGuardProxyClientUnlockDeleteResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.UnlockDeleteResponse); err != nil { + return DppResourceGuardProxyClientUnlockDeleteResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/exportjobs_client_example_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/exportjobs_client_example_test.go deleted file mode 100644 index a776f4571fea..000000000000 --- a/sdk/resourcemanager/dataprotection/armdataprotection/exportjobs_client_example_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. -// DO NOT EDIT. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginTrigger(ctx, "SwaggerTestRg", "NetSDKTestRsVault", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/exportjobsoperationresult_client_example_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/exportjobsoperationresult_client_example_test.go deleted file mode 100644 index 87addde525d9..000000000000 --- a/sdk/resourcemanager/dataprotection/armdataprotection/exportjobsoperationresult_client_example_test.go +++ /dev/null @@ -1,44 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "SwaggerTestRg", "NetSDKTestRsVault", "00000000-0000-0000-0000-000000000000", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExportJobsResult = armdataprotection.ExportJobsResult{ - // BlobSasKey: to.Ptr("someKey"), - // BlobURL: to.Ptr("https://azureblob.blob.core.windows.net/reportcontainer/exportjobsreport00000000-0000-0000-0000-000000000000"), - // ExcelFileBlobSasKey: to.Ptr("someKey"), - // ExcelFileBlobURL: to.Ptr("https://azureblob.blob.core.windows.net/reportcontainer/exportjobsreport00000000-0000-0000-0000-000000000000_ExcelFile.xlsx"), - // } -} diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/go.mod b/sdk/resourcemanager/dataprotection/armdataprotection/go.mod index 263649c906e0..9353aa998d30 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/go.mod +++ b/sdk/resourcemanager/dataprotection/armdataprotection/go.mod @@ -2,20 +2,12 @@ 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 v1.0.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.1 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.8.1 // indirect - github.com/golang-jwt/jwt/v4 v4.4.2 // indirect - github.com/google/uuid v1.1.1 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect - golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect golang.org/x/text v0.3.7 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/go.sum b/sdk/resourcemanager/dataprotection/armdataprotection/go.sum index 67cfef6bdf6e..3afb578030a5 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/go.sum +++ b/sdk/resourcemanager/dataprotection/armdataprotection/go.sum @@ -1,30 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 h1:sVPhtT2qjO86rTUaWMr4WoES4TkjGnzcioXcnHV9s5k= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.1 h1:T8quHYlUGyb/oqtSTwqlCr1ilJHrDv+ZtpSfo+hm1BU= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.1/go.mod h1:gLa1CL2RNE4s7M3yopJ/p0iq5DdY6Yv5ZUt9MTRZOQM= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.8.1 h1:oPdPEZFSbl7oSPEAIPMPBMUmiL+mqgzBJwM/9qYcwNg= -github.com/AzureAD/microsoft-authentication-library-for-go v0.8.1/go.mod h1:4qFor3D/HDsvBME35Xy9rwW9DecL+M2sNw1ybjPtwA0= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt/v4 v4.4.2 h1:rcc4lwaZgFMCZ5jxF9ABolDcIHdBytAFgqFPbSJQAYs= -github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -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/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 h1:Tgea0cVUD0ivh5ADBX4WwuI12DUd2to3nCYe2eayMIw= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/jobs_client_example_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/jobs_client_example_test.go deleted file mode 100644 index 3067a997739e..000000000000 --- a/sdk/resourcemanager/dataprotection/armdataprotection/jobs_client_example_test.go +++ /dev/null @@ -1,230 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("62b829ee-7936-40c9-a1c9-47a93f9f3965", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("BugBash1", "BugBashVaultForCCYv11", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AzureBackupJobResourceList = armdataprotection.AzureBackupJobResourceList{ - // Value: []*armdataprotection.AzureBackupJobResource{ - // { - // Name: to.Ptr("8989416e-7573-4836-8cf1-0e90954f1002"), - // Type: to.Ptr("Microsoft.DataProtection/Backupvaults/backupJobs"), - // ID: to.Ptr("/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/BugBash1/providers/Microsoft.DataProtection/Backupvaults/BugBashVaultForCCYv11/backupJobs/8989416e-7573-4836-8cf1-0e90954f1002"), - // Properties: &armdataprotection.AzureBackupJob{ - // ActivityID: to.Ptr("932925c4-3d81-4550-8105-c7f7b0a934c5"), - // BackupInstanceFriendlyName: to.Ptr("mabtestingccybasicv11\\bugbashdb4"), - // BackupInstanceID: to.Ptr("/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/BugBash1/providers/Microsoft.DataProtection/backupVaults/BugBashVaultForCCYv11/backupInstances/3048870f-b1b7-44c4-b078-368da3fd000e"), - // DataSourceID: to.Ptr("/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/DppPostgresTestingCcy/providers/Microsoft.DBforPostgreSQL/servers/mabtestingccybasicv11/databases/bugbashdb4"), - // DataSourceLocation: to.Ptr("centraluseuap"), - // DataSourceName: to.Ptr("bugbashdb4"), - // DataSourceSetName: to.Ptr("mabtestingccybasicv11"), - // DataSourceType: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"), - // Duration: to.Ptr("00:00:00"), - // IsUserTriggered: to.Ptr(false), - // Operation: to.Ptr("Backup"), - // OperationCategory: to.Ptr("Backup"), - // PolicyID: to.Ptr("/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/BugBash1/providers/Microsoft.DataProtection/backupVaults/BugBashVaultForCCYv11/backupPolicies/jakavetPolicy2"), - // PolicyName: to.Ptr("jakavetPolicy2"), - // ProgressEnabled: to.Ptr(false), - // SourceResourceGroup: to.Ptr("DppPostgresTestingCcy"), - // SourceSubscriptionID: to.Ptr("62b829ee-7936-40c9-a1c9-47a93f9f3965"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-16T05:00:08.1746833Z"); return t}()), - // Status: to.Ptr("Started"), - // SubscriptionID: to.Ptr("62b829ee-7936-40c9-a1c9-47a93f9f3965"), - // SupportedActions: []*string{ - // }, - // VaultName: to.Ptr("BugBashVaultForCCYv11"), - // }, - // }, - // { - // Name: to.Ptr("ad218c05-242a-47c2-b7b7-c16bd0f8870c"), - // Type: to.Ptr("Microsoft.DataProtection/Backupvaults/backupJobs"), - // ID: to.Ptr("/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/BugBash1/providers/Microsoft.DataProtection/Backupvaults/BugBashVaultForCCYv11/backupJobs/ad218c05-242a-47c2-b7b7-c16bd0f8870c"), - // Properties: &armdataprotection.AzureBackupJob{ - // ActivityID: to.Ptr("b4f32e03-ded0-46fc-9afc-91853878efcd"), - // BackupInstanceFriendlyName: to.Ptr("mabtestingccybasicv11\\bugbashdb5"), - // BackupInstanceID: to.Ptr("/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/BugBash1/providers/Microsoft.DataProtection/backupVaults/BugBashVaultForCCYv11/backupInstances/943c60db-c033-4d93-bb00-66048474e00e"), - // DataSourceID: to.Ptr("/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/DppPostgresTestingCcy/providers/Microsoft.DBforPostgreSQL/servers/mabtestingccybasicv11/databases/bugbashdb5"), - // DataSourceLocation: to.Ptr("centraluseuap"), - // DataSourceName: to.Ptr("bugbashdb5"), - // DataSourceSetName: to.Ptr("mabtestingccybasicv11"), - // DataSourceType: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"), - // Duration: to.Ptr("00:00:00"), - // IsUserTriggered: to.Ptr(false), - // Operation: to.Ptr("Backup"), - // OperationCategory: to.Ptr("Backup"), - // PolicyID: to.Ptr("/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/BugBash1/providers/Microsoft.DataProtection/backupVaults/BugBashVaultForCCYv11/backupPolicies/jakavetPolicy3"), - // PolicyName: to.Ptr("jakavetPolicy3"), - // ProgressEnabled: to.Ptr(false), - // SourceResourceGroup: to.Ptr("DppPostgresTestingCcy"), - // SourceSubscriptionID: to.Ptr("62b829ee-7936-40c9-a1c9-47a93f9f3965"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-16T18:00:03.6660733Z"); return t}()), - // Status: to.Ptr("Started"), - // SubscriptionID: to.Ptr("62b829ee-7936-40c9-a1c9-47a93f9f3965"), - // SupportedActions: []*string{ - // }, - // VaultName: to.Ptr("BugBashVaultForCCYv11"), - // }, - // }, - // { - // Name: to.Ptr("3c60cb49-63e8-4b21-b9bd-26277b3fdfae"), - // Type: to.Ptr("Microsoft.DataProtection/Backupvaults/backupJobs"), - // ID: to.Ptr("/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/BugBash1/providers/Microsoft.DataProtection/Backupvaults/BugBashVaultForCCYv11/backupJobs/3c60cb49-63e8-4b21-b9bd-26277b3fdfae"), - // Properties: &armdataprotection.AzureBackupJob{ - // ActivityID: to.Ptr("c4344fb4-7c11-43a4-8307-7ae7c7fb09b9"), - // BackupInstanceFriendlyName: to.Ptr("mabtestingccybasicv11\\bugbashdb2"), - // BackupInstanceID: to.Ptr("/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/BugBash1/providers/Microsoft.DataProtection/backupVaults/BugBashVaultForCCYv11/backupInstances/28460a9d-707a-45f3-ace6-b16284c2900e"), - // DataSourceID: to.Ptr("/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/DppPostgresTestingCcy/providers/Microsoft.DBforPostgreSQL/servers/mabtestingccybasicv11/databases/bugbashdb2"), - // DataSourceLocation: to.Ptr("centraluseuap"), - // DataSourceName: to.Ptr("bugbashdb2"), - // DataSourceSetName: to.Ptr("mabtestingccybasicv11"), - // DataSourceType: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"), - // Duration: to.Ptr("00:00:00"), - // IsUserTriggered: to.Ptr(false), - // Operation: to.Ptr("Backup"), - // OperationCategory: to.Ptr("Backup"), - // PolicyID: to.Ptr("/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/BugBash1/providers/Microsoft.DataProtection/backupVaults/BugBashVaultForCCYv11/backupPolicies/jakavetdailypolicy"), - // PolicyName: to.Ptr("jakavetdailypolicy"), - // ProgressEnabled: to.Ptr(false), - // SourceResourceGroup: to.Ptr("DppPostgresTestingCcy"), - // SourceSubscriptionID: to.Ptr("62b829ee-7936-40c9-a1c9-47a93f9f3965"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-17T03:00:03.7604146Z"); return t}()), - // Status: to.Ptr("Started"), - // SubscriptionID: to.Ptr("62b829ee-7936-40c9-a1c9-47a93f9f3965"), - // SupportedActions: []*string{ - // }, - // VaultName: to.Ptr("BugBashVaultForCCYv11"), - // }, - // }, - // { - // Name: to.Ptr("43252662-1b43-44fd-a856-0055665cb097"), - // Type: to.Ptr("Microsoft.DataProtection/Backupvaults/backupJobs"), - // ID: to.Ptr("/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/BugBash1/providers/Microsoft.DataProtection/Backupvaults/BugBashVaultForCCYv11/backupJobs/43252662-1b43-44fd-a856-0055665cb097"), - // Properties: &armdataprotection.AzureBackupJob{ - // ActivityID: to.Ptr("94052cf1-a47f-4c1b-93e7-79e07b2bd008-Tue Mar 17 2021 11:11:48 GMT+0530 (India Standard Time)-Ibz"), - // BackupInstanceFriendlyName: to.Ptr("mabtestingccybasicv11\\bugbashdb3"), - // BackupInstanceID: to.Ptr("/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/BugBash1/providers/Microsoft.DataProtection/backupVaults/BugBashVaultForCCYv11/backupInstances/0b247869-b8be-4885-b832-8ac4cdf5b00e"), - // DataSourceID: to.Ptr("/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/DppPostgresTestingCcy/providers/Microsoft.DBforPostgreSQL/servers/mabtestingccybasicv11/databases/bugbashdb3"), - // DataSourceLocation: to.Ptr("centraluseuap"), - // DataSourceName: to.Ptr("bugbashdb3"), - // DataSourceSetName: to.Ptr("mabtestingccybasicv11"), - // DataSourceType: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"), - // Duration: to.Ptr("00:02:11.9724387"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-17T11:14:02.5319646Z"); return t}()), - // IsUserTriggered: to.Ptr(true), - // Operation: to.Ptr("Backup"), - // OperationCategory: to.Ptr("Backup"), - // PolicyID: to.Ptr("/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/BugBash1/providers/Microsoft.DataProtection/backupVaults/BugBashVaultForCCYv11/backupPolicies/jakavetPolicy1"), - // PolicyName: to.Ptr("jakavetPolicy1"), - // ProgressEnabled: to.Ptr(false), - // SourceResourceGroup: to.Ptr("DppPostgresTestingCcy"), - // SourceSubscriptionID: to.Ptr("62b829ee-7936-40c9-a1c9-47a93f9f3965"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-17T11:11:50.5595259Z"); return t}()), - // Status: to.Ptr("Succeeded"), - // SubscriptionID: to.Ptr("62b829ee-7936-40c9-a1c9-47a93f9f3965"), - // SupportedActions: []*string{ - // to.Ptr("")}, - // VaultName: to.Ptr("BugBashVaultForCCYv11"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("62b829ee-7936-40c9-a1c9-47a93f9f3965", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "BugBash1", "BugBashVaultForCCYv11", "3c60cb49-63e8-4b21-b9bd-26277b3fdfae", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AzureBackupJobResource = armdataprotection.AzureBackupJobResource{ - // Name: to.Ptr("3c60cb49-63e8-4b21-b9bd-26277b3fdfae"), - // Type: to.Ptr("Microsoft.DataProtection/Backupvaults/backupJobs"), - // ID: to.Ptr("/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/BugBash1/providers/Microsoft.DataProtection/Backupvaults/BugBashVaultForCCYv11/backupJobs/3c60cb49-63e8-4b21-b9bd-26277b3fdfae"), - // Properties: &armdataprotection.AzureBackupJob{ - // ActivityID: to.Ptr("c4344fb4-7c11-43a4-8307-7ae7c7fb09b9"), - // BackupInstanceFriendlyName: to.Ptr("mabtestingccybasicv11\\bugbashdb2"), - // BackupInstanceID: to.Ptr("/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/BugBash1/providers/Microsoft.DataProtection/backupVaults/BugBashVaultForCCYv11/backupInstances/28460a9d-707a-45f3-ace6-b16284c2900e"), - // DataSourceID: to.Ptr("/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/DppPostgresTestingCcy/providers/Microsoft.DBforPostgreSQL/servers/mabtestingccybasicv11/databases/bugbashdb2"), - // DataSourceLocation: to.Ptr("centraluseuap"), - // DataSourceName: to.Ptr("bugbashdb2"), - // DataSourceSetName: to.Ptr("mabtestingccybasicv11"), - // DataSourceType: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"), - // Duration: to.Ptr("00:00:00"), - // ExtendedInfo: &armdataprotection.JobExtendedInfo{ - // AdditionalDetails: map[string]*string{ - // "PolicyRuleName": to.Ptr("BackupWeekly"), - // "RetentionTag": to.Ptr("Default"), - // "TaskId": to.Ptr("c4344fb4-7c11-43a4-8307-7ae7c7fb09b9"), - // }, - // SubTasks: []*armdataprotection.JobSubTask{ - // { - // TaskID: to.Ptr[int32](1), - // TaskName: to.Ptr("Trigger Backup"), - // TaskStatus: to.Ptr("Started"), - // }}, - // }, - // IsUserTriggered: to.Ptr(false), - // Operation: to.Ptr("Backup"), - // OperationCategory: to.Ptr("Backup"), - // PolicyID: to.Ptr("/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/BugBash1/providers/Microsoft.DataProtection/backupVaults/BugBashVaultForCCYv11/backupPolicies/jakavetdailypolicy"), - // PolicyName: to.Ptr("jakavetdailypolicy"), - // ProgressEnabled: to.Ptr(false), - // SourceResourceGroup: to.Ptr("DppPostgresTestingCcy"), - // SourceSubscriptionID: to.Ptr("62b829ee-7936-40c9-a1c9-47a93f9f3965"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-17T03:00:03.7604146Z"); return t}()), - // Status: to.Ptr("Started"), - // SubscriptionID: to.Ptr("62b829ee-7936-40c9-a1c9-47a93f9f3965"), - // SupportedActions: []*string{ - // }, - // VaultName: to.Ptr("BugBashVaultForCCYv11"), - // }, - // } -} diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/models.go b/sdk/resourcemanager/dataprotection/armdataprotection/models.go index a22e69738043..c6cf3017f4db 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/models.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/models.go @@ -1484,6 +1484,34 @@ type DppResource struct { Type *string `json:"type,omitempty" azure:"ro"` } +// DppResourceGuardProxyClientCreateOrUpdateOptions contains the optional parameters for the DppResourceGuardProxyClient.CreateOrUpdate +// method. +type DppResourceGuardProxyClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// DppResourceGuardProxyClientDeleteOptions contains the optional parameters for the DppResourceGuardProxyClient.Delete method. +type DppResourceGuardProxyClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// DppResourceGuardProxyClientGetOptions contains the optional parameters for the DppResourceGuardProxyClient.Get method. +type DppResourceGuardProxyClientGetOptions struct { + // placeholder for future optional parameters +} + +// DppResourceGuardProxyClientListOptions contains the optional parameters for the DppResourceGuardProxyClient.NewListPager +// method. +type DppResourceGuardProxyClientListOptions struct { + // placeholder for future optional parameters +} + +// DppResourceGuardProxyClientUnlockDeleteOptions contains the optional parameters for the DppResourceGuardProxyClient.UnlockDelete +// method. +type DppResourceGuardProxyClientUnlockDeleteOptions struct { + // placeholder for future optional parameters +} + // DppResourceList - ListResource type DppResourceList struct { // The uri to fetch the next page of resources. Call ListNext() fetches next page of resources. @@ -2182,6 +2210,47 @@ type ResourceGuardOperation struct { VaultCriticalOperation *string `json:"vaultCriticalOperation,omitempty" azure:"ro"` } +// ResourceGuardOperationDetail - VaultCritical Operation protected by a resource guard +type ResourceGuardOperationDetail struct { + DefaultResourceRequest *string `json:"defaultResourceRequest,omitempty"` + VaultCriticalOperation *string `json:"vaultCriticalOperation,omitempty"` +} + +// ResourceGuardProxyBase object, used in ResourceGuardProxyBaseResource +type ResourceGuardProxyBase struct { + Description *string `json:"description,omitempty"` + LastUpdatedTime *string `json:"lastUpdatedTime,omitempty"` + ResourceGuardOperationDetails []*ResourceGuardOperationDetail `json:"resourceGuardOperationDetails,omitempty"` + ResourceGuardResourceID *string `json:"resourceGuardResourceId,omitempty"` +} + +// ResourceGuardProxyBaseResource object, used for response and request bodies for ResourceGuardProxy APIs +type ResourceGuardProxyBaseResource struct { + // ResourceGuardProxyBaseResource properties + Properties *ResourceGuardProxyBase `json:"properties,omitempty"` + + // READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/… + Type *string `json:"type,omitempty" azure:"ro"` +} + +// ResourceGuardProxyBaseResourceList - List of ResourceGuardProxyBase resources +type ResourceGuardProxyBaseResourceList struct { + // The uri to fetch the next page of resources. Call ListNext() fetches next page of resources. + NextLink *string `json:"nextLink,omitempty"` + + // List of resources. + Value []*ResourceGuardProxyBaseResource `json:"value,omitempty"` +} + type ResourceGuardResource struct { // Optional ETag. ETag *string `json:"eTag,omitempty"` @@ -2669,6 +2738,18 @@ type TriggerContext struct { // GetTriggerContext implements the TriggerContextClassification interface for type TriggerContext. func (t *TriggerContext) GetTriggerContext() *TriggerContext { return t } +// UnlockDeleteRequest - Request body of unlock delete API. +type UnlockDeleteRequest struct { + ResourceGuardOperationRequests []*string `json:"resourceGuardOperationRequests,omitempty"` + ResourceToBeDeleted *string `json:"resourceToBeDeleted,omitempty"` +} + +// UnlockDeleteResponse - Response of Unlock Delete API. +type UnlockDeleteResponse struct { + // This is the time when unlock delete privileges will get expired. + UnlockDeleteExpiryTime *string `json:"unlockDeleteExpiryTime,omitempty"` +} + // UserFacingError - Error object used by layers that have access to localized content, and propagate that to user type UserFacingError struct { // Unique code for this error diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/models_serde.go b/sdk/resourcemanager/dataprotection/armdataprotection/models_serde.go index 43fa361ff674..97be77577968 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/models_serde.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/models_serde.go @@ -4211,6 +4211,150 @@ func (r *ResourceGuardOperation) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ResourceGuardOperationDetail. +func (r ResourceGuardOperationDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "defaultResourceRequest", r.DefaultResourceRequest) + populate(objectMap, "vaultCriticalOperation", r.VaultCriticalOperation) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceGuardOperationDetail. +func (r *ResourceGuardOperationDetail) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "defaultResourceRequest": + err = unpopulate(val, "DefaultResourceRequest", &r.DefaultResourceRequest) + delete(rawMsg, key) + case "vaultCriticalOperation": + err = unpopulate(val, "VaultCriticalOperation", &r.VaultCriticalOperation) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceGuardProxyBase. +func (r ResourceGuardProxyBase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", r.Description) + populate(objectMap, "lastUpdatedTime", r.LastUpdatedTime) + populate(objectMap, "resourceGuardOperationDetails", r.ResourceGuardOperationDetails) + populate(objectMap, "resourceGuardResourceId", r.ResourceGuardResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceGuardProxyBase. +func (r *ResourceGuardProxyBase) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &r.Description) + delete(rawMsg, key) + case "lastUpdatedTime": + err = unpopulate(val, "LastUpdatedTime", &r.LastUpdatedTime) + delete(rawMsg, key) + case "resourceGuardOperationDetails": + err = unpopulate(val, "ResourceGuardOperationDetails", &r.ResourceGuardOperationDetails) + delete(rawMsg, key) + case "resourceGuardResourceId": + err = unpopulate(val, "ResourceGuardResourceID", &r.ResourceGuardResourceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceGuardProxyBaseResource. +func (r ResourceGuardProxyBaseResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "systemData", r.SystemData) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceGuardProxyBaseResource. +func (r *ResourceGuardProxyBaseResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &r.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceGuardProxyBaseResourceList. +func (r ResourceGuardProxyBaseResourceList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceGuardProxyBaseResourceList. +func (r *ResourceGuardProxyBaseResourceList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &r.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ResourceGuardResource. func (r ResourceGuardResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -5122,6 +5266,64 @@ func (t *TriggerContext) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type UnlockDeleteRequest. +func (u UnlockDeleteRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "resourceGuardOperationRequests", u.ResourceGuardOperationRequests) + populate(objectMap, "resourceToBeDeleted", u.ResourceToBeDeleted) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UnlockDeleteRequest. +func (u *UnlockDeleteRequest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "resourceGuardOperationRequests": + err = unpopulate(val, "ResourceGuardOperationRequests", &u.ResourceGuardOperationRequests) + delete(rawMsg, key) + case "resourceToBeDeleted": + err = unpopulate(val, "ResourceToBeDeleted", &u.ResourceToBeDeleted) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UnlockDeleteResponse. +func (u UnlockDeleteResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "unlockDeleteExpiryTime", u.UnlockDeleteExpiryTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UnlockDeleteResponse. +func (u *UnlockDeleteResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "unlockDeleteExpiryTime": + err = unpopulate(val, "UnlockDeleteExpiryTime", &u.UnlockDeleteExpiryTime) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type UserFacingError. func (u UserFacingError) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/operationresult_client_example_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/operationresult_client_example_test.go deleted file mode 100644 index fd462b835a94..000000000000 --- a/sdk/resourcemanager/dataprotection/armdataprotection/operationresult_client_example_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. -// DO NOT EDIT. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "MjkxOTMyODMtYTE3My00YzJjLTg5NjctN2E4MDIxNDA3NjA2OzdjNGE2ZWRjLWJjMmItNDRkYi1hYzMzLWY1YzEwNzk5Y2EyOA==", "WestUS", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperationJobExtendedInfo = armdataprotection.OperationJobExtendedInfo{ - // ObjectType: to.Ptr("OperationJobExtendedInfo"), - // JobID: to.Ptr("c60cb49-63e8-4b21-b9bd-26277b3fdfae"), - // } -} diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/operations_client_example_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/operations_client_example_test.go deleted file mode 100644 index 14f57b2a04f4..000000000000 --- a/sdk/resourcemanager/dataprotection/armdataprotection/operations_client_example_test.go +++ /dev/null @@ -1,566 +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. -// DO NOT EDIT. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ClientDiscoveryResponse = armdataprotection.ClientDiscoveryResponse{ - // Value: []*armdataprotection.ClientDiscoveryValueForSingleAPI{ - // { - // Name: to.Ptr("Microsoft.DataProtection/locations/getBackupStatus/action"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("Check Backup Status for Recovery Services Vaults"), - // Operation: to.Ptr("Check Backup Status for Vault"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Backup Status"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/backupVaults/backupInstances/write"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("Creates a Backup Instance"), - // Operation: to.Ptr("Create a Backup Instance"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Backup Instance"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/backupVaults/backupInstances/delete"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("Deletes the Backup Instance"), - // Operation: to.Ptr("Delete Backup Instance"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Backup Instance"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/backupVaults/backupInstances/read"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns details of the Backup Instance"), - // Operation: to.Ptr("Get Backup Instance Details"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Backup Instance"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/backupVaults/backupInstances/read"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns all Backup Instances"), - // Operation: to.Ptr("Get Backup Instances"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Backup Instance"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/backupVaults/backupInstances/backup/action"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("Performs Backup on the Backup Instance"), - // Operation: to.Ptr("Backup Backup Instance"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Backup Instance"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/backupVaults/backupInstances/sync/action"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("Sync operation retries last failed operation on backup instance to bring it to a valid state."), - // Operation: to.Ptr("Sync Backup Instance"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Backup Instance"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/backupVaults/backupInstances/operationResults/read"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns Backup Operation Result for Backup Vault."), - // Operation: to.Ptr("Get Backup Operation Result"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Backup Instance"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/backupVaults/backupInstances/stopProtection/action"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("Stop Protection operation stops both backup and retention schedules of backup instance. Existing data will be retained forever."), - // Operation: to.Ptr("Stop Protection of Backup Instance"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Backup Instance"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/backupVaults/backupInstances/suspendBackups/action"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("Suspend Backups operation stops only backups of backup instance. Retention activities will continue and hence data will be ratained as per policy."), - // Operation: to.Ptr("Suspend Backups of Backup Instance"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Backup Instance"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/backupVaults/backupInstances/resumeProtection/action"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("Resume protection of a ProtectionStopped BI."), - // Operation: to.Ptr("Resume Protection of Backup Instance"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Backup Instance"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/backupVaults/backupInstances/resumeBackups/action"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("Resume Backups for a BackupsSuspended BI."), - // Operation: to.Ptr("Resume Backups of Backup Instance"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Backup Instance"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/backupVaults/backupInstances/validateRestore/action"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("Validates for Restore of the Backup Instance"), - // Operation: to.Ptr("Validate for Restore of Backup Instance"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Backup Instance"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/backupVaults/backupInstances/restore/action"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("Triggers restore on the Backup Instance"), - // Operation: to.Ptr("Restore Backup Instance"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Backup Instance"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/backupVaults/backupPolicies/write"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("Creates Backup Policy"), - // Operation: to.Ptr("Create Backup Policy"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Backup Policies"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/backupVaults/backupPolicies/delete"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("Deletes the Backup Policy"), - // Operation: to.Ptr("Delete Backup Policy"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Backup Policies"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/backupVaults/backupPolicies/read"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns details of the Backup Policy"), - // Operation: to.Ptr("Get Backup Policy details"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Backup Policies"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/backupVaults/backupPolicies/read"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns all Backup Policies"), - // Operation: to.Ptr("Get Backup Policies"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Backup Policies"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/backupVaults/backupResourceGuardProxies/read"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("Get the list of ResourceGuard proxies for a resource"), - // Operation: to.Ptr("Get the list of ResourceGuard proxies for a resource"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Resource Guard Proxy"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/backupVaults/backupResourceGuardProxies/read"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("Get ResourceGuard proxy operation gets an object representing the Azure resource of type 'ResourceGuard proxy'"), - // Operation: to.Ptr("Get ResourceGuard proxy"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Resource Guard Proxy"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/backupVaults/backupResourceGuardProxies/write"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("Create ResourceGuard proxy operation creates an Azure resource of type 'ResourceGuard Proxy'"), - // Operation: to.Ptr("Create ResourceGuard proxy"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Resource Guard Proxy"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/backupVaults/backupResourceGuardProxies/delete"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("The Delete ResourceGuard proxy operation deletes the specified Azure resource of type 'ResourceGuard proxy'"), - // Operation: to.Ptr("Delete ResourceGuard proxy"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Resource Guard Proxy"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/backupVaults/backupResourceGuardProxies/unlockDelete/action"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("Unlock delete ResourceGuard proxy operation unlocks the next delete critical operation"), - // Operation: to.Ptr("Unlock delete ResourceGuard proxy operation unlocks the next delete critical operation"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Resource Guard Proxy"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/backupVaults/backupInstances/recoveryPoints/read"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns details of the Recovery Point"), - // Operation: to.Ptr("Get Recovery Point Details"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Recovery Points"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/backupVaults/backupInstances/recoveryPoints/read"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns all Recovery Points"), - // Operation: to.Ptr("Get Recovery Points"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Recovery Points"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/backupVaults/backupInstances/findRestorableTimeRanges/action"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("Finds Restorable Time Ranges"), - // Operation: to.Ptr("Find Restorable Time Ranges"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Restorable Time Ranges"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/backupVaults/write"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("Create BackupVault operation creates an Azure resource of type 'Backup Vault'"), - // Operation: to.Ptr("Create Backup Vault"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Backup Vaults"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/backupVaults/read"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("Create BackupVault operation creates an Azure resource of type 'Backup Vault'"), - // Operation: to.Ptr("Create Backup Vault"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Backup Vaults"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/backupVaults/delete"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("Create BackupVault operation creates an Azure resource of type 'Backup Vault'"), - // Operation: to.Ptr("Create Backup Vault"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Backup Vaults"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/backupVaults/operationResults/read"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("Gets Operation Result of a Patch Operation for a Backup Vault"), - // Operation: to.Ptr("Get Operation Result of a Patch Operation for a Backup Vault"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Backup Vaults"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/locations/checkNameAvailability/action"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("Checks if the requested BackupVault Name is Available"), - // Operation: to.Ptr("Check if the requested BackupVault Name is Available"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Backup Vaults"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/backupVaults/read"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("Gets list of Backup Vaults in a Resource Group"), - // Operation: to.Ptr("Get Backup Vaults in a Resource Group"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Backup Vaults"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/backupVaults/read"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("Gets list of Backup Vaults in a Subscription"), - // Operation: to.Ptr("Get Backup Vaults in a Subscription"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Backup Vaults"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/subscriptions/resourceGroups/providers/resourceGuards/write"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("Create ResourceGuard operation creates an Azure resource of type 'ResourceGuard'"), - // Operation: to.Ptr("Create ResourceGuard"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Resource Guards"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/subscriptions/resourceGroups/providers/resourceGuards/read"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("The Get ResourceGuard operation gets an object representing the Azure resource of type 'ResourceGuard'"), - // Operation: to.Ptr("Get ResourceGuard"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Resource Guards"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/subscriptions/resourceGroups/providers/resourceGuards/delete"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("The Delete ResourceGuard operation deletes the specified Azure resource of type 'ResourceGuard'"), - // Operation: to.Ptr("Delete ResourceGuard"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Resource Guards"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/subscriptions/resourceGroups/providers/resourceGuards/read"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("Gets list of ResourceGuards in a Resource Group"), - // Operation: to.Ptr("Get ResourceGuards in a Resource Group"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Resource Guards"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/subscriptions/providers/resourceGuards/read"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("Gets list of ResourceGuards in a Subscription"), - // Operation: to.Ptr("Get ResourceGuards in a Subscription"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Resource Guards"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/subscriptions/resourceGroups/providers/resourceGuards/write"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("Update ResouceGuard operation updates an Azure resource of type 'ResourceGuard'"), - // Operation: to.Ptr("Update ResourceGuard"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Resource Guards"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/subscriptions/resourceGroups/providers/resourceGuards/{operationName}/read"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("Gets ResourceGuard operation request info"), - // Operation: to.Ptr("Get ResourceGuard operation request info"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Resource Guards"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/subscriptions/resourceGroups/providers/resourceGuards/{operationName}/read"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("Gets ResourceGuard default operation request info"), - // Operation: to.Ptr("Get ResourceGuard default operation request info"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Resource Guards"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/subscriptions/providers/locations/checkFeatureSupport/action"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("Validates if a feature is supported"), - // Operation: to.Ptr("Validate if a feature is supported"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Resource Provider Operation"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/locations/operationStatus/read"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns Backup Operation Status for Backup Vault."), - // Operation: to.Ptr("Get Backup Operation Status"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Backup Operation Status"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/backupVaults/operationStatus/read"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns Backup Operation Status for Backup Vault."), - // Operation: to.Ptr("Get Backup Operation Status"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Backup Operation Status"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/subscriptions/resourceGroups/providers/operationStatus/read"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns Backup Operation Status for Backup Vault."), - // Operation: to.Ptr("Get Backup Operation Status"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Backup Operation Status"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/locations/operationResults/read"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns Backup Operation Result for Backup Vault."), - // Operation: to.Ptr("Get Backup Operation Result"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Backup Operation Results"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/backupVaults/validateForBackup/action"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("Validates for backup of Backup Instance"), - // Operation: to.Ptr("Validate for backup of Backup Instance"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Validate Backup"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/backupVaults/backupJobs/read"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("Get Jobs list"), - // Operation: to.Ptr("Backup Jobs"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Backup Jobs"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/backupJobs/read"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("Get Job details"), - // Operation: to.Ptr("Backup Job Object"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Backup Jobs"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/register/action"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("Registers subscription for given Resource Provider"), - // Operation: to.Ptr("Register Resource Provider"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Resource Provider Operation"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/unregister/action"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("Unregisters subscription for given Resource Provider"), - // Operation: to.Ptr("Unregister Resource Provider"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Resource Provider Operation"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.DataProtection/operations/read"), - // Display: &armdataprotection.ClientDiscoveryDisplay{ - // Description: to.Ptr("Operation returns the list of Operations for a Resource Provider"), - // Operation: to.Ptr("List of Operations"), - // Provider: to.Ptr("Microsoft.DataProtection"), - // Resource: to.Ptr("Resource Provider Operation"), - // }, - // Origin: to.Ptr("user"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/operationstatus_client_example_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/operationstatus_client_example_test.go deleted file mode 100644 index faa47ed25280..000000000000 --- a/sdk/resourcemanager/dataprotection/armdataprotection/operationstatus_client_example_test.go +++ /dev/null @@ -1,45 +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. -// DO NOT EDIT. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "WestUS", "MjkxOTMyODMtYTE3My00YzJjLTg5NjctN2E4MDIxNDA3NjA2OzdjNGE2ZWRjLWJjMmItNDRkYi1hYzMzLWY1YzEwNzk5Y2EyOA==", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperationResource = armdataprotection.OperationResource{ - // Name: to.Ptr("MjkxOTMyODMtYTE3My00YzJjLTg5NjctN2E4MDIxNDA3NjA2OzdjNGE2ZWRjLWJjMmItNDRkYi1hYzMzLWY1YzEwNzk5Y2EyOA=="), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-11-20T09:49:46Z"); return t}()), - // ID: to.Ptr("/subscriptions/0b352192-dcac-4cc7-992e-a96190ccc68c/providers/Microsoft.DataProtection/locations/WestUS/operationStatus/MjkxOTMyODMtYTE3My00YzJjLTg5NjctN2E4MDIxNDA3NjA2OzdjNGE2ZWRjLWJjMmItNDRkYi1hYzMzLWY1YzEwNzk5Y2EyOA=="), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-11-20T09:49:44.0478496Z"); return t}()), - // Status: to.Ptr("Succeeded"), - // } -} diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/operationstatusbackupvaultcontext_client_example_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/operationstatusbackupvaultcontext_client_example_test.go deleted file mode 100644 index c4b218f903c2..000000000000 --- a/sdk/resourcemanager/dataprotection/armdataprotection/operationstatusbackupvaultcontext_client_example_test.go +++ /dev/null @@ -1,45 +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. -// DO NOT EDIT. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "SampleResourceGroup", "swaggerExample", "MjkxOTMyODMtYTE3My00YzJjLTg5NjctN2E4MDIxNDA3NjA2OzdjNGE2ZWRjLWJjMmItNDRkYi1hYzMzLWY1YzEwNzk5Y2EyOA==", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperationResource = armdataprotection.OperationResource{ - // Name: to.Ptr("MjkxOTMyODMtYTE3My00YzJjLTg5NjctN2E4MDIxNDA3NjA2OzdjNGE2ZWRjLWJjMmItNDRkYi1hYzMzLWY1YzEwNzk5Y2EyOA=="), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-11-20T09:49:46Z"); return t}()), - // ID: to.Ptr("/subscriptions/0b352192-dcac-4cc7-992e-a96190ccc68c/resourceGroups/SampleResourceGroup/providers/Microsoft.DataProtection/backupVaults/swaggerExample/operationStatus/MjkxOTMyODMtYTE3My00YzJjLTg5NjctN2E4MDIxNDA3NjA2OzdjNGE2ZWRjLWJjMmItNDRkYi1hYzMzLWY1YzEwNzk5Y2EyOA=="), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-11-20T09:49:44.0478496Z"); return t}()), - // Status: to.Ptr("Succeeded"), - // } -} diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/operationstatusresourcegroupcontext_client_example_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/operationstatusresourcegroupcontext_client_example_test.go deleted file mode 100644 index e418a51d354f..000000000000 --- a/sdk/resourcemanager/dataprotection/armdataprotection/operationstatusresourcegroupcontext_client_example_test.go +++ /dev/null @@ -1,45 +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. -// DO NOT EDIT. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "SampleResourceGroup", "MjkxOTMyODMtYTE3My00YzJjLTg5NjctN2E4MDIxNDA3NjA2OzdjNGE2ZWRjLWJjMmItNDRkYi1hYzMzLWY1YzEwNzk5Y2EyOA==", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperationResource = armdataprotection.OperationResource{ - // Name: to.Ptr("MjkxOTMyODMtYTE3My00YzJjLTg5NjctN2E4MDIxNDA3NjA2OzdjNGE2ZWRjLWJjMmItNDRkYi1hYzMzLWY1YzEwNzk5Y2EyOA=="), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-11-20T09:49:46Z"); return t}()), - // ID: to.Ptr("/subscriptions/0b352192-dcac-4cc7-992e-a96190ccc68c/resourceGroups/SampleResourceGroup/providers/Microsoft.DataProtection/operationStatus/MjkxOTMyODMtYTE3My00YzJjLTg5NjctN2E4MDIxNDA3NjA2OzdjNGE2ZWRjLWJjMmItNDRkYi1hYzMzLWY1YzEwNzk5Y2EyOA=="), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-11-20T09:49:44.0478496Z"); return t}()), - // Status: to.Ptr("Succeeded"), - // } -} diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/recoverypoints_client_example_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/recoverypoints_client_example_test.go deleted file mode 100644 index b91bb454a9e1..000000000000 --- a/sdk/resourcemanager/dataprotection/armdataprotection/recoverypoints_client_example_test.go +++ /dev/null @@ -1,141 +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. -// DO NOT EDIT. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("04cf684a-d41f-4550-9f70-7708a3a2283b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("000pikumar", "PratikPrivatePreviewVault1", "testInstance1", &armdataprotection.RecoveryPointsClientListOptions{Filter: nil, - SkipToken: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AzureBackupRecoveryPointResourceList = armdataprotection.AzureBackupRecoveryPointResourceList{ - // Value: []*armdataprotection.AzureBackupRecoveryPointResource{ - // { - // Name: to.Ptr("7fb2cddd-c5b3-44f6-a0d9-db3c4f9d5e35"), - // Type: to.Ptr("microsoft.dataprotection/backupvaults/backupInstances/recoveryPoints"), - // ID: to.Ptr("/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/HelloTest/providers/Microsoft.DataProtection/backupVaults/HelloTestVault/backupInstances/653213d-c5b3-44f6-a0d9-db3c4f9d8e34/recoveryPoints/7fb2cddd-c5b3-44f6-a0d9-db3c4f9d5f25"), - // Properties: &armdataprotection.AzureBackupDiscreteRecoveryPoint{ - // ObjectType: to.Ptr("AzureBackupDiscreteRecoveryPoint"), - // ExpiryTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T13:00:00Z"); return t}()), - // FriendlyName: to.Ptr("panbha4"), - // RecoveryPointDataStoresDetails: []*armdataprotection.RecoveryPointDataStoreDetails{ - // { - // Type: to.Ptr("Snapshot"), - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-01T13:00:00Z"); return t}()), - // ID: to.Ptr("0ff03512-b333-4509-a6c7-12164c8b1dce"), - // MetaData: to.Ptr("123456"), - // }, - // { - // Type: to.Ptr("BackupStorage"), - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-01T13:00:00Z"); return t}()), - // ID: to.Ptr("5d8cfd30-722e-4bab-85f6-4a9d01ffc6f1"), - // MetaData: to.Ptr("123456"), - // }}, - // RecoveryPointTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-01T13:00:00Z"); return t}()), - // RecoveryPointType: to.Ptr("Full"), - // }, - // }, - // { - // Name: to.Ptr("7fb2cddd-c5b3-44f6-a0d9-db3c4f9d5f25"), - // Type: to.Ptr("microsoft.dataprotection/backupvaults/backupInstances/recoveryPoints"), - // ID: to.Ptr("/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/HelloTest/providers/Microsoft.DataProtection/backupVaults/HelloTestVault/backupInstances/653213d-c5b3-44f6-a0d9-db3c4f9d8e34/recoveryPoints/7fb2cddd-c5b3-44f6-a0d9-db3c4f9d5f25"), - // Properties: &armdataprotection.AzureBackupDiscreteRecoveryPoint{ - // ObjectType: to.Ptr("AzureBackupDiscreteRecoveryPoint"), - // FriendlyName: to.Ptr("panbha4"), - // RecoveryPointDataStoresDetails: []*armdataprotection.RecoveryPointDataStoreDetails{ - // { - // Type: to.Ptr("Snapshot"), - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-01T13:00:00Z"); return t}()), - // ID: to.Ptr("808cfd30-722e-4bab-85f6-4a9d01ffc6f2"), - // MetaData: to.Ptr("123456"), - // }, - // { - // Type: to.Ptr("BackupStorage"), - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-01T13:00:00Z"); return t}()), - // ID: to.Ptr("798cfd30-722e-4bab-85f6-4a9d01ffc6f3"), - // MetaData: to.Ptr("123456"), - // }}, - // RecoveryPointTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-01T13:00:00Z"); return t}()), - // RecoveryPointType: to.Ptr("Full"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("04cf684a-d41f-4550-9f70-7708a3a2283b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "000pikumar", "PratikPrivatePreviewVault1", "testInstance1", "7fb2cddd-c5b3-44f6-a0d9-db3c4f9d5f25", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AzureBackupRecoveryPointResource = armdataprotection.AzureBackupRecoveryPointResource{ - // Name: to.Ptr("7fb2cddd-c5b3-44f6-a0d9-db3c4f9d5f25"), - // Type: to.Ptr("microsoft.dataprotection/backupvaults/backupInstances/recoveryPoints"), - // ID: to.Ptr("/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/HelloTest/providers/Microsoft.DataProtection/backupVaults/HelloTestVault/backupInstances/653213d-c5b3-44f6-a0d9-db3c4f9d8e34/recoveryPoints/7fb2cddd-c5b3-44f6-a0d9-db3c4f9d5f25"), - // Properties: &armdataprotection.AzureBackupDiscreteRecoveryPoint{ - // ObjectType: to.Ptr("AzureBackupDiscreteRecoveryPoint"), - // FriendlyName: to.Ptr("panbha4"), - // RecoveryPointDataStoresDetails: []*armdataprotection.RecoveryPointDataStoreDetails{ - // { - // Type: to.Ptr("Snapshot"), - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-01T13:00:00Z"); return t}()), - // ID: to.Ptr("0ff03512-b333-4509-a6c7-12164c8b1dce"), - // MetaData: to.Ptr("123456"), - // }, - // { - // Type: to.Ptr("BackupStorage"), - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-01T13:00:00Z"); return t}()), - // ID: to.Ptr("5d8cfd30-722e-4bab-85f6-4a9d01ffc6f1"), - // MetaData: to.Ptr("123456"), - // }}, - // RecoveryPointTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-01T13:00:00Z"); return t}()), - // RecoveryPointType: to.Ptr("Full"), - // }, - // } -} diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/resourceguards_client_example_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/resourceguards_client_example_test.go deleted file mode 100644 index 462fbdb4983b..000000000000 --- a/sdk/resourcemanager/dataprotection/armdataprotection/resourceguards_client_example_test.go +++ /dev/null @@ -1,632 +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. -// DO NOT EDIT. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewGetResourcesInSubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ResourceGuardResourceList = armdataprotection.ResourceGuardResourceList{ - // Value: []*armdataprotection.ResourceGuardResource{ - // { - // Name: to.Ptr("VaultGuardTestNew"), - // Type: to.Ptr("Microsoft.DataProtection/resourceGuards"), - // ID: to.Ptr("/subscriptions/c999d45b-944f-418c-a0d8-c3fcfd1802c8/resourceGroups/vaultguardRGNew/providers/Microsoft.DataProtection/resourceGuards/VaultGuardTestNew"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "TestKey": to.Ptr("TestValue"), - // }, - // Properties: &armdataprotection.ResourceGuard{ - // Description: to.Ptr("Please take JIT access before performing any of the critical operation"), - // AllowAutoApprovals: to.Ptr(true), - // ProvisioningState: to.Ptr(armdataprotection.ProvisioningStateSucceeded), - // ResourceGuardOperations: []*armdataprotection.ResourceGuardOperation{ - // { - // RequestResourceType: to.Ptr("Microsoft.DataProtection/resourceGuards/deleteResourceGuardProxyRequests"), - // VaultCriticalOperation: to.Ptr("Microsoft.RecoveryServices/vaults/backupResourceGuardProxies/delete"), - // }, - // { - // RequestResourceType: to.Ptr("Microsoft.DataProtection/resourceGuards/disableSoftDeleteRequests"), - // VaultCriticalOperation: to.Ptr("Microsoft.RecoveryServices/vaults/backupconfig/write"), - // }}, - // VaultCriticalOperationExclusionList: []*string{ - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewGetResourcesInResourceGroupPager("SampleResourceGroup", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ResourceGuardResourceList = armdataprotection.ResourceGuardResourceList{ - // Value: []*armdataprotection.ResourceGuardResource{ - // { - // Name: to.Ptr("VaultGuardTestNew"), - // Type: to.Ptr("Microsoft.DataProtection/resourceGuards"), - // ID: to.Ptr("/subscriptions/c999d45b-944f-418c-a0d8-c3fcfd1802c8/resourceGroups/vaultguardRGNew/providers/Microsoft.DataProtection/resourceGuards/VaultGuardTestNew"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "TestKey": to.Ptr("TestValue"), - // }, - // Properties: &armdataprotection.ResourceGuard{ - // Description: to.Ptr("Please take JIT access before performing any of the critical operation"), - // AllowAutoApprovals: to.Ptr(true), - // ProvisioningState: to.Ptr(armdataprotection.ProvisioningStateSucceeded), - // ResourceGuardOperations: []*armdataprotection.ResourceGuardOperation{ - // { - // RequestResourceType: to.Ptr("Microsoft.DataProtection/resourceGuards/deleteResourceGuardProxyRequests"), - // VaultCriticalOperation: to.Ptr("Microsoft.RecoveryServices/vaults/backupResourceGuardProxies/delete"), - // }, - // { - // RequestResourceType: to.Ptr("Microsoft.DataProtection/resourceGuards/disableSoftDeleteRequests"), - // VaultCriticalOperation: to.Ptr("Microsoft.RecoveryServices/vaults/backupconfig/write"), - // }}, - // VaultCriticalOperationExclusionList: []*string{ - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Put(ctx, "SampleResourceGroup", "swaggerExample", armdataprotection.ResourceGuardResource{ - Location: to.Ptr("WestUS"), - Tags: map[string]*string{ - "key1": to.Ptr("val1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ResourceGuardResource = armdataprotection.ResourceGuardResource{ - // Name: to.Ptr("VaultGuardTestNew"), - // Type: to.Ptr("Microsoft.DataProtection/resourceGuards"), - // ID: to.Ptr("/subscriptions/c999d45b-944f-418c-a0d8-c3fcfd1802c8/resourceGroups/vaultguardRGNew/providers/Microsoft.DataProtection/resourceGuards/VaultGuardTestNew"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "TestKey": to.Ptr("TestValue"), - // }, - // Properties: &armdataprotection.ResourceGuard{ - // Description: to.Ptr("Please take JIT access before performing any of the critical operation"), - // AllowAutoApprovals: to.Ptr(true), - // ProvisioningState: to.Ptr(armdataprotection.ProvisioningStateSucceeded), - // ResourceGuardOperations: []*armdataprotection.ResourceGuardOperation{ - // { - // RequestResourceType: to.Ptr("Microsoft.DataProtection/resourceGuards/deleteResourceGuardProxyRequests"), - // VaultCriticalOperation: to.Ptr("Microsoft.RecoveryServices/vaults/backupResourceGuardProxies/delete"), - // }, - // { - // RequestResourceType: to.Ptr("Microsoft.DataProtection/resourceGuards/disableSoftDeleteRequests"), - // VaultCriticalOperation: to.Ptr("Microsoft.RecoveryServices/vaults/backupconfig/write"), - // }}, - // VaultCriticalOperationExclusionList: []*string{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "SampleResourceGroup", "swaggerExample", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ResourceGuardResource = armdataprotection.ResourceGuardResource{ - // Name: to.Ptr("ResourceGuardTestNew"), - // Type: to.Ptr("Microsoft.DataProtection/resourceGuards"), - // ID: to.Ptr("/subscriptions/c999d45b-944f-418c-a0d8-c3fcfd1802c8/resourceGroups/vaultguardRGNew/providers/Microsoft.DataProtection/resourceGuards/VaultGuardTestNew"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "TestKey": to.Ptr("TestValue"), - // }, - // Properties: &armdataprotection.ResourceGuard{ - // Description: to.Ptr("Please take JIT access before performing any of the critical operation"), - // AllowAutoApprovals: to.Ptr(true), - // ProvisioningState: to.Ptr(armdataprotection.ProvisioningStateSucceeded), - // ResourceGuardOperations: []*armdataprotection.ResourceGuardOperation{ - // { - // RequestResourceType: to.Ptr("Microsoft.DataProtection/resourceGuards/deleteResourceGuardProxyRequests"), - // VaultCriticalOperation: to.Ptr("Microsoft.RecoveryServices/vaults/backupResourceGuardProxies/delete"), - // }, - // { - // RequestResourceType: to.Ptr("Microsoft.DataProtection/resourceGuards/disableSoftDeleteRequests"), - // VaultCriticalOperation: to.Ptr("Microsoft.RecoveryServices/vaults/backupconfig/write"), - // }}, - // VaultCriticalOperationExclusionList: []*string{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, "SampleResourceGroup", "swaggerExample", 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/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Patch(ctx, "SampleResourceGroup", "swaggerExample", armdataprotection.PatchResourceGuardInput{ - Tags: map[string]*string{ - "newKey": to.Ptr("newVal"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ResourceGuardResource = armdataprotection.ResourceGuardResource{ - // Name: to.Ptr("VaultGuardTestNew"), - // Type: to.Ptr("Microsoft.DataProtection/resourceGuards"), - // ID: to.Ptr("/subscriptions/c999d45b-944f-418c-a0d8-c3fcfd1802c8/resourceGroups/vaultguardRGNew/providers/Microsoft.DataProtection/resourceGuards/VaultGuardTestNew"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "TestKey": to.Ptr("TestValue"), - // }, - // Properties: &armdataprotection.ResourceGuard{ - // Description: to.Ptr("Please take JIT access before performing any of the critical operation"), - // AllowAutoApprovals: to.Ptr(true), - // ProvisioningState: to.Ptr(armdataprotection.ProvisioningStateSucceeded), - // ResourceGuardOperations: []*armdataprotection.ResourceGuardOperation{ - // { - // RequestResourceType: to.Ptr("Microsoft.DataProtection/resourceGuards/deleteResourceGuardProxyRequests"), - // VaultCriticalOperation: to.Ptr("Microsoft.RecoveryServices/vaults/backupResourceGuardProxies/delete"), - // }, - // { - // RequestResourceType: to.Ptr("Microsoft.DataProtection/resourceGuards/disableSoftDeleteRequests"), - // VaultCriticalOperation: to.Ptr("Microsoft.RecoveryServices/vaults/backupconfig/write"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewGetDisableSoftDeleteRequestsObjectsPager("SampleResourceGroup", "swaggerExample", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DppBaseResourceList = armdataprotection.DppBaseResourceList{ - // Value: []*armdataprotection.DppBaseResource{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.DataProtection/resourceGuards/disableSoftDeleteRequests"), - // ID: to.Ptr("subscriotions/0b352192-dcac-4cc7-992e-a96190ccc68c/resourceGroups/SampleResourceGroup/providers/Microsoft.DataProtection/resourceGuards/swaggerExample/disableSoftDeleteRequests/default"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewGetDeleteResourceGuardProxyRequestsObjectsPager("SampleResourceGroup", "swaggerExample", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DppBaseResourceList = armdataprotection.DppBaseResourceList{ - // Value: []*armdataprotection.DppBaseResource{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.DataProtection/resourceGuards/deleteResourceGuardProxyRequests"), - // ID: to.Ptr("subscriotions/0b352192-dcac-4cc7-992e-a96190ccc68c/resourceGroups/SampleResourceGroup/providers/Microsoft.DataProtection/resourceGuards/swaggerExample/deleteResourceGuardProxyRequests/default"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewGetBackupSecurityPINRequestsObjectsPager("SampleResourceGroup", "swaggerExample", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DppBaseResourceList = armdataprotection.DppBaseResourceList{ - // Value: []*armdataprotection.DppBaseResource{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.DataProtection/resourceGuards/getBackupSecurityPINRequests"), - // ID: to.Ptr("subscriotions/0b352192-dcac-4cc7-992e-a96190ccc68c/resourceGroups/SampleResourceGroup/providers/Microsoft.DataProtection/resourceGuards/swaggerExample/getBackupSecurityPINRequests/default"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewGetDeleteProtectedItemRequestsObjectsPager("SampleResourceGroup", "swaggerExample", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DppBaseResourceList = armdataprotection.DppBaseResourceList{ - // Value: []*armdataprotection.DppBaseResource{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.DataProtection/resourceGuards/deleteProtectedItemRequests"), - // ID: to.Ptr("subscriotions/0b352192-dcac-4cc7-992e-a96190ccc68c/resourceGroups/SampleResourceGroup/providers/Microsoft.DataProtection/resourceGuards/swaggerExample/deleteProtectedItemRequests/default"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewGetUpdateProtectionPolicyRequestsObjectsPager("SampleResourceGroup", "swaggerExample", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DppBaseResourceList = armdataprotection.DppBaseResourceList{ - // Value: []*armdataprotection.DppBaseResource{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.DataProtection/resourceGuards/updateProtectionPolicyRequests"), - // ID: to.Ptr("subscriotions/0b352192-dcac-4cc7-992e-a96190ccc68c/resourceGroups/SampleResourceGroup/providers/Microsoft.DataProtection/resourceGuards/swaggerExample/updateProtectionPolicyRequests/default"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewGetUpdateProtectedItemRequestsObjectsPager("SampleResourceGroup", "swaggerExample", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DppBaseResourceList = armdataprotection.DppBaseResourceList{ - // Value: []*armdataprotection.DppBaseResource{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.DataProtection/resourceGuards/updateProtectedItemRequests"), - // ID: to.Ptr("subscriotions/0b352192-dcac-4cc7-992e-a96190ccc68c/resourceGroups/SampleResourceGroup/providers/Microsoft.DataProtection/resourceGuards/swaggerExample/updateProtectedItemRequests/default"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetDefaultDisableSoftDeleteRequestsObject(ctx, "SampleResourceGroup", "swaggerExample", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DppBaseResource = armdataprotection.DppBaseResource{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.DataProtection/resourceGuards/disableSoftDeleteRequests"), - // ID: to.Ptr("subscriotions/0b352192-dcac-4cc7-992e-a96190ccc68c/resourceGroups/SampleResourceGroup/providers/Microsoft.DataProtection/resourceGuards/swaggerExample/disableSoftDeleteRequests/default"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetDefaultDeleteResourceGuardProxyRequestsObject(ctx, "SampleResourceGroup", "swaggerExample", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DppBaseResource = armdataprotection.DppBaseResource{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.DataProtection/resourceGuards/deleteResourceGuardProxyRequests"), - // ID: to.Ptr("subscriotions/0b352192-dcac-4cc7-992e-a96190ccc68c/resourceGroups/SampleResourceGroup/providers/Microsoft.DataProtection/resourceGuards/swaggerExample/deleteResourceGuardProxyRequests/default"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetDefaultBackupSecurityPINRequestsObject(ctx, "SampleResourceGroup", "swaggerExample", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DppBaseResource = armdataprotection.DppBaseResource{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.DataProtection/resourceGuards/getBackupSecurityPINRequests"), - // ID: to.Ptr("subscriotions/0b352192-dcac-4cc7-992e-a96190ccc68c/resourceGroups/SampleResourceGroup/providers/Microsoft.DataProtection/resourceGuards/swaggerExample/getBackupSecurityPINRequests/default"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetDefaultDeleteProtectedItemRequestsObject(ctx, "SampleResourceGroup", "swaggerExample", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DppBaseResource = armdataprotection.DppBaseResource{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.DataProtection/resourceGuards/deleteProtectedItemRequests"), - // ID: to.Ptr("subscriotions/0b352192-dcac-4cc7-992e-a96190ccc68c/resourceGroups/SampleResourceGroup/providers/Microsoft.DataProtection/resourceGuards/swaggerExample/deleteProtectedItemRequests/default"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetDefaultUpdateProtectionPolicyRequestsObject(ctx, "SampleResourceGroup", "swaggerExample", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DppBaseResource = armdataprotection.DppBaseResource{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.DataProtection/resourceGuards/updateProtectionPolicyRequests"), - // ID: to.Ptr("subscriotions/0b352192-dcac-4cc7-992e-a96190ccc68c/resourceGroups/SampleResourceGroup/providers/Microsoft.DataProtection/resourceGuards/swaggerExample/updateProtectionPolicyRequests/default"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetDefaultUpdateProtectedItemRequestsObject(ctx, "SampleResourceGroup", "swaggerExample", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DppBaseResource = armdataprotection.DppBaseResource{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.DataProtection/resourceGuards/updateProtectedItemRequests"), - // ID: to.Ptr("subscriotions/0b352192-dcac-4cc7-992e-a96190ccc68c/resourceGroups/SampleResourceGroup/providers/Microsoft.DataProtection/resourceGuards/swaggerExample/updateProtectedItemRequests/default"), - // } -} diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/response_types.go b/sdk/resourcemanager/dataprotection/armdataprotection/response_types.go index 2e55ed7bfb1a..fb6c0b00df93 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/response_types.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/response_types.go @@ -182,6 +182,31 @@ type DeletedBackupInstancesClientUndeleteResponse struct { // placeholder for future response values } +// DppResourceGuardProxyClientCreateOrUpdateResponse contains the response from method DppResourceGuardProxyClient.CreateOrUpdate. +type DppResourceGuardProxyClientCreateOrUpdateResponse struct { + ResourceGuardProxyBaseResource +} + +// DppResourceGuardProxyClientDeleteResponse contains the response from method DppResourceGuardProxyClient.Delete. +type DppResourceGuardProxyClientDeleteResponse struct { + // placeholder for future response values +} + +// DppResourceGuardProxyClientGetResponse contains the response from method DppResourceGuardProxyClient.Get. +type DppResourceGuardProxyClientGetResponse struct { + ResourceGuardProxyBaseResource +} + +// DppResourceGuardProxyClientListResponse contains the response from method DppResourceGuardProxyClient.NewListPager. +type DppResourceGuardProxyClientListResponse struct { + ResourceGuardProxyBaseResourceList +} + +// DppResourceGuardProxyClientUnlockDeleteResponse contains the response from method DppResourceGuardProxyClient.UnlockDelete. +type DppResourceGuardProxyClientUnlockDeleteResponse struct { + UnlockDeleteResponse +} + // ExportJobsClientTriggerResponse contains the response from method ExportJobsClient.BeginTrigger. type ExportJobsClientTriggerResponse struct { // placeholder for future response values diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/restorabletimeranges_client_example_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/restorabletimeranges_client_example_test.go deleted file mode 100644 index c20db2296468..000000000000 --- a/sdk/resourcemanager/dataprotection/armdataprotection/restorabletimeranges_client_example_test.go +++ /dev/null @@ -1,56 +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. -// DO NOT EDIT. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3035214dea933cd02b1ecfa982c185a572f84b8a/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/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("04cf684a-d41f-4550-9f70-7708a3a2283b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Find(ctx, "Blob-Backup", "ZBlobBackupVaultBVTD3", "zblobbackuptestsa58", armdataprotection.AzureBackupFindRestorableTimeRangesRequest{ - EndTime: to.Ptr("2021-02-24T00:35:17.6829685Z"), - SourceDataStoreType: to.Ptr(armdataprotection.RestoreSourceDataStoreTypeOperationalStore), - StartTime: to.Ptr("2020-10-17T23:28:17.6829685Z"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AzureBackupFindRestorableTimeRangesResponseResource = armdataprotection.AzureBackupFindRestorableTimeRangesResponseResource{ - // Type: to.Ptr("Microsoft.DataProtection/backupVaults/backupInstances/findRestorableTimeRanges"), - // ID: to.Ptr("zblobbackuptestsa58"), - // Properties: &armdataprotection.AzureBackupFindRestorableTimeRangesResponse{ - // ObjectType: to.Ptr("AzureBackupFindRestorableTimeRangesResponse"), - // RestorableTimeRanges: []*armdataprotection.RestorableTimeRange{ - // { - // EndTime: to.Ptr("2021-02-24T00:35:17.0000000Z"), - // ObjectType: to.Ptr("RestorableTimeRange"), - // StartTime: to.Ptr("2021-02-23T18:33:51.6349708Z"), - // }}, - // }, - // } -}