From ccbf3d9019f1dbc5ad46a33de87ce5db4a2691b3 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 1 May 2023 19:22:34 +0000 Subject: [PATCH] CodeGen from PR 23778 in Azure/azure-rest-api-specs Merge 0d8420e253b1419b2a4a19a6015e412b473a7b75 into be4adb7c2681e82c81c25902bb5e4964229a79a2 --- .../armappconfiguration/CHANGELOG.md | 4 + .../armappconfiguration/autorest.md | 7 +- ...configurationstores_client_example_test.go | 896 ------------------ .../armappconfiguration/constants.go | 2 +- .../armappconfiguration/go.mod | 14 +- .../armappconfiguration/go.sum | 22 +- .../armappconfiguration/keyvalues_client.go | 13 +- .../keyvalues_client_example_test.go | 125 --- .../operations_client_example_test.go | 554 ----------- ...endpointconnections_client_example_test.go | 167 ---- ...rivatelinkresources_client_example_test.go | 90 -- .../replicas_client_example_test.go | 186 ---- 12 files changed, 23 insertions(+), 2057 deletions(-) delete mode 100644 sdk/resourcemanager/appconfiguration/armappconfiguration/configurationstores_client_example_test.go delete mode 100644 sdk/resourcemanager/appconfiguration/armappconfiguration/keyvalues_client_example_test.go delete mode 100644 sdk/resourcemanager/appconfiguration/armappconfiguration/operations_client_example_test.go delete mode 100644 sdk/resourcemanager/appconfiguration/armappconfiguration/privateendpointconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/appconfiguration/armappconfiguration/privatelinkresources_client_example_test.go delete mode 100644 sdk/resourcemanager/appconfiguration/armappconfiguration/replicas_client_example_test.go diff --git a/sdk/resourcemanager/appconfiguration/armappconfiguration/CHANGELOG.md b/sdk/resourcemanager/appconfiguration/armappconfiguration/CHANGELOG.md index 6a90eac4bd4b..18a48b41141c 100644 --- a/sdk/resourcemanager/appconfiguration/armappconfiguration/CHANGELOG.md +++ b/sdk/resourcemanager/appconfiguration/armappconfiguration/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 2.0.1 (2023-05-01) +### Other Changes + + ## 2.0.0 (2023-04-28) ### Breaking Changes diff --git a/sdk/resourcemanager/appconfiguration/armappconfiguration/autorest.md b/sdk/resourcemanager/appconfiguration/armappconfiguration/autorest.md index cb5f774cf8ce..689c06a30993 100644 --- a/sdk/resourcemanager/appconfiguration/armappconfiguration/autorest.md +++ b/sdk/resourcemanager/appconfiguration/armappconfiguration/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appconfiguration/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appconfiguration/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/appconfiguration/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/appconfiguration/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 2.0.0 -tag: package-2023-03-01 +module-version: 2.0.1 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/appconfiguration/armappconfiguration/configurationstores_client_example_test.go b/sdk/resourcemanager/appconfiguration/armappconfiguration/configurationstores_client_example_test.go deleted file mode 100644 index 4c80dff6cda8..000000000000 --- a/sdk/resourcemanager/appconfiguration/armappconfiguration/configurationstores_client_example_test.go +++ /dev/null @@ -1,896 +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 armappconfiguration_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/appconfiguration/armappconfiguration/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresList.json -func ExampleConfigurationStoresClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewConfigurationStoresClient().NewListPager(&armappconfiguration.ConfigurationStoresClientListOptions{SkipToken: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ConfigurationStoreListResult = armappconfiguration.ConfigurationStoreListResult{ - // Value: []*armappconfiguration.ConfigurationStore{ - // { - // Name: to.Ptr("contoso"), - // Type: to.Ptr("Microsoft.AppConfiguration/configurationStores"), - // ID: to.Ptr("/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/resourceGroups/myResourceGroup/providers/Microsoft.AppConfiguration/configurationStores/contoso"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // }, - // Identity: &armappconfiguration.ResourceIdentity{ - // Type: to.Ptr(armappconfiguration.IdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA"), - // TenantID: to.Ptr("BBBBBBBB-BBBB-BBBB-BBBB-BBBBBBBBBBBB"), - // }, - // Properties: &armappconfiguration.ConfigurationStoreProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55+00:00"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // Encryption: &armappconfiguration.EncryptionProperties{ - // KeyVaultProperties: &armappconfiguration.KeyVaultProperties{ - // }, - // }, - // Endpoint: to.Ptr("https://contoso.azconfig.io"), - // PrivateEndpointConnections: []*armappconfiguration.PrivateEndpointConnectionReference{ - // }, - // ProvisioningState: to.Ptr(armappconfiguration.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armappconfiguration.PublicNetworkAccessDisabled), - // }, - // SKU: &armappconfiguration.SKU{ - // Name: to.Ptr("Standard"), - // }, - // SystemData: &armappconfiguration.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55+00:00"); return t}()), - // CreatedBy: to.Ptr("foo@contoso.com"), - // CreatedByType: to.Ptr(armappconfiguration.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55+00:00"); return t}()), - // LastModifiedBy: to.Ptr("foo@contoso.com"), - // LastModifiedByType: to.Ptr(armappconfiguration.CreatedByTypeUser), - // }, - // }, - // { - // Name: to.Ptr("contoso2"), - // Type: to.Ptr("Microsoft.AppConfiguration/configurationStores"), - // ID: to.Ptr("/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/resourceGroups/myResourceGroup/providers/Microsoft.AppConfiguration/configurationStores/contoso2"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // }, - // Identity: &armappconfiguration.ResourceIdentity{ - // Type: to.Ptr(armappconfiguration.IdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("CCCCCCCC-CCCC-CCCC-CCCC-CCCCCCCCCCCC"), - // TenantID: to.Ptr("BBBBBBBB-BBBB-BBBB-BBBB-BBBBBBBBBBBB"), - // }, - // Properties: &armappconfiguration.ConfigurationStoreProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T23:06:59+00:00"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // Encryption: &armappconfiguration.EncryptionProperties{ - // KeyVaultProperties: &armappconfiguration.KeyVaultProperties{ - // }, - // }, - // Endpoint: to.Ptr("https://contoso2.azconfig.io"), - // PrivateEndpointConnections: []*armappconfiguration.PrivateEndpointConnectionReference{ - // }, - // ProvisioningState: to.Ptr(armappconfiguration.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armappconfiguration.PublicNetworkAccessDisabled), - // }, - // SKU: &armappconfiguration.SKU{ - // Name: to.Ptr("Standard"), - // }, - // SystemData: &armappconfiguration.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55+00:00"); return t}()), - // CreatedBy: to.Ptr("foo@contoso.com"), - // CreatedByType: to.Ptr(armappconfiguration.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55+00:00"); return t}()), - // LastModifiedBy: to.Ptr("foo@contoso.com"), - // LastModifiedByType: to.Ptr(armappconfiguration.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresListByResourceGroup.json -func ExampleConfigurationStoresClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewConfigurationStoresClient().NewListByResourceGroupPager("myResourceGroup", &armappconfiguration.ConfigurationStoresClientListByResourceGroupOptions{SkipToken: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ConfigurationStoreListResult = armappconfiguration.ConfigurationStoreListResult{ - // Value: []*armappconfiguration.ConfigurationStore{ - // { - // Name: to.Ptr("contoso"), - // Type: to.Ptr("Microsoft.AppConfiguration/configurationStores"), - // ID: to.Ptr("/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/resourceGroups/myResourceGroup/providers/Microsoft.AppConfiguration/configurationStores/contoso"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // }, - // Properties: &armappconfiguration.ConfigurationStoreProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55+00:00"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // Encryption: &armappconfiguration.EncryptionProperties{ - // KeyVaultProperties: &armappconfiguration.KeyVaultProperties{ - // }, - // }, - // Endpoint: to.Ptr("https://contoso.azconfig.io"), - // PrivateEndpointConnections: []*armappconfiguration.PrivateEndpointConnectionReference{ - // }, - // ProvisioningState: to.Ptr(armappconfiguration.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armappconfiguration.PublicNetworkAccessDisabled), - // }, - // SKU: &armappconfiguration.SKU{ - // Name: to.Ptr("Standard"), - // }, - // SystemData: &armappconfiguration.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55+00:00"); return t}()), - // CreatedBy: to.Ptr("foo@contoso.com"), - // CreatedByType: to.Ptr(armappconfiguration.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55+00:00"); return t}()), - // LastModifiedBy: to.Ptr("foo@contoso.com"), - // LastModifiedByType: to.Ptr(armappconfiguration.CreatedByTypeUser), - // }, - // }, - // { - // Name: to.Ptr("contoso2"), - // Type: to.Ptr("Microsoft.AppConfiguration/configurationStores"), - // ID: to.Ptr("/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/resourceGroups/myResourceGroup/providers/Microsoft.AppConfiguration/configurationStores/contoso2"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // }, - // Properties: &armappconfiguration.ConfigurationStoreProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T23:06:59+00:00"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // Encryption: &armappconfiguration.EncryptionProperties{ - // KeyVaultProperties: &armappconfiguration.KeyVaultProperties{ - // }, - // }, - // Endpoint: to.Ptr("https://contoso2.azconfig.io"), - // PrivateEndpointConnections: []*armappconfiguration.PrivateEndpointConnectionReference{ - // }, - // ProvisioningState: to.Ptr(armappconfiguration.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armappconfiguration.PublicNetworkAccessDisabled), - // }, - // SKU: &armappconfiguration.SKU{ - // Name: to.Ptr("Standard"), - // }, - // SystemData: &armappconfiguration.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55+00:00"); return t}()), - // CreatedBy: to.Ptr("foo@contoso.com"), - // CreatedByType: to.Ptr(armappconfiguration.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55+00:00"); return t}()), - // LastModifiedBy: to.Ptr("foo@contoso.com"), - // LastModifiedByType: to.Ptr(armappconfiguration.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresGet.json -func ExampleConfigurationStoresClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewConfigurationStoresClient().Get(ctx, "myResourceGroup", "contoso", 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.ConfigurationStore = armappconfiguration.ConfigurationStore{ - // Name: to.Ptr("contoso"), - // Type: to.Ptr("Microsoft.AppConfiguration/configurationStores"), - // ID: to.Ptr("/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/resourceGroups/myResourceGroup/providers/Microsoft.AppConfiguration/configurationStores/contoso"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // }, - // Identity: &armappconfiguration.ResourceIdentity{ - // Type: to.Ptr(armappconfiguration.IdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA"), - // TenantID: to.Ptr("BBBBBBBB-BBBB-BBBB-BBBB-BBBBBBBBBBBB"), - // }, - // Properties: &armappconfiguration.ConfigurationStoreProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55+00:00"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // Encryption: &armappconfiguration.EncryptionProperties{ - // KeyVaultProperties: &armappconfiguration.KeyVaultProperties{ - // }, - // }, - // Endpoint: to.Ptr("https://contoso.azconfig.io"), - // PrivateEndpointConnections: []*armappconfiguration.PrivateEndpointConnectionReference{ - // }, - // ProvisioningState: to.Ptr(armappconfiguration.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armappconfiguration.PublicNetworkAccessDisabled), - // }, - // SKU: &armappconfiguration.SKU{ - // Name: to.Ptr("Standard"), - // }, - // SystemData: &armappconfiguration.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55+00:00"); return t}()), - // CreatedBy: to.Ptr("foo@contoso.com"), - // CreatedByType: to.Ptr(armappconfiguration.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55+00:00"); return t}()), - // LastModifiedBy: to.Ptr("foo@contoso.com"), - // LastModifiedByType: to.Ptr(armappconfiguration.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresCreate.json -func ExampleConfigurationStoresClient_BeginCreate_configurationStoresCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConfigurationStoresClient().BeginCreate(ctx, "myResourceGroup", "contoso", armappconfiguration.ConfigurationStore{ - Location: to.Ptr("westus"), - Tags: map[string]*string{ - "myTag": to.Ptr("myTagValue"), - }, - SKU: &armappconfiguration.SKU{ - Name: to.Ptr("Standard"), - }, - }, 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.ConfigurationStore = armappconfiguration.ConfigurationStore{ - // Name: to.Ptr("contoso"), - // Type: to.Ptr("Microsoft.AppConfiguration/configurationStores"), - // ID: to.Ptr("/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/resourceGroups/myResourceGroup/providers/Microsoft.AppConfiguration/configurationStores/contoso"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "myTag": to.Ptr("myTagValue"), - // }, - // Properties: &armappconfiguration.ConfigurationStoreProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55+00:00"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // EnablePurgeProtection: to.Ptr(false), - // Encryption: &armappconfiguration.EncryptionProperties{ - // KeyVaultProperties: &armappconfiguration.KeyVaultProperties{ - // }, - // }, - // Endpoint: to.Ptr("https://contoso.azconfig.io"), - // PrivateEndpointConnections: []*armappconfiguration.PrivateEndpointConnectionReference{ - // }, - // ProvisioningState: to.Ptr(armappconfiguration.ProvisioningStateSucceeded), - // SoftDeleteRetentionInDays: to.Ptr[int32](30), - // }, - // SKU: &armappconfiguration.SKU{ - // Name: to.Ptr("Standard"), - // }, - // SystemData: &armappconfiguration.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55+00:00"); return t}()), - // CreatedBy: to.Ptr("foo@contoso.com"), - // CreatedByType: to.Ptr(armappconfiguration.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55+00:00"); return t}()), - // LastModifiedBy: to.Ptr("foo@contoso.com"), - // LastModifiedByType: to.Ptr(armappconfiguration.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresCreateWithIdentity.json -func ExampleConfigurationStoresClient_BeginCreate_configurationStoresCreateWithIdentity() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConfigurationStoresClient().BeginCreate(ctx, "myResourceGroup", "contoso", armappconfiguration.ConfigurationStore{ - Location: to.Ptr("westus"), - Tags: map[string]*string{ - "myTag": to.Ptr("myTagValue"), - }, - Identity: &armappconfiguration.ResourceIdentity{ - Type: to.Ptr(armappconfiguration.IdentityTypeSystemAssignedUserAssigned), - UserAssignedIdentities: map[string]*armappconfiguration.UserIdentity{ - "/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/resourcegroups/myResourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2": {}, - }, - }, - SKU: &armappconfiguration.SKU{ - Name: to.Ptr("Standard"), - }, - }, 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.ConfigurationStore = armappconfiguration.ConfigurationStore{ - // Name: to.Ptr("contoso"), - // Type: to.Ptr("Microsoft.AppConfiguration/configurationStores"), - // ID: to.Ptr("/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/resourceGroups/myResourceGroup/providers/Microsoft.AppConfiguration/configurationStores/contoso"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "myTag": to.Ptr("myTagValue"), - // }, - // Identity: &armappconfiguration.ResourceIdentity{ - // Type: to.Ptr(armappconfiguration.IdentityTypeSystemAssignedUserAssigned), - // PrincipalID: to.Ptr("AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA"), - // TenantID: to.Ptr("BBBBBBBB-BBBB-BBBB-BBBB-BBBBBBBBBBBB"), - // UserAssignedIdentities: map[string]*armappconfiguration.UserIdentity{ - // "/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/resourcegroups/myResourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2": &armappconfiguration.UserIdentity{ - // ClientID: to.Ptr("CCCCCCCC-CCCC-CCCC-CCCC-CCCCCCCCCCCC"), - // PrincipalID: to.Ptr("DDDDDDDD-DDDD-DDDD-DDDD-DDDDDDDDDDDD"), - // }, - // }, - // }, - // Properties: &armappconfiguration.ConfigurationStoreProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55+00:00"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // Encryption: &armappconfiguration.EncryptionProperties{ - // KeyVaultProperties: &armappconfiguration.KeyVaultProperties{ - // }, - // }, - // Endpoint: to.Ptr("https://contoso.azconfig.io"), - // PrivateEndpointConnections: []*armappconfiguration.PrivateEndpointConnectionReference{ - // }, - // ProvisioningState: to.Ptr(armappconfiguration.ProvisioningStateSucceeded), - // }, - // SKU: &armappconfiguration.SKU{ - // Name: to.Ptr("Standard"), - // }, - // SystemData: &armappconfiguration.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55+00:00"); return t}()), - // CreatedBy: to.Ptr("foo@contoso.com"), - // CreatedByType: to.Ptr(armappconfiguration.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55+00:00"); return t}()), - // LastModifiedBy: to.Ptr("foo@contoso.com"), - // LastModifiedByType: to.Ptr(armappconfiguration.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresCreateWithLocalAuthDisabled.json -func ExampleConfigurationStoresClient_BeginCreate_configurationStoresCreateWithLocalAuthDisabled() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConfigurationStoresClient().BeginCreate(ctx, "myResourceGroup", "contoso", armappconfiguration.ConfigurationStore{ - Location: to.Ptr("westus"), - Properties: &armappconfiguration.ConfigurationStoreProperties{ - DisableLocalAuth: to.Ptr(true), - }, - SKU: &armappconfiguration.SKU{ - Name: to.Ptr("Standard"), - }, - }, 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.ConfigurationStore = armappconfiguration.ConfigurationStore{ - // Name: to.Ptr("contoso"), - // Type: to.Ptr("Microsoft.AppConfiguration/configurationStores"), - // ID: to.Ptr("/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/resourceGroups/myResourceGroup/providers/Microsoft.AppConfiguration/configurationStores/contoso"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // }, - // Properties: &armappconfiguration.ConfigurationStoreProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55+00:00"); return t}()), - // DisableLocalAuth: to.Ptr(true), - // Encryption: &armappconfiguration.EncryptionProperties{ - // KeyVaultProperties: &armappconfiguration.KeyVaultProperties{ - // }, - // }, - // Endpoint: to.Ptr("https://contoso.azconfig.io"), - // PrivateEndpointConnections: []*armappconfiguration.PrivateEndpointConnectionReference{ - // }, - // ProvisioningState: to.Ptr(armappconfiguration.ProvisioningStateSucceeded), - // }, - // SKU: &armappconfiguration.SKU{ - // Name: to.Ptr("Standard"), - // }, - // SystemData: &armappconfiguration.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55+00:00"); return t}()), - // CreatedBy: to.Ptr("foo@contoso.com"), - // CreatedByType: to.Ptr(armappconfiguration.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55+00:00"); return t}()), - // LastModifiedBy: to.Ptr("foo@contoso.com"), - // LastModifiedByType: to.Ptr(armappconfiguration.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresDelete.json -func ExampleConfigurationStoresClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConfigurationStoresClient().BeginDelete(ctx, "myResourceGroup", "contoso", 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/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresUpdate.json -func ExampleConfigurationStoresClient_BeginUpdate_configurationStoresUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConfigurationStoresClient().BeginUpdate(ctx, "myResourceGroup", "contoso", armappconfiguration.ConfigurationStoreUpdateParameters{ - SKU: &armappconfiguration.SKU{ - Name: to.Ptr("Standard"), - }, - Tags: map[string]*string{ - "Category": to.Ptr("Marketing"), - }, - }, 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.ConfigurationStore = armappconfiguration.ConfigurationStore{ - // Name: to.Ptr("contoso"), - // Type: to.Ptr("Microsoft.AppConfiguration/configurationStores"), - // ID: to.Ptr("/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/resourceGroups/myResourceGroup/providers/Microsoft.AppConfiguration/configurationStores/contoso"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "Category": to.Ptr("Marketing"), - // }, - // Properties: &armappconfiguration.ConfigurationStoreProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55+00:00"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // Encryption: &armappconfiguration.EncryptionProperties{ - // KeyVaultProperties: &armappconfiguration.KeyVaultProperties{ - // }, - // }, - // Endpoint: to.Ptr("https://contoso.azconfig.io"), - // PrivateEndpointConnections: []*armappconfiguration.PrivateEndpointConnectionReference{ - // }, - // ProvisioningState: to.Ptr(armappconfiguration.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armappconfiguration.PublicNetworkAccessDisabled), - // }, - // SKU: &armappconfiguration.SKU{ - // Name: to.Ptr("Standard"), - // }, - // SystemData: &armappconfiguration.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55+00:00"); return t}()), - // CreatedBy: to.Ptr("foo@contoso.com"), - // CreatedByType: to.Ptr(armappconfiguration.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55+00:00"); return t}()), - // LastModifiedBy: to.Ptr("foo@contoso.com"), - // LastModifiedByType: to.Ptr(armappconfiguration.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresUpdateDisableLocalAuth.json -func ExampleConfigurationStoresClient_BeginUpdate_configurationStoresUpdateDisableLocalAuth() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConfigurationStoresClient().BeginUpdate(ctx, "myResourceGroup", "contoso", armappconfiguration.ConfigurationStoreUpdateParameters{ - Properties: &armappconfiguration.ConfigurationStorePropertiesUpdateParameters{ - DisableLocalAuth: to.Ptr(true), - }, - SKU: &armappconfiguration.SKU{ - Name: to.Ptr("Standard"), - }, - }, 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.ConfigurationStore = armappconfiguration.ConfigurationStore{ - // Name: to.Ptr("contoso"), - // Type: to.Ptr("Microsoft.AppConfiguration/configurationStores"), - // ID: to.Ptr("/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/resourceGroups/myResourceGroup/providers/Microsoft.AppConfiguration/configurationStores/contoso"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // }, - // Properties: &armappconfiguration.ConfigurationStoreProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55+00:00"); return t}()), - // DisableLocalAuth: to.Ptr(true), - // Encryption: &armappconfiguration.EncryptionProperties{ - // KeyVaultProperties: &armappconfiguration.KeyVaultProperties{ - // }, - // }, - // Endpoint: to.Ptr("https://contoso.azconfig.io"), - // PrivateEndpointConnections: []*armappconfiguration.PrivateEndpointConnectionReference{ - // }, - // ProvisioningState: to.Ptr(armappconfiguration.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armappconfiguration.PublicNetworkAccessDisabled), - // }, - // SKU: &armappconfiguration.SKU{ - // Name: to.Ptr("Standard"), - // }, - // SystemData: &armappconfiguration.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55+00:00"); return t}()), - // CreatedBy: to.Ptr("foo@contoso.com"), - // CreatedByType: to.Ptr(armappconfiguration.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55+00:00"); return t}()), - // LastModifiedBy: to.Ptr("foo@contoso.com"), - // LastModifiedByType: to.Ptr(armappconfiguration.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresUpdateWithIdentity.json -func ExampleConfigurationStoresClient_BeginUpdate_configurationStoresUpdateWithIdentity() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConfigurationStoresClient().BeginUpdate(ctx, "myResourceGroup", "contoso", armappconfiguration.ConfigurationStoreUpdateParameters{ - Identity: &armappconfiguration.ResourceIdentity{ - Type: to.Ptr(armappconfiguration.IdentityTypeSystemAssignedUserAssigned), - UserAssignedIdentities: map[string]*armappconfiguration.UserIdentity{ - "/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/resourcegroups/myResourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2": {}, - }, - }, - SKU: &armappconfiguration.SKU{ - Name: to.Ptr("Standard"), - }, - Tags: map[string]*string{ - "Category": to.Ptr("Marketing"), - }, - }, 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.ConfigurationStore = armappconfiguration.ConfigurationStore{ - // Name: to.Ptr("contoso"), - // Type: to.Ptr("Microsoft.AppConfiguration/configurationStores"), - // ID: to.Ptr("/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/resourceGroups/myResourceGroup/providers/Microsoft.AppConfiguration/configurationStores/contoso"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "Category": to.Ptr("Marketing"), - // }, - // Identity: &armappconfiguration.ResourceIdentity{ - // Type: to.Ptr(armappconfiguration.IdentityTypeSystemAssignedUserAssigned), - // PrincipalID: to.Ptr("AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA"), - // TenantID: to.Ptr("BBBBBBBB-BBBB-BBBB-BBBB-BBBBBBBBBBBB"), - // UserAssignedIdentities: map[string]*armappconfiguration.UserIdentity{ - // "/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/resourcegroups/myResourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2": &armappconfiguration.UserIdentity{ - // ClientID: to.Ptr("CCCCCCCC-CCCC-CCCC-CCCC-CCCCCCCCCCCC"), - // PrincipalID: to.Ptr("DDDDDDDD-DDDD-DDDD-DDDD-DDDDDDDDDDDD"), - // }, - // }, - // }, - // Properties: &armappconfiguration.ConfigurationStoreProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55+00:00"); return t}()), - // DisableLocalAuth: to.Ptr(false), - // Encryption: &armappconfiguration.EncryptionProperties{ - // KeyVaultProperties: &armappconfiguration.KeyVaultProperties{ - // }, - // }, - // Endpoint: to.Ptr("https://contoso.azconfig.io"), - // PrivateEndpointConnections: []*armappconfiguration.PrivateEndpointConnectionReference{ - // }, - // ProvisioningState: to.Ptr(armappconfiguration.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armappconfiguration.PublicNetworkAccessDisabled), - // }, - // SKU: &armappconfiguration.SKU{ - // Name: to.Ptr("Standard"), - // }, - // SystemData: &armappconfiguration.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55+00:00"); return t}()), - // CreatedBy: to.Ptr("foo@contoso.com"), - // CreatedByType: to.Ptr(armappconfiguration.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55+00:00"); return t}()), - // LastModifiedBy: to.Ptr("foo@contoso.com"), - // LastModifiedByType: to.Ptr(armappconfiguration.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresListKeys.json -func ExampleConfigurationStoresClient_NewListKeysPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewConfigurationStoresClient().NewListKeysPager("myResourceGroup", "contoso", &armappconfiguration.ConfigurationStoresClientListKeysOptions{SkipToken: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.APIKeyListResult = armappconfiguration.APIKeyListResult{ - // Value: []*armappconfiguration.APIKey{ - // { - // Name: to.Ptr("Primary"), - // ConnectionString: to.Ptr("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"), - // ID: to.Ptr("439AD01B4BE67DB1"), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:54+00:00"); return t}()), - // ReadOnly: to.Ptr(false), - // Value: to.Ptr("000000000000000000000000000000000000000000000000000000"), - // }, - // { - // Name: to.Ptr("Secondary"), - // ConnectionString: to.Ptr("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"), - // ID: to.Ptr("CB45E100456857B9"), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:54+00:00"); return t}()), - // ReadOnly: to.Ptr(false), - // Value: to.Ptr("000000000000000000000000000000000000000000000000000000"), - // }, - // { - // Name: to.Ptr("Primary Read Only"), - // ConnectionString: to.Ptr("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"), - // ID: to.Ptr("B3AC55B7E71431A9"), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:54+00:00"); return t}()), - // ReadOnly: to.Ptr(true), - // Value: to.Ptr("000000000000000000000000000000000000000000000000000000"), - // }, - // { - // Name: to.Ptr("Secondary Read Only"), - // ConnectionString: to.Ptr("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"), - // ID: to.Ptr("E2AF6A9A89DCC177"), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:54+00:00"); return t}()), - // ReadOnly: to.Ptr(true), - // Value: to.Ptr("000000000000000000000000000000000000000000000000000000"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresRegenerateKey.json -func ExampleConfigurationStoresClient_RegenerateKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewConfigurationStoresClient().RegenerateKey(ctx, "myResourceGroup", "contoso", armappconfiguration.RegenerateKeyParameters{ - ID: to.Ptr("439AD01B4BE67DB1"), - }, 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.APIKey = armappconfiguration.APIKey{ - // Name: to.Ptr("Primary"), - // ConnectionString: to.Ptr("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"), - // ID: to.Ptr("439AD01B4BE67DB1"), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-26T22:59:24.2370906+00:00"); return t}()), - // ReadOnly: to.Ptr(false), - // Value: to.Ptr("000000000000000000000000000000000000000000000000000000"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/DeletedConfigurationStoresList.json -func ExampleConfigurationStoresClient_NewListDeletedPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewConfigurationStoresClient().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.DeletedConfigurationStoreListResult = armappconfiguration.DeletedConfigurationStoreListResult{ - // Value: []*armappconfiguration.DeletedConfigurationStore{ - // { - // Name: to.Ptr("contoso"), - // Type: to.Ptr("Microsoft.AppConfiguration/deletedConfigurationStores"), - // ID: to.Ptr("/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/providers/Microsoft.AppConfiguration/locations/westus/deletedConfigurationStores/contoso"), - // Properties: &armappconfiguration.DeletedConfigurationStoreProperties{ - // ConfigurationStoreID: to.Ptr("/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/resourceGroups/myResourceGroup/providers/Microsoft.AppConfiguration/configurationStores/contoso"), - // 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{ - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/DeletedConfigurationStoresGet.json -func ExampleConfigurationStoresClient_GetDeleted() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewConfigurationStoresClient().GetDeleted(ctx, "westus", "contoso", 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.DeletedConfigurationStore = armappconfiguration.DeletedConfigurationStore{ - // Name: to.Ptr("contoso"), - // Type: to.Ptr("Microsoft.AppConfiguration/deletedConfigurationStores"), - // ID: to.Ptr("/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/providers/Microsoft.AppConfiguration/locations/westus/deletedConfigurationStores/contoso"), - // Properties: &armappconfiguration.DeletedConfigurationStoreProperties{ - // ConfigurationStoreID: to.Ptr("/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/resourceGroups/myResourceGroup/providers/Microsoft.AppConfiguration/configurationStores/contoso"), - // 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{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/DeletedConfigurationStoresPurge.json -func ExampleConfigurationStoresClient_BeginPurgeDeleted() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConfigurationStoresClient().BeginPurgeDeleted(ctx, "westus", "contoso", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/appconfiguration/armappconfiguration/constants.go b/sdk/resourcemanager/appconfiguration/armappconfiguration/constants.go index a93a5cbb8349..ae8efd01cc9d 100644 --- a/sdk/resourcemanager/appconfiguration/armappconfiguration/constants.go +++ b/sdk/resourcemanager/appconfiguration/armappconfiguration/constants.go @@ -11,7 +11,7 @@ package armappconfiguration const ( moduleName = "armappconfiguration" - moduleVersion = "v2.0.0" + moduleVersion = "v2.0.1" ) // ActionsRequired - Any action that is required beyond basic workflow (approve/ reject/ disconnect) diff --git a/sdk/resourcemanager/appconfiguration/armappconfiguration/go.mod b/sdk/resourcemanager/appconfiguration/armappconfiguration/go.mod index 2848627341ac..d11b980b0a5b 100644 --- a/sdk/resourcemanager/appconfiguration/armappconfiguration/go.mod +++ b/sdk/resourcemanager/appconfiguration/armappconfiguration/go.mod @@ -2,20 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appconfiguration/ar 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.2 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 // indirect - github.com/golang-jwt/jwt/v4 v4.5.0 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect - golang.org/x/crypto v0.6.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.7.0 // indirect - golang.org/x/sys v0.5.0 // indirect golang.org/x/text v0.7.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/appconfiguration/armappconfiguration/go.sum b/sdk/resourcemanager/appconfiguration/armappconfiguration/go.sum index 8ba445a8c4da..b6bd7eaad1ba 100644 --- a/sdk/resourcemanager/appconfiguration/armappconfiguration/go.sum +++ b/sdk/resourcemanager/appconfiguration/armappconfiguration/go.sum @@ -1,31 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 h1:rTnT/Jrcm+figWlYz4Ixzt0SJVR2cMC8lvZcimipiEY= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0/go.mod h1:ON4tFdPTwRcgWEaVDrN3584Ef+b7GgSJaXxe5fW9t4M= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 h1:uqM+VoHjVH6zdlkLF2b6O0ZANcHoj3rO0PoQ3jglUJA= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2/go.mod h1:twTKAa1E6hLmSDjLhaCkbTMQKc7p/rNLU40rLxGEOCI= github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 h1:leh5DwKv6Ihwi+h60uHtn6UWAxBbZ0q8DwQVMzf61zw= github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 h1:UE9n9rkJF62ArLb1F3DEjRt8O3jLwMWdSoypKV4f3MU= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= -github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= -golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/appconfiguration/armappconfiguration/keyvalues_client.go b/sdk/resourcemanager/appconfiguration/armappconfiguration/keyvalues_client.go index ea17cdd2e79e..a060158f19ae 100644 --- a/sdk/resourcemanager/appconfiguration/armappconfiguration/keyvalues_client.go +++ b/sdk/resourcemanager/appconfiguration/armappconfiguration/keyvalues_client.go @@ -44,7 +44,8 @@ func NewKeyValuesClient(subscriptionID string, credential azcore.TokenCredential return client, nil } -// CreateOrUpdate - Creates a key-value. +// CreateOrUpdate - Creates a key-value. NOTE: This operation is intended for use in ARM Template deployments. For all other +// scenarios involving App Configuration key-values the data plane API should be used instead. // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2023-03-01 @@ -110,7 +111,8 @@ func (client *KeyValuesClient) createOrUpdateHandleResponse(resp *http.Response) return result, nil } -// BeginDelete - Deletes a key-value. +// BeginDelete - Deletes a key-value. NOTE: This operation is intended for use in ARM Template deployments. For all other +// scenarios involving App Configuration key-values the data plane API should be used instead. // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2023-03-01 @@ -130,7 +132,8 @@ func (client *KeyValuesClient) BeginDelete(ctx context.Context, resourceGroupNam } } -// Delete - Deletes a key-value. +// Delete - Deletes a key-value. NOTE: This operation is intended for use in ARM Template deployments. For all other scenarios +// involving App Configuration key-values the data plane API should be used instead. // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2023-03-01 @@ -179,7 +182,9 @@ func (client *KeyValuesClient) deleteCreateRequest(ctx context.Context, resource return req, nil } -// Get - Gets the properties of the specified key-value. +// Get - Gets the properties of the specified key-value. NOTE: This operation is intended for use in ARM Template deployments. +// For all other scenarios involving App Configuration key-values the data plane API +// should be used instead. // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2023-03-01 diff --git a/sdk/resourcemanager/appconfiguration/armappconfiguration/keyvalues_client_example_test.go b/sdk/resourcemanager/appconfiguration/armappconfiguration/keyvalues_client_example_test.go deleted file mode 100644 index 3794b4d6c917..000000000000 --- a/sdk/resourcemanager/appconfiguration/armappconfiguration/keyvalues_client_example_test.go +++ /dev/null @@ -1,125 +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 armappconfiguration_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/appconfiguration/armappconfiguration/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresGetKeyValue.json -func ExampleKeyValuesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewKeyValuesClient().Get(ctx, "myResourceGroup", "contoso", "myKey$myLabel", 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.KeyValue = armappconfiguration.KeyValue{ - // Name: to.Ptr("myKey$myLabel"), - // Type: to.Ptr("Microsoft.AppConfiguration/configurationStores/keyValues"), - // ID: to.Ptr("/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/resourceGroups/myResourceGroup/providers/Microsoft.AppConfiguration/configurationStores/contoso/keyValues/myKey$myLabel"), - // Properties: &armappconfiguration.KeyValueProperties{ - // ContentType: to.Ptr(""), - // ETag: to.Ptr("IhDxoa8VkXxPsYsemBlxvV0d5fp"), - // Key: to.Ptr("myKey"), - // Label: to.Ptr("myLabel"), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-23T06:42:24+00:00"); return t}()), - // Locked: to.Ptr(false), - // Tags: map[string]*string{ - // "tag1": to.Ptr("tagValue1"), - // "tag2": to.Ptr("tagValue2"), - // }, - // Value: to.Ptr("myValue"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresCreateKeyValue.json -func ExampleKeyValuesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewKeyValuesClient().CreateOrUpdate(ctx, "myResourceGroup", "contoso", "myKey$myLabel", &armappconfiguration.KeyValuesClientCreateOrUpdateOptions{KeyValueParameters: &armappconfiguration.KeyValue{ - Properties: &armappconfiguration.KeyValueProperties{ - Tags: map[string]*string{ - "tag1": to.Ptr("tagValue1"), - "tag2": to.Ptr("tagValue2"), - }, - Value: to.Ptr("myValue"), - }, - }, - }) - 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.KeyValue = armappconfiguration.KeyValue{ - // Name: to.Ptr("myKey$myLabel"), - // Type: to.Ptr("Microsoft.AppConfiguration/configurationStores/keyValues"), - // ID: to.Ptr("/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/resourceGroups/myResourceGroup/providers/Microsoft.AppConfiguration/configurationStores/contoso/keyValues/myKey$myLabel"), - // Properties: &armappconfiguration.KeyValueProperties{ - // ContentType: to.Ptr(""), - // ETag: to.Ptr("IhDxoa8VkXxPsYsemBlxvV0d5fp"), - // Key: to.Ptr("myKey"), - // Label: to.Ptr("myLabel"), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-23T06:42:24+00:00"); return t}()), - // Locked: to.Ptr(false), - // Tags: map[string]*string{ - // "tag1": to.Ptr("tagValue1"), - // "tag2": to.Ptr("tagValue2"), - // }, - // Value: to.Ptr("myValue"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresDeleteKeyValue.json -func ExampleKeyValuesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewKeyValuesClient().BeginDelete(ctx, "myResourceGroup", "contoso", "myKey$myLabel", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/appconfiguration/armappconfiguration/operations_client_example_test.go b/sdk/resourcemanager/appconfiguration/armappconfiguration/operations_client_example_test.go deleted file mode 100644 index 2ca815cb8000..000000000000 --- a/sdk/resourcemanager/appconfiguration/armappconfiguration/operations_client_example_test.go +++ /dev/null @@ -1,554 +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 armappconfiguration_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/appconfiguration/armappconfiguration/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/CheckNameAvailable.json -func ExampleOperationsClient_CheckNameAvailability_configurationStoresCheckNameAvailable() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOperationsClient().CheckNameAvailability(ctx, armappconfiguration.CheckNameAvailabilityParameters{ - Name: to.Ptr("contoso"), - Type: to.Ptr(armappconfiguration.ConfigurationResourceTypeMicrosoftAppConfigurationConfigurationStores), - }, 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.NameAvailabilityStatus = armappconfiguration.NameAvailabilityStatus{ - // Message: to.Ptr("The specified name is available."), - // NameAvailable: to.Ptr(true), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/CheckNameNotAvailable.json -func ExampleOperationsClient_CheckNameAvailability_configurationStoresCheckNameNotAvailable() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOperationsClient().CheckNameAvailability(ctx, armappconfiguration.CheckNameAvailabilityParameters{ - Name: to.Ptr("contoso"), - Type: to.Ptr(armappconfiguration.ConfigurationResourceTypeMicrosoftAppConfigurationConfigurationStores), - }, 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.NameAvailabilityStatus = armappconfiguration.NameAvailabilityStatus{ - // Message: to.Ptr("The specified name is already in use."), - // NameAvailable: to.Ptr(false), - // Reason: to.Ptr("AlreadyExists"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/OperationsList.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 := armappconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(&armappconfiguration.OperationsClientListOptions{SkipToken: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationDefinitionListResult = armappconfiguration.OperationDefinitionListResult{ - // Value: []*armappconfiguration.OperationDefinition{ - // { - // Name: to.Ptr("Microsoft.AppConfiguration/operations/read"), - // Display: &armappconfiguration.OperationDefinitionDisplay{ - // Description: to.Ptr("Lists all of the operations supported by Microsoft App Configuration."), - // Operation: to.Ptr("List Operations"), - // Provider: to.Ptr("Microsoft App Configuration"), - // Resource: to.Ptr("Operation"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AppConfiguration/register/action"), - // Display: &armappconfiguration.OperationDefinitionDisplay{ - // Description: to.Ptr("Registers a subscription to use Microsoft App Configuration."), - // Operation: to.Ptr("Register for Microsoft App Configuration"), - // Provider: to.Ptr("Microsoft App Configuration"), - // Resource: to.Ptr("Microsoft App Configuration"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AppConfiguration/unregister/action"), - // Display: &armappconfiguration.OperationDefinitionDisplay{ - // Description: to.Ptr("Unregisters a subscription from using Microsoft App Configuration."), - // Operation: to.Ptr("Unregister for Microsoft App Configuration"), - // Provider: to.Ptr("Microsoft App Configuration"), - // Resource: to.Ptr("Microsoft App Configuration"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AppConfiguration/locations/operationsStatus/read"), - // Display: &armappconfiguration.OperationDefinitionDisplay{ - // Description: to.Ptr("Get the status of an operation."), - // Operation: to.Ptr("Get Operation Status"), - // Provider: to.Ptr("Microsoft App Configuration"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AppConfiguration/checkNameAvailability/read"), - // Display: &armappconfiguration.OperationDefinitionDisplay{ - // Description: to.Ptr("Check whether the resource name is available for use."), - // Operation: to.Ptr("Check Name Availability"), - // Provider: to.Ptr("Microsoft App Configuration"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AppConfiguration/locations/checkNameAvailability/read"), - // Display: &armappconfiguration.OperationDefinitionDisplay{ - // Description: to.Ptr("Check whether the resource name is available for use."), - // Operation: to.Ptr("Check Name Availability"), - // Provider: to.Ptr("Microsoft App Configuration"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AppConfiguration/configurationStores/read"), - // Display: &armappconfiguration.OperationDefinitionDisplay{ - // Description: to.Ptr("Gets the properties of the specified configuration store or lists all the configuration stores under the specified resource group or subscription."), - // Operation: to.Ptr("Get Configuration Store or List Configuration Stores"), - // Provider: to.Ptr("Microsoft App Configuration"), - // Resource: to.Ptr("Configuration Store"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AppConfiguration/configurationStores/write"), - // Display: &armappconfiguration.OperationDefinitionDisplay{ - // Description: to.Ptr("Create or update a configuration store with the specified parameters."), - // Operation: to.Ptr("Create or Update Configuration Store"), - // Provider: to.Ptr("Microsoft App Configuration"), - // Resource: to.Ptr("Configuration Store"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AppConfiguration/configurationStores/delete"), - // Display: &armappconfiguration.OperationDefinitionDisplay{ - // Description: to.Ptr("Deletes a configuration store."), - // Operation: to.Ptr("Delete Configuration Store"), - // Provider: to.Ptr("Microsoft App Configuration"), - // Resource: to.Ptr("Configuration Store"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AppConfiguration/configurationStores/ListKeys/action"), - // Display: &armappconfiguration.OperationDefinitionDisplay{ - // Description: to.Ptr("Lists the API keys for the specified configuration store."), - // Operation: to.Ptr("List Configuration Store API Keys"), - // Provider: to.Ptr("Microsoft App Configuration"), - // Resource: to.Ptr("Configuration Store"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AppConfiguration/configurationStores/RegenerateKey/action"), - // Display: &armappconfiguration.OperationDefinitionDisplay{ - // Description: to.Ptr("Regenerates of the API key's for the specified configuration store."), - // Operation: to.Ptr("Regenerate Configuration Store API Key"), - // Provider: to.Ptr("Microsoft App Configuration"), - // Resource: to.Ptr("Configuration Store"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AppConfiguration/configurationStores/ListKeyValue/action"), - // Display: &armappconfiguration.OperationDefinitionDisplay{ - // Description: to.Ptr("Lists a key-value for the specified configuration store."), - // Operation: to.Ptr("List Configuration Store Key-Value"), - // Provider: to.Ptr("Microsoft App Configuration"), - // Resource: to.Ptr("Configuration Store"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AppConfiguration/configurationStores/eventGridFilters/read"), - // Display: &armappconfiguration.OperationDefinitionDisplay{ - // Description: to.Ptr("Gets the properties of the specified configuration store event grid filter or lists all the configuration store event grid filters under the specified configuration store."), - // Operation: to.Ptr("Get Configuration Store Event Grid Filter or List Configuration Store Event Grid Filters"), - // Provider: to.Ptr("Microsoft App Configuration"), - // Resource: to.Ptr("Configuration Store Event Grid Filter"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AppConfiguration/configurationStores/eventGridFilters/write"), - // Display: &armappconfiguration.OperationDefinitionDisplay{ - // Description: to.Ptr("Create or update a configuration store event grid filter with the specified parameters."), - // Operation: to.Ptr("Create or Update Configuration Store Event Grid Filter"), - // Provider: to.Ptr("Microsoft App Configuration"), - // Resource: to.Ptr("Configuration Store Event Grid Filter"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AppConfiguration/configurationStores/eventGridFilters/delete"), - // Display: &armappconfiguration.OperationDefinitionDisplay{ - // Description: to.Ptr("Deletes a configuration store event grid filter."), - // Operation: to.Ptr("Delete Configuration Store Event Grid Filter"), - // Provider: to.Ptr("Microsoft App Configuration"), - // Resource: to.Ptr("Configuration Store Event Grid Filter"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AppConfiguration/configurationStores/providers/Microsoft.Insights/metricDefinitions/read"), - // Display: &armappconfiguration.OperationDefinitionDisplay{ - // Description: to.Ptr("Retrieve all metric definitions for Microsoft App Configuration."), - // Operation: to.Ptr("Read Configuration Store Metric Definitions"), - // Provider: to.Ptr("Microsoft App Configuration"), - // Resource: to.Ptr("Microsoft App Configuration Metric Definition."), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("System"), - // Properties: &armappconfiguration.OperationProperties{ - // ServiceSpecification: &armappconfiguration.ServiceSpecification{ - // MetricSpecifications: []*armappconfiguration.MetricSpecification{ - // { - // Name: to.Ptr("HttpIncomingRequestCount"), - // AggregationType: to.Ptr("Count"), - // Dimensions: []*armappconfiguration.MetricDimension{ - // { - // Name: to.Ptr("StatusCode"), - // DisplayName: to.Ptr("HttpStatusCode"), - // InternalName: to.Ptr("StatusCode"), - // }, - // { - // Name: to.Ptr("Authentication"), - // DisplayName: to.Ptr("AuthenticationScheme"), - // InternalName: to.Ptr("Authentication"), - // }}, - // DisplayDescription: to.Ptr("Total number of incoming http requests."), - // DisplayName: to.Ptr("HttpIncomingRequestCount"), - // FillGapWithZero: to.Ptr(true), - // InternalMetricName: to.Ptr("HttpIncomingRequestCount"), - // Unit: to.Ptr("Count"), - // }, - // { - // Name: to.Ptr("HttpIncomingRequestDuration"), - // AggregationType: to.Ptr("Average"), - // Dimensions: []*armappconfiguration.MetricDimension{ - // { - // Name: to.Ptr("StatusCode"), - // DisplayName: to.Ptr("HttpStatusCode"), - // InternalName: to.Ptr("StatusCode"), - // }, - // { - // Name: to.Ptr("Authentication"), - // DisplayName: to.Ptr("AuthenticationScheme"), - // InternalName: to.Ptr("Authentication"), - // }}, - // DisplayDescription: to.Ptr("Latency on an http request."), - // DisplayName: to.Ptr("HttpIncomingRequestDuration"), - // FillGapWithZero: to.Ptr(true), - // InternalMetricName: to.Ptr("HttpIncomingRequestDuration"), - // Unit: to.Ptr("Count"), - // }, - // { - // Name: to.Ptr("ThrottledHttpRequestCount"), - // AggregationType: to.Ptr("Count"), - // DisplayDescription: to.Ptr("Throttled http requests."), - // DisplayName: to.Ptr("ThrottledHttpRequestCount"), - // FillGapWithZero: to.Ptr(true), - // InternalMetricName: to.Ptr("ThrottledHttpRequestCount"), - // Unit: to.Ptr("Count"), - // }}, - // }, - // }, - // }, - // { - // Name: to.Ptr("Microsoft.AppConfiguration/configurationStores/providers/Microsoft.Insights/diagnosticSettings/read"), - // Display: &armappconfiguration.OperationDefinitionDisplay{ - // Description: to.Ptr("Read all Diagnostic Settings values for a Configuration Store."), - // Operation: to.Ptr("Read Configuration Store Diagnostic Settings"), - // Provider: to.Ptr("Microsoft App Configuration"), - // Resource: to.Ptr("Configuration Store"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("System"), - // }, - // { - // Name: to.Ptr("Microsoft.AppConfiguration/configurationStores/providers/Microsoft.Insights/diagnosticSettings/write"), - // Display: &armappconfiguration.OperationDefinitionDisplay{ - // Description: to.Ptr("Write/Overwrite Diagnostic Settings for Microsoft App Configuration."), - // Operation: to.Ptr("Write Configuration Store Diagnostic Settings"), - // Provider: to.Ptr("Microsoft App Configuration"), - // Resource: to.Ptr("Configuration Store"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("System"), - // }, - // { - // Name: to.Ptr("Microsoft.AppConfiguration/configurationStores/providers/Microsoft.Insights/logDefinitions/read"), - // Display: &armappconfiguration.OperationDefinitionDisplay{ - // Description: to.Ptr("Retrieve all log definitions for Microsoft App Configuration."), - // Operation: to.Ptr("Read Configuration Store Log Definitions"), - // Provider: to.Ptr("Microsoft App Configuration"), - // Resource: to.Ptr("Microsoft App Configuration Log Definition."), - // }, - // IsDataAction: to.Ptr(false), - // Properties: &armappconfiguration.OperationProperties{ - // ServiceSpecification: &armappconfiguration.ServiceSpecification{ - // LogSpecifications: []*armappconfiguration.LogSpecification{ - // { - // Name: to.Ptr("HttpRequest"), - // DisplayName: to.Ptr("HTTP Requests"), - // }, - // { - // Name: to.Ptr("Audit"), - // DisplayName: to.Ptr("Audit"), - // }}, - // }, - // }, - // }, - // { - // Name: to.Ptr("Microsoft.AppConfiguration/configurationStores/privateEndpointConnectionProxies/validate/action"), - // Display: &armappconfiguration.OperationDefinitionDisplay{ - // Description: to.Ptr("Validate a private endpoint connection proxy under the specified configuration store."), - // Operation: to.Ptr("Validate Private Endpoint Connection Proxy"), - // Provider: to.Ptr("Microsoft App Configuration"), - // Resource: to.Ptr("Private Endpoint Connection Proxy"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AppConfiguration/configurationStores/privateEndpointConnectionProxies/read"), - // Display: &armappconfiguration.OperationDefinitionDisplay{ - // Description: to.Ptr("Get a private endpoint connection proxy under the specified configuration store."), - // Operation: to.Ptr("Get Private Endpoint Connection Proxy"), - // Provider: to.Ptr("Microsoft App Configuration"), - // Resource: to.Ptr("Private Endpoint Connection Proxy"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AppConfiguration/configurationStores/privateEndpointConnectionProxies/write"), - // Display: &armappconfiguration.OperationDefinitionDisplay{ - // Description: to.Ptr("Create or update a private endpoint connection proxy under the specified configuration store."), - // Operation: to.Ptr("Create or Update Private Endpoint Connection Proxy"), - // Provider: to.Ptr("Microsoft App Configuration"), - // Resource: to.Ptr("Private Endpoint Connection Proxy"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AppConfiguration/configurationStores/privateEndpointConnectionProxies/delete"), - // Display: &armappconfiguration.OperationDefinitionDisplay{ - // Description: to.Ptr("Delete a private endpoint connection proxy under the specified configuration store."), - // Operation: to.Ptr("Delete Private Endpoint Connection Proxy"), - // Provider: to.Ptr("Microsoft App Configuration"), - // Resource: to.Ptr("Private Endpoint Connection Proxy"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AppConfiguration/configurationStores/privateEndpointConnections/read"), - // Display: &armappconfiguration.OperationDefinitionDisplay{ - // Description: to.Ptr("Get a private endpoint connection or list private endpoint connections under the specified configuration store."), - // Operation: to.Ptr("Get Private Endpoint Connection or List Private Endpoint Connections"), - // Provider: to.Ptr("Microsoft App Configuration"), - // Resource: to.Ptr("Private Endpoint Connection"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AppConfiguration/configurationStores/privateEndpointConnections/write"), - // Display: &armappconfiguration.OperationDefinitionDisplay{ - // Description: to.Ptr("Approve or reject a private endpoint connection under the specified configuration store."), - // Operation: to.Ptr("Approve or Reject Private Endpoint Connection"), - // Provider: to.Ptr("Microsoft App Configuration"), - // Resource: to.Ptr("Private Endpoint Connection"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AppConfiguration/configurationStores/privateEndpointConnections/delete"), - // Display: &armappconfiguration.OperationDefinitionDisplay{ - // Description: to.Ptr("Delete a private endpoint connection under the specified configuration store."), - // Operation: to.Ptr("Delete Private Endpoint Connection"), - // Provider: to.Ptr("Microsoft App Configuration"), - // Resource: to.Ptr("Private Endpoint Connection"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AppConfiguration/configurationStores/PrivateEndpointConnectionsApproval/action"), - // Display: &armappconfiguration.OperationDefinitionDisplay{ - // Description: to.Ptr("Auto-Approve a private endpoint connection under the specified configuration store."), - // Operation: to.Ptr("Auto-Approve Private Endpoint Connection"), - // Provider: to.Ptr("Microsoft App Configuration"), - // Resource: to.Ptr("Private Endpoint Connection"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AppConfiguration/configurationStores/privateLinkResources/read"), - // Display: &armappconfiguration.OperationDefinitionDisplay{ - // Description: to.Ptr("Lists all the private link resources under the specified configuration store."), - // Operation: to.Ptr("List Private Link"), - // Provider: to.Ptr("Microsoft App Configuration"), - // Resource: to.Ptr("Private Link"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AppConfiguration/configurationStores/keyValues/read"), - // Display: &armappconfiguration.OperationDefinitionDisplay{ - // Description: to.Ptr("Reads a key-value from the configuration store."), - // Operation: to.Ptr("Read Key-Value"), - // Provider: to.Ptr("Microsoft App Configuration"), - // Resource: to.Ptr("Key-Value"), - // }, - // IsDataAction: to.Ptr(true), - // }, - // { - // Name: to.Ptr("Microsoft.AppConfiguration/configurationStores/keyValues/write"), - // Display: &armappconfiguration.OperationDefinitionDisplay{ - // Description: to.Ptr("Creates or updates a key-value in the configuration store."), - // Operation: to.Ptr("Write Key-Value"), - // Provider: to.Ptr("Microsoft App Configuration"), - // Resource: to.Ptr("Key-Value"), - // }, - // IsDataAction: to.Ptr(true), - // }, - // { - // Name: to.Ptr("Microsoft.AppConfiguration/configurationStores/keyValues/delete"), - // Display: &armappconfiguration.OperationDefinitionDisplay{ - // Description: to.Ptr("Deletes an existing key-value from the configuration store."), - // Operation: to.Ptr("Delete Key-Value"), - // Provider: to.Ptr("Microsoft App Configuration"), - // Resource: to.Ptr("Key-Value"), - // }, - // IsDataAction: to.Ptr(true), - // }, - // { - // Name: to.Ptr("Microsoft.AppConfiguration/locations/deletedConfigurationStores/read"), - // Display: &armappconfiguration.OperationDefinitionDisplay{ - // Description: to.Ptr("Gets the properties of the specified deleted configuration store or lists all the deleted configuration stores under the specified subscription."), - // Operation: to.Ptr("Get Deleted Configuration Store or List Deleted Configuration Stores"), - // Provider: to.Ptr("Microsoft App Configuration"), - // Resource: to.Ptr("Deleted Configuration Store"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AppConfiguration/locations/deletedConfigurationStores/purge/action"), - // Display: &armappconfiguration.OperationDefinitionDisplay{ - // Description: to.Ptr("Purge the specified deleted configuration store."), - // Operation: to.Ptr("Purge Deleted Configuration Store"), - // Provider: to.Ptr("Microsoft App Configuration"), - // Resource: to.Ptr("Deleted Configuration Store"), - // }, - // IsDataAction: to.Ptr(false), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/RegionalCheckNameAvailable.json -func ExampleOperationsClient_RegionalCheckNameAvailability_configurationStoresCheckNameAvailable() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOperationsClient().RegionalCheckNameAvailability(ctx, "westus", armappconfiguration.CheckNameAvailabilityParameters{ - Name: to.Ptr("contoso"), - Type: to.Ptr(armappconfiguration.ConfigurationResourceTypeMicrosoftAppConfigurationConfigurationStores), - }, 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.NameAvailabilityStatus = armappconfiguration.NameAvailabilityStatus{ - // Message: to.Ptr("The specified name is available."), - // NameAvailable: to.Ptr(true), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/RegionalCheckNameNotAvailable.json -func ExampleOperationsClient_RegionalCheckNameAvailability_configurationStoresCheckNameNotAvailable() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOperationsClient().RegionalCheckNameAvailability(ctx, "westus", armappconfiguration.CheckNameAvailabilityParameters{ - Name: to.Ptr("contoso"), - Type: to.Ptr(armappconfiguration.ConfigurationResourceTypeMicrosoftAppConfigurationConfigurationStores), - }, 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.NameAvailabilityStatus = armappconfiguration.NameAvailabilityStatus{ - // Message: to.Ptr("The specified name is already in use."), - // NameAvailable: to.Ptr(false), - // Reason: to.Ptr("AlreadyExists"), - // } -} diff --git a/sdk/resourcemanager/appconfiguration/armappconfiguration/privateendpointconnections_client_example_test.go b/sdk/resourcemanager/appconfiguration/armappconfiguration/privateendpointconnections_client_example_test.go deleted file mode 100644 index 51f00a025d67..000000000000 --- a/sdk/resourcemanager/appconfiguration/armappconfiguration/privateendpointconnections_client_example_test.go +++ /dev/null @@ -1,167 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armappconfiguration_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/appconfiguration/armappconfiguration/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresListPrivateEndpointConnections.json -func ExamplePrivateEndpointConnectionsClient_NewListByConfigurationStorePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateEndpointConnectionsClient().NewListByConfigurationStorePager("myResourceGroup", "contoso", 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 = armappconfiguration.PrivateEndpointConnectionListResult{ - // Value: []*armappconfiguration.PrivateEndpointConnection{ - // { - // Name: to.Ptr("myConnection"), - // Type: to.Ptr("Microsoft.AppConfiguration/configurationStores/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/resourceGroups/myResourceGroup/providers/Microsoft.AppConfiguration/configurationStores/contoso/privateEndpointConnections/myConnection"), - // Properties: &armappconfiguration.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armappconfiguration.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/resourceGroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/peexample01"), - // }, - // PrivateLinkServiceConnectionState: &armappconfiguration.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // ActionsRequired: to.Ptr(armappconfiguration.ActionsRequiredNone), - // Status: to.Ptr(armappconfiguration.ConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armappconfiguration.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresGetPrivateEndpointConnection.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 := armappconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateEndpointConnectionsClient().Get(ctx, "myResourceGroup", "contoso", "myConnection", 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 = armappconfiguration.PrivateEndpointConnection{ - // Name: to.Ptr("myConnection"), - // Type: to.Ptr("Microsoft.AppConfiguration/configurationStores/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/resourceGroups/myResourceGroup/providers/Microsoft.AppConfiguration/configurationStores/contoso/privateEndpointConnections/myConnection"), - // Properties: &armappconfiguration.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armappconfiguration.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/resourceGroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/peexample01"), - // }, - // PrivateLinkServiceConnectionState: &armappconfiguration.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // ActionsRequired: to.Ptr(armappconfiguration.ActionsRequiredNone), - // Status: to.Ptr(armappconfiguration.ConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armappconfiguration.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresUpdatePrivateEndpointConnection.json -func ExamplePrivateEndpointConnectionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "contoso", "myConnection", armappconfiguration.PrivateEndpointConnection{ - Properties: &armappconfiguration.PrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armappconfiguration.PrivateLinkServiceConnectionState{ - Description: to.Ptr("Auto-Approved"), - Status: to.Ptr(armappconfiguration.ConnectionStatusApproved), - }, - }, - }, 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 = armappconfiguration.PrivateEndpointConnection{ - // Name: to.Ptr("myConnection"), - // Type: to.Ptr("Microsoft.AppConfiguration/configurationStores/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/resourceGroups/myResourceGroup/providers/Microsoft.AppConfiguration/configurationStores/contoso/privateEndpointConnections/myConnection"), - // Properties: &armappconfiguration.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armappconfiguration.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/resourceGroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/peexample01"), - // }, - // PrivateLinkServiceConnectionState: &armappconfiguration.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // ActionsRequired: to.Ptr(armappconfiguration.ActionsRequiredNone), - // Status: to.Ptr(armappconfiguration.ConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armappconfiguration.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresDeletePrivateEndpointConnection.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 := armappconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginDelete(ctx, "myResourceGroup", "contoso", "myConnection", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/appconfiguration/armappconfiguration/privatelinkresources_client_example_test.go b/sdk/resourcemanager/appconfiguration/armappconfiguration/privatelinkresources_client_example_test.go deleted file mode 100644 index 93e4fb32a0fc..000000000000 --- a/sdk/resourcemanager/appconfiguration/armappconfiguration/privatelinkresources_client_example_test.go +++ /dev/null @@ -1,90 +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 armappconfiguration_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appconfiguration/armappconfiguration/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/PrivateLinkResourcesListByConfigurationStore.json -func ExamplePrivateLinkResourcesClient_NewListByConfigurationStorePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateLinkResourcesClient().NewListByConfigurationStorePager("myResourceGroup", "contoso", 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.PrivateLinkResourceListResult = armappconfiguration.PrivateLinkResourceListResult{ - // Value: []*armappconfiguration.PrivateLinkResource{ - // { - // Name: to.Ptr("configurationStores"), - // Type: to.Ptr("Microsoft.AppConfiguraiton/configurationStores/privateLinkResources"), - // ID: to.Ptr("/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/resourceGroups/myResourceGroup/providers/Microsoft.AppConfiguration/configurationStores/contoso/privateLinkResources/configurationStores"), - // Properties: &armappconfiguration.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("configurationStores"), - // RequiredMembers: []*string{ - // to.Ptr("configurationStores")}, - // RequiredZoneNames: []*string{ - // to.Ptr("privatelink.azconfig.io")}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/PrivateLinkResourceGet.json -func ExamplePrivateLinkResourcesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateLinkResourcesClient().Get(ctx, "myResourceGroup", "contoso", "configurationStores", 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.PrivateLinkResource = armappconfiguration.PrivateLinkResource{ - // Name: to.Ptr("configurationStores"), - // Type: to.Ptr("Microsoft.AppConfiguraiton/configurationStores/privateLinkResources"), - // ID: to.Ptr("/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/resourceGroups/myResourceGroup/providers/Microsoft.AppConfiguration/configurationStores/contoso/privateLinkResources/configurationStores"), - // Properties: &armappconfiguration.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("configurationStores"), - // RequiredMembers: []*string{ - // to.Ptr("configurationStores")}, - // RequiredZoneNames: []*string{ - // to.Ptr("privatelink.azconfig.io")}, - // }, - // } -} diff --git a/sdk/resourcemanager/appconfiguration/armappconfiguration/replicas_client_example_test.go b/sdk/resourcemanager/appconfiguration/armappconfiguration/replicas_client_example_test.go deleted file mode 100644 index b912cdd3da86..000000000000 --- a/sdk/resourcemanager/appconfiguration/armappconfiguration/replicas_client_example_test.go +++ /dev/null @@ -1,186 +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 armappconfiguration_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/appconfiguration/armappconfiguration/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresListReplicas.json -func ExampleReplicasClient_NewListByConfigurationStorePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewReplicasClient().NewListByConfigurationStorePager("myResourceGroup", "contoso", &armappconfiguration.ReplicasClientListByConfigurationStoreOptions{SkipToken: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ReplicaListResult = armappconfiguration.ReplicaListResult{ - // Value: []*armappconfiguration.Replica{ - // { - // Name: to.Ptr("myReplicaEus"), - // Type: to.Ptr("Microsoft.AppConfiguration/configurationStores/replicas"), - // ID: to.Ptr("/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/resourceGroups/myResourceGroup/providers/Microsoft.AppConfiguration/configurationStores/contoso/replicas/myReplicaEus"), - // Location: to.Ptr("eastus"), - // Properties: &armappconfiguration.ReplicaProperties{ - // Endpoint: to.Ptr("https://contoso-myreplicaeus.azconfig.io"), - // ProvisioningState: to.Ptr(armappconfiguration.ReplicaProvisioningStateSucceeded), - // }, - // SystemData: &armappconfiguration.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55+00:00"); return t}()), - // CreatedBy: to.Ptr("foo@contoso.com"), - // CreatedByType: to.Ptr(armappconfiguration.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55+00:00"); return t}()), - // LastModifiedBy: to.Ptr("foo@contoso.com"), - // LastModifiedByType: to.Ptr(armappconfiguration.CreatedByTypeUser), - // }, - // }, - // { - // Name: to.Ptr("myReplicaWestEurope"), - // Type: to.Ptr("Microsoft.AppConfiguration/configurationStores/replicas"), - // ID: to.Ptr("/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/resourceGroups/myResourceGroup/providers/Microsoft.AppConfiguration/configurationStores/contoso/replicas/myReplicaWestEurope"), - // Location: to.Ptr("westeurope"), - // Properties: &armappconfiguration.ReplicaProperties{ - // Endpoint: to.Ptr("https://contoso-myreplicawesteurope.azconfig.io"), - // ProvisioningState: to.Ptr(armappconfiguration.ReplicaProvisioningStateSucceeded), - // }, - // SystemData: &armappconfiguration.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55+00:00"); return t}()), - // CreatedBy: to.Ptr("foo@contoso.com"), - // CreatedByType: to.Ptr(armappconfiguration.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55+00:00"); return t}()), - // LastModifiedBy: to.Ptr("foo@contoso.com"), - // LastModifiedByType: to.Ptr(armappconfiguration.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresGetReplica.json -func ExampleReplicasClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewReplicasClient().Get(ctx, "myResourceGroup", "contoso", "myReplicaEus", 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.Replica = armappconfiguration.Replica{ - // Name: to.Ptr("myReplicaEus"), - // Type: to.Ptr("Microsoft.AppConfiguration/configurationStores/replicas"), - // ID: to.Ptr("/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/resourceGroups/myResourceGroup/providers/Microsoft.AppConfiguration/configurationStores/contoso/replicas/myReplicaEus"), - // Location: to.Ptr("eastus"), - // Properties: &armappconfiguration.ReplicaProperties{ - // Endpoint: to.Ptr("https://contoso-myreplicaeus.azconfig.io"), - // ProvisioningState: to.Ptr(armappconfiguration.ReplicaProvisioningStateSucceeded), - // }, - // SystemData: &armappconfiguration.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55+00:00"); return t}()), - // CreatedBy: to.Ptr("foo@contoso.com"), - // CreatedByType: to.Ptr(armappconfiguration.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55+00:00"); return t}()), - // LastModifiedBy: to.Ptr("foo@contoso.com"), - // LastModifiedByType: to.Ptr(armappconfiguration.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresCreateReplica.json -func ExampleReplicasClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicasClient().BeginCreate(ctx, "myResourceGroup", "contoso", "myReplicaEus", armappconfiguration.Replica{ - Location: to.Ptr("eastus"), - }, 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.Replica = armappconfiguration.Replica{ - // Name: to.Ptr("myReplicaEus"), - // Type: to.Ptr("Microsoft.AppConfiguration/configurationStores/replicas"), - // ID: to.Ptr("/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/resourceGroups/myResourceGroup/providers/Microsoft.AppConfiguration/configurationStores/contoso/replicas/myReplicaEus"), - // Location: to.Ptr("eastus"), - // Properties: &armappconfiguration.ReplicaProperties{ - // Endpoint: to.Ptr("https://contoso-myreplicaeus.azconfig.io"), - // ProvisioningState: to.Ptr(armappconfiguration.ReplicaProvisioningStateSucceeded), - // }, - // SystemData: &armappconfiguration.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55+00:00"); return t}()), - // CreatedBy: to.Ptr("foo@contoso.com"), - // CreatedByType: to.Ptr(armappconfiguration.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55+00:00"); return t}()), - // LastModifiedBy: to.Ptr("foo@contoso.com"), - // LastModifiedByType: to.Ptr(armappconfiguration.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresDeleteReplica.json -func ExampleReplicasClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicasClient().BeginDelete(ctx, "myResourceGroup", "contoso", "myReplicaEus", 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) - } -}