From 23f7e0457fa4a4348ba544ed9c190c5d5e96b417 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 24 May 2023 02:03:25 +0000 Subject: [PATCH] CodeGen from PR 24135 in Azure/azure-rest-api-specs Merge 129c671d979a134cc78caf4f5f38bf7889b51892 into 2b5927fd07bfb51809a06ca35b6142f63ba77bab --- .../keyvault/armkeyvault/CHANGELOG.md | 6 + .../keyvault/armkeyvault/autorest.md | 7 +- .../keyvault/armkeyvault/constants.go | 6 +- .../keyvault/armkeyvault/go.mod | 2 +- .../armkeyvault/keys_client_example_test.go | 276 ----- .../managedhsmkeys_client_example_test.go | 269 ----- .../managedhsms_client_example_test.go | 506 -------- ...endpointconnections_client_example_test.go | 193 --- ...rivatelinkresources_client_example_test.go | 53 - .../mhsmregions_client_example_test.go | 56 - .../keyvault/armkeyvault/models.go | 746 ++++++------ .../operations_client_example_test.go | 361 ------ ...endpointconnections_client_example_test.go | 195 ---- ...rivatelinkresources_client_example_test.go | 53 - .../secrets_client_example_test.go | 190 --- .../armkeyvault/vaults_client_example_test.go | 1030 ----------------- 16 files changed, 387 insertions(+), 3562 deletions(-) delete mode 100644 sdk/resourcemanager/keyvault/armkeyvault/keys_client_example_test.go delete mode 100644 sdk/resourcemanager/keyvault/armkeyvault/managedhsmkeys_client_example_test.go delete mode 100644 sdk/resourcemanager/keyvault/armkeyvault/managedhsms_client_example_test.go delete mode 100644 sdk/resourcemanager/keyvault/armkeyvault/mhsmprivateendpointconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/keyvault/armkeyvault/mhsmprivatelinkresources_client_example_test.go delete mode 100644 sdk/resourcemanager/keyvault/armkeyvault/mhsmregions_client_example_test.go delete mode 100644 sdk/resourcemanager/keyvault/armkeyvault/operations_client_example_test.go delete mode 100644 sdk/resourcemanager/keyvault/armkeyvault/privateendpointconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/keyvault/armkeyvault/privatelinkresources_client_example_test.go delete mode 100644 sdk/resourcemanager/keyvault/armkeyvault/secrets_client_example_test.go delete mode 100644 sdk/resourcemanager/keyvault/armkeyvault/vaults_client_example_test.go diff --git a/sdk/resourcemanager/keyvault/armkeyvault/CHANGELOG.md b/sdk/resourcemanager/keyvault/armkeyvault/CHANGELOG.md index f9cd65aaaa1e..6660e263909f 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/CHANGELOG.md +++ b/sdk/resourcemanager/keyvault/armkeyvault/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History +## 1.3.0 (2023-05-24) +### Features Added + +- New value `ManagedHsmSKUNameCustomB6` added to enum type `ManagedHsmSKUName` + + ## 1.2.0 (2023-04-28) ### Features Added diff --git a/sdk/resourcemanager/keyvault/armkeyvault/autorest.md b/sdk/resourcemanager/keyvault/armkeyvault/autorest.md index 4692f2f562e1..e7f865880a82 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/autorest.md +++ b/sdk/resourcemanager/keyvault/armkeyvault/autorest.md @@ -5,11 +5,10 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/keyvault/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/keyvault/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.2.0 +module-version: 1.3.0 modelerfour: seal-single-value-enum-by-default: true -tag: package-2023-02 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/keyvault/armkeyvault/constants.go b/sdk/resourcemanager/keyvault/armkeyvault/constants.go index d6415ed56047..cc3f3f3a0579 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/constants.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/constants.go @@ -11,7 +11,7 @@ package armkeyvault const ( moduleName = "armkeyvault" - moduleVersion = "v1.2.0" + moduleVersion = "v1.3.0" ) type AccessPolicyUpdateKind string @@ -353,6 +353,7 @@ type ManagedHsmSKUName string const ( ManagedHsmSKUNameStandardB1 ManagedHsmSKUName = "Standard_B1" ManagedHsmSKUNameCustomB32 ManagedHsmSKUName = "Custom_B32" + ManagedHsmSKUNameCustomB6 ManagedHsmSKUName = "Custom_B6" ) // PossibleManagedHsmSKUNameValues returns the possible values for the ManagedHsmSKUName const type. @@ -360,6 +361,7 @@ func PossibleManagedHsmSKUNameValues() []ManagedHsmSKUName { return []ManagedHsmSKUName{ ManagedHsmSKUNameStandardB1, ManagedHsmSKUNameCustomB32, + ManagedHsmSKUNameCustomB6, } } @@ -477,7 +479,7 @@ func PossibleProvisioningStateValues() []ProvisioningState { } } -// PublicNetworkAccess - Control permission for data plane traffic coming from public networks while private endpoint is enabled. +// PublicNetworkAccess - Control permission to the managed HSM from public networks. type PublicNetworkAccess string const ( diff --git a/sdk/resourcemanager/keyvault/armkeyvault/go.mod b/sdk/resourcemanager/keyvault/armkeyvault/go.mod index 10794b172667..17b39c20eed9 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/go.mod +++ b/sdk/resourcemanager/keyvault/armkeyvault/go.mod @@ -4,12 +4,12 @@ go 1.18 require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.2 github.com/stretchr/testify v1.7.0 ) require ( + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.0.0 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v0.7.0 // indirect diff --git a/sdk/resourcemanager/keyvault/armkeyvault/keys_client_example_test.go b/sdk/resourcemanager/keyvault/armkeyvault/keys_client_example_test.go deleted file mode 100644 index 0ae869b948e6..000000000000 --- a/sdk/resourcemanager/keyvault/armkeyvault/keys_client_example_test.go +++ /dev/null @@ -1,276 +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 armkeyvault_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/keyvault/armkeyvault" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/createKey.json -func ExampleKeysClient_CreateIfNotExist() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkeyvault.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewKeysClient().CreateIfNotExist(ctx, "sample-group", "sample-vault-name", "sample-key-name", armkeyvault.KeyCreateParameters{ - Properties: &armkeyvault.KeyProperties{ - Kty: to.Ptr(armkeyvault.JSONWebKeyTypeRSA), - }, - }, 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.Key = armkeyvault.Key{ - // Name: to.Ptr("sample-key-name"), - // Type: to.Ptr("Microsoft.KeyVault/vaults/keys"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault-name/keys/sample-key-name"), - // Location: to.Ptr("westus"), - // Properties: &armkeyvault.KeyProperties{ - // Attributes: &armkeyvault.KeyAttributes{ - // Created: to.Ptr[int64](1598533051), - // Enabled: to.Ptr(true), - // RecoveryLevel: to.Ptr(armkeyvault.DeletionRecoveryLevelPurgeable), - // Updated: to.Ptr[int64](1598533051), - // }, - // KeyOps: []*armkeyvault.JSONWebKeyOperation{ - // to.Ptr(armkeyvault.JSONWebKeyOperationEncrypt), - // to.Ptr(armkeyvault.JSONWebKeyOperationDecrypt), - // to.Ptr(armkeyvault.JSONWebKeyOperationSign), - // to.Ptr(armkeyvault.JSONWebKeyOperationVerify), - // to.Ptr(armkeyvault.JSONWebKeyOperationWrapKey), - // to.Ptr(armkeyvault.JSONWebKeyOperationUnwrapKey)}, - // KeySize: to.Ptr[int32](2048), - // KeyURI: to.Ptr("https://sample-vault-name.vault.azure.net:443/keys/sample-key-name"), - // KeyURIWithVersion: to.Ptr("https://sample-vault-name.vault.azure.net:443/keys/sample-key-name/fd618d9519b74f9aae94ade66b876acc"), - // Kty: to.Ptr(armkeyvault.JSONWebKeyTypeRSA), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/getKey.json -func ExampleKeysClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkeyvault.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewKeysClient().Get(ctx, "sample-group", "sample-vault-name", "sample-key-name", 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.Key = armkeyvault.Key{ - // Name: to.Ptr("sample-key-name"), - // Type: to.Ptr("Microsoft.KeyVault/vaults/keys"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault-name/keys/sample-key-name"), - // Location: to.Ptr("westus"), - // Properties: &armkeyvault.KeyProperties{ - // Attributes: &armkeyvault.KeyAttributes{ - // Created: to.Ptr[int64](1598533051), - // Enabled: to.Ptr(true), - // RecoveryLevel: to.Ptr(armkeyvault.DeletionRecoveryLevelPurgeable), - // Updated: to.Ptr[int64](1598533051), - // }, - // KeyOps: []*armkeyvault.JSONWebKeyOperation{ - // to.Ptr(armkeyvault.JSONWebKeyOperationEncrypt), - // to.Ptr(armkeyvault.JSONWebKeyOperationDecrypt), - // to.Ptr(armkeyvault.JSONWebKeyOperationSign), - // to.Ptr(armkeyvault.JSONWebKeyOperationVerify), - // to.Ptr(armkeyvault.JSONWebKeyOperationWrapKey), - // to.Ptr(armkeyvault.JSONWebKeyOperationUnwrapKey)}, - // KeySize: to.Ptr[int32](2048), - // KeyURI: to.Ptr("https://sample-vault-name.vault.azure.net:443/keys/sample-key-name"), - // KeyURIWithVersion: to.Ptr("https://sample-vault-name.vault.azure.net:443/keys/sample-key-name/fd618d9519b74f9aae94ade66b876acc"), - // Kty: to.Ptr(armkeyvault.JSONWebKeyTypeRSA), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/listKeys.json -func ExampleKeysClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkeyvault.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewKeysClient().NewListPager("sample-group", "sample-vault-name", 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.KeyListResult = armkeyvault.KeyListResult{ - // Value: []*armkeyvault.Key{ - // { - // Name: to.Ptr("sample-key-name-1"), - // Type: to.Ptr("Microsoft.KeyVault/vaults/keys"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault-name/keys/sample-key-name-1"), - // Location: to.Ptr("westus"), - // Properties: &armkeyvault.KeyProperties{ - // Attributes: &armkeyvault.KeyAttributes{ - // Created: to.Ptr[int64](1596493796), - // Enabled: to.Ptr(true), - // RecoveryLevel: to.Ptr(armkeyvault.DeletionRecoveryLevelPurgeable), - // Updated: to.Ptr[int64](1596493796), - // }, - // KeyURI: to.Ptr("https://sample-vault-name.vault.azure.net:443/keys/sample-key-name-1"), - // }, - // }, - // { - // Name: to.Ptr("sample-key-name-2"), - // Type: to.Ptr("Microsoft.KeyVault/vaults/keys"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault-name/keys/sample-key-name-2"), - // Location: to.Ptr("westus"), - // Properties: &armkeyvault.KeyProperties{ - // Attributes: &armkeyvault.KeyAttributes{ - // Created: to.Ptr[int64](1596493797), - // Enabled: to.Ptr(true), - // RecoveryLevel: to.Ptr(armkeyvault.DeletionRecoveryLevelPurgeable), - // Updated: to.Ptr[int64](1596493797), - // }, - // KeyURI: to.Ptr("https://sample-vault-name.vault.azure.net:443/keys/sample-key-name-2"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/getKeyVersion.json -func ExampleKeysClient_GetVersion() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkeyvault.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewKeysClient().GetVersion(ctx, "sample-group", "sample-vault-name", "sample-key-name", "fd618d9519b74f9aae94ade66b876acc", 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.Key = armkeyvault.Key{ - // Name: to.Ptr("fd618d9519b74f9aae94ade66b876acc"), - // Type: to.Ptr("Microsoft.KeyVault/vaults/keys/versions"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault-name/keys/sample-key-name/versions/fd618d9519b74f9aae94ade66b876acc"), - // Location: to.Ptr("westus"), - // Properties: &armkeyvault.KeyProperties{ - // Attributes: &armkeyvault.KeyAttributes{ - // Created: to.Ptr[int64](1598533051), - // Enabled: to.Ptr(true), - // RecoveryLevel: to.Ptr(armkeyvault.DeletionRecoveryLevelPurgeable), - // Updated: to.Ptr[int64](1598533051), - // }, - // KeyOps: []*armkeyvault.JSONWebKeyOperation{ - // to.Ptr(armkeyvault.JSONWebKeyOperationEncrypt), - // to.Ptr(armkeyvault.JSONWebKeyOperationDecrypt), - // to.Ptr(armkeyvault.JSONWebKeyOperationSign), - // to.Ptr(armkeyvault.JSONWebKeyOperationVerify), - // to.Ptr(armkeyvault.JSONWebKeyOperationWrapKey), - // to.Ptr(armkeyvault.JSONWebKeyOperationUnwrapKey)}, - // KeySize: to.Ptr[int32](2048), - // KeyURI: to.Ptr("https://sample-vault-name.vault.azure.net:443/keys/sample-key-name"), - // KeyURIWithVersion: to.Ptr("https://sample-vault-name.vault.azure.net:443/keys/sample-key-name/fd618d9519b74f9aae94ade66b876acc"), - // Kty: to.Ptr(armkeyvault.JSONWebKeyTypeRSA), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/listKeyVersions.json -func ExampleKeysClient_NewListVersionsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkeyvault.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewKeysClient().NewListVersionsPager("sample-group", "sample-vault-name", "sample-key-name", 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.KeyListResult = armkeyvault.KeyListResult{ - // Value: []*armkeyvault.Key{ - // { - // Name: to.Ptr("c2296aa24acf4daf86942bff5aca73dd"), - // Type: to.Ptr("Microsoft.KeyVault/vaults/keys/versions"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault-name/keys/sample-key-name/versions/c2296aa24acf4daf86942bff5aca73dd"), - // Location: to.Ptr("westus"), - // Properties: &armkeyvault.KeyProperties{ - // Attributes: &armkeyvault.KeyAttributes{ - // Created: to.Ptr[int64](1598641074), - // Enabled: to.Ptr(true), - // RecoveryLevel: to.Ptr(armkeyvault.DeletionRecoveryLevelPurgeable), - // Updated: to.Ptr[int64](1598641074), - // }, - // KeyURI: to.Ptr("https://sample-vault-name.vault.azure.net:443/keys/sample-key-name"), - // KeyURIWithVersion: to.Ptr("https://sample-vault-name.vault.azure.net:443/keys/sample-key-name/c2296aa24acf4daf86942bff5aca73dd"), - // }, - // }, - // { - // Name: to.Ptr("d5a04667b6f44b0ca62825f5eae93da6"), - // Type: to.Ptr("Microsoft.KeyVault/vaults/keys/versions"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault-name/keys/sample-key-name/versions/d5a04667b6f44b0ca62825f5eae93da6"), - // Location: to.Ptr("westus"), - // Properties: &armkeyvault.KeyProperties{ - // Attributes: &armkeyvault.KeyAttributes{ - // Created: to.Ptr[int64](1598641295), - // Enabled: to.Ptr(true), - // RecoveryLevel: to.Ptr(armkeyvault.DeletionRecoveryLevelPurgeable), - // Updated: to.Ptr[int64](1598641295), - // }, - // KeyURI: to.Ptr("https://sample-vault-name.vault.azure.net:443/keys/sample-key-name"), - // KeyURIWithVersion: to.Ptr("https://sample-vault-name.vault.azure.net:443/keys/sample-key-name/d5a04667b6f44b0ca62825f5eae93da6"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/keyvault/armkeyvault/managedhsmkeys_client_example_test.go b/sdk/resourcemanager/keyvault/armkeyvault/managedhsmkeys_client_example_test.go deleted file mode 100644 index 4a13e1f796a2..000000000000 --- a/sdk/resourcemanager/keyvault/armkeyvault/managedhsmkeys_client_example_test.go +++ /dev/null @@ -1,269 +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 armkeyvault_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/keyvault/armkeyvault" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/managedHsmCreateKey.json -func ExampleManagedHsmKeysClient_CreateIfNotExist() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkeyvault.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedHsmKeysClient().CreateIfNotExist(ctx, "sample-group", "sample-managedhsm-name", "sample-key-name", armkeyvault.ManagedHsmKeyCreateParameters{ - Properties: &armkeyvault.ManagedHsmKeyProperties{ - Kty: to.Ptr(armkeyvault.JSONWebKeyTypeRSA), - }, - }, 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.ManagedHsmKey = armkeyvault.ManagedHsmKey{ - // Name: to.Ptr("sample-key-name"), - // Type: to.Ptr("Microsoft.KeyVault/managedHSMs/keys"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/managedHSMs/sample-managedhsm-name/keys/sample-key-name"), - // Properties: &armkeyvault.ManagedHsmKeyProperties{ - // Attributes: &armkeyvault.ManagedHsmKeyAttributes{ - // Created: to.Ptr[int64](1598533051), - // Enabled: to.Ptr(true), - // RecoveryLevel: to.Ptr(armkeyvault.DeletionRecoveryLevelPurgeable), - // Updated: to.Ptr[int64](1598533051), - // }, - // KeyOps: []*armkeyvault.JSONWebKeyOperation{ - // to.Ptr(armkeyvault.JSONWebKeyOperationEncrypt), - // to.Ptr(armkeyvault.JSONWebKeyOperationDecrypt), - // to.Ptr(armkeyvault.JSONWebKeyOperationSign), - // to.Ptr(armkeyvault.JSONWebKeyOperationVerify), - // to.Ptr(armkeyvault.JSONWebKeyOperationWrapKey), - // to.Ptr(armkeyvault.JSONWebKeyOperationUnwrapKey)}, - // KeySize: to.Ptr[int32](2048), - // KeyURI: to.Ptr("https://sample-managedhsm-name.managedhsm.azure.net:443/keys/sample-key-name"), - // KeyURIWithVersion: to.Ptr("https://sample-managedhsm-name.managedhsm.azure.net:443/keys/sample-key-name/fd618d9519b74f9aae94ade66b876acc"), - // Kty: to.Ptr(armkeyvault.JSONWebKeyTypeRSA), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/managedHsmGetKey.json -func ExampleManagedHsmKeysClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkeyvault.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedHsmKeysClient().Get(ctx, "sample-group", "sample-managedhsm-name", "sample-key-name", 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.ManagedHsmKey = armkeyvault.ManagedHsmKey{ - // Name: to.Ptr("sample-key-name"), - // Type: to.Ptr("Microsoft.KeyVault/managedHSMs/keys"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/managedHSMs/sample-managedhsm-name/keys/sample-key-name"), - // Properties: &armkeyvault.ManagedHsmKeyProperties{ - // Attributes: &armkeyvault.ManagedHsmKeyAttributes{ - // Created: to.Ptr[int64](1598533051), - // Enabled: to.Ptr(true), - // RecoveryLevel: to.Ptr(armkeyvault.DeletionRecoveryLevelPurgeable), - // Updated: to.Ptr[int64](1598533051), - // }, - // KeyOps: []*armkeyvault.JSONWebKeyOperation{ - // to.Ptr(armkeyvault.JSONWebKeyOperationEncrypt), - // to.Ptr(armkeyvault.JSONWebKeyOperationDecrypt), - // to.Ptr(armkeyvault.JSONWebKeyOperationSign), - // to.Ptr(armkeyvault.JSONWebKeyOperationVerify), - // to.Ptr(armkeyvault.JSONWebKeyOperationWrapKey), - // to.Ptr(armkeyvault.JSONWebKeyOperationUnwrapKey)}, - // KeySize: to.Ptr[int32](2048), - // KeyURI: to.Ptr("https://sample-managedhsm-name.managedhsm.azure.net:443/keys/sample-key-name"), - // KeyURIWithVersion: to.Ptr("https://sample-managedhsm-name.managedhsm.azure.net:443/keys/sample-key-name/fd618d9519b74f9aae94ade66b876acc"), - // Kty: to.Ptr(armkeyvault.JSONWebKeyTypeRSA), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/managedHsmListKeys.json -func ExampleManagedHsmKeysClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkeyvault.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedHsmKeysClient().NewListPager("sample-group", "sample-managedhsm-name", 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.ManagedHsmKeyListResult = armkeyvault.ManagedHsmKeyListResult{ - // Value: []*armkeyvault.ManagedHsmKey{ - // { - // Name: to.Ptr("sample-key-name-1"), - // Type: to.Ptr("Microsoft.KeyVault/managedHSMs/keys"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/managedHSMs/sample-managedhsm-name/keys/sample-key-name-1"), - // Properties: &armkeyvault.ManagedHsmKeyProperties{ - // Attributes: &armkeyvault.ManagedHsmKeyAttributes{ - // Created: to.Ptr[int64](1596493796), - // Enabled: to.Ptr(true), - // RecoveryLevel: to.Ptr(armkeyvault.DeletionRecoveryLevelPurgeable), - // Updated: to.Ptr[int64](1596493796), - // }, - // KeyURI: to.Ptr("https://sample-managedhsm-name.managedhsm.azure.net:443/keys/sample-key-name-1"), - // }, - // }, - // { - // Name: to.Ptr("sample-key-name-2"), - // Type: to.Ptr("Microsoft.KeyVault/managedHSMs/keys"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/managedHSMs/sample-managedhsm-name/keys/sample-key-name-2"), - // Properties: &armkeyvault.ManagedHsmKeyProperties{ - // Attributes: &armkeyvault.ManagedHsmKeyAttributes{ - // Created: to.Ptr[int64](1596493797), - // Enabled: to.Ptr(true), - // RecoveryLevel: to.Ptr(armkeyvault.DeletionRecoveryLevelPurgeable), - // Updated: to.Ptr[int64](1596493797), - // }, - // KeyURI: to.Ptr("https://sample-managedhsm-name.managedhsm.azure.net:443/keys/sample-key-name-2"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/managedHsmGetKeyVersion.json -func ExampleManagedHsmKeysClient_GetVersion() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkeyvault.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedHsmKeysClient().GetVersion(ctx, "sample-group", "sample-managedhsm-name", "sample-key-name", "fd618d9519b74f9aae94ade66b876acc", 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.ManagedHsmKey = armkeyvault.ManagedHsmKey{ - // Name: to.Ptr("fd618d9519b74f9aae94ade66b876acc"), - // Type: to.Ptr("Microsoft.KeyVault/managedHSMs/keys/versions"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/managedHSMs/sample-managedhsm-name/keys/sample-key-name/versions/fd618d9519b74f9aae94ade66b876acc"), - // Properties: &armkeyvault.ManagedHsmKeyProperties{ - // Attributes: &armkeyvault.ManagedHsmKeyAttributes{ - // Created: to.Ptr[int64](1598533051), - // Enabled: to.Ptr(true), - // RecoveryLevel: to.Ptr(armkeyvault.DeletionRecoveryLevelPurgeable), - // Updated: to.Ptr[int64](1598533051), - // }, - // KeyOps: []*armkeyvault.JSONWebKeyOperation{ - // to.Ptr(armkeyvault.JSONWebKeyOperationEncrypt), - // to.Ptr(armkeyvault.JSONWebKeyOperationDecrypt), - // to.Ptr(armkeyvault.JSONWebKeyOperationSign), - // to.Ptr(armkeyvault.JSONWebKeyOperationVerify), - // to.Ptr(armkeyvault.JSONWebKeyOperationWrapKey), - // to.Ptr(armkeyvault.JSONWebKeyOperationUnwrapKey)}, - // KeySize: to.Ptr[int32](2048), - // KeyURI: to.Ptr("https://sample-managedhsm-name.managedhsm.azure.net:443/keys/sample-key-name"), - // KeyURIWithVersion: to.Ptr("https://sample-managedhsm-name.managedhsm.azure.net:443/keys/sample-key-name/fd618d9519b74f9aae94ade66b876acc"), - // Kty: to.Ptr(armkeyvault.JSONWebKeyTypeRSA), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/managedHsmListKeyVersions.json -func ExampleManagedHsmKeysClient_NewListVersionsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkeyvault.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedHsmKeysClient().NewListVersionsPager("sample-group", "sample-managedhsm-name", "sample-key-name", 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.ManagedHsmKeyListResult = armkeyvault.ManagedHsmKeyListResult{ - // Value: []*armkeyvault.ManagedHsmKey{ - // { - // Name: to.Ptr("c2296aa24acf4daf86942bff5aca73dd"), - // Type: to.Ptr("Microsoft.KeyVault/managedHSMs/keys/versions"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/managedHSMs/sample-managedhsm-name/keys/sample-key-name/versions/c2296aa24acf4daf86942bff5aca73dd"), - // Properties: &armkeyvault.ManagedHsmKeyProperties{ - // Attributes: &armkeyvault.ManagedHsmKeyAttributes{ - // Created: to.Ptr[int64](1598641074), - // Enabled: to.Ptr(true), - // RecoveryLevel: to.Ptr(armkeyvault.DeletionRecoveryLevelPurgeable), - // Updated: to.Ptr[int64](1598641074), - // }, - // KeyURI: to.Ptr("https://sample-managedhsm-name.managedhsm.azure.net:443/keys/sample-key-name"), - // KeyURIWithVersion: to.Ptr("https://sample-managedhsm-name.managedhsm.azure.net:443/keys/sample-key-name/c2296aa24acf4daf86942bff5aca73dd"), - // }, - // }, - // { - // Name: to.Ptr("d5a04667b6f44b0ca62825f5eae93da6"), - // Type: to.Ptr("Microsoft.KeyVault/managedHSMs/keys/versions"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/managedHSMs/sample-managedhsm-name/keys/sample-key-name/versions/d5a04667b6f44b0ca62825f5eae93da6"), - // Properties: &armkeyvault.ManagedHsmKeyProperties{ - // Attributes: &armkeyvault.ManagedHsmKeyAttributes{ - // Created: to.Ptr[int64](1598641295), - // Enabled: to.Ptr(true), - // RecoveryLevel: to.Ptr(armkeyvault.DeletionRecoveryLevelPurgeable), - // Updated: to.Ptr[int64](1598641295), - // }, - // KeyURI: to.Ptr("https://sample-managedhsm-name.managedhsm.azure.net:443/keys/sample-key-name"), - // KeyURIWithVersion: to.Ptr("https://sample-managedhsm-name.managedhsm.azure.net:443/keys/sample-key-name/d5a04667b6f44b0ca62825f5eae93da6"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/keyvault/armkeyvault/managedhsms_client_example_test.go b/sdk/resourcemanager/keyvault/armkeyvault/managedhsms_client_example_test.go deleted file mode 100644 index ce9dc516c40d..000000000000 --- a/sdk/resourcemanager/keyvault/armkeyvault/managedhsms_client_example_test.go +++ /dev/null @@ -1,506 +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 armkeyvault_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/keyvault/armkeyvault" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/ManagedHsm_CreateOrUpdate.json -func ExampleManagedHsmsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkeyvault.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedHsmsClient().BeginCreateOrUpdate(ctx, "hsm-group", "hsm1", armkeyvault.ManagedHsm{ - Location: to.Ptr("westus"), - SKU: &armkeyvault.ManagedHsmSKU{ - Name: to.Ptr(armkeyvault.ManagedHsmSKUNameStandardB1), - Family: to.Ptr(armkeyvault.ManagedHsmSKUFamilyB), - }, - Tags: map[string]*string{ - "Dept": to.Ptr("hsm"), - "Environment": to.Ptr("dogfood"), - }, - Properties: &armkeyvault.ManagedHsmProperties{ - EnablePurgeProtection: to.Ptr(false), - EnableSoftDelete: to.Ptr(true), - InitialAdminObjectIDs: []*string{ - to.Ptr("00000000-0000-0000-0000-000000000000")}, - SoftDeleteRetentionInDays: to.Ptr[int32](90), - TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - }, - }, 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.ManagedHsm = armkeyvault.ManagedHsm{ - // Name: to.Ptr("hsm1"), - // Type: to.Ptr("Microsoft.KeyVault/managedHSMs"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.KeyVault/managedHSMs/hsm1"), - // Location: to.Ptr("westus"), - // SKU: &armkeyvault.ManagedHsmSKU{ - // Name: to.Ptr(armkeyvault.ManagedHsmSKUNameStandardB1), - // Family: to.Ptr(armkeyvault.ManagedHsmSKUFamilyB), - // }, - // Tags: map[string]*string{ - // "Dept": to.Ptr("hsm"), - // "Environment": to.Ptr("dogfood"), - // }, - // Properties: &armkeyvault.ManagedHsmProperties{ - // EnablePurgeProtection: to.Ptr(false), - // EnableSoftDelete: to.Ptr(true), - // HsmURI: to.Ptr("https://westus.hsm1.managedhsm.azure.net"), - // InitialAdminObjectIDs: []*string{ - // to.Ptr("00000000-0000-0000-0000-000000000000")}, - // ProvisioningState: to.Ptr(armkeyvault.ProvisioningStateSucceeded), - // SoftDeleteRetentionInDays: to.Ptr[int32](90), - // StatusMessage: to.Ptr("ManagedHsm is functional."), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/ManagedHsm_Update.json -func ExampleManagedHsmsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkeyvault.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedHsmsClient().BeginUpdate(ctx, "hsm-group", "hsm1", armkeyvault.ManagedHsm{ - Tags: map[string]*string{ - "Dept": to.Ptr("hsm"), - "Environment": to.Ptr("dogfood"), - "Slice": to.Ptr("A"), - }, - }, 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.ManagedHsm = armkeyvault.ManagedHsm{ - // Name: to.Ptr("hsm1"), - // Type: to.Ptr("Microsoft.KeyVault/managedHSMs"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.KeyVault/managedHSMs/hsm1"), - // Location: to.Ptr("westus"), - // SKU: &armkeyvault.ManagedHsmSKU{ - // Name: to.Ptr(armkeyvault.ManagedHsmSKUNameStandardB1), - // Family: to.Ptr(armkeyvault.ManagedHsmSKUFamilyB), - // }, - // Tags: map[string]*string{ - // "Dept": to.Ptr("hsm"), - // "Environment": to.Ptr("dogfood"), - // "Slice": to.Ptr("A"), - // }, - // Properties: &armkeyvault.ManagedHsmProperties{ - // EnablePurgeProtection: to.Ptr(false), - // EnableSoftDelete: to.Ptr(true), - // HsmURI: to.Ptr("https://westus.hsm1.managedhsm.azure.net"), - // InitialAdminObjectIDs: []*string{ - // to.Ptr("00000000-0000-0000-0000-000000000000")}, - // ProvisioningState: to.Ptr(armkeyvault.ProvisioningStateSucceeded), - // SoftDeleteRetentionInDays: to.Ptr[int32](90), - // StatusMessage: to.Ptr("ManagedHsm is functional."), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/ManagedHsm_Delete.json -func ExampleManagedHsmsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkeyvault.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedHsmsClient().BeginDelete(ctx, "hsm-group", "hsm1", 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/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/ManagedHsm_Get.json -func ExampleManagedHsmsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkeyvault.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedHsmsClient().Get(ctx, "hsm-group", "hsm1", 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.ManagedHsm = armkeyvault.ManagedHsm{ - // Name: to.Ptr("hsm1"), - // Type: to.Ptr("Microsoft.KeyVault/managedHSMs"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.KeyVault/managedHSMs/hsm1"), - // Location: to.Ptr("westus"), - // SKU: &armkeyvault.ManagedHsmSKU{ - // Name: to.Ptr(armkeyvault.ManagedHsmSKUNameStandardB1), - // Family: to.Ptr(armkeyvault.ManagedHsmSKUFamilyB), - // }, - // Tags: map[string]*string{ - // "Dept": to.Ptr("hsm"), - // "Environment": to.Ptr("dogfood"), - // }, - // Properties: &armkeyvault.ManagedHsmProperties{ - // EnablePurgeProtection: to.Ptr(false), - // EnableSoftDelete: to.Ptr(true), - // HsmURI: to.Ptr("https://westus.hsm1.managedhsm.azure.net"), - // InitialAdminObjectIDs: []*string{ - // to.Ptr("00000000-0000-0000-0000-000000000000")}, - // ProvisioningState: to.Ptr(armkeyvault.ProvisioningStateSucceeded), - // SoftDeleteRetentionInDays: to.Ptr[int32](90), - // StatusMessage: to.Ptr("ManagedHsm is functional."), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/ManagedHsm_ListByResourceGroup.json -func ExampleManagedHsmsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkeyvault.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedHsmsClient().NewListByResourceGroupPager("hsm-group", &armkeyvault.ManagedHsmsClientListByResourceGroupOptions{Top: 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.ManagedHsmListResult = armkeyvault.ManagedHsmListResult{ - // Value: []*armkeyvault.ManagedHsm{ - // { - // Name: to.Ptr("hsm1"), - // Type: to.Ptr("Microsoft.KeyVault/managedHSMs"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.KeyVault/managedHSMs/hsm1"), - // Location: to.Ptr("westus"), - // SKU: &armkeyvault.ManagedHsmSKU{ - // Name: to.Ptr(armkeyvault.ManagedHsmSKUNameStandardB1), - // Family: to.Ptr(armkeyvault.ManagedHsmSKUFamilyB), - // }, - // Tags: map[string]*string{ - // "Dept": to.Ptr("hsm"), - // "Environment": to.Ptr("dogfood"), - // }, - // Properties: &armkeyvault.ManagedHsmProperties{ - // EnablePurgeProtection: to.Ptr(false), - // EnableSoftDelete: to.Ptr(true), - // HsmURI: to.Ptr("https://westus.hsm1.managedhsm.azure.net"), - // InitialAdminObjectIDs: []*string{ - // to.Ptr("00000000-0000-0000-0000-000000000000")}, - // ProvisioningState: to.Ptr(armkeyvault.ProvisioningStateSucceeded), - // SoftDeleteRetentionInDays: to.Ptr[int32](90), - // StatusMessage: to.Ptr("ManagedHsm is functional."), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // }, - // { - // Name: to.Ptr("hsm2"), - // Type: to.Ptr("Microsoft.KeyVault/managedHSMs"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.KeyVault/managedHSMs/hsm2"), - // Location: to.Ptr("westus"), - // SKU: &armkeyvault.ManagedHsmSKU{ - // Name: to.Ptr(armkeyvault.ManagedHsmSKUNameStandardB1), - // Family: to.Ptr(armkeyvault.ManagedHsmSKUFamilyB), - // }, - // Tags: map[string]*string{ - // "Dept": to.Ptr("hsm"), - // "Environment": to.Ptr("production"), - // }, - // Properties: &armkeyvault.ManagedHsmProperties{ - // EnablePurgeProtection: to.Ptr(false), - // EnableSoftDelete: to.Ptr(true), - // HsmURI: to.Ptr("https://westus.hsm2.managedhsm.azure.net"), - // InitialAdminObjectIDs: []*string{ - // to.Ptr("00000000-0000-0000-0000-000000000000")}, - // ProvisioningState: to.Ptr(armkeyvault.ProvisioningStateSucceeded), - // SoftDeleteRetentionInDays: to.Ptr[int32](90), - // StatusMessage: to.Ptr("ManagedHsm is functional."), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/ManagedHsm_ListBySubscription.json -func ExampleManagedHsmsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkeyvault.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedHsmsClient().NewListBySubscriptionPager(&armkeyvault.ManagedHsmsClientListBySubscriptionOptions{Top: 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.ManagedHsmListResult = armkeyvault.ManagedHsmListResult{ - // Value: []*armkeyvault.ManagedHsm{ - // { - // Name: to.Ptr("hsm1"), - // Type: to.Ptr("Microsoft.KeyVault/managedHSMs"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.KeyVault/managedHSMs/hsm1"), - // Location: to.Ptr("westus"), - // SKU: &armkeyvault.ManagedHsmSKU{ - // Name: to.Ptr(armkeyvault.ManagedHsmSKUNameStandardB1), - // Family: to.Ptr(armkeyvault.ManagedHsmSKUFamilyB), - // }, - // Tags: map[string]*string{ - // "Dept": to.Ptr("hsm"), - // "Environment": to.Ptr("dogfood"), - // }, - // Properties: &armkeyvault.ManagedHsmProperties{ - // EnablePurgeProtection: to.Ptr(false), - // EnableSoftDelete: to.Ptr(true), - // HsmURI: to.Ptr("https://westus.hsm1.managedhsm.azure.net"), - // InitialAdminObjectIDs: []*string{ - // to.Ptr("00000000-0000-0000-0000-000000000000")}, - // ProvisioningState: to.Ptr(armkeyvault.ProvisioningStateSucceeded), - // SoftDeleteRetentionInDays: to.Ptr[int32](90), - // StatusMessage: to.Ptr("ManagedHsm is functional."), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // }, - // { - // Name: to.Ptr("hsm2"), - // Type: to.Ptr("Microsoft.KeyVault/managedHSMs"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.KeyVault/managedHSMs/hsm2"), - // Location: to.Ptr("westus"), - // SKU: &armkeyvault.ManagedHsmSKU{ - // Name: to.Ptr(armkeyvault.ManagedHsmSKUNameStandardB1), - // Family: to.Ptr(armkeyvault.ManagedHsmSKUFamilyB), - // }, - // Tags: map[string]*string{ - // "Dept": to.Ptr("hsm"), - // "Environment": to.Ptr("production"), - // }, - // Properties: &armkeyvault.ManagedHsmProperties{ - // EnablePurgeProtection: to.Ptr(false), - // EnableSoftDelete: to.Ptr(true), - // HsmURI: to.Ptr("https://westus.hsm2.managedhsm.azure.net"), - // InitialAdminObjectIDs: []*string{ - // to.Ptr("00000000-0000-0000-0000-000000000000")}, - // ProvisioningState: to.Ptr(armkeyvault.ProvisioningStateSucceeded), - // SoftDeleteRetentionInDays: to.Ptr[int32](90), - // StatusMessage: to.Ptr("ManagedHsm is functional."), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/DeletedManagedHsm_List.json -func ExampleManagedHsmsClient_NewListDeletedPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkeyvault.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedHsmsClient().NewListDeletedPager(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.DeletedManagedHsmListResult = armkeyvault.DeletedManagedHsmListResult{ - // Value: []*armkeyvault.DeletedManagedHsm{ - // { - // Name: to.Ptr("vault-agile-drawer-6404"), - // Type: to.Ptr("Microsoft.KeyVault/deletedManagedHSMs"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/westus/deletedManagedHSMs/hsm1"), - // Properties: &armkeyvault.DeletedManagedHsmProperties{ - // DeletionDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T00:00:59Z"); return t}()), - // Location: to.Ptr("westus"), - // MhsmID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.KeyVault/managedHSMs/hsm1"), - // PurgeProtectionEnabled: to.Ptr(true), - // ScheduledPurgeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T00:00:59Z"); return t}()), - // Tags: map[string]*string{ - // "Dept": to.Ptr("hsm"), - // "Environment": to.Ptr("production"), - // }, - // }, - // }, - // { - // Name: to.Ptr("vault-agile-drawer-6404"), - // Type: to.Ptr("Microsoft.KeyVault/deletedManagedHSMs"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/westus/deletedManagedHSMs/hsm2"), - // Properties: &armkeyvault.DeletedManagedHsmProperties{ - // DeletionDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T00:00:59Z"); return t}()), - // Location: to.Ptr("westus"), - // MhsmID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.KeyVault/managedHSMs/hsm2"), - // PurgeProtectionEnabled: to.Ptr(true), - // ScheduledPurgeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T00:00:59Z"); return t}()), - // Tags: map[string]*string{ - // "Dept": to.Ptr("hsm"), - // "Environment": to.Ptr("production"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/DeletedManagedHsm_Get.json -func ExampleManagedHsmsClient_GetDeleted() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkeyvault.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedHsmsClient().GetDeleted(ctx, "hsm1", "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.DeletedManagedHsm = armkeyvault.DeletedManagedHsm{ - // Name: to.Ptr("vault-agile-drawer-6404"), - // Type: to.Ptr("Microsoft.KeyVault/deletedManagedHSMs"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/westus/deletedManagedHSMs/hsm1"), - // Properties: &armkeyvault.DeletedManagedHsmProperties{ - // DeletionDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T00:00:59Z"); return t}()), - // Location: to.Ptr("westus"), - // MhsmID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.KeyVault/managedHSMs/hsm1"), - // PurgeProtectionEnabled: to.Ptr(true), - // ScheduledPurgeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T00:00:59Z"); return t}()), - // Tags: map[string]*string{ - // "Dept": to.Ptr("hsm"), - // "Environment": to.Ptr("production"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/DeletedManagedHsm_Purge.json -func ExampleManagedHsmsClient_BeginPurgeDeleted() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkeyvault.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedHsmsClient().BeginPurgeDeleted(ctx, "hsm1", "westus", 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/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/ManagedHsm_checkMhsmNameAvailability.json -func ExampleManagedHsmsClient_CheckMhsmNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkeyvault.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedHsmsClient().CheckMhsmNameAvailability(ctx, armkeyvault.CheckMhsmNameAvailabilityParameters{ - Name: to.Ptr("sample-mhsm"), - }, 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.CheckMhsmNameAvailabilityResult = armkeyvault.CheckMhsmNameAvailabilityResult{ - // NameAvailable: to.Ptr(true), - // } -} diff --git a/sdk/resourcemanager/keyvault/armkeyvault/mhsmprivateendpointconnections_client_example_test.go b/sdk/resourcemanager/keyvault/armkeyvault/mhsmprivateendpointconnections_client_example_test.go deleted file mode 100644 index a267b3e4323a..000000000000 --- a/sdk/resourcemanager/keyvault/armkeyvault/mhsmprivateendpointconnections_client_example_test.go +++ /dev/null @@ -1,193 +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 armkeyvault_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/keyvault/armkeyvault" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/ManagedHsm_ListPrivateEndpointConnectionsByResource.json -func ExampleMHSMPrivateEndpointConnectionsClient_NewListByResourcePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkeyvault.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMHSMPrivateEndpointConnectionsClient().NewListByResourcePager("sample-group", "sample-mhsm", 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.MHSMPrivateEndpointConnectionsListResult = armkeyvault.MHSMPrivateEndpointConnectionsListResult{ - // Value: []*armkeyvault.MHSMPrivateEndpointConnection{ - // { - // Name: to.Ptr("sample-pec1"), - // Type: to.Ptr("Microsoft.KeyVault/managedhsms/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/managedhsms/sample-mhsm/privateEndpointConnections/sample-pec1"), - // Etag: to.Ptr(""), - // Properties: &armkeyvault.MHSMPrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armkeyvault.MHSMPrivateEndpoint{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-1234-000000000000/resourceGroups/sample-group/providers/Microsoft.Network/privateEndpoints/sample-pe1"), - // }, - // PrivateLinkServiceConnectionState: &armkeyvault.MHSMPrivateLinkServiceConnectionState{ - // Description: to.Ptr("This was automatically approved by user1234@contoso.com"), - // ActionsRequired: to.Ptr(armkeyvault.ActionsRequiredNone), - // Status: to.Ptr(armkeyvault.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armkeyvault.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("sample-pec2"), - // Type: to.Ptr("Microsoft.KeyVault/managedhsms/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/managedhsms/sample-mhsm/privateEndpointConnections/sample-pec2"), - // Etag: to.Ptr(""), - // Properties: &armkeyvault.MHSMPrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armkeyvault.MHSMPrivateEndpoint{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-1234-000000000000/resourceGroups/sample-group/providers/Microsoft.Network/privateEndpoints/sample-pe2"), - // }, - // PrivateLinkServiceConnectionState: &armkeyvault.MHSMPrivateLinkServiceConnectionState{ - // Description: to.Ptr("This was automatically approved by user1234@contoso.com"), - // ActionsRequired: to.Ptr(armkeyvault.ActionsRequiredNone), - // Status: to.Ptr(armkeyvault.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armkeyvault.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/ManagedHsm_getPrivateEndpointConnection.json -func ExampleMHSMPrivateEndpointConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkeyvault.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMHSMPrivateEndpointConnectionsClient().Get(ctx, "sample-group", "sample-mhsm", "sample-pec", 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.MHSMPrivateEndpointConnection = armkeyvault.MHSMPrivateEndpointConnection{ - // Name: to.Ptr("sample-pec"), - // Type: to.Ptr("Microsoft.KeyVault/managedhsms/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/managedhsms/sample-mhsm/privateEndpointConnections/sample-pec"), - // Etag: to.Ptr(""), - // Properties: &armkeyvault.MHSMPrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armkeyvault.MHSMPrivateEndpoint{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-1234-000000000000/resourceGroups/sample-group/providers/Microsoft.Network/privateEndpoints/sample-pe"), - // }, - // PrivateLinkServiceConnectionState: &armkeyvault.MHSMPrivateLinkServiceConnectionState{ - // Description: to.Ptr("This was automatically approved by user1234@contoso.com"), - // ActionsRequired: to.Ptr(armkeyvault.ActionsRequiredNone), - // Status: to.Ptr(armkeyvault.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armkeyvault.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/ManagedHsm_putPrivateEndpointConnection.json -func ExampleMHSMPrivateEndpointConnectionsClient_Put() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkeyvault.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMHSMPrivateEndpointConnectionsClient().Put(ctx, "sample-group", "sample-mhsm", "sample-pec", armkeyvault.MHSMPrivateEndpointConnection{ - Properties: &armkeyvault.MHSMPrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armkeyvault.MHSMPrivateLinkServiceConnectionState{ - Description: to.Ptr("My name is Joe and I'm approving this."), - Status: to.Ptr(armkeyvault.PrivateEndpointServiceConnectionStatusApproved), - }, - }, - }, 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.MHSMPrivateEndpointConnection = armkeyvault.MHSMPrivateEndpointConnection{ - // Name: to.Ptr("sample-pec"), - // Type: to.Ptr("Microsoft.KeyVault/managedhsms/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/managedhsms/sample-mhsm/privateEndpointConnections/sample-pec"), - // Properties: &armkeyvault.MHSMPrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armkeyvault.MHSMPrivateEndpoint{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-1234-000000000000/resourceGroups/sample-group/providers/Microsoft.Network/privateEndpoints/sample-pe"), - // }, - // PrivateLinkServiceConnectionState: &armkeyvault.MHSMPrivateLinkServiceConnectionState{ - // Description: to.Ptr("My name is Joe and I'm approving this."), - // ActionsRequired: to.Ptr(armkeyvault.ActionsRequiredNone), - // Status: to.Ptr(armkeyvault.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armkeyvault.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/ManagedHsm_deletePrivateEndpointConnection.json -func ExampleMHSMPrivateEndpointConnectionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkeyvault.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMHSMPrivateEndpointConnectionsClient().BeginDelete(ctx, "sample-group", "sample-mhsm", "sample-pec", 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.MHSMPrivateEndpointConnection = armkeyvault.MHSMPrivateEndpointConnection{ - // Name: to.Ptr("sample-pec"), - // Type: to.Ptr("Microsoft.KeyVault/managedhsms/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/managedhsms/sample-vault/privateEndpointConnections/sample-pec"), - // Properties: &armkeyvault.MHSMPrivateEndpointConnectionProperties{ - // ProvisioningState: to.Ptr(armkeyvault.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // } -} diff --git a/sdk/resourcemanager/keyvault/armkeyvault/mhsmprivatelinkresources_client_example_test.go b/sdk/resourcemanager/keyvault/armkeyvault/mhsmprivatelinkresources_client_example_test.go deleted file mode 100644 index 164cf084d304..000000000000 --- a/sdk/resourcemanager/keyvault/armkeyvault/mhsmprivatelinkresources_client_example_test.go +++ /dev/null @@ -1,53 +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 armkeyvault_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/ManagedHsm_listPrivateLinkResources.json -func ExampleMHSMPrivateLinkResourcesClient_ListByMHSMResource() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkeyvault.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMHSMPrivateLinkResourcesClient().ListByMHSMResource(ctx, "sample-group", "sample-mhsm", 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.MHSMPrivateLinkResourceListResult = armkeyvault.MHSMPrivateLinkResourceListResult{ - // Value: []*armkeyvault.MHSMPrivateLinkResource{ - // { - // Name: to.Ptr("managedhsm"), - // Type: to.Ptr("Microsoft.KeyVault/managedhsms/privateLinkResources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-resource-group/providers/Microsoft.KeyVault/managedhsms/sample-mhsm/privateLinkResources/managedhsm"), - // Properties: &armkeyvault.MHSMPrivateLinkResourceProperties{ - // GroupID: to.Ptr("managedhsms"), - // RequiredMembers: []*string{ - // to.Ptr("default")}, - // RequiredZoneNames: []*string{ - // to.Ptr("privatelink.managedhsm.azure.net")}, - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/keyvault/armkeyvault/mhsmregions_client_example_test.go b/sdk/resourcemanager/keyvault/armkeyvault/mhsmregions_client_example_test.go deleted file mode 100644 index c0ce6b61180a..000000000000 --- a/sdk/resourcemanager/keyvault/armkeyvault/mhsmregions_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 armkeyvault_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/ManagedHsm_ListRegionsByResource.json -func ExampleMHSMRegionsClient_NewListByResourcePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkeyvault.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMHSMRegionsClient().NewListByResourcePager("sample-group", "sample-mhsm", 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.MHSMRegionsListResult = armkeyvault.MHSMRegionsListResult{ - // Value: []*armkeyvault.MHSMGeoReplicatedRegion{ - // { - // Name: to.Ptr("sample-region1"), - // IsPrimary: to.Ptr(true), - // ProvisioningState: to.Ptr(armkeyvault.GeoReplicationRegionProvisioningStateSucceeded), - // }, - // { - // Name: to.Ptr("sample-region2"), - // IsPrimary: to.Ptr(false), - // ProvisioningState: to.Ptr(armkeyvault.GeoReplicationRegionProvisioningStateSucceeded), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/keyvault/armkeyvault/models.go b/sdk/resourcemanager/keyvault/armkeyvault/models.go index 27413da2a258..4a988f3b0918 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/models.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/models.go @@ -16,304 +16,304 @@ import "time" type AccessPolicyEntry struct { // REQUIRED; The object ID of a user, service principal or security group in the Azure Active Directory tenant for the vault. // The object ID must be unique for the list of access policies. - ObjectID *string `json:"objectId,omitempty"` + ObjectID *string // REQUIRED; Permissions the identity has for keys, secrets and certificates. - Permissions *Permissions `json:"permissions,omitempty"` + Permissions *Permissions // REQUIRED; The Azure Active Directory tenant ID that should be used for authenticating requests to the key vault. - TenantID *string `json:"tenantId,omitempty"` + TenantID *string // Application ID of the client making request on behalf of a principal - ApplicationID *string `json:"applicationId,omitempty"` + ApplicationID *string } type Action struct { // The type of action. - Type *KeyRotationPolicyActionType `json:"type,omitempty"` + Type *KeyRotationPolicyActionType } // Attributes - The object attributes managed by the KeyVault service. type Attributes struct { // Determines whether the object is enabled. - Enabled *bool `json:"enabled,omitempty"` + Enabled *bool // Expiry date in seconds since 1970-01-01T00:00:00Z. - Expires *time.Time `json:"exp,omitempty"` + Expires *time.Time // Not before date in seconds since 1970-01-01T00:00:00Z. - NotBefore *time.Time `json:"nbf,omitempty"` + NotBefore *time.Time // READ-ONLY; Creation time in seconds since 1970-01-01T00:00:00Z. - Created *time.Time `json:"created,omitempty" azure:"ro"` + Created *time.Time // READ-ONLY; Last updated time in seconds since 1970-01-01T00:00:00Z. - Updated *time.Time `json:"updated,omitempty" azure:"ro"` + Updated *time.Time } // CheckMhsmNameAvailabilityParameters - The parameters used to check the availability of the managed hsm name. type CheckMhsmNameAvailabilityParameters struct { // REQUIRED; The managed hsm name. - Name *string `json:"name,omitempty"` + Name *string } // CheckMhsmNameAvailabilityResult - The CheckMhsmNameAvailability operation response. type CheckMhsmNameAvailabilityResult struct { // READ-ONLY; An error message explaining the Reason value in more detail. - Message *string `json:"message,omitempty" azure:"ro"` + Message *string // READ-ONLY; A boolean value that indicates whether the name is available for you to use. If true, the name is available. // If false, the name has already been taken or is invalid and cannot be used. - NameAvailable *bool `json:"nameAvailable,omitempty" azure:"ro"` + NameAvailable *bool // READ-ONLY; The reason that a managed hsm name could not be used. The reason element is only returned if NameAvailable is // false. - Reason *Reason `json:"reason,omitempty" azure:"ro"` + Reason *Reason } // CheckNameAvailabilityResult - The CheckNameAvailability operation response. type CheckNameAvailabilityResult struct { // READ-ONLY; An error message explaining the Reason value in more detail. - Message *string `json:"message,omitempty" azure:"ro"` + Message *string // READ-ONLY; A boolean value that indicates whether the name is available for you to use. If true, the name is available. // If false, the name has already been taken or is invalid and cannot be used. - NameAvailable *bool `json:"nameAvailable,omitempty" azure:"ro"` + NameAvailable *bool // READ-ONLY; The reason that a vault name could not be used. The Reason element is only returned if NameAvailable is false. - Reason *Reason `json:"reason,omitempty" azure:"ro"` + Reason *Reason } type DeletedManagedHsm struct { // Properties of the deleted managed HSM - Properties *DeletedManagedHsmProperties `json:"properties,omitempty"` + Properties *DeletedManagedHsmProperties // READ-ONLY; The Azure Resource Manager resource ID for the deleted managed HSM Pool. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the managed HSM Pool. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; The resource type of the managed HSM Pool. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // DeletedManagedHsmListResult - List of deleted managed HSM Pools type DeletedManagedHsmListResult struct { // The URL to get the next set of deleted managed HSM Pools. - NextLink *string `json:"nextLink,omitempty"` + NextLink *string // The list of deleted managed HSM Pools. - Value []*DeletedManagedHsm `json:"value,omitempty"` + Value []*DeletedManagedHsm } // DeletedManagedHsmProperties - Properties of the deleted managed HSM. type DeletedManagedHsmProperties struct { // READ-ONLY; The deleted date. - DeletionDate *time.Time `json:"deletionDate,omitempty" azure:"ro"` + DeletionDate *time.Time // READ-ONLY; The location of the original managed HSM. - Location *string `json:"location,omitempty" azure:"ro"` + Location *string // READ-ONLY; The resource id of the original managed HSM. - MhsmID *string `json:"mhsmId,omitempty" azure:"ro"` + MhsmID *string // READ-ONLY; Purge protection status of the original managed HSM. - PurgeProtectionEnabled *bool `json:"purgeProtectionEnabled,omitempty" azure:"ro"` + PurgeProtectionEnabled *bool // READ-ONLY; The scheduled purged date. - ScheduledPurgeDate *time.Time `json:"scheduledPurgeDate,omitempty" azure:"ro"` + ScheduledPurgeDate *time.Time // READ-ONLY; Tags of the original managed HSM. - Tags map[string]*string `json:"tags,omitempty" azure:"ro"` + Tags map[string]*string } // DeletedVault - Deleted vault information with extended details. type DeletedVault struct { // Properties of the vault - Properties *DeletedVaultProperties `json:"properties,omitempty"` + Properties *DeletedVaultProperties // READ-ONLY; The resource ID for the deleted key vault. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the key vault. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; The resource type of the key vault. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // DeletedVaultListResult - List of vaults type DeletedVaultListResult struct { // The URL to get the next set of deleted vaults. - NextLink *string `json:"nextLink,omitempty"` + NextLink *string // The list of deleted vaults. - Value []*DeletedVault `json:"value,omitempty"` + Value []*DeletedVault } // DeletedVaultProperties - Properties of the deleted vault. type DeletedVaultProperties struct { // READ-ONLY; The deleted date. - DeletionDate *time.Time `json:"deletionDate,omitempty" azure:"ro"` + DeletionDate *time.Time // READ-ONLY; The location of the original vault. - Location *string `json:"location,omitempty" azure:"ro"` + Location *string // READ-ONLY; Purge protection status of the original vault. - PurgeProtectionEnabled *bool `json:"purgeProtectionEnabled,omitempty" azure:"ro"` + PurgeProtectionEnabled *bool // READ-ONLY; The scheduled purged date. - ScheduledPurgeDate *time.Time `json:"scheduledPurgeDate,omitempty" azure:"ro"` + ScheduledPurgeDate *time.Time // READ-ONLY; Tags of the original vault. - Tags map[string]*string `json:"tags,omitempty" azure:"ro"` + Tags map[string]*string // READ-ONLY; The resource id of the original vault. - VaultID *string `json:"vaultId,omitempty" azure:"ro"` + VaultID *string } // DimensionProperties - Type of operation: get, read, delete, etc. type DimensionProperties struct { // Display name of dimension. - DisplayName *string `json:"displayName,omitempty"` + DisplayName *string // Name of dimension. - Name *string `json:"name,omitempty"` + Name *string // Property to specify whether the dimension should be exported for Shoebox. - ToBeExportedForShoebox *bool `json:"toBeExportedForShoebox,omitempty"` + ToBeExportedForShoebox *bool } // Error - The server error. type Error struct { // READ-ONLY; The error code. - Code *string `json:"code,omitempty" azure:"ro"` + Code *string // READ-ONLY; The inner error, contains a more specific error code. - InnerError *Error `json:"innererror,omitempty" azure:"ro"` + InnerError *Error // READ-ONLY; The error message. - Message *string `json:"message,omitempty" azure:"ro"` + Message *string } // IPRule - A rule governing the accessibility of a vault from a specific ip address or ip range. type IPRule struct { // REQUIRED; An IPv4 address range in CIDR notation, such as '124.56.78.91' (simple IP address) or '124.56.78.0/24' (all addresses // that start with 124.56.78). - Value *string `json:"value,omitempty"` + Value *string } // Key - The key resource. type Key struct { // REQUIRED; The properties of the key. - Properties *KeyProperties `json:"properties,omitempty"` + Properties *KeyProperties // READ-ONLY; Fully qualified identifier of the key vault resource. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Azure location of the key vault resource. - Location *string `json:"location,omitempty" azure:"ro"` + Location *string // READ-ONLY; Name of the key vault resource. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Tags assigned to the key vault resource. - Tags map[string]*string `json:"tags,omitempty" azure:"ro"` + Tags map[string]*string // READ-ONLY; Resource type of the key vault resource. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // KeyAttributes - The object attributes managed by the Azure Key Vault service. type KeyAttributes struct { // Determines whether or not the object is enabled. - Enabled *bool `json:"enabled,omitempty"` + Enabled *bool // Expiry date in seconds since 1970-01-01T00:00:00Z. - Expires *int64 `json:"exp,omitempty"` + Expires *int64 // Indicates if the private key can be exported. - Exportable *bool `json:"exportable,omitempty"` + Exportable *bool // Not before date in seconds since 1970-01-01T00:00:00Z. - NotBefore *int64 `json:"nbf,omitempty"` + NotBefore *int64 // READ-ONLY; Creation time in seconds since 1970-01-01T00:00:00Z. - Created *int64 `json:"created,omitempty" azure:"ro"` + Created *int64 // READ-ONLY; The deletion recovery level currently in effect for the object. If it contains 'Purgeable', then the object // can be permanently deleted by a privileged user; otherwise, only the system can purge the // object at the end of the retention interval. - RecoveryLevel *DeletionRecoveryLevel `json:"recoveryLevel,omitempty" azure:"ro"` + RecoveryLevel *DeletionRecoveryLevel // READ-ONLY; Last updated time in seconds since 1970-01-01T00:00:00Z. - Updated *int64 `json:"updated,omitempty" azure:"ro"` + Updated *int64 } // KeyCreateParameters - The parameters used to create a key. type KeyCreateParameters struct { // REQUIRED; The properties of the key to be created. - Properties *KeyProperties `json:"properties,omitempty"` + Properties *KeyProperties // The tags that will be assigned to the key. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string } // KeyListResult - The page of keys. type KeyListResult struct { // The URL to get the next page of keys. - NextLink *string `json:"nextLink,omitempty"` + NextLink *string // The key resources. - Value []*Key `json:"value,omitempty"` + Value []*Key } // KeyProperties - The properties of the key. type KeyProperties struct { // The attributes of the key. - Attributes *KeyAttributes `json:"attributes,omitempty"` + Attributes *KeyAttributes // The elliptic curve name. For valid values, see JsonWebKeyCurveName. - CurveName *JSONWebKeyCurveName `json:"curveName,omitempty"` - KeyOps []*JSONWebKeyOperation `json:"keyOps,omitempty"` + CurveName *JSONWebKeyCurveName + KeyOps []*JSONWebKeyOperation // The key size in bits. For example: 2048, 3072, or 4096 for RSA. - KeySize *int32 `json:"keySize,omitempty"` + KeySize *int32 // The type of the key. For valid values, see JsonWebKeyType. - Kty *JSONWebKeyType `json:"kty,omitempty"` + Kty *JSONWebKeyType // Key release policy in response. It will be used for both output and input. Omitted if empty - ReleasePolicy *KeyReleasePolicy `json:"release_policy,omitempty"` + ReleasePolicy *KeyReleasePolicy // Key rotation policy in response. It will be used for both output and input. Omitted if empty - RotationPolicy *RotationPolicy `json:"rotationPolicy,omitempty"` + RotationPolicy *RotationPolicy // READ-ONLY; The URI to retrieve the current version of the key. - KeyURI *string `json:"keyUri,omitempty" azure:"ro"` + KeyURI *string // READ-ONLY; The URI to retrieve the specific version of the key. - KeyURIWithVersion *string `json:"keyUriWithVersion,omitempty" azure:"ro"` + KeyURIWithVersion *string } type KeyReleasePolicy struct { // Content type and version of key release policy - ContentType *string `json:"contentType,omitempty"` + ContentType *string // Blob encoding the policy rules under which the key can be released. - Data []byte `json:"data,omitempty"` + Data []byte } type KeyRotationPolicyAttributes struct { // The expiration time for the new key version. It should be in ISO8601 format. Eg: 'P90D', 'P1Y'. - ExpiryTime *string `json:"expiryTime,omitempty"` + ExpiryTime *string // READ-ONLY; Creation time in seconds since 1970-01-01T00:00:00Z. - Created *int64 `json:"created,omitempty" azure:"ro"` + Created *int64 // READ-ONLY; Last updated time in seconds since 1970-01-01T00:00:00Z. - Updated *int64 `json:"updated,omitempty" azure:"ro"` + Updated *int64 } // KeysClientCreateIfNotExistOptions contains the optional parameters for the KeysClient.CreateIfNotExist method. @@ -343,117 +343,117 @@ type KeysClientListVersionsOptions struct { type LifetimeAction struct { // The action of key rotation policy lifetimeAction. - Action *Action `json:"action,omitempty"` + Action *Action // The trigger of key rotation policy lifetimeAction. - Trigger *Trigger `json:"trigger,omitempty"` + Trigger *Trigger } // LogSpecification - Log specification of operation. type LogSpecification struct { // Blob duration of specification. - BlobDuration *string `json:"blobDuration,omitempty"` + BlobDuration *string // Display name of log specification. - DisplayName *string `json:"displayName,omitempty"` + DisplayName *string // Name of log specification. - Name *string `json:"name,omitempty"` + Name *string } // MHSMGeoReplicatedRegion - A region that this managed HSM Pool has been extended to. type MHSMGeoReplicatedRegion struct { // A boolean value that indicates whether the region is the primary region or a secondary region. - IsPrimary *bool `json:"isPrimary,omitempty"` + IsPrimary *bool // Name of the geo replicated region. - Name *string `json:"name,omitempty"` + Name *string // READ-ONLY; Provisioning state of the geo replicated region. - ProvisioningState *GeoReplicationRegionProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *GeoReplicationRegionProvisioningState } // MHSMIPRule - A rule governing the accessibility of a managed HSM pool from a specific IP address or IP range. type MHSMIPRule struct { // REQUIRED; An IPv4 address range in CIDR notation, such as '124.56.78.91' (simple IP address) or '124.56.78.0/24' (all addresses // that start with 124.56.78). - Value *string `json:"value,omitempty"` + Value *string } // MHSMNetworkRuleSet - A set of rules governing the network accessibility of a managed hsm pool. type MHSMNetworkRuleSet struct { // Tells what traffic can bypass network rules. This can be 'AzureServices' or 'None'. If not specified the default is 'AzureServices'. - Bypass *NetworkRuleBypassOptions `json:"bypass,omitempty"` + Bypass *NetworkRuleBypassOptions // The default action when no rule from ipRules and from virtualNetworkRules match. This is only used after the bypass property // has been evaluated. - DefaultAction *NetworkRuleAction `json:"defaultAction,omitempty"` + DefaultAction *NetworkRuleAction // The list of IP address rules. - IPRules []*MHSMIPRule `json:"ipRules,omitempty"` + IPRules []*MHSMIPRule // The list of virtual network rules. - VirtualNetworkRules []*MHSMVirtualNetworkRule `json:"virtualNetworkRules,omitempty"` + VirtualNetworkRules []*MHSMVirtualNetworkRule } // MHSMPrivateEndpoint - Private endpoint object properties. type MHSMPrivateEndpoint struct { // READ-ONLY; Full identifier of the private endpoint resource. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string } // MHSMPrivateEndpointConnection - Private endpoint connection resource. type MHSMPrivateEndpointConnection struct { // Modified whenever there is a change in the state of private endpoint connection. - Etag *string `json:"etag,omitempty"` + Etag *string // The supported Azure location where the managed HSM Pool should be created. - Location *string `json:"location,omitempty"` + Location *string // Resource properties. - Properties *MHSMPrivateEndpointConnectionProperties `json:"properties,omitempty"` + Properties *MHSMPrivateEndpointConnectionProperties // SKU details - SKU *ManagedHsmSKU `json:"sku,omitempty"` + SKU *ManagedHsmSKU // Resource tags - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; The Azure Resource Manager resource ID for the managed HSM Pool. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the managed HSM Pool. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the key vault resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The resource type of the managed HSM Pool. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // MHSMPrivateEndpointConnectionItem - Private endpoint connection item. type MHSMPrivateEndpointConnectionItem struct { // Modified whenever there is a change in the state of private endpoint connection. - Etag *string `json:"etag,omitempty"` + Etag *string // Id of private endpoint connection. - ID *string `json:"id,omitempty"` + ID *string // Private endpoint connection properties. - Properties *MHSMPrivateEndpointConnectionProperties `json:"properties,omitempty"` + Properties *MHSMPrivateEndpointConnectionProperties } // MHSMPrivateEndpointConnectionProperties - Properties of the private endpoint connection resource. type MHSMPrivateEndpointConnectionProperties struct { // Properties of the private endpoint object. - PrivateEndpoint *MHSMPrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateEndpoint *MHSMPrivateEndpoint // Approval state of the private link connection. - PrivateLinkServiceConnectionState *MHSMPrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` + PrivateLinkServiceConnectionState *MHSMPrivateLinkServiceConnectionState // Provisioning state of the private endpoint connection. - ProvisioningState *PrivateEndpointConnectionProvisioningState `json:"provisioningState,omitempty"` + ProvisioningState *PrivateEndpointConnectionProvisioningState } // MHSMPrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the MHSMPrivateEndpointConnectionsClient.BeginDelete @@ -484,55 +484,55 @@ type MHSMPrivateEndpointConnectionsClientPutOptions struct { // MHSMPrivateEndpointConnectionsListResult - List of private endpoint connections associated with a managed HSM Pools type MHSMPrivateEndpointConnectionsListResult struct { // The URL to get the next set of managed HSM Pools. - NextLink *string `json:"nextLink,omitempty"` + NextLink *string // The private endpoint connection associated with a managed HSM Pools. - Value []*MHSMPrivateEndpointConnection `json:"value,omitempty"` + Value []*MHSMPrivateEndpointConnection } // MHSMPrivateLinkResource - A private link resource type MHSMPrivateLinkResource struct { // The supported Azure location where the managed HSM Pool should be created. - Location *string `json:"location,omitempty"` + Location *string // Resource properties. - Properties *MHSMPrivateLinkResourceProperties `json:"properties,omitempty"` + Properties *MHSMPrivateLinkResourceProperties // SKU details - SKU *ManagedHsmSKU `json:"sku,omitempty"` + SKU *ManagedHsmSKU // Resource tags - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; The Azure Resource Manager resource ID for the managed HSM Pool. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the managed HSM Pool. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the key vault resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The resource type of the managed HSM Pool. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // MHSMPrivateLinkResourceListResult - A list of private link resources type MHSMPrivateLinkResourceListResult struct { // Array of private link resources - Value []*MHSMPrivateLinkResource `json:"value,omitempty"` + Value []*MHSMPrivateLinkResource } // MHSMPrivateLinkResourceProperties - Properties of a private link resource. type MHSMPrivateLinkResourceProperties struct { // Required DNS zone names of the the private link resource. - RequiredZoneNames []*string `json:"requiredZoneNames,omitempty"` + RequiredZoneNames []*string // READ-ONLY; Group identifier of private link resource. - GroupID *string `json:"groupId,omitempty" azure:"ro"` + GroupID *string // READ-ONLY; Required member names of private link resource. - RequiredMembers []*string `json:"requiredMembers,omitempty" azure:"ro"` + RequiredMembers []*string } // MHSMPrivateLinkResourcesClientListByMHSMResourceOptions contains the optional parameters for the MHSMPrivateLinkResourcesClient.ListByMHSMResource @@ -544,13 +544,13 @@ type MHSMPrivateLinkResourcesClientListByMHSMResourceOptions struct { // MHSMPrivateLinkServiceConnectionState - An object that represents the approval state of the private link connection. type MHSMPrivateLinkServiceConnectionState struct { // A message indicating if changes on the service provider require any updates on the consumer. - ActionsRequired *ActionsRequired `json:"actionsRequired,omitempty"` + ActionsRequired *ActionsRequired // The reason for approval or rejection. - Description *string `json:"description,omitempty"` + Description *string // Indicates whether the connection has been approved, rejected or removed by the key vault owner. - Status *PrivateEndpointServiceConnectionStatus `json:"status,omitempty"` + Status *PrivateEndpointServiceConnectionStatus } // MHSMRegionsClientListByResourceOptions contains the optional parameters for the MHSMRegionsClient.NewListByResourcePager @@ -562,172 +562,172 @@ type MHSMRegionsClientListByResourceOptions struct { // MHSMRegionsListResult - List of regions associated with a managed HSM Pools type MHSMRegionsListResult struct { // The URL to get the next set of managed HSM Pools. - NextLink *string `json:"nextLink,omitempty"` + NextLink *string // The region associated with a managed HSM Pools. - Value []*MHSMGeoReplicatedRegion `json:"value,omitempty"` + Value []*MHSMGeoReplicatedRegion } // MHSMVirtualNetworkRule - A rule governing the accessibility of a managed hsm pool from a specific virtual network. type MHSMVirtualNetworkRule struct { // REQUIRED; Full resource id of a vnet subnet, such as '/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1'. - ID *string `json:"id,omitempty"` + ID *string } // ManagedHSMSecurityDomainProperties - The security domain properties of the managed hsm. type ManagedHSMSecurityDomainProperties struct { // READ-ONLY; Activation Status - ActivationStatus *ActivationStatus `json:"activationStatus,omitempty" azure:"ro"` + ActivationStatus *ActivationStatus // READ-ONLY; Activation Status Message. - ActivationStatusMessage *string `json:"activationStatusMessage,omitempty" azure:"ro"` + ActivationStatusMessage *string } // ManagedHsm - Resource information with extended details. type ManagedHsm struct { // The supported Azure location where the managed HSM Pool should be created. - Location *string `json:"location,omitempty"` + Location *string // Properties of the managed HSM - Properties *ManagedHsmProperties `json:"properties,omitempty"` + Properties *ManagedHsmProperties // SKU details - SKU *ManagedHsmSKU `json:"sku,omitempty"` + SKU *ManagedHsmSKU // Resource tags - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; The Azure Resource Manager resource ID for the managed HSM Pool. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the managed HSM Pool. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the key vault resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The resource type of the managed HSM Pool. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } type ManagedHsmAction struct { // The type of action. - Type *KeyRotationPolicyActionType `json:"type,omitempty"` + Type *KeyRotationPolicyActionType } // ManagedHsmError - The error exception. type ManagedHsmError struct { // READ-ONLY; The server error. - Error *Error `json:"error,omitempty" azure:"ro"` + Error *Error } // ManagedHsmKey - The key resource. type ManagedHsmKey struct { // REQUIRED; The properties of the key. - Properties *ManagedHsmKeyProperties `json:"properties,omitempty"` + Properties *ManagedHsmKeyProperties // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ManagedHsmKeyAttributes - The object attributes managed by the Azure Key Vault service. type ManagedHsmKeyAttributes struct { // Determines whether or not the object is enabled. - Enabled *bool `json:"enabled,omitempty"` + Enabled *bool // Expiry date in seconds since 1970-01-01T00:00:00Z. - Expires *int64 `json:"exp,omitempty"` + Expires *int64 // Indicates if the private key can be exported. - Exportable *bool `json:"exportable,omitempty"` + Exportable *bool // Not before date in seconds since 1970-01-01T00:00:00Z. - NotBefore *int64 `json:"nbf,omitempty"` + NotBefore *int64 // READ-ONLY; Creation time in seconds since 1970-01-01T00:00:00Z. - Created *int64 `json:"created,omitempty" azure:"ro"` + Created *int64 // READ-ONLY; The deletion recovery level currently in effect for the object. If it contains 'Purgeable', then the object // can be permanently deleted by a privileged user; otherwise, only the system can purge the // object at the end of the retention interval. - RecoveryLevel *DeletionRecoveryLevel `json:"recoveryLevel,omitempty" azure:"ro"` + RecoveryLevel *DeletionRecoveryLevel // READ-ONLY; Last updated time in seconds since 1970-01-01T00:00:00Z. - Updated *int64 `json:"updated,omitempty" azure:"ro"` + Updated *int64 } // ManagedHsmKeyCreateParameters - The parameters used to create a key. type ManagedHsmKeyCreateParameters struct { // REQUIRED; The properties of the key to be created. - Properties *ManagedHsmKeyProperties `json:"properties,omitempty"` + Properties *ManagedHsmKeyProperties // The tags that will be assigned to the key. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string } // ManagedHsmKeyListResult - The page of keys. type ManagedHsmKeyListResult struct { // The URL to get the next page of keys. - NextLink *string `json:"nextLink,omitempty"` + NextLink *string // The key resources. - Value []*ManagedHsmKey `json:"value,omitempty"` + Value []*ManagedHsmKey } // ManagedHsmKeyProperties - The properties of the key. type ManagedHsmKeyProperties struct { // The attributes of the key. - Attributes *ManagedHsmKeyAttributes `json:"attributes,omitempty"` + Attributes *ManagedHsmKeyAttributes // The elliptic curve name. For valid values, see JsonWebKeyCurveName. - CurveName *JSONWebKeyCurveName `json:"curveName,omitempty"` - KeyOps []*JSONWebKeyOperation `json:"keyOps,omitempty"` + CurveName *JSONWebKeyCurveName + KeyOps []*JSONWebKeyOperation // The key size in bits. For example: 2048, 3072, or 4096 for RSA. - KeySize *int32 `json:"keySize,omitempty"` + KeySize *int32 // The type of the key. For valid values, see JsonWebKeyType. - Kty *JSONWebKeyType `json:"kty,omitempty"` + Kty *JSONWebKeyType // Key release policy in response. It will be used for both output and input. Omitted if empty - ReleasePolicy *ManagedHsmKeyReleasePolicy `json:"release_policy,omitempty"` + ReleasePolicy *ManagedHsmKeyReleasePolicy // Key rotation policy in response. It will be used for both output and input. Omitted if empty - RotationPolicy *ManagedHsmRotationPolicy `json:"rotationPolicy,omitempty"` + RotationPolicy *ManagedHsmRotationPolicy // READ-ONLY; The URI to retrieve the current version of the key. - KeyURI *string `json:"keyUri,omitempty" azure:"ro"` + KeyURI *string // READ-ONLY; The URI to retrieve the specific version of the key. - KeyURIWithVersion *string `json:"keyUriWithVersion,omitempty" azure:"ro"` + KeyURIWithVersion *string } type ManagedHsmKeyReleasePolicy struct { // Content type and version of key release policy - ContentType *string `json:"contentType,omitempty"` + ContentType *string // Blob encoding the policy rules under which the key can be released. - Data []byte `json:"data,omitempty"` + Data []byte } type ManagedHsmKeyRotationPolicyAttributes struct { // The expiration time for the new key version. It should be in ISO8601 format. Eg: 'P90D', 'P1Y'. - ExpiryTime *string `json:"expiryTime,omitempty"` + ExpiryTime *string // READ-ONLY; Creation time in seconds since 1970-01-01T00:00:00Z. - Created *int64 `json:"created,omitempty" azure:"ro"` + Created *int64 // READ-ONLY; Last updated time in seconds since 1970-01-01T00:00:00Z. - Updated *int64 `json:"updated,omitempty" azure:"ro"` + Updated *int64 } // ManagedHsmKeysClientCreateIfNotExistOptions contains the optional parameters for the ManagedHsmKeysClient.CreateIfNotExist @@ -759,122 +759,122 @@ type ManagedHsmKeysClientListVersionsOptions struct { type ManagedHsmLifetimeAction struct { // The action of key rotation policy lifetimeAction. - Action *ManagedHsmAction `json:"action,omitempty"` + Action *ManagedHsmAction // The trigger of key rotation policy lifetimeAction. - Trigger *ManagedHsmTrigger `json:"trigger,omitempty"` + Trigger *ManagedHsmTrigger } // ManagedHsmListResult - List of managed HSM Pools type ManagedHsmListResult struct { // The URL to get the next set of managed HSM Pools. - NextLink *string `json:"nextLink,omitempty"` + NextLink *string // The list of managed HSM Pools. - Value []*ManagedHsm `json:"value,omitempty"` + Value []*ManagedHsm } // ManagedHsmProperties - Properties of the managed HSM Pool type ManagedHsmProperties struct { // The create mode to indicate whether the resource is being created or is being recovered from a deleted resource. - CreateMode *CreateMode `json:"createMode,omitempty"` + CreateMode *CreateMode // Property specifying whether protection against purge is enabled for this managed HSM pool. Setting this property to true // activates protection against purge for this managed HSM pool and its content - - // only the Managed HSM service may initiate a hard, irrecoverable deletion. The setting is effective only if soft delete - // is also enabled. Enabling this functionality is irreversible. - EnablePurgeProtection *bool `json:"enablePurgeProtection,omitempty"` + // only the Managed HSM service may initiate a hard, irrecoverable deletion. Enabling this functionality is irreversible. + EnablePurgeProtection *bool - // Property to specify whether the 'soft delete' functionality is enabled for this managed HSM pool. If it's not set to any - // value(true or false) when creating new managed HSM pool, it will be set to true - // by default. Once set to true, it cannot be reverted to false. - EnableSoftDelete *bool `json:"enableSoftDelete,omitempty"` + // Property to specify whether the 'soft delete' functionality is enabled for this managed HSM pool. Soft delete is enabled + // by default for all managed HSMs and is immutable. + EnableSoftDelete *bool // Array of initial administrators object ids for this managed hsm pool. - InitialAdminObjectIDs []*string `json:"initialAdminObjectIds,omitempty"` + InitialAdminObjectIDs []*string // Rules governing the accessibility of the key vault from specific network locations. - NetworkACLs *MHSMNetworkRuleSet `json:"networkAcls,omitempty"` + NetworkACLs *MHSMNetworkRuleSet - // Control permission for data plane traffic coming from public networks while private endpoint is enabled. - PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` + // Control permission to the managed HSM from public networks. + PublicNetworkAccess *PublicNetworkAccess // List of all regions associated with the managed hsm pool. - Regions []*MHSMGeoReplicatedRegion `json:"regions,omitempty"` + Regions []*MHSMGeoReplicatedRegion - // softDelete data retention days. It accepts >=7 and <=90. - SoftDeleteRetentionInDays *int32 `json:"softDeleteRetentionInDays,omitempty"` + // Soft deleted data retention days. When you delete an HSM or a key, it will remain recoverable for the configured retention + // period or for a default period of 90 days. It accepts values between 7 and + // 90. + SoftDeleteRetentionInDays *int32 // The Azure Active Directory tenant ID that should be used for authenticating requests to the managed HSM pool. - TenantID *string `json:"tenantId,omitempty"` + TenantID *string // READ-ONLY; The URI of the managed hsm pool for performing operations on keys. - HsmURI *string `json:"hsmUri,omitempty" azure:"ro"` + HsmURI *string // READ-ONLY; List of private endpoint connections associated with the managed hsm pool. - PrivateEndpointConnections []*MHSMPrivateEndpointConnectionItem `json:"privateEndpointConnections,omitempty" azure:"ro"` + PrivateEndpointConnections []*MHSMPrivateEndpointConnectionItem // READ-ONLY; Provisioning state. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *ProvisioningState // READ-ONLY; The scheduled purge date in UTC. - ScheduledPurgeDate *time.Time `json:"scheduledPurgeDate,omitempty" azure:"ro"` + ScheduledPurgeDate *time.Time // READ-ONLY; Managed HSM security domain properties. - SecurityDomainProperties *ManagedHSMSecurityDomainProperties `json:"securityDomainProperties,omitempty" azure:"ro"` + SecurityDomainProperties *ManagedHSMSecurityDomainProperties // READ-ONLY; Resource Status Message. - StatusMessage *string `json:"statusMessage,omitempty" azure:"ro"` + StatusMessage *string } // ManagedHsmResource - Managed HSM resource type ManagedHsmResource struct { // The supported Azure location where the managed HSM Pool should be created. - Location *string `json:"location,omitempty"` + Location *string // SKU details - SKU *ManagedHsmSKU `json:"sku,omitempty"` + SKU *ManagedHsmSKU // Resource tags - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; The Azure Resource Manager resource ID for the managed HSM Pool. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the managed HSM Pool. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the key vault resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The resource type of the managed HSM Pool. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } type ManagedHsmRotationPolicy struct { // The attributes of key rotation policy. - Attributes *ManagedHsmKeyRotationPolicyAttributes `json:"attributes,omitempty"` + Attributes *ManagedHsmKeyRotationPolicyAttributes // The lifetimeActions for key rotation action. - LifetimeActions []*ManagedHsmLifetimeAction `json:"lifetimeActions,omitempty"` + LifetimeActions []*ManagedHsmLifetimeAction } // ManagedHsmSKU - SKU details type ManagedHsmSKU struct { // REQUIRED; SKU Family of the managed HSM Pool - Family *ManagedHsmSKUFamily `json:"family,omitempty"` + Family *ManagedHsmSKUFamily // REQUIRED; SKU of the managed HSM Pool - Name *ManagedHsmSKUName `json:"name,omitempty"` + Name *ManagedHsmSKUName } type ManagedHsmTrigger struct { // The time duration after key creation to rotate the key. It only applies to rotate. It will be in ISO 8601 duration format. // Eg: 'P90D', 'P1Y'. - TimeAfterCreate *string `json:"timeAfterCreate,omitempty"` + TimeAfterCreate *string // The time duration before key expiring to rotate or notify. It will be in ISO 8601 duration format. Eg: 'P90D', 'P1Y'. - TimeBeforeExpiry *string `json:"timeBeforeExpiry,omitempty"` + TimeBeforeExpiry *string } // ManagedHsmsClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedHsmsClient.BeginCreateOrUpdate @@ -941,102 +941,102 @@ type ManagedHsmsClientListDeletedOptions struct { // MetricSpecification - Metric specification of operation. type MetricSpecification struct { // The metric aggregation type. Possible values include: 'Average', 'Count', 'Total'. - AggregationType *string `json:"aggregationType,omitempty"` + AggregationType *string // The dimensions of metric - Dimensions []*DimensionProperties `json:"dimensions,omitempty"` + Dimensions []*DimensionProperties // Display description of metric specification. - DisplayDescription *string `json:"displayDescription,omitempty"` + DisplayDescription *string // Display name of metric specification. - DisplayName *string `json:"displayName,omitempty"` + DisplayName *string // Property to specify whether to fill gap with zero. - FillGapWithZero *bool `json:"fillGapWithZero,omitempty"` + FillGapWithZero *bool // The internal metric name. - InternalMetricName *string `json:"internalMetricName,omitempty"` + InternalMetricName *string // The metric lock aggregation type. - LockAggregationType *string `json:"lockAggregationType,omitempty"` + LockAggregationType *string // Name of metric specification. - Name *string `json:"name,omitempty"` + Name *string // The supported aggregation types for the metrics. - SupportedAggregationTypes []*string `json:"supportedAggregationTypes,omitempty"` + SupportedAggregationTypes []*string // The supported time grain types for the metrics. - SupportedTimeGrainTypes []*string `json:"supportedTimeGrainTypes,omitempty"` + SupportedTimeGrainTypes []*string // The metric unit. Possible values include: 'Bytes', 'Count', 'Milliseconds'. - Unit *string `json:"unit,omitempty"` + Unit *string } // NetworkRuleSet - A set of rules governing the network accessibility of a vault. type NetworkRuleSet struct { // Tells what traffic can bypass network rules. This can be 'AzureServices' or 'None'. If not specified the default is 'AzureServices'. - Bypass *NetworkRuleBypassOptions `json:"bypass,omitempty"` + Bypass *NetworkRuleBypassOptions // The default action when no rule from ipRules and from virtualNetworkRules match. This is only used after the bypass property // has been evaluated. - DefaultAction *NetworkRuleAction `json:"defaultAction,omitempty"` + DefaultAction *NetworkRuleAction // The list of IP address rules. - IPRules []*IPRule `json:"ipRules,omitempty"` + IPRules []*IPRule // The list of virtual network rules. - VirtualNetworkRules []*VirtualNetworkRule `json:"virtualNetworkRules,omitempty"` + VirtualNetworkRules []*VirtualNetworkRule } // Operation - Key Vault REST API operation definition. type Operation struct { // Display metadata associated with the operation. - Display *OperationDisplay `json:"display,omitempty"` + Display *OperationDisplay // Property to specify whether the action is a data action. - IsDataAction *bool `json:"isDataAction,omitempty"` + IsDataAction *bool // Operation name: {provider}/{resource}/{operation} - Name *string `json:"name,omitempty"` + Name *string // Properties of operation, include metric specifications. - OperationProperties *OperationProperties `json:"properties,omitempty"` + OperationProperties *OperationProperties // The origin of operations. - Origin *string `json:"origin,omitempty"` + Origin *string } // OperationDisplay - Display metadata associated with the operation. type OperationDisplay struct { // Description of operation. - Description *string `json:"description,omitempty"` + Description *string // Type of operation: get, read, delete, etc. - Operation *string `json:"operation,omitempty"` + Operation *string // Service provider: Microsoft Key Vault. - Provider *string `json:"provider,omitempty"` + Provider *string // Resource on which the operation is performed etc. - Resource *string `json:"resource,omitempty"` + Resource *string } // OperationListResult - Result of the request to list Storage operations. It contains a list of operations and a URL link // to get the next set of results. type OperationListResult struct { // The URL to get the next set of operations. - NextLink *string `json:"nextLink,omitempty"` + NextLink *string // List of Storage operations supported by the Storage resource provider. - Value []*Operation `json:"value,omitempty"` + Value []*Operation } // OperationProperties - Properties of operation, include metric specifications. type OperationProperties struct { // One property of operation, include metric specifications. - ServiceSpecification *ServiceSpecification `json:"serviceSpecification,omitempty"` + ServiceSpecification *ServiceSpecification } // OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. @@ -1047,79 +1047,79 @@ type OperationsClientListOptions struct { // Permissions the identity has for keys, secrets, certificates and storage. type Permissions struct { // Permissions to certificates - Certificates []*CertificatePermissions `json:"certificates,omitempty"` + Certificates []*CertificatePermissions // Permissions to keys - Keys []*KeyPermissions `json:"keys,omitempty"` + Keys []*KeyPermissions // Permissions to secrets - Secrets []*SecretPermissions `json:"secrets,omitempty"` + Secrets []*SecretPermissions // Permissions to storage accounts - Storage []*StoragePermissions `json:"storage,omitempty"` + Storage []*StoragePermissions } // PrivateEndpoint - Private endpoint object properties. type PrivateEndpoint struct { // READ-ONLY; Full identifier of the private endpoint resource. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string } // PrivateEndpointConnection - Private endpoint connection resource. type PrivateEndpointConnection struct { // Modified whenever there is a change in the state of private endpoint connection. - Etag *string `json:"etag,omitempty"` + Etag *string // Resource properties. - Properties *PrivateEndpointConnectionProperties `json:"properties,omitempty"` + Properties *PrivateEndpointConnectionProperties // READ-ONLY; Fully qualified identifier of the key vault resource. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Azure location of the key vault resource. - Location *string `json:"location,omitempty" azure:"ro"` + Location *string // READ-ONLY; Name of the key vault resource. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Tags assigned to the key vault resource. - Tags map[string]*string `json:"tags,omitempty" azure:"ro"` + Tags map[string]*string // READ-ONLY; Resource type of the key vault resource. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // PrivateEndpointConnectionItem - Private endpoint connection item. type PrivateEndpointConnectionItem struct { // Modified whenever there is a change in the state of private endpoint connection. - Etag *string `json:"etag,omitempty"` + Etag *string // Id of private endpoint connection. - ID *string `json:"id,omitempty"` + ID *string // Private endpoint connection properties. - Properties *PrivateEndpointConnectionProperties `json:"properties,omitempty"` + Properties *PrivateEndpointConnectionProperties } // PrivateEndpointConnectionListResult - List of private endpoint connections. type PrivateEndpointConnectionListResult struct { // The URL to get the next set of private endpoint connections. - NextLink *string `json:"nextLink,omitempty"` + NextLink *string // The list of private endpoint connections. - Value []*PrivateEndpointConnection `json:"value,omitempty"` + Value []*PrivateEndpointConnection } // PrivateEndpointConnectionProperties - Properties of the private endpoint connection resource. type PrivateEndpointConnectionProperties struct { // Properties of the private endpoint object. - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateEndpoint *PrivateEndpoint // Approval state of the private link connection. - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState // Provisioning state of the private endpoint connection. - ProvisioningState *PrivateEndpointConnectionProvisioningState `json:"provisioningState,omitempty"` + ProvisioningState *PrivateEndpointConnectionProvisioningState } // PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete @@ -1150,40 +1150,40 @@ type PrivateEndpointConnectionsClientPutOptions struct { // PrivateLinkResource - A private link resource type PrivateLinkResource struct { // Resource properties. - Properties *PrivateLinkResourceProperties `json:"properties,omitempty"` + Properties *PrivateLinkResourceProperties // READ-ONLY; Fully qualified identifier of the key vault resource. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Azure location of the key vault resource. - Location *string `json:"location,omitempty" azure:"ro"` + Location *string // READ-ONLY; Name of the key vault resource. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Tags assigned to the key vault resource. - Tags map[string]*string `json:"tags,omitempty" azure:"ro"` + Tags map[string]*string // READ-ONLY; Resource type of the key vault resource. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // PrivateLinkResourceListResult - A list of private link resources type PrivateLinkResourceListResult struct { // Array of private link resources - Value []*PrivateLinkResource `json:"value,omitempty"` + Value []*PrivateLinkResource } // PrivateLinkResourceProperties - Properties of a private link resource. type PrivateLinkResourceProperties struct { // Required DNS zone names of the the private link resource. - RequiredZoneNames []*string `json:"requiredZoneNames,omitempty"` + RequiredZoneNames []*string // READ-ONLY; Group identifier of private link resource. - GroupID *string `json:"groupId,omitempty" azure:"ro"` + GroupID *string // READ-ONLY; Required member names of private link resource. - RequiredMembers []*string `json:"requiredMembers,omitempty" azure:"ro"` + RequiredMembers []*string } // PrivateLinkResourcesClientListByVaultOptions contains the optional parameters for the PrivateLinkResourcesClient.ListByVault @@ -1195,170 +1195,170 @@ type PrivateLinkResourcesClientListByVaultOptions struct { // PrivateLinkServiceConnectionState - An object that represents the approval state of the private link connection. type PrivateLinkServiceConnectionState struct { // A message indicating if changes on the service provider require any updates on the consumer. - ActionsRequired *ActionsRequired `json:"actionsRequired,omitempty"` + ActionsRequired *ActionsRequired // The reason for approval or rejection. - Description *string `json:"description,omitempty"` + Description *string // Indicates whether the connection has been approved, rejected or removed by the key vault owner. - Status *PrivateEndpointServiceConnectionStatus `json:"status,omitempty"` + Status *PrivateEndpointServiceConnectionStatus } // ProxyResourceWithoutSystemData - Common fields that are returned in the response for all Azure Resource Manager resources type ProxyResourceWithoutSystemData struct { // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // Resource - Key Vault resource type Resource struct { // READ-ONLY; Fully qualified identifier of the key vault resource. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Azure location of the key vault resource. - Location *string `json:"location,omitempty" azure:"ro"` + Location *string // READ-ONLY; Name of the key vault resource. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Tags assigned to the key vault resource. - Tags map[string]*string `json:"tags,omitempty" azure:"ro"` + Tags map[string]*string // READ-ONLY; Resource type of the key vault resource. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ResourceListResult - List of vault resources. type ResourceListResult struct { // The URL to get the next set of vault resources. - NextLink *string `json:"nextLink,omitempty"` + NextLink *string // The list of vault resources. - Value []*Resource `json:"value,omitempty"` + Value []*Resource } type RotationPolicy struct { // The attributes of key rotation policy. - Attributes *KeyRotationPolicyAttributes `json:"attributes,omitempty"` + Attributes *KeyRotationPolicyAttributes // The lifetimeActions for key rotation action. - LifetimeActions []*LifetimeAction `json:"lifetimeActions,omitempty"` + LifetimeActions []*LifetimeAction } // SKU details type SKU struct { // REQUIRED; SKU family name - Family *SKUFamily `json:"family,omitempty"` + Family *SKUFamily // REQUIRED; SKU name to specify whether the key vault is a standard vault or a premium vault. - Name *SKUName `json:"name,omitempty"` + Name *SKUName } // Secret - Resource information with extended details. type Secret struct { // REQUIRED; Properties of the secret - Properties *SecretProperties `json:"properties,omitempty"` + Properties *SecretProperties // READ-ONLY; Fully qualified identifier of the key vault resource. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Azure location of the key vault resource. - Location *string `json:"location,omitempty" azure:"ro"` + Location *string // READ-ONLY; Name of the key vault resource. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Tags assigned to the key vault resource. - Tags map[string]*string `json:"tags,omitempty" azure:"ro"` + Tags map[string]*string // READ-ONLY; Resource type of the key vault resource. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // SecretAttributes - The secret management attributes. type SecretAttributes struct { // Determines whether the object is enabled. - Enabled *bool `json:"enabled,omitempty"` + Enabled *bool // Expiry date in seconds since 1970-01-01T00:00:00Z. - Expires *time.Time `json:"exp,omitempty"` + Expires *time.Time // Not before date in seconds since 1970-01-01T00:00:00Z. - NotBefore *time.Time `json:"nbf,omitempty"` + NotBefore *time.Time // READ-ONLY; Creation time in seconds since 1970-01-01T00:00:00Z. - Created *time.Time `json:"created,omitempty" azure:"ro"` + Created *time.Time // READ-ONLY; Last updated time in seconds since 1970-01-01T00:00:00Z. - Updated *time.Time `json:"updated,omitempty" azure:"ro"` + Updated *time.Time } // SecretCreateOrUpdateParameters - Parameters for creating or updating a secret type SecretCreateOrUpdateParameters struct { // REQUIRED; Properties of the secret - Properties *SecretProperties `json:"properties,omitempty"` + Properties *SecretProperties // The tags that will be assigned to the secret. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string } // SecretListResult - List of secrets type SecretListResult struct { // The URL to get the next set of secrets. - NextLink *string `json:"nextLink,omitempty"` + NextLink *string // The list of secrets. - Value []*Secret `json:"value,omitempty"` + Value []*Secret } // SecretPatchParameters - Parameters for patching a secret type SecretPatchParameters struct { // Properties of the secret - Properties *SecretPatchProperties `json:"properties,omitempty"` + Properties *SecretPatchProperties // The tags that will be assigned to the secret. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string } // SecretPatchProperties - Properties of the secret type SecretPatchProperties struct { // The attributes of the secret. - Attributes *SecretAttributes `json:"attributes,omitempty"` + Attributes *SecretAttributes // The content type of the secret. - ContentType *string `json:"contentType,omitempty"` + ContentType *string // The value of the secret. - Value *string `json:"value,omitempty"` + Value *string } // SecretProperties - Properties of the secret type SecretProperties struct { // The attributes of the secret. - Attributes *SecretAttributes `json:"attributes,omitempty"` + Attributes *SecretAttributes // The content type of the secret. - ContentType *string `json:"contentType,omitempty"` + ContentType *string // The value of the secret. NOTE: 'value' will never be returned from the service, as APIs using this model are is intended // for internal use in ARM deployments. Users should use the data-plane REST // service for interaction with vault secrets. - Value *string `json:"value,omitempty"` + Value *string // READ-ONLY; The URI to retrieve the current version of the secret. - SecretURI *string `json:"secretUri,omitempty" azure:"ro"` + SecretURI *string // READ-ONLY; The URI to retrieve the specific version of the secret. - SecretURIWithVersion *string `json:"secretUriWithVersion,omitempty" azure:"ro"` + SecretURIWithVersion *string } // SecretsClientCreateOrUpdateOptions contains the optional parameters for the SecretsClient.CreateOrUpdate method. @@ -1385,209 +1385,209 @@ type SecretsClientUpdateOptions struct { // ServiceSpecification - One property of operation, include log specifications. type ServiceSpecification struct { // Log specifications of operation. - LogSpecifications []*LogSpecification `json:"logSpecifications,omitempty"` + LogSpecifications []*LogSpecification // Metric specifications of operation. - MetricSpecifications []*MetricSpecification `json:"metricSpecifications,omitempty"` + MetricSpecifications []*MetricSpecification } // SystemData - Metadata pertaining to creation and last modification of the key vault resource. type SystemData struct { // The timestamp of the key vault resource creation (UTC). - CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAt *time.Time // The identity that created the key vault resource. - CreatedBy *string `json:"createdBy,omitempty"` + CreatedBy *string // The type of identity that created the key vault resource. - CreatedByType *IdentityType `json:"createdByType,omitempty"` + CreatedByType *IdentityType // The timestamp of the key vault resource last modification (UTC). - LastModifiedAt *time.Time `json:"lastModifiedAt,omitempty"` + LastModifiedAt *time.Time // The identity that last modified the key vault resource. - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + LastModifiedBy *string // The type of identity that last modified the key vault resource. - LastModifiedByType *IdentityType `json:"lastModifiedByType,omitempty"` + LastModifiedByType *IdentityType } type Trigger struct { // The time duration after key creation to rotate the key. It only applies to rotate. It will be in ISO 8601 duration format. // Eg: 'P90D', 'P1Y'. - TimeAfterCreate *string `json:"timeAfterCreate,omitempty"` + TimeAfterCreate *string // The time duration before key expiring to rotate or notify. It will be in ISO 8601 duration format. Eg: 'P90D', 'P1Y'. - TimeBeforeExpiry *string `json:"timeBeforeExpiry,omitempty"` + TimeBeforeExpiry *string } // Vault - Resource information with extended details. type Vault struct { // REQUIRED; Properties of the vault - Properties *VaultProperties `json:"properties,omitempty"` + Properties *VaultProperties // Azure location of the key vault resource. - Location *string `json:"location,omitempty"` + Location *string // Tags assigned to the key vault resource. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Fully qualified identifier of the key vault resource. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Name of the key vault resource. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; System metadata for the key vault. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; Resource type of the key vault resource. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // VaultAccessPolicyParameters - Parameters for updating the access policy in a vault type VaultAccessPolicyParameters struct { // REQUIRED; Properties of the access policy - Properties *VaultAccessPolicyProperties `json:"properties,omitempty"` + Properties *VaultAccessPolicyProperties // READ-ONLY; The resource id of the access policy. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The resource type of the access policy. - Location *string `json:"location,omitempty" azure:"ro"` + Location *string // READ-ONLY; The resource name of the access policy. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; The resource name of the access policy. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // VaultAccessPolicyProperties - Properties of the vault access policy type VaultAccessPolicyProperties struct { // REQUIRED; An array of 0 to 16 identities that have access to the key vault. All identities in the array must use the same // tenant ID as the key vault's tenant ID. - AccessPolicies []*AccessPolicyEntry `json:"accessPolicies,omitempty"` + AccessPolicies []*AccessPolicyEntry } // VaultCheckNameAvailabilityParameters - The parameters used to check the availability of the vault name. type VaultCheckNameAvailabilityParameters struct { // REQUIRED; The vault name. - Name *string `json:"name,omitempty"` + Name *string // CONSTANT; The type of resource, Microsoft.KeyVault/vaults // Field has constant value "Microsoft.KeyVault/vaults", any specified value is ignored. - Type *string `json:"type,omitempty"` + Type *string } // VaultCreateOrUpdateParameters - Parameters for creating or updating a vault type VaultCreateOrUpdateParameters struct { // REQUIRED; The supported Azure location where the key vault should be created. - Location *string `json:"location,omitempty"` + Location *string // REQUIRED; Properties of the vault - Properties *VaultProperties `json:"properties,omitempty"` + Properties *VaultProperties // The tags that will be assigned to the key vault. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string } // VaultListResult - List of vaults type VaultListResult struct { // The URL to get the next set of vaults. - NextLink *string `json:"nextLink,omitempty"` + NextLink *string // The list of vaults. - Value []*Vault `json:"value,omitempty"` + Value []*Vault } // VaultPatchParameters - Parameters for creating or updating a vault type VaultPatchParameters struct { // Properties of the vault - Properties *VaultPatchProperties `json:"properties,omitempty"` + Properties *VaultPatchProperties // The tags that will be assigned to the key vault. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string } // VaultPatchProperties - Properties of the vault type VaultPatchProperties struct { // An array of 0 to 16 identities that have access to the key vault. All identities in the array must use the same tenant // ID as the key vault's tenant ID. - AccessPolicies []*AccessPolicyEntry `json:"accessPolicies,omitempty"` + AccessPolicies []*AccessPolicyEntry // The vault's create mode to indicate whether the vault need to be recovered or not. - CreateMode *CreateMode `json:"createMode,omitempty"` + CreateMode *CreateMode // Property specifying whether protection against purge is enabled for this vault. Setting this property to true activates // protection against purge for this vault and its content - only the Key Vault // service may initiate a hard, irrecoverable deletion. The setting is effective only if soft delete is also enabled. Enabling // this functionality is irreversible - that is, the property does not accept // false as its value. - EnablePurgeProtection *bool `json:"enablePurgeProtection,omitempty"` + EnablePurgeProtection *bool // Property that controls how data actions are authorized. When true, the key vault will use Role Based Access Control (RBAC) // for authorization of data actions, and the access policies specified in vault // properties will be ignored. When false, the key vault will use the access policies specified in vault properties, and any // policy stored on Azure Resource Manager will be ignored. If null or not // specified, the value of this property will not change. - EnableRbacAuthorization *bool `json:"enableRbacAuthorization,omitempty"` + EnableRbacAuthorization *bool // Property to specify whether the 'soft delete' functionality is enabled for this key vault. Once set to true, it cannot // be reverted to false. - EnableSoftDelete *bool `json:"enableSoftDelete,omitempty"` + EnableSoftDelete *bool // Property to specify whether Azure Virtual Machines are permitted to retrieve certificates stored as secrets from the key // vault. - EnabledForDeployment *bool `json:"enabledForDeployment,omitempty"` + EnabledForDeployment *bool // Property to specify whether Azure Disk Encryption is permitted to retrieve secrets from the vault and unwrap keys. - EnabledForDiskEncryption *bool `json:"enabledForDiskEncryption,omitempty"` + EnabledForDiskEncryption *bool // Property to specify whether Azure Resource Manager is permitted to retrieve secrets from the key vault. - EnabledForTemplateDeployment *bool `json:"enabledForTemplateDeployment,omitempty"` + EnabledForTemplateDeployment *bool // A collection of rules governing the accessibility of the vault from specific network locations. - NetworkACLs *NetworkRuleSet `json:"networkAcls,omitempty"` + NetworkACLs *NetworkRuleSet // Property to specify whether the vault will accept traffic from public internet. If set to 'disabled' all traffic except // private endpoint traffic and that that originates from trusted services will be // blocked. This will override the set firewall rules, meaning that even if the firewall rules are present we will not honor // the rules. - PublicNetworkAccess *string `json:"publicNetworkAccess,omitempty"` + PublicNetworkAccess *string // SKU details - SKU *SKU `json:"sku,omitempty"` + SKU *SKU // softDelete data retention days. It accepts >=7 and <=90. - SoftDeleteRetentionInDays *int32 `json:"softDeleteRetentionInDays,omitempty"` + SoftDeleteRetentionInDays *int32 // The Azure Active Directory tenant ID that should be used for authenticating requests to the key vault. - TenantID *string `json:"tenantId,omitempty"` + TenantID *string } // VaultProperties - Properties of the vault type VaultProperties struct { // REQUIRED; SKU details - SKU *SKU `json:"sku,omitempty"` + SKU *SKU // REQUIRED; The Azure Active Directory tenant ID that should be used for authenticating requests to the key vault. - TenantID *string `json:"tenantId,omitempty"` + TenantID *string // An array of 0 to 1024 identities that have access to the key vault. All identities in the array must use the same tenant // ID as the key vault's tenant ID. When createMode is set to recover, access // policies are not required. Otherwise, access policies are required. - AccessPolicies []*AccessPolicyEntry `json:"accessPolicies,omitempty"` + AccessPolicies []*AccessPolicyEntry // The vault's create mode to indicate whether the vault need to be recovered or not. - CreateMode *CreateMode `json:"createMode,omitempty"` + CreateMode *CreateMode // Property specifying whether protection against purge is enabled for this vault. Setting this property to true activates // protection against purge for this vault and its content - only the Key Vault // service may initiate a hard, irrecoverable deletion. The setting is effective only if soft delete is also enabled. Enabling // this functionality is irreversible - that is, the property does not accept // false as its value. - EnablePurgeProtection *bool `json:"enablePurgeProtection,omitempty"` + EnablePurgeProtection *bool // Property that controls how data actions are authorized. When true, the key vault will use Role Based Access Control (RBAC) // for authorization of data actions, and the access policies specified in vault @@ -1595,46 +1595,46 @@ type VaultProperties struct { // policy stored on Azure Resource Manager will be ignored. If null or not // specified, the vault is created with the default value of false. Note that management actions are always authorized with // RBAC. - EnableRbacAuthorization *bool `json:"enableRbacAuthorization,omitempty"` + EnableRbacAuthorization *bool // Property to specify whether the 'soft delete' functionality is enabled for this key vault. If it's not set to any value(true // or false) when creating new key vault, it will be set to true by default. // Once set to true, it cannot be reverted to false. - EnableSoftDelete *bool `json:"enableSoftDelete,omitempty"` + EnableSoftDelete *bool // Property to specify whether Azure Virtual Machines are permitted to retrieve certificates stored as secrets from the key // vault. - EnabledForDeployment *bool `json:"enabledForDeployment,omitempty"` + EnabledForDeployment *bool // Property to specify whether Azure Disk Encryption is permitted to retrieve secrets from the vault and unwrap keys. - EnabledForDiskEncryption *bool `json:"enabledForDiskEncryption,omitempty"` + EnabledForDiskEncryption *bool // Property to specify whether Azure Resource Manager is permitted to retrieve secrets from the key vault. - EnabledForTemplateDeployment *bool `json:"enabledForTemplateDeployment,omitempty"` + EnabledForTemplateDeployment *bool // Rules governing the accessibility of the key vault from specific network locations. - NetworkACLs *NetworkRuleSet `json:"networkAcls,omitempty"` + NetworkACLs *NetworkRuleSet // Provisioning state of the vault. - ProvisioningState *VaultProvisioningState `json:"provisioningState,omitempty"` + ProvisioningState *VaultProvisioningState // Property to specify whether the vault will accept traffic from public internet. If set to 'disabled' all traffic except // private endpoint traffic and that that originates from trusted services will be // blocked. This will override the set firewall rules, meaning that even if the firewall rules are present we will not honor // the rules. - PublicNetworkAccess *string `json:"publicNetworkAccess,omitempty"` + PublicNetworkAccess *string // softDelete data retention days. It accepts >=7 and <=90. - SoftDeleteRetentionInDays *int32 `json:"softDeleteRetentionInDays,omitempty"` + SoftDeleteRetentionInDays *int32 // The URI of the vault for performing operations on keys and secrets. - VaultURI *string `json:"vaultUri,omitempty"` + VaultURI *string // READ-ONLY; The resource id of HSM Pool. - HsmPoolResourceID *string `json:"hsmPoolResourceId,omitempty" azure:"ro"` + HsmPoolResourceID *string // READ-ONLY; List of private endpoint connections associated with the key vault. - PrivateEndpointConnections []*PrivateEndpointConnectionItem `json:"privateEndpointConnections,omitempty" azure:"ro"` + PrivateEndpointConnections []*PrivateEndpointConnectionItem } // VaultsClientBeginCreateOrUpdateOptions contains the optional parameters for the VaultsClient.BeginCreateOrUpdate method. @@ -1707,8 +1707,8 @@ type VaultsClientUpdateOptions struct { // VirtualNetworkRule - A rule governing the accessibility of a vault from a specific virtual network. type VirtualNetworkRule struct { // REQUIRED; Full resource id of a vnet subnet, such as '/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1'. - ID *string `json:"id,omitempty"` + ID *string // Property to specify whether NRP will ignore the check if parent subnet has serviceEndpoints configured. - IgnoreMissingVnetServiceEndpoint *bool `json:"ignoreMissingVnetServiceEndpoint,omitempty"` + IgnoreMissingVnetServiceEndpoint *bool } diff --git a/sdk/resourcemanager/keyvault/armkeyvault/operations_client_example_test.go b/sdk/resourcemanager/keyvault/armkeyvault/operations_client_example_test.go deleted file mode 100644 index fa6c9b0495b4..000000000000 --- a/sdk/resourcemanager/keyvault/armkeyvault/operations_client_example_test.go +++ /dev/null @@ -1,361 +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 armkeyvault_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/listOperations.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkeyvault.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().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.OperationListResult = armkeyvault.OperationListResult{ - // Value: []*armkeyvault.Operation{ - // { - // Name: to.Ptr("Microsoft.KeyVault/vaults/read"), - // Display: &armkeyvault.OperationDisplay{ - // Description: to.Ptr("View the properties of a key vault"), - // Operation: to.Ptr("View Key Vault"), - // Provider: to.Ptr("Microsoft Key Vault"), - // Resource: to.Ptr("Key Vault"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.KeyVault/vaults/write"), - // Display: &armkeyvault.OperationDisplay{ - // Description: to.Ptr("Create a new key vault or update the properties of an existing key vault"), - // Operation: to.Ptr("Update Key Vault"), - // Provider: to.Ptr("Microsoft Key Vault"), - // Resource: to.Ptr("Key Vault"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.KeyVault/vaults/delete"), - // Display: &armkeyvault.OperationDisplay{ - // Description: to.Ptr("Delete a key vault"), - // Operation: to.Ptr("Delete Key Vault"), - // Provider: to.Ptr("Microsoft Key Vault"), - // Resource: to.Ptr("Key Vault"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.KeyVault/vaults/deploy/action"), - // Display: &armkeyvault.OperationDisplay{ - // Description: to.Ptr("Enables access to secrets in a key vault when deploying Azure resources"), - // Operation: to.Ptr("Use Vault for Azure Deployments"), - // Provider: to.Ptr("Microsoft Key Vault"), - // Resource: to.Ptr("Key Vault"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.KeyVault/vaults/secrets/read"), - // Display: &armkeyvault.OperationDisplay{ - // Description: to.Ptr("View the properties of a secret, but not its value"), - // Operation: to.Ptr("View Secret Properties"), - // Provider: to.Ptr("Microsoft Key Vault"), - // Resource: to.Ptr("Secret"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.KeyVault/vaults/secrets/write"), - // Display: &armkeyvault.OperationDisplay{ - // Description: to.Ptr("Create a new secret or update the value of an existing secret"), - // Operation: to.Ptr("Update Secret"), - // Provider: to.Ptr("Microsoft Key Vault"), - // Resource: to.Ptr("Secret"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.KeyVault/vaults/accessPolicies/write"), - // Display: &armkeyvault.OperationDisplay{ - // Description: to.Ptr("Update an existing access policy by merging or replacing, or add a new access policy to a vault."), - // Operation: to.Ptr("Update Access Policy"), - // Provider: to.Ptr("Microsoft Key Vault"), - // Resource: to.Ptr("Access Policy"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.KeyVault/vaults/providers/Microsoft.Insights/logDefinitions/read"), - // Display: &armkeyvault.OperationDisplay{ - // Description: to.Ptr("Gets the available logs for a key vault"), - // Operation: to.Ptr("Read log definition"), - // Provider: to.Ptr("Microsoft Key Vault"), - // Resource: to.Ptr("Key Vault Log Definition"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("system"), - // OperationProperties: &armkeyvault.OperationProperties{ - // ServiceSpecification: &armkeyvault.ServiceSpecification{ - // LogSpecifications: []*armkeyvault.LogSpecification{ - // { - // Name: to.Ptr("AuditEvent"), - // BlobDuration: to.Ptr("PT1H"), - // DisplayName: to.Ptr("Audit Logs"), - // }}, - // MetricSpecifications: []*armkeyvault.MetricSpecification{ - // { - // Name: to.Ptr("ServiceApiHit"), - // AggregationType: to.Ptr(""), - // Dimensions: []*armkeyvault.DimensionProperties{ - // { - // Name: to.Ptr("ActivityType"), - // DisplayName: to.Ptr(""), - // ToBeExportedForShoebox: to.Ptr(true), - // }, - // { - // Name: to.Ptr("ActivityName"), - // DisplayName: to.Ptr(""), - // ToBeExportedForShoebox: to.Ptr(true), - // }}, - // DisplayDescription: to.Ptr(""), - // DisplayName: to.Ptr(""), - // FillGapWithZero: to.Ptr(false), - // InternalMetricName: to.Ptr("AuditEvent"), - // LockAggregationType: to.Ptr(""), - // SupportedAggregationTypes: []*string{ - // to.Ptr("")}, - // SupportedTimeGrainTypes: []*string{ - // to.Ptr("")}, - // Unit: to.Ptr(""), - // }}, - // }, - // }, - // }, - // { - // Name: to.Ptr("Microsoft.KeyVault/vaults/providers/Microsoft.Insights/diagnosticSettings/Read"), - // Display: &armkeyvault.OperationDisplay{ - // Description: to.Ptr("Gets the diagnostic setting for the resource"), - // Operation: to.Ptr("Read diagnostic setting"), - // Provider: to.Ptr("Microsoft Key Vault"), - // Resource: to.Ptr("Key Vault Diagnostic Settings"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("system"), - // }, - // { - // Name: to.Ptr("Microsoft.KeyVault/vaults/providers/Microsoft.Insights/diagnosticSettings/Write"), - // Display: &armkeyvault.OperationDisplay{ - // Description: to.Ptr("Creates or updates the diagnostic setting for the resource"), - // Operation: to.Ptr("Write diagnostic setting"), - // Provider: to.Ptr("Microsoft Key Vault"), - // Resource: to.Ptr("Key Vault Diagnostic Settings"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("system"), - // }, - // { - // Name: to.Ptr("Microsoft.KeyVault/register/action"), - // Display: &armkeyvault.OperationDisplay{ - // Description: to.Ptr("Registers a subscription"), - // Operation: to.Ptr("Register Subscription"), - // Provider: to.Ptr("Microsoft Key Vault"), - // Resource: to.Ptr("Subscription"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.KeyVault/unregister/action"), - // Display: &armkeyvault.OperationDisplay{ - // Description: to.Ptr("Unregisters a subscription"), - // Operation: to.Ptr("Unregister Subscription"), - // Provider: to.Ptr("Microsoft Key Vault"), - // Resource: to.Ptr("Subscription"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.KeyVault/operations/read"), - // Display: &armkeyvault.OperationDisplay{ - // Description: to.Ptr("Lists operations available on Microsoft.KeyVault resource provider"), - // Operation: to.Ptr("Available Key Vault Operations"), - // Provider: to.Ptr("Microsoft Key Vault"), - // Resource: to.Ptr("Operations"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.KeyVault/checkNameAvailability/read"), - // Display: &armkeyvault.OperationDisplay{ - // Description: to.Ptr("Checks that a key vault name is valid and is not in use"), - // Operation: to.Ptr("Check Name Availability"), - // Provider: to.Ptr("Microsoft Key Vault"), - // Resource: to.Ptr("Name Availability"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.KeyVault/deletedVaults/read"), - // Display: &armkeyvault.OperationDisplay{ - // Description: to.Ptr("View the properties of soft deleted key vaults"), - // Operation: to.Ptr("View Soft Deleted Vaults"), - // Provider: to.Ptr("Microsoft Key Vault"), - // Resource: to.Ptr("Soft Deleted Key Vault"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.KeyVault/locations/deletedVaults/read"), - // Display: &armkeyvault.OperationDisplay{ - // Description: to.Ptr("View the properties of a soft deleted key vault"), - // Operation: to.Ptr("View Soft Deleted Key Vault"), - // Provider: to.Ptr("Microsoft Key Vault"), - // Resource: to.Ptr("Soft Deleted Key Vault"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.KeyVault/locations/deletedVaults/purge/action"), - // Display: &armkeyvault.OperationDisplay{ - // Description: to.Ptr("Purge a soft deleted key vault"), - // Operation: to.Ptr("Purge Soft Deleted Key Vault"), - // Provider: to.Ptr("Microsoft Key Vault"), - // Resource: to.Ptr("Soft Deleted Key Vault"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.KeyVault/locations/operationResults/read"), - // Display: &armkeyvault.OperationDisplay{ - // Description: to.Ptr("Check the result of a long run operation"), - // Operation: to.Ptr("Check Operation Result"), - // Provider: to.Ptr("Microsoft Key Vault"), - // Resource: to.Ptr("Long Run Operation Result"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.KeyVault/hsmPools/read"), - // Display: &armkeyvault.OperationDisplay{ - // Description: to.Ptr("View the properties of an HSM pool"), - // Operation: to.Ptr("View HSM pool"), - // Provider: to.Ptr("Microsoft Key Vault"), - // Resource: to.Ptr("HSM pool"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.KeyVault/hsmPools/write"), - // Display: &armkeyvault.OperationDisplay{ - // Description: to.Ptr("Create a new HSM pool of update the properties of an existing HSM pool"), - // Operation: to.Ptr("Create or Update HSM pool"), - // Provider: to.Ptr("Microsoft Key Vault"), - // Resource: to.Ptr("HSM pool"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.KeyVault/hsmPools/delete"), - // Display: &armkeyvault.OperationDisplay{ - // Description: to.Ptr("Delete an HSM pool"), - // Operation: to.Ptr("Delete HSM pool"), - // Provider: to.Ptr("Microsoft Key Vault"), - // Resource: to.Ptr("HSM pool"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.KeyVault/hsmPools/joinVault/action"), - // Display: &armkeyvault.OperationDisplay{ - // Description: to.Ptr("Join a key vault to an HSM pool"), - // Operation: to.Ptr("Join KeyVault to HSM pool"), - // Provider: to.Ptr("Microsoft Key Vault"), - // Resource: to.Ptr("HSM pool"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.KeyVault/managedHSMs/read"), - // Display: &armkeyvault.OperationDisplay{ - // Description: to.Ptr("View the properties of a Managed HSM"), - // Operation: to.Ptr("View Managed HSM"), - // Provider: to.Ptr("Microsoft Key Vault"), - // Resource: to.Ptr("Managed HSM"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.KeyVault/managedHSMs/write"), - // Display: &armkeyvault.OperationDisplay{ - // Description: to.Ptr("Create a new Managed HSM of update the properties of an existing Managed HSM"), - // Operation: to.Ptr("Create or Update Managed HSM"), - // Provider: to.Ptr("Microsoft Key Vault"), - // Resource: to.Ptr("Managed HSM"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.KeyVault/managedHSMs/delete"), - // Display: &armkeyvault.OperationDisplay{ - // Description: to.Ptr("Delete a Managed HSM"), - // Operation: to.Ptr("Delete Managed HSM"), - // Provider: to.Ptr("Microsoft Key Vault"), - // Resource: to.Ptr("Managed HSM"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.KeyVault/vaults/providers/Microsoft.Insights/metricDefinitions/read"), - // Display: &armkeyvault.OperationDisplay{ - // Description: to.Ptr("Gets the available metrics for a key vault"), - // Operation: to.Ptr("Read metric definition"), - // Provider: to.Ptr("Microsoft Key Vault"), - // Resource: to.Ptr("Key Vault Metric Definition"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("system"), - // OperationProperties: &armkeyvault.OperationProperties{ - // ServiceSpecification: &armkeyvault.ServiceSpecification{ - // }, - // }, - // }, - // { - // Name: to.Ptr("Microsoft.KeyVault/locations/deleteVirtualNetworkOrSubnets/action"), - // Display: &armkeyvault.OperationDisplay{ - // Description: to.Ptr("Notifies Microsoft.KeyVault that a virtual network or subnet is being deleted"), - // Operation: to.Ptr("Modify Network ACLs containing the deleted Vitual Network or Subnet "), - // Provider: to.Ptr("Microsoft Key Vault"), - // Resource: to.Ptr("Location"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("system"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/keyvault/armkeyvault/privateendpointconnections_client_example_test.go b/sdk/resourcemanager/keyvault/armkeyvault/privateendpointconnections_client_example_test.go deleted file mode 100644 index 5a7d862e35dd..000000000000 --- a/sdk/resourcemanager/keyvault/armkeyvault/privateendpointconnections_client_example_test.go +++ /dev/null @@ -1,195 +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 armkeyvault_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/keyvault/armkeyvault" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/getPrivateEndpointConnection.json -func ExamplePrivateEndpointConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkeyvault.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateEndpointConnectionsClient().Get(ctx, "sample-group", "sample-vault", "sample-pec", 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.PrivateEndpointConnection = armkeyvault.PrivateEndpointConnection{ - // Name: to.Ptr("sample-pec"), - // Type: to.Ptr("Microsoft.KeyVault/vaults/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault/privateEndpointConnections/sample-pec"), - // Etag: to.Ptr(""), - // Properties: &armkeyvault.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armkeyvault.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-1234-000000000000/resourceGroups/sample-group/providers/Microsoft.Network/privateEndpoints/sample-pe"), - // }, - // PrivateLinkServiceConnectionState: &armkeyvault.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("This was automatically approved by user1234@contoso.com"), - // ActionsRequired: to.Ptr(armkeyvault.ActionsRequiredNone), - // Status: to.Ptr(armkeyvault.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armkeyvault.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/putPrivateEndpointConnection.json -func ExamplePrivateEndpointConnectionsClient_Put() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkeyvault.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateEndpointConnectionsClient().Put(ctx, "sample-group", "sample-vault", "sample-pec", armkeyvault.PrivateEndpointConnection{ - Etag: to.Ptr(""), - Properties: &armkeyvault.PrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armkeyvault.PrivateLinkServiceConnectionState{ - Description: to.Ptr("My name is Joe and I'm approving this."), - Status: to.Ptr(armkeyvault.PrivateEndpointServiceConnectionStatusApproved), - }, - }, - }, 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.PrivateEndpointConnection = armkeyvault.PrivateEndpointConnection{ - // Name: to.Ptr("sample-pec"), - // Type: to.Ptr("Microsoft.KeyVault/vaults/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault/privateEndpointConnections/sample-pec"), - // Etag: to.Ptr(""), - // Properties: &armkeyvault.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armkeyvault.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-1234-000000000000/resourceGroups/sample-group/providers/Microsoft.Network/privateEndpoints/sample-pe"), - // }, - // PrivateLinkServiceConnectionState: &armkeyvault.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("My name is Joe and I'm approving this."), - // ActionsRequired: to.Ptr(armkeyvault.ActionsRequiredNone), - // Status: to.Ptr(armkeyvault.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armkeyvault.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/deletePrivateEndpointConnection.json -func ExamplePrivateEndpointConnectionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkeyvault.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginDelete(ctx, "sample-group", "sample-vault", "sample-pec", 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.PrivateEndpointConnection = armkeyvault.PrivateEndpointConnection{ - // Name: to.Ptr("sample-pec"), - // Type: to.Ptr("Microsoft.KeyVault/vaults/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault/privateEndpointConnections/sample-pec"), - // Properties: &armkeyvault.PrivateEndpointConnectionProperties{ - // ProvisioningState: to.Ptr(armkeyvault.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/listPrivateEndpointConnection.json -func ExamplePrivateEndpointConnectionsClient_NewListByResourcePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkeyvault.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateEndpointConnectionsClient().NewListByResourcePager("sample-group", "sample-vault", 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.PrivateEndpointConnectionListResult = armkeyvault.PrivateEndpointConnectionListResult{ - // Value: []*armkeyvault.PrivateEndpointConnection{ - // { - // Name: to.Ptr("sample-pec"), - // Type: to.Ptr("Microsoft.KeyVault/vaults/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault/privateEndpointConnections/sample-pec"), - // Etag: to.Ptr(""), - // Properties: &armkeyvault.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armkeyvault.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-1234-000000000000/resourceGroups/sample-group/providers/Microsoft.Network/privateEndpoints/sample-pe"), - // }, - // PrivateLinkServiceConnectionState: &armkeyvault.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("This was automatically approved by user1234@contoso.com"), - // ActionsRequired: to.Ptr(armkeyvault.ActionsRequiredNone), - // Status: to.Ptr(armkeyvault.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armkeyvault.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("sample-pec"), - // Type: to.Ptr("Microsoft.KeyVault/vaults/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault/privateEndpointConnections/sample-pec"), - // Etag: to.Ptr(""), - // Properties: &armkeyvault.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armkeyvault.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-1234-000000000000/resourceGroups/sample-group/providers/Microsoft.Network/privateEndpoints/sample-pe"), - // }, - // PrivateLinkServiceConnectionState: &armkeyvault.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("This was automatically approved by user1234@contoso.com"), - // ActionsRequired: to.Ptr(armkeyvault.ActionsRequiredNone), - // Status: to.Ptr(armkeyvault.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armkeyvault.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/keyvault/armkeyvault/privatelinkresources_client_example_test.go b/sdk/resourcemanager/keyvault/armkeyvault/privatelinkresources_client_example_test.go deleted file mode 100644 index 25bb06d79c95..000000000000 --- a/sdk/resourcemanager/keyvault/armkeyvault/privatelinkresources_client_example_test.go +++ /dev/null @@ -1,53 +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 armkeyvault_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/listPrivateLinkResources.json -func ExamplePrivateLinkResourcesClient_ListByVault() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkeyvault.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateLinkResourcesClient().ListByVault(ctx, "sample-group", "sample-vault", 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.PrivateLinkResourceListResult = armkeyvault.PrivateLinkResourceListResult{ - // Value: []*armkeyvault.PrivateLinkResource{ - // { - // Name: to.Ptr("vault"), - // Type: to.Ptr("Microsoft.KeyVault/vaults/privateLinkResources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-resource-group/providers/Microsoft.KeyVault/vaults/sample-vault/privateLinkResources/vault"), - // Properties: &armkeyvault.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("vault"), - // RequiredMembers: []*string{ - // to.Ptr("default")}, - // RequiredZoneNames: []*string{ - // to.Ptr("privatelink.vaultcore.azure.net")}, - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/keyvault/armkeyvault/secrets_client_example_test.go b/sdk/resourcemanager/keyvault/armkeyvault/secrets_client_example_test.go deleted file mode 100644 index 3407eb28e6db..000000000000 --- a/sdk/resourcemanager/keyvault/armkeyvault/secrets_client_example_test.go +++ /dev/null @@ -1,190 +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 armkeyvault_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/keyvault/armkeyvault" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/createSecret.json -func ExampleSecretsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkeyvault.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSecretsClient().CreateOrUpdate(ctx, "sample-group", "sample-vault", "secret-name", armkeyvault.SecretCreateOrUpdateParameters{ - Properties: &armkeyvault.SecretProperties{ - Value: to.Ptr("secret-value"), - }, - }, 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.Secret = armkeyvault.Secret{ - // Name: to.Ptr("secret-name"), - // Type: to.Ptr("Microsoft.KeyVault/vaults/secrets"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault/secrets/secret-name"), - // Location: to.Ptr("westus"), - // Properties: &armkeyvault.SecretProperties{ - // Attributes: &armkeyvault.SecretAttributes{ - // Created: to.Ptr(time.Unix(1514938738, 0)), - // Enabled: to.Ptr(true), - // Updated: to.Ptr(time.Unix(1514938738, 0)), - // }, - // SecretURI: to.Ptr("https://sample-vault.vault.azure.net/secrets/secret-name"), - // SecretURIWithVersion: to.Ptr("https:/sample-vault.vault.azure.net/secrets/secret-name/baf6de32c4774c7c81345f6476cf90a4"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/updateSecret.json -func ExampleSecretsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkeyvault.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSecretsClient().Update(ctx, "sample-group", "sample-vault", "secret-name", armkeyvault.SecretPatchParameters{ - Properties: &armkeyvault.SecretPatchProperties{ - Value: to.Ptr("secret-value2"), - }, - }, 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.Secret = armkeyvault.Secret{ - // Name: to.Ptr("secret-name"), - // Type: to.Ptr("Microsoft.KeyVault/vaults/secrets"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault/secrets/secret-name"), - // Location: to.Ptr("westus"), - // Properties: &armkeyvault.SecretProperties{ - // Attributes: &armkeyvault.SecretAttributes{ - // Created: to.Ptr(time.Unix(1514940684, 0)), - // Enabled: to.Ptr(true), - // Updated: to.Ptr(time.Unix(1514940698, 0)), - // }, - // SecretURI: to.Ptr("https://sample-vault.vault.azure.net/secrets/secret-name"), - // SecretURIWithVersion: to.Ptr("https://sample-vault.vault.azure.net/secrets/secret-name/b8c802f549764f2d97885d152f92ee9d"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/getSecret.json -func ExampleSecretsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkeyvault.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSecretsClient().Get(ctx, "sample-group", "sample-vault", "secret-name", 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.Secret = armkeyvault.Secret{ - // Name: to.Ptr("secret-name"), - // Type: to.Ptr("Microsoft.KeyVault/vaults/secrets"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault/secrets/secret-name"), - // Location: to.Ptr("westus"), - // Properties: &armkeyvault.SecretProperties{ - // Attributes: &armkeyvault.SecretAttributes{ - // Created: to.Ptr(time.Unix(1514940950, 0)), - // Enabled: to.Ptr(true), - // Updated: to.Ptr(time.Unix(1514940950, 0)), - // }, - // SecretURI: to.Ptr("https://sample-vault.vault.azure.net/secrets/secret-name"), - // SecretURIWithVersion: to.Ptr("https://sample-vault.vault.azure.net/secrets/secret-name/77445834f7de41bab81d0723bf996860"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/listSecrets.json -func ExampleSecretsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkeyvault.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSecretsClient().NewListPager("sample-group", "sample-vault", &armkeyvault.SecretsClientListOptions{Top: 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.SecretListResult = armkeyvault.SecretListResult{ - // Value: []*armkeyvault.Secret{ - // { - // Name: to.Ptr("secret-name"), - // Type: to.Ptr("Microsoft.KeyVault/vaults/secrets"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault/secrets/secret-name"), - // Location: to.Ptr("westus"), - // Properties: &armkeyvault.SecretProperties{ - // Attributes: &armkeyvault.SecretAttributes{ - // Created: to.Ptr(time.Unix(1514941476, 0)), - // Enabled: to.Ptr(true), - // Updated: to.Ptr(time.Unix(1514941476, 0)), - // }, - // SecretURI: to.Ptr("https://sample-vault.vault.azure.net/secrets/secret-name"), - // SecretURIWithVersion: to.Ptr("https://sample-vault.vault.azure.net/secrets/secret-name/40af42fbc10047f8a756a73211492f56"), - // }, - // }, - // { - // Name: to.Ptr("secret-name2"), - // Type: to.Ptr("Microsoft.KeyVault/vaults/secrets"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault/secrets/secret-name2"), - // Location: to.Ptr("westus"), - // Properties: &armkeyvault.SecretProperties{ - // Attributes: &armkeyvault.SecretAttributes{ - // Created: to.Ptr(time.Unix(1514941476, 0)), - // Enabled: to.Ptr(true), - // Updated: to.Ptr(time.Unix(1514941476, 0)), - // }, - // SecretURI: to.Ptr("https://sample-vault.vault.azure.net/secrets/secret-name2"), - // SecretURIWithVersion: to.Ptr("https://sample-vault.vault.azure.net/secrets/secret-name2/cd7264a6f56c44d1b594423c80609aae"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/keyvault/armkeyvault/vaults_client_example_test.go b/sdk/resourcemanager/keyvault/armkeyvault/vaults_client_example_test.go deleted file mode 100644 index 1ced2417e804..000000000000 --- a/sdk/resourcemanager/keyvault/armkeyvault/vaults_client_example_test.go +++ /dev/null @@ -1,1030 +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 armkeyvault_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/keyvault/armkeyvault" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/createVault.json -func ExampleVaultsClient_BeginCreateOrUpdate_createANewVaultOrUpdateAnExistingVault() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkeyvault.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVaultsClient().BeginCreateOrUpdate(ctx, "sample-resource-group", "sample-vault", armkeyvault.VaultCreateOrUpdateParameters{ - Location: to.Ptr("westus"), - Properties: &armkeyvault.VaultProperties{ - AccessPolicies: []*armkeyvault.AccessPolicyEntry{ - { - ObjectID: to.Ptr("00000000-0000-0000-0000-000000000000"), - Permissions: &armkeyvault.Permissions{ - Certificates: []*armkeyvault.CertificatePermissions{ - to.Ptr(armkeyvault.CertificatePermissionsGet), - to.Ptr(armkeyvault.CertificatePermissionsList), - to.Ptr(armkeyvault.CertificatePermissionsDelete), - to.Ptr(armkeyvault.CertificatePermissionsCreate), - to.Ptr(armkeyvault.CertificatePermissionsImport), - to.Ptr(armkeyvault.CertificatePermissionsUpdate), - to.Ptr(armkeyvault.CertificatePermissionsManagecontacts), - to.Ptr(armkeyvault.CertificatePermissionsGetissuers), - to.Ptr(armkeyvault.CertificatePermissionsListissuers), - to.Ptr(armkeyvault.CertificatePermissionsSetissuers), - to.Ptr(armkeyvault.CertificatePermissionsDeleteissuers), - to.Ptr(armkeyvault.CertificatePermissionsManageissuers), - to.Ptr(armkeyvault.CertificatePermissionsRecover), - to.Ptr(armkeyvault.CertificatePermissionsPurge)}, - Keys: []*armkeyvault.KeyPermissions{ - to.Ptr(armkeyvault.KeyPermissionsEncrypt), - to.Ptr(armkeyvault.KeyPermissionsDecrypt), - to.Ptr(armkeyvault.KeyPermissionsWrapKey), - to.Ptr(armkeyvault.KeyPermissionsUnwrapKey), - to.Ptr(armkeyvault.KeyPermissionsSign), - to.Ptr(armkeyvault.KeyPermissionsVerify), - to.Ptr(armkeyvault.KeyPermissionsGet), - to.Ptr(armkeyvault.KeyPermissionsList), - to.Ptr(armkeyvault.KeyPermissionsCreate), - to.Ptr(armkeyvault.KeyPermissionsUpdate), - to.Ptr(armkeyvault.KeyPermissionsImport), - to.Ptr(armkeyvault.KeyPermissionsDelete), - to.Ptr(armkeyvault.KeyPermissionsBackup), - to.Ptr(armkeyvault.KeyPermissionsRestore), - to.Ptr(armkeyvault.KeyPermissionsRecover), - to.Ptr(armkeyvault.KeyPermissionsPurge)}, - Secrets: []*armkeyvault.SecretPermissions{ - to.Ptr(armkeyvault.SecretPermissionsGet), - to.Ptr(armkeyvault.SecretPermissionsList), - to.Ptr(armkeyvault.SecretPermissionsSet), - to.Ptr(armkeyvault.SecretPermissionsDelete), - to.Ptr(armkeyvault.SecretPermissionsBackup), - to.Ptr(armkeyvault.SecretPermissionsRestore), - to.Ptr(armkeyvault.SecretPermissionsRecover), - to.Ptr(armkeyvault.SecretPermissionsPurge)}, - }, - TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - }}, - EnabledForDeployment: to.Ptr(true), - EnabledForDiskEncryption: to.Ptr(true), - EnabledForTemplateDeployment: to.Ptr(true), - PublicNetworkAccess: to.Ptr("Enabled"), - SKU: &armkeyvault.SKU{ - Name: to.Ptr(armkeyvault.SKUNameStandard), - Family: to.Ptr(armkeyvault.SKUFamilyA), - }, - TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - }, - }, 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.Vault = armkeyvault.Vault{ - // Name: to.Ptr("sample-vault"), - // Type: to.Ptr("Microsoft.KeyVault/vaults"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-resource-group/providers/Microsoft.KeyVault/vaults/sample-vault"), - // Location: to.Ptr("westus"), - // Properties: &armkeyvault.VaultProperties{ - // AccessPolicies: []*armkeyvault.AccessPolicyEntry{ - // { - // ObjectID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Permissions: &armkeyvault.Permissions{ - // Certificates: []*armkeyvault.CertificatePermissions{ - // to.Ptr(armkeyvault.CertificatePermissionsGet), - // to.Ptr(armkeyvault.CertificatePermissionsList), - // to.Ptr(armkeyvault.CertificatePermissionsDelete), - // to.Ptr(armkeyvault.CertificatePermissionsCreate), - // to.Ptr(armkeyvault.CertificatePermissionsImport), - // to.Ptr(armkeyvault.CertificatePermissionsUpdate), - // to.Ptr(armkeyvault.CertificatePermissionsManagecontacts), - // to.Ptr(armkeyvault.CertificatePermissionsGetissuers), - // to.Ptr(armkeyvault.CertificatePermissionsListissuers), - // to.Ptr(armkeyvault.CertificatePermissionsSetissuers), - // to.Ptr(armkeyvault.CertificatePermissionsDeleteissuers), - // to.Ptr(armkeyvault.CertificatePermissionsManageissuers), - // to.Ptr(armkeyvault.CertificatePermissionsRecover), - // to.Ptr(armkeyvault.CertificatePermissionsPurge)}, - // Keys: []*armkeyvault.KeyPermissions{ - // to.Ptr(armkeyvault.KeyPermissionsEncrypt), - // to.Ptr(armkeyvault.KeyPermissionsDecrypt), - // to.Ptr(armkeyvault.KeyPermissionsWrapKey), - // to.Ptr(armkeyvault.KeyPermissionsUnwrapKey), - // to.Ptr(armkeyvault.KeyPermissionsSign), - // to.Ptr(armkeyvault.KeyPermissionsVerify), - // to.Ptr(armkeyvault.KeyPermissionsGet), - // to.Ptr(armkeyvault.KeyPermissionsList), - // to.Ptr(armkeyvault.KeyPermissionsCreate), - // to.Ptr(armkeyvault.KeyPermissionsUpdate), - // to.Ptr(armkeyvault.KeyPermissionsImport), - // to.Ptr(armkeyvault.KeyPermissionsDelete), - // to.Ptr(armkeyvault.KeyPermissionsBackup), - // to.Ptr(armkeyvault.KeyPermissionsRestore), - // to.Ptr(armkeyvault.KeyPermissionsRecover), - // to.Ptr(armkeyvault.KeyPermissionsPurge)}, - // Secrets: []*armkeyvault.SecretPermissions{ - // to.Ptr(armkeyvault.SecretPermissionsGet), - // to.Ptr(armkeyvault.SecretPermissionsList), - // to.Ptr(armkeyvault.SecretPermissionsSet), - // to.Ptr(armkeyvault.SecretPermissionsDelete), - // to.Ptr(armkeyvault.SecretPermissionsBackup), - // to.Ptr(armkeyvault.SecretPermissionsRestore), - // to.Ptr(armkeyvault.SecretPermissionsRecover), - // to.Ptr(armkeyvault.SecretPermissionsPurge)}, - // }, - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }}, - // EnabledForDeployment: to.Ptr(true), - // EnabledForDiskEncryption: to.Ptr(true), - // EnabledForTemplateDeployment: to.Ptr(true), - // HsmPoolResourceID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // NetworkACLs: &armkeyvault.NetworkRuleSet{ - // Bypass: to.Ptr(armkeyvault.NetworkRuleBypassOptionsAzureServices), - // DefaultAction: to.Ptr(armkeyvault.NetworkRuleActionDeny), - // IPRules: []*armkeyvault.IPRule{ - // { - // Value: to.Ptr(""), - // }}, - // VirtualNetworkRules: []*armkeyvault.VirtualNetworkRule{ - // { - // ID: to.Ptr(""), - // IgnoreMissingVnetServiceEndpoint: to.Ptr(false), - // }}, - // }, - // PrivateEndpointConnections: []*armkeyvault.PrivateEndpointConnectionItem{ - // { - // Etag: to.Ptr(""), - // ID: to.Ptr(""), - // Properties: &armkeyvault.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armkeyvault.PrivateEndpoint{ - // ID: to.Ptr(""), - // }, - // PrivateLinkServiceConnectionState: &armkeyvault.PrivateLinkServiceConnectionState{ - // ActionsRequired: to.Ptr(armkeyvault.ActionsRequiredNone), - // Status: to.Ptr(armkeyvault.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armkeyvault.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // }}, - // ProvisioningState: to.Ptr(armkeyvault.VaultProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr("Enabled"), - // SKU: &armkeyvault.SKU{ - // Name: to.Ptr(armkeyvault.SKUNameStandard), - // Family: to.Ptr(armkeyvault.SKUFamilyA), - // }, - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // VaultURI: to.Ptr("https://sample-vault.vault.azure.net"), - // }, - // SystemData: &armkeyvault.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:00:00.0000000Z"); return t}()), - // CreatedBy: to.Ptr("keyVaultUser1"), - // CreatedByType: to.Ptr(armkeyvault.IdentityTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:00:00.0000000Z"); return t}()), - // LastModifiedBy: to.Ptr("keyVaultUser2"), - // LastModifiedByType: to.Ptr(armkeyvault.IdentityTypeUser), - // }, - // Tags: map[string]*string{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/createVaultWithNetworkAcls.json -func ExampleVaultsClient_BeginCreateOrUpdate_createOrUpdateAVaultWithNetworkAcls() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkeyvault.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVaultsClient().BeginCreateOrUpdate(ctx, "sample-resource-group", "sample-vault", armkeyvault.VaultCreateOrUpdateParameters{ - Location: to.Ptr("westus"), - Properties: &armkeyvault.VaultProperties{ - EnabledForDeployment: to.Ptr(true), - EnabledForDiskEncryption: to.Ptr(true), - EnabledForTemplateDeployment: to.Ptr(true), - NetworkACLs: &armkeyvault.NetworkRuleSet{ - Bypass: to.Ptr(armkeyvault.NetworkRuleBypassOptionsAzureServices), - DefaultAction: to.Ptr(armkeyvault.NetworkRuleActionDeny), - IPRules: []*armkeyvault.IPRule{ - { - Value: to.Ptr("124.56.78.91"), - }, - { - Value: to.Ptr("'10.91.4.0/24'"), - }}, - VirtualNetworkRules: []*armkeyvault.VirtualNetworkRule{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"), - }}, - }, - SKU: &armkeyvault.SKU{ - Name: to.Ptr(armkeyvault.SKUNameStandard), - Family: to.Ptr(armkeyvault.SKUFamilyA), - }, - TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - }, - }, 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.Vault = armkeyvault.Vault{ - // Name: to.Ptr("sample-vault"), - // Type: to.Ptr("Microsoft.KeyVault/vaults"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-resource-group/providers/Microsoft.KeyVault/vaults/sample-vault"), - // Location: to.Ptr("westus"), - // Properties: &armkeyvault.VaultProperties{ - // EnabledForDeployment: to.Ptr(true), - // EnabledForDiskEncryption: to.Ptr(true), - // EnabledForTemplateDeployment: to.Ptr(true), - // HsmPoolResourceID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // NetworkACLs: &armkeyvault.NetworkRuleSet{ - // Bypass: to.Ptr(armkeyvault.NetworkRuleBypassOptionsAzureServices), - // DefaultAction: to.Ptr(armkeyvault.NetworkRuleActionDeny), - // IPRules: []*armkeyvault.IPRule{ - // { - // Value: to.Ptr("124.56.78.91/32"), - // }, - // { - // Value: to.Ptr("'10.91.4.0/24'"), - // }}, - // VirtualNetworkRules: []*armkeyvault.VirtualNetworkRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/microsoft.network/virtualnetworks/test-vnet/subnets/subnet1"), - // }}, - // }, - // SKU: &armkeyvault.SKU{ - // Name: to.Ptr(armkeyvault.SKUNameStandard), - // Family: to.Ptr(armkeyvault.SKUFamilyA), - // }, - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // VaultURI: to.Ptr("https://sample-vault.vault.azure.net"), - // }, - // SystemData: &armkeyvault.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:00:00.0000000Z"); return t}()), - // CreatedBy: to.Ptr("keyVaultUser1"), - // CreatedByType: to.Ptr(armkeyvault.IdentityTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:00:00.0000000Z"); return t}()), - // LastModifiedBy: to.Ptr("keyVaultUser2"), - // LastModifiedByType: to.Ptr(armkeyvault.IdentityTypeUser), - // }, - // Tags: map[string]*string{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/updateVault.json -func ExampleVaultsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkeyvault.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVaultsClient().Update(ctx, "sample-resource-group", "sample-vault", armkeyvault.VaultPatchParameters{ - Properties: &armkeyvault.VaultPatchProperties{ - AccessPolicies: []*armkeyvault.AccessPolicyEntry{ - { - ObjectID: to.Ptr("00000000-0000-0000-0000-000000000000"), - Permissions: &armkeyvault.Permissions{ - Certificates: []*armkeyvault.CertificatePermissions{ - to.Ptr(armkeyvault.CertificatePermissionsGet), - to.Ptr(armkeyvault.CertificatePermissionsList), - to.Ptr(armkeyvault.CertificatePermissionsDelete), - to.Ptr(armkeyvault.CertificatePermissionsCreate), - to.Ptr(armkeyvault.CertificatePermissionsImport), - to.Ptr(armkeyvault.CertificatePermissionsUpdate), - to.Ptr(armkeyvault.CertificatePermissionsManagecontacts), - to.Ptr(armkeyvault.CertificatePermissionsGetissuers), - to.Ptr(armkeyvault.CertificatePermissionsListissuers), - to.Ptr(armkeyvault.CertificatePermissionsSetissuers), - to.Ptr(armkeyvault.CertificatePermissionsDeleteissuers), - to.Ptr(armkeyvault.CertificatePermissionsManageissuers), - to.Ptr(armkeyvault.CertificatePermissionsRecover), - to.Ptr(armkeyvault.CertificatePermissionsPurge)}, - Keys: []*armkeyvault.KeyPermissions{ - to.Ptr(armkeyvault.KeyPermissionsEncrypt), - to.Ptr(armkeyvault.KeyPermissionsDecrypt), - to.Ptr(armkeyvault.KeyPermissionsWrapKey), - to.Ptr(armkeyvault.KeyPermissionsUnwrapKey), - to.Ptr(armkeyvault.KeyPermissionsSign), - to.Ptr(armkeyvault.KeyPermissionsVerify), - to.Ptr(armkeyvault.KeyPermissionsGet), - to.Ptr(armkeyvault.KeyPermissionsList), - to.Ptr(armkeyvault.KeyPermissionsCreate), - to.Ptr(armkeyvault.KeyPermissionsUpdate), - to.Ptr(armkeyvault.KeyPermissionsImport), - to.Ptr(armkeyvault.KeyPermissionsDelete), - to.Ptr(armkeyvault.KeyPermissionsBackup), - to.Ptr(armkeyvault.KeyPermissionsRestore), - to.Ptr(armkeyvault.KeyPermissionsRecover), - to.Ptr(armkeyvault.KeyPermissionsPurge)}, - Secrets: []*armkeyvault.SecretPermissions{ - to.Ptr(armkeyvault.SecretPermissionsGet), - to.Ptr(armkeyvault.SecretPermissionsList), - to.Ptr(armkeyvault.SecretPermissionsSet), - to.Ptr(armkeyvault.SecretPermissionsDelete), - to.Ptr(armkeyvault.SecretPermissionsBackup), - to.Ptr(armkeyvault.SecretPermissionsRestore), - to.Ptr(armkeyvault.SecretPermissionsRecover), - to.Ptr(armkeyvault.SecretPermissionsPurge)}, - }, - TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - }}, - EnabledForDeployment: to.Ptr(true), - EnabledForDiskEncryption: to.Ptr(true), - EnabledForTemplateDeployment: to.Ptr(true), - PublicNetworkAccess: to.Ptr("Enabled"), - SKU: &armkeyvault.SKU{ - Name: to.Ptr(armkeyvault.SKUNameStandard), - Family: to.Ptr(armkeyvault.SKUFamilyA), - }, - TenantID: to.Ptr("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.Vault = armkeyvault.Vault{ - // Name: to.Ptr("sample-vault"), - // Type: to.Ptr("Microsoft.KeyVault/vaults"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-resource-group/providers/Microsoft.KeyVault/vaults/sample-vault"), - // Location: to.Ptr("westus"), - // Properties: &armkeyvault.VaultProperties{ - // AccessPolicies: []*armkeyvault.AccessPolicyEntry{ - // { - // ObjectID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Permissions: &armkeyvault.Permissions{ - // Certificates: []*armkeyvault.CertificatePermissions{ - // to.Ptr(armkeyvault.CertificatePermissionsGet), - // to.Ptr(armkeyvault.CertificatePermissionsList), - // to.Ptr(armkeyvault.CertificatePermissionsDelete), - // to.Ptr(armkeyvault.CertificatePermissionsCreate), - // to.Ptr(armkeyvault.CertificatePermissionsImport), - // to.Ptr(armkeyvault.CertificatePermissionsUpdate), - // to.Ptr(armkeyvault.CertificatePermissionsManagecontacts), - // to.Ptr(armkeyvault.CertificatePermissionsGetissuers), - // to.Ptr(armkeyvault.CertificatePermissionsListissuers), - // to.Ptr(armkeyvault.CertificatePermissionsSetissuers), - // to.Ptr(armkeyvault.CertificatePermissionsDeleteissuers), - // to.Ptr(armkeyvault.CertificatePermissionsManageissuers), - // to.Ptr(armkeyvault.CertificatePermissionsRecover), - // to.Ptr(armkeyvault.CertificatePermissionsPurge)}, - // Keys: []*armkeyvault.KeyPermissions{ - // to.Ptr(armkeyvault.KeyPermissionsEncrypt), - // to.Ptr(armkeyvault.KeyPermissionsDecrypt), - // to.Ptr(armkeyvault.KeyPermissionsWrapKey), - // to.Ptr(armkeyvault.KeyPermissionsUnwrapKey), - // to.Ptr(armkeyvault.KeyPermissionsSign), - // to.Ptr(armkeyvault.KeyPermissionsVerify), - // to.Ptr(armkeyvault.KeyPermissionsGet), - // to.Ptr(armkeyvault.KeyPermissionsList), - // to.Ptr(armkeyvault.KeyPermissionsCreate), - // to.Ptr(armkeyvault.KeyPermissionsUpdate), - // to.Ptr(armkeyvault.KeyPermissionsImport), - // to.Ptr(armkeyvault.KeyPermissionsDelete), - // to.Ptr(armkeyvault.KeyPermissionsBackup), - // to.Ptr(armkeyvault.KeyPermissionsRestore), - // to.Ptr(armkeyvault.KeyPermissionsRecover), - // to.Ptr(armkeyvault.KeyPermissionsPurge)}, - // Secrets: []*armkeyvault.SecretPermissions{ - // to.Ptr(armkeyvault.SecretPermissionsGet), - // to.Ptr(armkeyvault.SecretPermissionsList), - // to.Ptr(armkeyvault.SecretPermissionsSet), - // to.Ptr(armkeyvault.SecretPermissionsDelete), - // to.Ptr(armkeyvault.SecretPermissionsBackup), - // to.Ptr(armkeyvault.SecretPermissionsRestore), - // to.Ptr(armkeyvault.SecretPermissionsRecover), - // to.Ptr(armkeyvault.SecretPermissionsPurge)}, - // }, - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }}, - // EnabledForDeployment: to.Ptr(true), - // EnabledForDiskEncryption: to.Ptr(true), - // EnabledForTemplateDeployment: to.Ptr(true), - // HsmPoolResourceID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // NetworkACLs: &armkeyvault.NetworkRuleSet{ - // Bypass: to.Ptr(armkeyvault.NetworkRuleBypassOptionsAzureServices), - // DefaultAction: to.Ptr(armkeyvault.NetworkRuleActionDeny), - // IPRules: []*armkeyvault.IPRule{ - // { - // Value: to.Ptr(""), - // }}, - // VirtualNetworkRules: []*armkeyvault.VirtualNetworkRule{ - // { - // ID: to.Ptr(""), - // IgnoreMissingVnetServiceEndpoint: to.Ptr(false), - // }}, - // }, - // PrivateEndpointConnections: []*armkeyvault.PrivateEndpointConnectionItem{ - // { - // ID: to.Ptr(""), - // Properties: &armkeyvault.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armkeyvault.PrivateEndpoint{ - // ID: to.Ptr(""), - // }, - // PrivateLinkServiceConnectionState: &armkeyvault.PrivateLinkServiceConnectionState{ - // ActionsRequired: to.Ptr(armkeyvault.ActionsRequiredNone), - // Status: to.Ptr(armkeyvault.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armkeyvault.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // }}, - // ProvisioningState: to.Ptr(armkeyvault.VaultProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr("Enabled"), - // SKU: &armkeyvault.SKU{ - // Name: to.Ptr(armkeyvault.SKUNameStandard), - // Family: to.Ptr(armkeyvault.SKUFamilyA), - // }, - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // VaultURI: to.Ptr("https://sample-vault.vault.azure.net"), - // }, - // SystemData: &armkeyvault.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:00:00.0000000Z"); return t}()), - // CreatedBy: to.Ptr("keyVaultUser1"), - // CreatedByType: to.Ptr(armkeyvault.IdentityTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:00:00.0000000Z"); return t}()), - // LastModifiedBy: to.Ptr("keyVaultUser2"), - // LastModifiedByType: to.Ptr(armkeyvault.IdentityTypeUser), - // }, - // Tags: map[string]*string{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/deleteVault.json -func ExampleVaultsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkeyvault.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewVaultsClient().Delete(ctx, "sample-resource-group", "sample-vault", 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/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/getVault.json -func ExampleVaultsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkeyvault.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVaultsClient().Get(ctx, "sample-resource-group", "sample-vault", 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.Vault = armkeyvault.Vault{ - // Name: to.Ptr("sample-vault"), - // Type: to.Ptr("Microsoft.KeyVault/vaults"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-resource-group/providers/Microsoft.KeyVault/vaults/sample-vault"), - // Location: to.Ptr("westus"), - // Properties: &armkeyvault.VaultProperties{ - // AccessPolicies: []*armkeyvault.AccessPolicyEntry{ - // { - // ObjectID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Permissions: &armkeyvault.Permissions{ - // Certificates: []*armkeyvault.CertificatePermissions{ - // to.Ptr(armkeyvault.CertificatePermissionsGet), - // to.Ptr(armkeyvault.CertificatePermissionsList), - // to.Ptr(armkeyvault.CertificatePermissionsDelete), - // to.Ptr(armkeyvault.CertificatePermissionsCreate), - // to.Ptr(armkeyvault.CertificatePermissionsImport), - // to.Ptr(armkeyvault.CertificatePermissionsUpdate), - // to.Ptr(armkeyvault.CertificatePermissionsManagecontacts), - // to.Ptr(armkeyvault.CertificatePermissionsGetissuers), - // to.Ptr(armkeyvault.CertificatePermissionsListissuers), - // to.Ptr(armkeyvault.CertificatePermissionsSetissuers), - // to.Ptr(armkeyvault.CertificatePermissionsDeleteissuers), - // to.Ptr(armkeyvault.CertificatePermissionsManageissuers), - // to.Ptr(armkeyvault.CertificatePermissionsRecover), - // to.Ptr(armkeyvault.CertificatePermissionsPurge)}, - // Keys: []*armkeyvault.KeyPermissions{ - // to.Ptr(armkeyvault.KeyPermissionsEncrypt), - // to.Ptr(armkeyvault.KeyPermissionsDecrypt), - // to.Ptr(armkeyvault.KeyPermissionsWrapKey), - // to.Ptr(armkeyvault.KeyPermissionsUnwrapKey), - // to.Ptr(armkeyvault.KeyPermissionsSign), - // to.Ptr(armkeyvault.KeyPermissionsVerify), - // to.Ptr(armkeyvault.KeyPermissionsGet), - // to.Ptr(armkeyvault.KeyPermissionsList), - // to.Ptr(armkeyvault.KeyPermissionsCreate), - // to.Ptr(armkeyvault.KeyPermissionsUpdate), - // to.Ptr(armkeyvault.KeyPermissionsImport), - // to.Ptr(armkeyvault.KeyPermissionsDelete), - // to.Ptr(armkeyvault.KeyPermissionsBackup), - // to.Ptr(armkeyvault.KeyPermissionsRestore), - // to.Ptr(armkeyvault.KeyPermissionsRecover), - // to.Ptr(armkeyvault.KeyPermissionsPurge)}, - // Secrets: []*armkeyvault.SecretPermissions{ - // to.Ptr(armkeyvault.SecretPermissionsGet), - // to.Ptr(armkeyvault.SecretPermissionsList), - // to.Ptr(armkeyvault.SecretPermissionsSet), - // to.Ptr(armkeyvault.SecretPermissionsDelete), - // to.Ptr(armkeyvault.SecretPermissionsBackup), - // to.Ptr(armkeyvault.SecretPermissionsRestore), - // to.Ptr(armkeyvault.SecretPermissionsRecover), - // to.Ptr(armkeyvault.SecretPermissionsPurge)}, - // }, - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }}, - // EnabledForDeployment: to.Ptr(true), - // EnabledForDiskEncryption: to.Ptr(true), - // EnabledForTemplateDeployment: to.Ptr(true), - // HsmPoolResourceID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // ProvisioningState: to.Ptr(armkeyvault.VaultProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr("Enabled"), - // SKU: &armkeyvault.SKU{ - // Name: to.Ptr(armkeyvault.SKUNameStandard), - // Family: to.Ptr(armkeyvault.SKUFamilyA), - // }, - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // VaultURI: to.Ptr("https://sample-vault.vault.azure.net"), - // }, - // SystemData: &armkeyvault.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:00:00.0000000Z"); return t}()), - // CreatedBy: to.Ptr("keyVaultUser1"), - // CreatedByType: to.Ptr(armkeyvault.IdentityTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:00:00.0000000Z"); return t}()), - // LastModifiedBy: to.Ptr("keyVaultUser2"), - // LastModifiedByType: to.Ptr(armkeyvault.IdentityTypeUser), - // }, - // Tags: map[string]*string{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/updateAccessPoliciesAdd.json -func ExampleVaultsClient_UpdateAccessPolicy() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkeyvault.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVaultsClient().UpdateAccessPolicy(ctx, "sample-group", "sample-vault", armkeyvault.AccessPolicyUpdateKindAdd, armkeyvault.VaultAccessPolicyParameters{ - Properties: &armkeyvault.VaultAccessPolicyProperties{ - AccessPolicies: []*armkeyvault.AccessPolicyEntry{ - { - ObjectID: to.Ptr("00000000-0000-0000-0000-000000000000"), - Permissions: &armkeyvault.Permissions{ - Certificates: []*armkeyvault.CertificatePermissions{ - to.Ptr(armkeyvault.CertificatePermissionsGet)}, - Keys: []*armkeyvault.KeyPermissions{ - to.Ptr(armkeyvault.KeyPermissionsEncrypt)}, - Secrets: []*armkeyvault.SecretPermissions{ - to.Ptr(armkeyvault.SecretPermissionsGet)}, - }, - TenantID: to.Ptr("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.VaultAccessPolicyParameters = armkeyvault.VaultAccessPolicyParameters{ - // Type: to.Ptr("Microsoft.KeyVault/vaults/accessPolicies"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault/accessPolicies/"), - // Properties: &armkeyvault.VaultAccessPolicyProperties{ - // AccessPolicies: []*armkeyvault.AccessPolicyEntry{ - // { - // ObjectID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Permissions: &armkeyvault.Permissions{ - // Certificates: []*armkeyvault.CertificatePermissions{ - // to.Ptr(armkeyvault.CertificatePermissionsGet)}, - // Keys: []*armkeyvault.KeyPermissions{ - // to.Ptr(armkeyvault.KeyPermissionsEncrypt)}, - // Secrets: []*armkeyvault.SecretPermissions{ - // to.Ptr(armkeyvault.SecretPermissionsGet)}, - // }, - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/listVaultByResourceGroup.json -func ExampleVaultsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkeyvault.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVaultsClient().NewListByResourceGroupPager("sample-group", &armkeyvault.VaultsClientListByResourceGroupOptions{Top: to.Ptr[int32](1)}) - 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.VaultListResult = armkeyvault.VaultListResult{ - // Value: []*armkeyvault.Vault{ - // { - // Name: to.Ptr("sample-vault"), - // Type: to.Ptr("Microsoft.KeyVault/vaults"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault"), - // Location: to.Ptr("westus"), - // Properties: &armkeyvault.VaultProperties{ - // AccessPolicies: []*armkeyvault.AccessPolicyEntry{ - // { - // ObjectID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Permissions: &armkeyvault.Permissions{ - // Certificates: []*armkeyvault.CertificatePermissions{ - // to.Ptr(armkeyvault.CertificatePermissionsGet), - // to.Ptr(armkeyvault.CertificatePermissionsList), - // to.Ptr(armkeyvault.CertificatePermissionsDelete), - // to.Ptr(armkeyvault.CertificatePermissionsCreate), - // to.Ptr(armkeyvault.CertificatePermissionsImport), - // to.Ptr(armkeyvault.CertificatePermissionsUpdate), - // to.Ptr(armkeyvault.CertificatePermissionsManagecontacts), - // to.Ptr(armkeyvault.CertificatePermissionsGetissuers), - // to.Ptr(armkeyvault.CertificatePermissionsListissuers), - // to.Ptr(armkeyvault.CertificatePermissionsSetissuers), - // to.Ptr(armkeyvault.CertificatePermissionsDeleteissuers), - // to.Ptr(armkeyvault.CertificatePermissionsManageissuers), - // to.Ptr(armkeyvault.CertificatePermissionsRecover), - // to.Ptr(armkeyvault.CertificatePermissionsPurge)}, - // Keys: []*armkeyvault.KeyPermissions{ - // to.Ptr(armkeyvault.KeyPermissionsEncrypt), - // to.Ptr(armkeyvault.KeyPermissionsDecrypt), - // to.Ptr(armkeyvault.KeyPermissionsWrapKey), - // to.Ptr(armkeyvault.KeyPermissionsUnwrapKey), - // to.Ptr(armkeyvault.KeyPermissionsSign), - // to.Ptr(armkeyvault.KeyPermissionsVerify), - // to.Ptr(armkeyvault.KeyPermissionsGet), - // to.Ptr(armkeyvault.KeyPermissionsList), - // to.Ptr(armkeyvault.KeyPermissionsCreate), - // to.Ptr(armkeyvault.KeyPermissionsUpdate), - // to.Ptr(armkeyvault.KeyPermissionsImport), - // to.Ptr(armkeyvault.KeyPermissionsDelete), - // to.Ptr(armkeyvault.KeyPermissionsBackup), - // to.Ptr(armkeyvault.KeyPermissionsRestore), - // to.Ptr(armkeyvault.KeyPermissionsRecover), - // to.Ptr(armkeyvault.KeyPermissionsPurge)}, - // Secrets: []*armkeyvault.SecretPermissions{ - // to.Ptr(armkeyvault.SecretPermissionsGet), - // to.Ptr(armkeyvault.SecretPermissionsList), - // to.Ptr(armkeyvault.SecretPermissionsSet), - // to.Ptr(armkeyvault.SecretPermissionsDelete), - // to.Ptr(armkeyvault.SecretPermissionsBackup), - // to.Ptr(armkeyvault.SecretPermissionsRestore), - // to.Ptr(armkeyvault.SecretPermissionsRecover), - // to.Ptr(armkeyvault.SecretPermissionsPurge)}, - // }, - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }}, - // EnableSoftDelete: to.Ptr(true), - // EnabledForDeployment: to.Ptr(true), - // EnabledForDiskEncryption: to.Ptr(true), - // EnabledForTemplateDeployment: to.Ptr(true), - // HsmPoolResourceID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // ProvisioningState: to.Ptr(armkeyvault.VaultProvisioningStateSucceeded), - // SKU: &armkeyvault.SKU{ - // Name: to.Ptr(armkeyvault.SKUNamePremium), - // Family: to.Ptr(armkeyvault.SKUFamilyA), - // }, - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // VaultURI: to.Ptr("https://sample-vault.vault.azure.net/"), - // }, - // SystemData: &armkeyvault.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:00:00.0000000Z"); return t}()), - // CreatedBy: to.Ptr("keyVaultUser1"), - // CreatedByType: to.Ptr(armkeyvault.IdentityTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:00:00.0000000Z"); return t}()), - // LastModifiedBy: to.Ptr("keyVaultUser2"), - // LastModifiedByType: to.Ptr(armkeyvault.IdentityTypeUser), - // }, - // Tags: map[string]*string{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/listVaultBySubscription.json -func ExampleVaultsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkeyvault.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVaultsClient().NewListBySubscriptionPager(&armkeyvault.VaultsClientListBySubscriptionOptions{Top: to.Ptr[int32](1)}) - 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.VaultListResult = armkeyvault.VaultListResult{ - // Value: []*armkeyvault.Vault{ - // { - // Name: to.Ptr("sample-vault"), - // Type: to.Ptr("Microsoft.KeyVault/vaults"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault"), - // Location: to.Ptr("westus"), - // Properties: &armkeyvault.VaultProperties{ - // AccessPolicies: []*armkeyvault.AccessPolicyEntry{ - // { - // ObjectID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Permissions: &armkeyvault.Permissions{ - // Certificates: []*armkeyvault.CertificatePermissions{ - // to.Ptr(armkeyvault.CertificatePermissionsGet), - // to.Ptr(armkeyvault.CertificatePermissionsList), - // to.Ptr(armkeyvault.CertificatePermissionsDelete), - // to.Ptr(armkeyvault.CertificatePermissionsCreate), - // to.Ptr(armkeyvault.CertificatePermissionsImport), - // to.Ptr(armkeyvault.CertificatePermissionsUpdate), - // to.Ptr(armkeyvault.CertificatePermissionsManagecontacts), - // to.Ptr(armkeyvault.CertificatePermissionsGetissuers), - // to.Ptr(armkeyvault.CertificatePermissionsListissuers), - // to.Ptr(armkeyvault.CertificatePermissionsSetissuers), - // to.Ptr(armkeyvault.CertificatePermissionsDeleteissuers), - // to.Ptr(armkeyvault.CertificatePermissionsManageissuers), - // to.Ptr(armkeyvault.CertificatePermissionsRecover), - // to.Ptr(armkeyvault.CertificatePermissionsPurge)}, - // Keys: []*armkeyvault.KeyPermissions{ - // to.Ptr(armkeyvault.KeyPermissionsEncrypt), - // to.Ptr(armkeyvault.KeyPermissionsDecrypt), - // to.Ptr(armkeyvault.KeyPermissionsWrapKey), - // to.Ptr(armkeyvault.KeyPermissionsUnwrapKey), - // to.Ptr(armkeyvault.KeyPermissionsSign), - // to.Ptr(armkeyvault.KeyPermissionsVerify), - // to.Ptr(armkeyvault.KeyPermissionsGet), - // to.Ptr(armkeyvault.KeyPermissionsList), - // to.Ptr(armkeyvault.KeyPermissionsCreate), - // to.Ptr(armkeyvault.KeyPermissionsUpdate), - // to.Ptr(armkeyvault.KeyPermissionsImport), - // to.Ptr(armkeyvault.KeyPermissionsDelete), - // to.Ptr(armkeyvault.KeyPermissionsBackup), - // to.Ptr(armkeyvault.KeyPermissionsRestore), - // to.Ptr(armkeyvault.KeyPermissionsRecover), - // to.Ptr(armkeyvault.KeyPermissionsPurge)}, - // Secrets: []*armkeyvault.SecretPermissions{ - // to.Ptr(armkeyvault.SecretPermissionsGet), - // to.Ptr(armkeyvault.SecretPermissionsList), - // to.Ptr(armkeyvault.SecretPermissionsSet), - // to.Ptr(armkeyvault.SecretPermissionsDelete), - // to.Ptr(armkeyvault.SecretPermissionsBackup), - // to.Ptr(armkeyvault.SecretPermissionsRestore), - // to.Ptr(armkeyvault.SecretPermissionsRecover), - // to.Ptr(armkeyvault.SecretPermissionsPurge)}, - // }, - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }}, - // EnableSoftDelete: to.Ptr(true), - // EnabledForDeployment: to.Ptr(true), - // EnabledForDiskEncryption: to.Ptr(true), - // EnabledForTemplateDeployment: to.Ptr(true), - // HsmPoolResourceID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // ProvisioningState: to.Ptr(armkeyvault.VaultProvisioningStateSucceeded), - // SKU: &armkeyvault.SKU{ - // Name: to.Ptr(armkeyvault.SKUNamePremium), - // Family: to.Ptr(armkeyvault.SKUFamilyA), - // }, - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // VaultURI: to.Ptr("https://sample-vault.vault.azure.net/"), - // }, - // SystemData: &armkeyvault.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:00:00.0000000Z"); return t}()), - // CreatedBy: to.Ptr("keyVaultUser1"), - // CreatedByType: to.Ptr(armkeyvault.IdentityTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:00:00.0000000Z"); return t}()), - // LastModifiedBy: to.Ptr("keyVaultUser2"), - // LastModifiedByType: to.Ptr(armkeyvault.IdentityTypeUser), - // }, - // Tags: map[string]*string{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/listDeletedVaults.json -func ExampleVaultsClient_NewListDeletedPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkeyvault.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVaultsClient().NewListDeletedPager(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.DeletedVaultListResult = armkeyvault.DeletedVaultListResult{ - // Value: []*armkeyvault.DeletedVault{ - // { - // Name: to.Ptr("vault-agile-drawer-6404"), - // Type: to.Ptr("Microsoft.KeyVault/deletedVaults"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/westus/deletedVaults/sample-vault"), - // Properties: &armkeyvault.DeletedVaultProperties{ - // DeletionDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-01-01T00:00:59Z"); return t}()), - // Location: to.Ptr("westus"), - // PurgeProtectionEnabled: to.Ptr(true), - // ScheduledPurgeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-01T00:00:59Z"); return t}()), - // Tags: map[string]*string{ - // }, - // VaultID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/getDeletedVault.json -func ExampleVaultsClient_GetDeleted() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkeyvault.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVaultsClient().GetDeleted(ctx, "sample-vault", "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.DeletedVault = armkeyvault.DeletedVault{ - // Name: to.Ptr("sample-vault"), - // Type: to.Ptr("Microsoft.KeyVault/deletedVaults"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/westus/deletedVaults/sample-vault"), - // Properties: &armkeyvault.DeletedVaultProperties{ - // DeletionDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-01-01T00:00:59Z"); return t}()), - // Location: to.Ptr("westus"), - // PurgeProtectionEnabled: to.Ptr(true), - // ScheduledPurgeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-01T00:00:59Z"); return t}()), - // Tags: map[string]*string{ - // }, - // VaultID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/purgeDeletedVault.json -func ExampleVaultsClient_BeginPurgeDeleted() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkeyvault.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVaultsClient().BeginPurgeDeleted(ctx, "sample-vault", "westus", 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/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/listVault.json -func ExampleVaultsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkeyvault.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVaultsClient().NewListPager(&armkeyvault.VaultsClientListOptions{Top: to.Ptr[int32](1)}) - 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.ResourceListResult = armkeyvault.ResourceListResult{ - // Value: []*armkeyvault.Resource{ - // { - // Name: to.Ptr("sample-vault"), - // Type: to.Ptr("Microsoft.KeyVault/vaults"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/checkVaultNameAvailability.json -func ExampleVaultsClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkeyvault.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVaultsClient().CheckNameAvailability(ctx, armkeyvault.VaultCheckNameAvailabilityParameters{ - Name: to.Ptr("sample-vault"), - Type: to.Ptr("Microsoft.KeyVault/vaults"), - }, 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 = armkeyvault.CheckNameAvailabilityResult{ - // NameAvailable: to.Ptr(true), - // } -}