From dc42a21f4d3e089039504f79bb6b4477974b4368 Mon Sep 17 00:00:00 2001 From: ReleaseHelper Date: Tue, 11 Apr 2023 01:17:07 +0000 Subject: [PATCH 1/2] [Release] sdk/resourcemanager/appconfiguration/armappconfiguration/2.0.0 generation from spec commit: 1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291 --- .../armappconfiguration/CHANGELOG.md | 19 + .../armappconfiguration/autorest.md | 7 +- .../armappconfiguration/client_factory.go | 5 + .../configurationstores_client.go | 52 +-- ...configurationstores_client_example_test.go | 32 +- .../armappconfiguration/constants.go | 24 +- .../armappconfiguration/go.mod | 2 +- .../armappconfiguration/keyvalues_client.go | 87 +--- .../keyvalues_client_example_test.go | 72 +-- .../armappconfiguration/models.go | 74 ++- .../armappconfiguration/models_serde.go | 109 +++++ .../armappconfiguration/operations_client.go | 12 +- .../operations_client_example_test.go | 435 +++++++++++++++++- .../privateendpointconnections_client.go | 24 +- ...endpointconnections_client_example_test.go | 10 +- .../privatelinkresources_client.go | 8 +- ...rivatelinkresources_client_example_test.go | 6 +- .../armappconfiguration/replicas_client.go | 323 +++++++++++++ .../replicas_client_example_test.go | 186 ++++++++ .../armappconfiguration/response_types.go | 25 +- 20 files changed, 1270 insertions(+), 242 deletions(-) create mode 100644 sdk/resourcemanager/appconfiguration/armappconfiguration/replicas_client.go create 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 02fe38b192e3..2c6ffff7dd9e 100644 --- a/sdk/resourcemanager/appconfiguration/armappconfiguration/CHANGELOG.md +++ b/sdk/resourcemanager/appconfiguration/armappconfiguration/CHANGELOG.md @@ -1,5 +1,24 @@ # Release History +## 2.0.0 (2023-04-28) +### Breaking Changes + +- Function `*KeyValuesClient.NewListByConfigurationStorePager` has been removed + +### Features Added + +- New enum type `ReplicaProvisioningState` with values `ReplicaProvisioningStateCanceled`, `ReplicaProvisioningStateCreating`, `ReplicaProvisioningStateDeleting`, `ReplicaProvisioningStateFailed`, `ReplicaProvisioningStateSucceeded` +- New function `*ClientFactory.NewReplicasClient() *ReplicasClient` +- New function `NewReplicasClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ReplicasClient, error)` +- New function `*ReplicasClient.BeginCreate(context.Context, string, string, string, Replica, *ReplicasClientBeginCreateOptions) (*runtime.Poller[ReplicasClientCreateResponse], error)` +- New function `*ReplicasClient.BeginDelete(context.Context, string, string, string, *ReplicasClientBeginDeleteOptions) (*runtime.Poller[ReplicasClientDeleteResponse], error)` +- New function `*ReplicasClient.Get(context.Context, string, string, string, *ReplicasClientGetOptions) (ReplicasClientGetResponse, error)` +- New function `*ReplicasClient.NewListByConfigurationStorePager(string, string, *ReplicasClientListByConfigurationStoreOptions) *runtime.Pager[ReplicasClientListByConfigurationStoreResponse]` +- New struct `Replica` +- New struct `ReplicaListResult` +- New struct `ReplicaProperties` + + ## 1.1.0 (2023-03-27) ### Features Added diff --git a/sdk/resourcemanager/appconfiguration/armappconfiguration/autorest.md b/sdk/resourcemanager/appconfiguration/armappconfiguration/autorest.md index f03a364066b4..cb5f774cf8ce 100644 --- a/sdk/resourcemanager/appconfiguration/armappconfiguration/autorest.md +++ b/sdk/resourcemanager/appconfiguration/armappconfiguration/autorest.md @@ -5,8 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/appconfiguration/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/appconfiguration/resource-manager/readme.go.md +- 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 license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.1.0 +module-version: 2.0.0 +tag: package-2023-03-01 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/appconfiguration/armappconfiguration/client_factory.go b/sdk/resourcemanager/appconfiguration/armappconfiguration/client_factory.go index 39572bdd4011..ed5c53ae3be9 100644 --- a/sdk/resourcemanager/appconfiguration/armappconfiguration/client_factory.go +++ b/sdk/resourcemanager/appconfiguration/armappconfiguration/client_factory.go @@ -62,3 +62,8 @@ func (c *ClientFactory) NewKeyValuesClient() *KeyValuesClient { subClient, _ := NewKeyValuesClient(c.subscriptionID, c.credential, c.options) return subClient } + +func (c *ClientFactory) NewReplicasClient() *ReplicasClient { + subClient, _ := NewReplicasClient(c.subscriptionID, c.credential, c.options) + return subClient +} diff --git a/sdk/resourcemanager/appconfiguration/armappconfiguration/configurationstores_client.go b/sdk/resourcemanager/appconfiguration/armappconfiguration/configurationstores_client.go index 132c26b2c1bc..24429c2155d4 100644 --- a/sdk/resourcemanager/appconfiguration/armappconfiguration/configurationstores_client.go +++ b/sdk/resourcemanager/appconfiguration/armappconfiguration/configurationstores_client.go @@ -47,7 +47,7 @@ func NewConfigurationStoresClient(subscriptionID string, credential azcore.Token // BeginCreate - Creates a configuration store with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-03-01 // - resourceGroupName - The name of the resource group to which the container registry belongs. // - configStoreName - The name of the configuration store. // - configStoreCreationParameters - The parameters for creating a configuration store. @@ -68,7 +68,7 @@ func (client *ConfigurationStoresClient) BeginCreate(ctx context.Context, resour // Create - Creates a configuration store with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-03-01 func (client *ConfigurationStoresClient) create(ctx context.Context, resourceGroupName string, configStoreName string, configStoreCreationParameters ConfigurationStore, options *ConfigurationStoresClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, configStoreName, configStoreCreationParameters, options) if err != nil { @@ -104,7 +104,7 @@ func (client *ConfigurationStoresClient) createCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2023-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, configStoreCreationParameters) @@ -113,7 +113,7 @@ func (client *ConfigurationStoresClient) createCreateRequest(ctx context.Context // BeginDelete - Deletes a configuration store. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-03-01 // - resourceGroupName - The name of the resource group to which the container registry belongs. // - configStoreName - The name of the configuration store. // - options - ConfigurationStoresClientBeginDeleteOptions contains the optional parameters for the ConfigurationStoresClient.BeginDelete @@ -133,7 +133,7 @@ func (client *ConfigurationStoresClient) BeginDelete(ctx context.Context, resour // Delete - Deletes a configuration store. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-03-01 func (client *ConfigurationStoresClient) deleteOperation(ctx context.Context, resourceGroupName string, configStoreName string, options *ConfigurationStoresClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, configStoreName, options) if err != nil { @@ -169,7 +169,7 @@ func (client *ConfigurationStoresClient) deleteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2023-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -178,7 +178,7 @@ func (client *ConfigurationStoresClient) deleteCreateRequest(ctx context.Context // Get - Gets the properties of the specified configuration store. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-03-01 // - resourceGroupName - The name of the resource group to which the container registry belongs. // - configStoreName - The name of the configuration store. // - options - ConfigurationStoresClientGetOptions contains the optional parameters for the ConfigurationStoresClient.Get method. @@ -217,7 +217,7 @@ func (client *ConfigurationStoresClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2023-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -235,7 +235,7 @@ func (client *ConfigurationStoresClient) getHandleResponse(resp *http.Response) // GetDeleted - Gets a deleted Azure app configuration store. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-03-01 // - location - The location in which uniqueness will be verified. // - configStoreName - The name of the configuration store. // - options - ConfigurationStoresClientGetDeletedOptions contains the optional parameters for the ConfigurationStoresClient.GetDeleted @@ -275,7 +275,7 @@ func (client *ConfigurationStoresClient) getDeletedCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2023-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -292,7 +292,7 @@ func (client *ConfigurationStoresClient) getDeletedHandleResponse(resp *http.Res // NewListPager - Lists the configuration stores for a given subscription. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-03-01 // - options - ConfigurationStoresClientListOptions contains the optional parameters for the ConfigurationStoresClient.NewListPager // method. func (client *ConfigurationStoresClient) NewListPager(options *ConfigurationStoresClientListOptions) *runtime.Pager[ConfigurationStoresClientListResponse] { @@ -335,7 +335,7 @@ func (client *ConfigurationStoresClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2023-03-01") if options != nil && options.SkipToken != nil { reqQP.Set("$skipToken", *options.SkipToken) } @@ -355,7 +355,7 @@ func (client *ConfigurationStoresClient) listHandleResponse(resp *http.Response) // NewListByResourceGroupPager - Lists the configuration stores for a given resource group. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-03-01 // - resourceGroupName - The name of the resource group to which the container registry belongs. // - options - ConfigurationStoresClientListByResourceGroupOptions contains the optional parameters for the ConfigurationStoresClient.NewListByResourceGroupPager // method. @@ -403,7 +403,7 @@ func (client *ConfigurationStoresClient) listByResourceGroupCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2023-03-01") if options != nil && options.SkipToken != nil { reqQP.Set("$skipToken", *options.SkipToken) } @@ -423,7 +423,7 @@ func (client *ConfigurationStoresClient) listByResourceGroupHandleResponse(resp // NewListDeletedPager - Gets information about the deleted configuration stores in a subscription. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-03-01 // - options - ConfigurationStoresClientListDeletedOptions contains the optional parameters for the ConfigurationStoresClient.NewListDeletedPager // method. func (client *ConfigurationStoresClient) NewListDeletedPager(options *ConfigurationStoresClientListDeletedOptions) *runtime.Pager[ConfigurationStoresClientListDeletedResponse] { @@ -466,7 +466,7 @@ func (client *ConfigurationStoresClient) listDeletedCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2023-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -483,7 +483,7 @@ func (client *ConfigurationStoresClient) listDeletedHandleResponse(resp *http.Re // NewListKeysPager - Lists the access key for the specified configuration store. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-03-01 // - resourceGroupName - The name of the resource group to which the container registry belongs. // - configStoreName - The name of the configuration store. // - options - ConfigurationStoresClientListKeysOptions contains the optional parameters for the ConfigurationStoresClient.NewListKeysPager @@ -536,7 +536,7 @@ func (client *ConfigurationStoresClient) listKeysCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2023-03-01") if options != nil && options.SkipToken != nil { reqQP.Set("$skipToken", *options.SkipToken) } @@ -557,7 +557,7 @@ func (client *ConfigurationStoresClient) listKeysHandleResponse(resp *http.Respo // BeginPurgeDeleted - Permanently deletes the specified configuration store. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-03-01 // - location - The location in which uniqueness will be verified. // - configStoreName - The name of the configuration store. // - options - ConfigurationStoresClientBeginPurgeDeletedOptions contains the optional parameters for the ConfigurationStoresClient.BeginPurgeDeleted @@ -577,7 +577,7 @@ func (client *ConfigurationStoresClient) BeginPurgeDeleted(ctx context.Context, // PurgeDeleted - Permanently deletes the specified configuration store. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-03-01 func (client *ConfigurationStoresClient) purgeDeleted(ctx context.Context, location string, configStoreName string, options *ConfigurationStoresClientBeginPurgeDeletedOptions) (*http.Response, error) { req, err := client.purgeDeletedCreateRequest(ctx, location, configStoreName, options) if err != nil { @@ -613,7 +613,7 @@ func (client *ConfigurationStoresClient) purgeDeletedCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2023-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -622,7 +622,7 @@ func (client *ConfigurationStoresClient) purgeDeletedCreateRequest(ctx context.C // RegenerateKey - Regenerates an access key for the specified configuration store. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-03-01 // - resourceGroupName - The name of the resource group to which the container registry belongs. // - configStoreName - The name of the configuration store. // - regenerateKeyParameters - The parameters for regenerating an access key. @@ -663,7 +663,7 @@ func (client *ConfigurationStoresClient) regenerateKeyCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2023-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, regenerateKeyParameters) @@ -681,7 +681,7 @@ func (client *ConfigurationStoresClient) regenerateKeyHandleResponse(resp *http. // BeginUpdate - Updates a configuration store with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-03-01 // - resourceGroupName - The name of the resource group to which the container registry belongs. // - configStoreName - The name of the configuration store. // - configStoreUpdateParameters - The parameters for updating a configuration store. @@ -702,7 +702,7 @@ func (client *ConfigurationStoresClient) BeginUpdate(ctx context.Context, resour // Update - Updates a configuration store with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-03-01 func (client *ConfigurationStoresClient) update(ctx context.Context, resourceGroupName string, configStoreName string, configStoreUpdateParameters ConfigurationStoreUpdateParameters, options *ConfigurationStoresClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, configStoreName, configStoreUpdateParameters, options) if err != nil { @@ -738,7 +738,7 @@ func (client *ConfigurationStoresClient) updateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2023-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, configStoreUpdateParameters) diff --git a/sdk/resourcemanager/appconfiguration/armappconfiguration/configurationstores_client_example_test.go b/sdk/resourcemanager/appconfiguration/armappconfiguration/configurationstores_client_example_test.go index a493290a93ec..4c80dff6cda8 100644 --- a/sdk/resourcemanager/appconfiguration/armappconfiguration/configurationstores_client_example_test.go +++ b/sdk/resourcemanager/appconfiguration/armappconfiguration/configurationstores_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "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/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2022-05-01/examples/ConfigurationStoresList.json +// 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 { @@ -120,7 +120,7 @@ func ExampleConfigurationStoresClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2022-05-01/examples/ConfigurationStoresListByResourceGroup.json +// 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 { @@ -212,7 +212,7 @@ func ExampleConfigurationStoresClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2022-05-01/examples/ConfigurationStoresGet.json +// 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 { @@ -269,7 +269,7 @@ func ExampleConfigurationStoresClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2022-05-01/examples/ConfigurationStoresCreate.json +// 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 { @@ -335,7 +335,7 @@ func ExampleConfigurationStoresClient_BeginCreate_configurationStoresCreate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2022-05-01/examples/ConfigurationStoresCreateWithIdentity.json +// 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 { @@ -416,7 +416,7 @@ func ExampleConfigurationStoresClient_BeginCreate_configurationStoresCreateWithI // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2022-05-01/examples/ConfigurationStoresCreateWithLocalAuthDisabled.json +// 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 { @@ -479,7 +479,7 @@ func ExampleConfigurationStoresClient_BeginCreate_configurationStoresCreateWithL // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2022-05-01/examples/ConfigurationStoresDelete.json +// 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 { @@ -500,7 +500,7 @@ func ExampleConfigurationStoresClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2022-05-01/examples/ConfigurationStoresUpdate.json +// 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 { @@ -564,7 +564,7 @@ func ExampleConfigurationStoresClient_BeginUpdate_configurationStoresUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2022-05-01/examples/ConfigurationStoresUpdateDisableLocalAuth.json +// 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 { @@ -627,7 +627,7 @@ func ExampleConfigurationStoresClient_BeginUpdate_configurationStoresUpdateDisab // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2022-05-01/examples/ConfigurationStoresUpdateWithIdentity.json +// 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 { @@ -708,7 +708,7 @@ func ExampleConfigurationStoresClient_BeginUpdate_configurationStoresUpdateWithI // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2022-05-01/examples/ConfigurationStoresListKeys.json +// 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 { @@ -768,7 +768,7 @@ func ExampleConfigurationStoresClient_NewListKeysPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2022-05-01/examples/ConfigurationStoresRegenerateKey.json +// 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 { @@ -798,7 +798,7 @@ func ExampleConfigurationStoresClient_RegenerateKey() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2022-05-01/examples/DeletedConfigurationStoresList.json +// 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 { @@ -840,7 +840,7 @@ func ExampleConfigurationStoresClient_NewListDeletedPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2022-05-01/examples/DeletedConfigurationStoresGet.json +// 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 { @@ -874,7 +874,7 @@ func ExampleConfigurationStoresClient_GetDeleted() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2022-05-01/examples/DeletedConfigurationStoresPurge.json +// 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 { diff --git a/sdk/resourcemanager/appconfiguration/armappconfiguration/constants.go b/sdk/resourcemanager/appconfiguration/armappconfiguration/constants.go index a621f1e35cdb..a93a5cbb8349 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 = "v1.1.0" + moduleVersion = "v2.0.0" ) // ActionsRequired - Any action that is required beyond basic workflow (approve/ reject/ disconnect) @@ -161,3 +161,25 @@ func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { PublicNetworkAccessEnabled, } } + +// ReplicaProvisioningState - The provisioning state of the replica. +type ReplicaProvisioningState string + +const ( + ReplicaProvisioningStateCanceled ReplicaProvisioningState = "Canceled" + ReplicaProvisioningStateCreating ReplicaProvisioningState = "Creating" + ReplicaProvisioningStateDeleting ReplicaProvisioningState = "Deleting" + ReplicaProvisioningStateFailed ReplicaProvisioningState = "Failed" + ReplicaProvisioningStateSucceeded ReplicaProvisioningState = "Succeeded" +) + +// PossibleReplicaProvisioningStateValues returns the possible values for the ReplicaProvisioningState const type. +func PossibleReplicaProvisioningStateValues() []ReplicaProvisioningState { + return []ReplicaProvisioningState{ + ReplicaProvisioningStateCanceled, + ReplicaProvisioningStateCreating, + ReplicaProvisioningStateDeleting, + ReplicaProvisioningStateFailed, + ReplicaProvisioningStateSucceeded, + } +} diff --git a/sdk/resourcemanager/appconfiguration/armappconfiguration/go.mod b/sdk/resourcemanager/appconfiguration/armappconfiguration/go.mod index 2ec629131605..2848627341ac 100644 --- a/sdk/resourcemanager/appconfiguration/armappconfiguration/go.mod +++ b/sdk/resourcemanager/appconfiguration/armappconfiguration/go.mod @@ -1,4 +1,4 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appconfiguration/armappconfiguration +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appconfiguration/armappconfiguration/v2 go 1.18 diff --git a/sdk/resourcemanager/appconfiguration/armappconfiguration/keyvalues_client.go b/sdk/resourcemanager/appconfiguration/armappconfiguration/keyvalues_client.go index 25dc79e01c1c..ea17cdd2e79e 100644 --- a/sdk/resourcemanager/appconfiguration/armappconfiguration/keyvalues_client.go +++ b/sdk/resourcemanager/appconfiguration/armappconfiguration/keyvalues_client.go @@ -47,7 +47,7 @@ func NewKeyValuesClient(subscriptionID string, credential azcore.TokenCredential // CreateOrUpdate - Creates a key-value. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-03-01 // - resourceGroupName - The name of the resource group to which the container registry belongs. // - configStoreName - The name of the configuration store. // - keyValueName - Identifier of key and label combination. Key and label are joined by $ character. Label is optional. @@ -92,7 +92,7 @@ func (client *KeyValuesClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2023-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.KeyValueParameters != nil { @@ -113,7 +113,7 @@ func (client *KeyValuesClient) createOrUpdateHandleResponse(resp *http.Response) // BeginDelete - Deletes a key-value. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-03-01 // - resourceGroupName - The name of the resource group to which the container registry belongs. // - configStoreName - The name of the configuration store. // - keyValueName - Identifier of key and label combination. Key and label are joined by $ character. Label is optional. @@ -133,7 +133,7 @@ func (client *KeyValuesClient) BeginDelete(ctx context.Context, resourceGroupNam // Delete - Deletes a key-value. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-03-01 func (client *KeyValuesClient) deleteOperation(ctx context.Context, resourceGroupName string, configStoreName string, keyValueName string, options *KeyValuesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, configStoreName, keyValueName, options) if err != nil { @@ -173,7 +173,7 @@ func (client *KeyValuesClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2023-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -182,7 +182,7 @@ func (client *KeyValuesClient) deleteCreateRequest(ctx context.Context, resource // Get - Gets the properties of the specified key-value. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-03-01 // - resourceGroupName - The name of the resource group to which the container registry belongs. // - configStoreName - The name of the configuration store. // - keyValueName - Identifier of key and label combination. Key and label are joined by $ character. Label is optional. @@ -226,7 +226,7 @@ func (client *KeyValuesClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2023-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -240,76 +240,3 @@ func (client *KeyValuesClient) getHandleResponse(resp *http.Response) (KeyValues } return result, nil } - -// NewListByConfigurationStorePager - Lists the key-values for a given configuration store. -// -// Generated from API version 2022-05-01 -// - resourceGroupName - The name of the resource group to which the container registry belongs. -// - configStoreName - The name of the configuration store. -// - options - KeyValuesClientListByConfigurationStoreOptions contains the optional parameters for the KeyValuesClient.NewListByConfigurationStorePager -// method. -func (client *KeyValuesClient) NewListByConfigurationStorePager(resourceGroupName string, configStoreName string, options *KeyValuesClientListByConfigurationStoreOptions) *runtime.Pager[KeyValuesClientListByConfigurationStoreResponse] { - return runtime.NewPager(runtime.PagingHandler[KeyValuesClientListByConfigurationStoreResponse]{ - More: func(page KeyValuesClientListByConfigurationStoreResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *KeyValuesClientListByConfigurationStoreResponse) (KeyValuesClientListByConfigurationStoreResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByConfigurationStoreCreateRequest(ctx, resourceGroupName, configStoreName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return KeyValuesClientListByConfigurationStoreResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return KeyValuesClientListByConfigurationStoreResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return KeyValuesClientListByConfigurationStoreResponse{}, runtime.NewResponseError(resp) - } - return client.listByConfigurationStoreHandleResponse(resp) - }, - }) -} - -// listByConfigurationStoreCreateRequest creates the ListByConfigurationStore request. -func (client *KeyValuesClient) listByConfigurationStoreCreateRequest(ctx context.Context, resourceGroupName string, configStoreName string, options *KeyValuesClientListByConfigurationStoreOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if configStoreName == "" { - return nil, errors.New("parameter configStoreName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{configStoreName}", url.PathEscape(configStoreName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") - if options != nil && options.SkipToken != nil { - reqQP.Set("$skipToken", *options.SkipToken) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByConfigurationStoreHandleResponse handles the ListByConfigurationStore response. -func (client *KeyValuesClient) listByConfigurationStoreHandleResponse(resp *http.Response) (KeyValuesClientListByConfigurationStoreResponse, error) { - result := KeyValuesClientListByConfigurationStoreResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.KeyValueListResult); err != nil { - return KeyValuesClientListByConfigurationStoreResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/appconfiguration/armappconfiguration/keyvalues_client_example_test.go b/sdk/resourcemanager/appconfiguration/armappconfiguration/keyvalues_client_example_test.go index be36a04b33a4..3794b4d6c917 100644 --- a/sdk/resourcemanager/appconfiguration/armappconfiguration/keyvalues_client_example_test.go +++ b/sdk/resourcemanager/appconfiguration/armappconfiguration/keyvalues_client_example_test.go @@ -15,74 +15,10 @@ import ( "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" + "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/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2022-05-01/examples/ConfigurationStoresListKeyValues.json -func ExampleKeyValuesClient_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.NewKeyValuesClient().NewListByConfigurationStorePager("myResourceGroup", "contoso", &armappconfiguration.KeyValuesClientListByConfigurationStoreOptions{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.KeyValueListResult = armappconfiguration.KeyValueListResult{ - // Value: []*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"), - // }, - // }, - // { - // Name: to.Ptr("myKey2$myLabel2"), - // Type: to.Ptr("Microsoft.AppConfiguration/configurationStores/keyValues"), - // ID: to.Ptr("/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/resourceGroups/myResourceGroup/providers/Microsoft.AppConfiguration/configurationStores/contoso/keyValues/myKey2$myLabel2"), - // Properties: &armappconfiguration.KeyValueProperties{ - // ContentType: to.Ptr(""), - // ETag: to.Ptr("IfDxoa8VkXxPsYsemBlxvV0d5fp"), - // Key: to.Ptr("myKey2"), - // Label: to.Ptr("myLabel2"), - // 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/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2022-05-01/examples/ConfigurationStoresGetKeyValue.json +// 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 { @@ -120,7 +56,7 @@ func ExampleKeyValuesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2022-05-01/examples/ConfigurationStoresCreateKeyValue.json +// 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 { @@ -167,7 +103,7 @@ func ExampleKeyValuesClient_CreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2022-05-01/examples/ConfigurationStoresDeleteKeyValue.json +// 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 { diff --git a/sdk/resourcemanager/appconfiguration/armappconfiguration/models.go b/sdk/resourcemanager/appconfiguration/armappconfiguration/models.go index 97a5dfe6e878..4465cda06ee8 100644 --- a/sdk/resourcemanager/appconfiguration/armappconfiguration/models.go +++ b/sdk/resourcemanager/appconfiguration/armappconfiguration/models.go @@ -378,15 +378,6 @@ type KeyValuesClientGetOptions struct { // placeholder for future optional parameters } -// KeyValuesClientListByConfigurationStoreOptions contains the optional parameters for the KeyValuesClient.NewListByConfigurationStorePager -// method. -type KeyValuesClientListByConfigurationStoreOptions struct { - // A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains - // a nextLink element, the value of the nextLink element will include a - // skipToken parameter that specifies a starting point to use for subsequent calls. - SkipToken *string -} - // KeyVaultProperties - Settings concerning key vault encryption for a configuration store. type KeyVaultProperties struct { // The client id of the identity which will be used to access key vault. @@ -675,6 +666,71 @@ type RegenerateKeyParameters struct { ID *string `json:"id,omitempty"` } +// Replica - The replica resource. +type Replica struct { + // The location of the replica. + Location *string `json:"location,omitempty"` + + // READ-ONLY; The resource ID. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the replica. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; All replica properties. + Properties *ReplicaProperties `json:"properties,omitempty" azure:"ro"` + + // READ-ONLY; Resource system metadata. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// ReplicaListResult - The result of a request to list replicas. +type ReplicaListResult struct { + // The URI that can be used to request the next set of paged results. + NextLink *string `json:"nextLink,omitempty"` + + // The collection value. + Value []*Replica `json:"value,omitempty"` +} + +// ReplicaProperties - All replica properties. +type ReplicaProperties struct { + // READ-ONLY; The URI of the replica where the replica API will be available. + Endpoint *string `json:"endpoint,omitempty" azure:"ro"` + + // READ-ONLY; The provisioning state of the replica. + ProvisioningState *ReplicaProvisioningState `json:"provisioningState,omitempty" azure:"ro"` +} + +// ReplicasClientBeginCreateOptions contains the optional parameters for the ReplicasClient.BeginCreate method. +type ReplicasClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicasClientBeginDeleteOptions contains the optional parameters for the ReplicasClient.BeginDelete method. +type ReplicasClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicasClientGetOptions contains the optional parameters for the ReplicasClient.Get method. +type ReplicasClientGetOptions struct { + // placeholder for future optional parameters +} + +// ReplicasClientListByConfigurationStoreOptions contains the optional parameters for the ReplicasClient.NewListByConfigurationStorePager +// method. +type ReplicasClientListByConfigurationStoreOptions struct { + // A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains + // a nextLink element, the value of the nextLink element will include a + // skipToken parameter that specifies a starting point to use for subsequent calls. + SkipToken *string +} + // Resource - Common fields that are returned in the response for all Azure Resource Manager resources type Resource struct { // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} diff --git a/sdk/resourcemanager/appconfiguration/armappconfiguration/models_serde.go b/sdk/resourcemanager/appconfiguration/armappconfiguration/models_serde.go index 3c382b82d153..0188f51b4992 100644 --- a/sdk/resourcemanager/appconfiguration/armappconfiguration/models_serde.go +++ b/sdk/resourcemanager/appconfiguration/armappconfiguration/models_serde.go @@ -1387,6 +1387,115 @@ func (r *RegenerateKeyParameters) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type Replica. +func (r Replica) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", r.ID) + populate(objectMap, "location", r.Location) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "systemData", r.SystemData) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Replica. +func (r *Replica) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &r.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &r.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ReplicaListResult. +func (r ReplicaListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicaListResult. +func (r *ReplicaListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &r.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ReplicaProperties. +func (r ReplicaProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "endpoint", r.Endpoint) + populate(objectMap, "provisioningState", r.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicaProperties. +func (r *ReplicaProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "endpoint": + err = unpopulate(val, "Endpoint", &r.Endpoint) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Resource. func (r Resource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) diff --git a/sdk/resourcemanager/appconfiguration/armappconfiguration/operations_client.go b/sdk/resourcemanager/appconfiguration/armappconfiguration/operations_client.go index 43cc5975e938..ec0d1ae466e4 100644 --- a/sdk/resourcemanager/appconfiguration/armappconfiguration/operations_client.go +++ b/sdk/resourcemanager/appconfiguration/armappconfiguration/operations_client.go @@ -47,7 +47,7 @@ func NewOperationsClient(subscriptionID string, credential azcore.TokenCredentia // CheckNameAvailability - Checks whether the configuration store name is available for use. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-03-01 // - checkNameAvailabilityParameters - The object containing information for the availability request. // - options - OperationsClientCheckNameAvailabilityOptions contains the optional parameters for the OperationsClient.CheckNameAvailability // method. @@ -78,7 +78,7 @@ func (client *OperationsClient) checkNameAvailabilityCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2023-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, checkNameAvailabilityParameters) @@ -95,7 +95,7 @@ func (client *OperationsClient) checkNameAvailabilityHandleResponse(resp *http.R // NewListPager - Lists the operations available from this provider. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-03-01 // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -133,7 +133,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2023-03-01") if options != nil && options.SkipToken != nil { reqQP.Set("$skipToken", *options.SkipToken) } @@ -154,7 +154,7 @@ func (client *OperationsClient) listHandleResponse(resp *http.Response) (Operati // RegionalCheckNameAvailability - Checks whether the configuration store name is available for use. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-03-01 // - location - The location in which uniqueness will be verified. // - checkNameAvailabilityParameters - The object containing information for the availability request. // - options - OperationsClientRegionalCheckNameAvailabilityOptions contains the optional parameters for the OperationsClient.RegionalCheckNameAvailability @@ -190,7 +190,7 @@ func (client *OperationsClient) regionalCheckNameAvailabilityCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2023-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, checkNameAvailabilityParameters) diff --git a/sdk/resourcemanager/appconfiguration/armappconfiguration/operations_client_example_test.go b/sdk/resourcemanager/appconfiguration/armappconfiguration/operations_client_example_test.go index 5a3dc90a9eb1..2ca815cb8000 100644 --- a/sdk/resourcemanager/appconfiguration/armappconfiguration/operations_client_example_test.go +++ b/sdk/resourcemanager/appconfiguration/armappconfiguration/operations_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "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/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2022-05-01/examples/CheckNameAvailable.json +// 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 { @@ -45,7 +45,7 @@ func ExampleOperationsClient_CheckNameAvailability_configurationStoresCheckNameA // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2022-05-01/examples/CheckNameNotAvailable.json +// 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 { @@ -73,7 +73,432 @@ func ExampleOperationsClient_CheckNameAvailability_configurationStoresCheckNameN // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2022-05-01/examples/RegionalCheckNameAvailable.json +// 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 { @@ -100,7 +525,7 @@ func ExampleOperationsClient_RegionalCheckNameAvailability_configurationStoresCh // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2022-05-01/examples/RegionalCheckNameNotAvailable.json +// 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 { diff --git a/sdk/resourcemanager/appconfiguration/armappconfiguration/privateendpointconnections_client.go b/sdk/resourcemanager/appconfiguration/armappconfiguration/privateendpointconnections_client.go index 50217d2982ab..2efffa0a9be1 100644 --- a/sdk/resourcemanager/appconfiguration/armappconfiguration/privateendpointconnections_client.go +++ b/sdk/resourcemanager/appconfiguration/armappconfiguration/privateendpointconnections_client.go @@ -45,9 +45,11 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor } // BeginCreateOrUpdate - Update the state of the specified private endpoint connection associated with the configuration store. +// This operation cannot be used to create a private endpoint connection. Private endpoint +// connections must be created with the Network resource provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-03-01 // - resourceGroupName - The name of the resource group to which the container registry belongs. // - configStoreName - The name of the configuration store. // - privateEndpointConnectionName - Private endpoint connection name @@ -67,9 +69,11 @@ func (client *PrivateEndpointConnectionsClient) BeginCreateOrUpdate(ctx context. } // CreateOrUpdate - Update the state of the specified private endpoint connection associated with the configuration store. +// This operation cannot be used to create a private endpoint connection. Private endpoint +// connections must be created with the Network resource provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-03-01 func (client *PrivateEndpointConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, configStoreName string, privateEndpointConnectionName string, privateEndpointConnection PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, configStoreName, privateEndpointConnectionName, privateEndpointConnection, options) if err != nil { @@ -109,7 +113,7 @@ func (client *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2023-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, privateEndpointConnection) @@ -118,7 +122,7 @@ func (client *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx // BeginDelete - Deletes a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-03-01 // - resourceGroupName - The name of the resource group to which the container registry belongs. // - configStoreName - The name of the configuration store. // - privateEndpointConnectionName - Private endpoint connection name @@ -139,7 +143,7 @@ func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, // Delete - Deletes a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-03-01 func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, configStoreName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, configStoreName, privateEndpointConnectionName, options) if err != nil { @@ -179,7 +183,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2023-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -188,7 +192,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. // Get - Gets the specified private endpoint connection associated with the configuration store. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-03-01 // - resourceGroupName - The name of the resource group to which the container registry belongs. // - configStoreName - The name of the configuration store. // - privateEndpointConnectionName - Private endpoint connection name @@ -233,7 +237,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2023-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -250,7 +254,7 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res // NewListByConfigurationStorePager - Lists all private endpoint connections for a configuration store. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-03-01 // - resourceGroupName - The name of the resource group to which the container registry belongs. // - configStoreName - The name of the configuration store. // - options - PrivateEndpointConnectionsClientListByConfigurationStoreOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListByConfigurationStorePager @@ -303,7 +307,7 @@ func (client *PrivateEndpointConnectionsClient) listByConfigurationStoreCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2023-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appconfiguration/armappconfiguration/privateendpointconnections_client_example_test.go b/sdk/resourcemanager/appconfiguration/armappconfiguration/privateendpointconnections_client_example_test.go index 87fcfed23513..51f00a025d67 100644 --- a/sdk/resourcemanager/appconfiguration/armappconfiguration/privateendpointconnections_client_example_test.go +++ b/sdk/resourcemanager/appconfiguration/armappconfiguration/privateendpointconnections_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "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/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2022-05-01/examples/ConfigurationStoresListPrivateEndpointConnections.json +// 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 { @@ -62,7 +62,7 @@ func ExamplePrivateEndpointConnectionsClient_NewListByConfigurationStorePager() } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2022-05-01/examples/ConfigurationStoresGetPrivateEndpointConnection.json +// 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 { @@ -98,7 +98,7 @@ func ExamplePrivateEndpointConnectionsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2022-05-01/examples/ConfigurationStoresCreatePrivateEndpointConnection.json +// 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 { @@ -145,7 +145,7 @@ func ExamplePrivateEndpointConnectionsClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2022-05-01/examples/ConfigurationStoresDeletePrivateEndpointConnection.json +// 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 { diff --git a/sdk/resourcemanager/appconfiguration/armappconfiguration/privatelinkresources_client.go b/sdk/resourcemanager/appconfiguration/armappconfiguration/privatelinkresources_client.go index dd457cb6ca00..30d9a6bd1664 100644 --- a/sdk/resourcemanager/appconfiguration/armappconfiguration/privatelinkresources_client.go +++ b/sdk/resourcemanager/appconfiguration/armappconfiguration/privatelinkresources_client.go @@ -47,7 +47,7 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke // Get - Gets a private link resource that need to be created for a configuration store. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-03-01 // - resourceGroupName - The name of the resource group to which the container registry belongs. // - configStoreName - The name of the configuration store. // - groupName - The name of the private link resource group. @@ -92,7 +92,7 @@ func (client *PrivateLinkResourcesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2023-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -109,7 +109,7 @@ func (client *PrivateLinkResourcesClient) getHandleResponse(resp *http.Response) // NewListByConfigurationStorePager - Gets the private link resources that need to be created for a configuration store. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-03-01 // - resourceGroupName - The name of the resource group to which the container registry belongs. // - configStoreName - The name of the configuration store. // - options - PrivateLinkResourcesClientListByConfigurationStoreOptions contains the optional parameters for the PrivateLinkResourcesClient.NewListByConfigurationStorePager @@ -162,7 +162,7 @@ func (client *PrivateLinkResourcesClient) listByConfigurationStoreCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2023-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appconfiguration/armappconfiguration/privatelinkresources_client_example_test.go b/sdk/resourcemanager/appconfiguration/armappconfiguration/privatelinkresources_client_example_test.go index ab381379b504..93e4fb32a0fc 100644 --- a/sdk/resourcemanager/appconfiguration/armappconfiguration/privatelinkresources_client_example_test.go +++ b/sdk/resourcemanager/appconfiguration/armappconfiguration/privatelinkresources_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appconfiguration/armappconfiguration" + "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/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2022-05-01/examples/PrivateLinkResourcesListByConfigurationStore.json +// 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 { @@ -57,7 +57,7 @@ func ExamplePrivateLinkResourcesClient_NewListByConfigurationStorePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2022-05-01/examples/PrivateLinkResourceGet.json +// 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 { diff --git a/sdk/resourcemanager/appconfiguration/armappconfiguration/replicas_client.go b/sdk/resourcemanager/appconfiguration/armappconfiguration/replicas_client.go new file mode 100644 index 000000000000..fcd13cc3e761 --- /dev/null +++ b/sdk/resourcemanager/appconfiguration/armappconfiguration/replicas_client.go @@ -0,0 +1,323 @@ +//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 + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// ReplicasClient contains the methods for the Replicas group. +// Don't use this type directly, use NewReplicasClient() instead. +type ReplicasClient struct { + internal *arm.Client + subscriptionID string +} + +// NewReplicasClient creates a new instance of ReplicasClient with the specified values. +// - subscriptionID - The Microsoft Azure subscription ID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewReplicasClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ReplicasClient, error) { + cl, err := arm.NewClient(moduleName+".ReplicasClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ReplicasClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreate - Creates a replica with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-03-01 +// - resourceGroupName - The name of the resource group to which the container registry belongs. +// - configStoreName - The name of the configuration store. +// - replicaName - The name of the replica. +// - replicaCreationParameters - The parameters for creating a replica. +// - options - ReplicasClientBeginCreateOptions contains the optional parameters for the ReplicasClient.BeginCreate method. +func (client *ReplicasClient) BeginCreate(ctx context.Context, resourceGroupName string, configStoreName string, replicaName string, replicaCreationParameters Replica, options *ReplicasClientBeginCreateOptions) (*runtime.Poller[ReplicasClientCreateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.create(ctx, resourceGroupName, configStoreName, replicaName, replicaCreationParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ReplicasClientCreateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[ReplicasClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Create - Creates a replica with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-03-01 +func (client *ReplicasClient) create(ctx context.Context, resourceGroupName string, configStoreName string, replicaName string, replicaCreationParameters Replica, options *ReplicasClientBeginCreateOptions) (*http.Response, error) { + req, err := client.createCreateRequest(ctx, resourceGroupName, configStoreName, replicaName, replicaCreationParameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createCreateRequest creates the Create request. +func (client *ReplicasClient) createCreateRequest(ctx context.Context, resourceGroupName string, configStoreName string, replicaName string, replicaCreationParameters Replica, options *ReplicasClientBeginCreateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/replicas/{replicaName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if configStoreName == "" { + return nil, errors.New("parameter configStoreName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{configStoreName}", url.PathEscape(configStoreName)) + if replicaName == "" { + return nil, errors.New("parameter replicaName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{replicaName}", url.PathEscape(replicaName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-03-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, replicaCreationParameters) +} + +// BeginDelete - Deletes a replica. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-03-01 +// - resourceGroupName - The name of the resource group to which the container registry belongs. +// - configStoreName - The name of the configuration store. +// - replicaName - The name of the replica. +// - options - ReplicasClientBeginDeleteOptions contains the optional parameters for the ReplicasClient.BeginDelete method. +func (client *ReplicasClient) BeginDelete(ctx context.Context, resourceGroupName string, configStoreName string, replicaName string, options *ReplicasClientBeginDeleteOptions) (*runtime.Poller[ReplicasClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, configStoreName, replicaName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ReplicasClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[ReplicasClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes a replica. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-03-01 +func (client *ReplicasClient) deleteOperation(ctx context.Context, resourceGroupName string, configStoreName string, replicaName string, options *ReplicasClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, configStoreName, replicaName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ReplicasClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, configStoreName string, replicaName string, options *ReplicasClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/replicas/{replicaName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if configStoreName == "" { + return nil, errors.New("parameter configStoreName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{configStoreName}", url.PathEscape(configStoreName)) + if replicaName == "" { + return nil, errors.New("parameter replicaName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{replicaName}", url.PathEscape(replicaName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-03-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the properties of the specified replica. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-03-01 +// - resourceGroupName - The name of the resource group to which the container registry belongs. +// - configStoreName - The name of the configuration store. +// - replicaName - The name of the replica. +// - options - ReplicasClientGetOptions contains the optional parameters for the ReplicasClient.Get method. +func (client *ReplicasClient) Get(ctx context.Context, resourceGroupName string, configStoreName string, replicaName string, options *ReplicasClientGetOptions) (ReplicasClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, configStoreName, replicaName, options) + if err != nil { + return ReplicasClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ReplicasClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ReplicasClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ReplicasClient) getCreateRequest(ctx context.Context, resourceGroupName string, configStoreName string, replicaName string, options *ReplicasClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/replicas/{replicaName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if configStoreName == "" { + return nil, errors.New("parameter configStoreName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{configStoreName}", url.PathEscape(configStoreName)) + if replicaName == "" { + return nil, errors.New("parameter replicaName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{replicaName}", url.PathEscape(replicaName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-03-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ReplicasClient) getHandleResponse(resp *http.Response) (ReplicasClientGetResponse, error) { + result := ReplicasClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Replica); err != nil { + return ReplicasClientGetResponse{}, err + } + return result, nil +} + +// NewListByConfigurationStorePager - Lists the replicas for a given configuration store. +// +// Generated from API version 2023-03-01 +// - resourceGroupName - The name of the resource group to which the container registry belongs. +// - configStoreName - The name of the configuration store. +// - options - ReplicasClientListByConfigurationStoreOptions contains the optional parameters for the ReplicasClient.NewListByConfigurationStorePager +// method. +func (client *ReplicasClient) NewListByConfigurationStorePager(resourceGroupName string, configStoreName string, options *ReplicasClientListByConfigurationStoreOptions) *runtime.Pager[ReplicasClientListByConfigurationStoreResponse] { + return runtime.NewPager(runtime.PagingHandler[ReplicasClientListByConfigurationStoreResponse]{ + More: func(page ReplicasClientListByConfigurationStoreResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ReplicasClientListByConfigurationStoreResponse) (ReplicasClientListByConfigurationStoreResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByConfigurationStoreCreateRequest(ctx, resourceGroupName, configStoreName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ReplicasClientListByConfigurationStoreResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ReplicasClientListByConfigurationStoreResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ReplicasClientListByConfigurationStoreResponse{}, runtime.NewResponseError(resp) + } + return client.listByConfigurationStoreHandleResponse(resp) + }, + }) +} + +// listByConfigurationStoreCreateRequest creates the ListByConfigurationStore request. +func (client *ReplicasClient) listByConfigurationStoreCreateRequest(ctx context.Context, resourceGroupName string, configStoreName string, options *ReplicasClientListByConfigurationStoreOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/replicas" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if configStoreName == "" { + return nil, errors.New("parameter configStoreName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{configStoreName}", url.PathEscape(configStoreName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-03-01") + if options != nil && options.SkipToken != nil { + reqQP.Set("$skipToken", *options.SkipToken) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByConfigurationStoreHandleResponse handles the ListByConfigurationStore response. +func (client *ReplicasClient) listByConfigurationStoreHandleResponse(resp *http.Response) (ReplicasClientListByConfigurationStoreResponse, error) { + result := ReplicasClientListByConfigurationStoreResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ReplicaListResult); err != nil { + return ReplicasClientListByConfigurationStoreResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/appconfiguration/armappconfiguration/replicas_client_example_test.go b/sdk/resourcemanager/appconfiguration/armappconfiguration/replicas_client_example_test.go new file mode 100644 index 000000000000..b912cdd3da86 --- /dev/null +++ b/sdk/resourcemanager/appconfiguration/armappconfiguration/replicas_client_example_test.go @@ -0,0 +1,186 @@ +//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) + } +} diff --git a/sdk/resourcemanager/appconfiguration/armappconfiguration/response_types.go b/sdk/resourcemanager/appconfiguration/armappconfiguration/response_types.go index c58ae6ac658f..c7a03de5f94c 100644 --- a/sdk/resourcemanager/appconfiguration/armappconfiguration/response_types.go +++ b/sdk/resourcemanager/appconfiguration/armappconfiguration/response_types.go @@ -79,11 +79,6 @@ type KeyValuesClientGetResponse struct { KeyValue } -// KeyValuesClientListByConfigurationStoreResponse contains the response from method KeyValuesClient.NewListByConfigurationStorePager. -type KeyValuesClientListByConfigurationStoreResponse struct { - KeyValueListResult -} - // OperationsClientCheckNameAvailabilityResponse contains the response from method OperationsClient.CheckNameAvailability. type OperationsClientCheckNameAvailabilityResponse struct { NameAvailabilityStatus @@ -128,3 +123,23 @@ type PrivateLinkResourcesClientGetResponse struct { type PrivateLinkResourcesClientListByConfigurationStoreResponse struct { PrivateLinkResourceListResult } + +// ReplicasClientCreateResponse contains the response from method ReplicasClient.BeginCreate. +type ReplicasClientCreateResponse struct { + Replica +} + +// ReplicasClientDeleteResponse contains the response from method ReplicasClient.BeginDelete. +type ReplicasClientDeleteResponse struct { + // placeholder for future response values +} + +// ReplicasClientGetResponse contains the response from method ReplicasClient.Get. +type ReplicasClientGetResponse struct { + Replica +} + +// ReplicasClientListByConfigurationStoreResponse contains the response from method ReplicasClient.NewListByConfigurationStorePager. +type ReplicasClientListByConfigurationStoreResponse struct { + ReplicaListResult +} From cb9a5dd756b9b3671dbd76452289c5c70d4b1c18 Mon Sep 17 00:00:00 2001 From: Alancere <804873052@qq.com> Date: Mon, 17 Apr 2023 17:07:26 +0800 Subject: [PATCH 2/2] update --- .../armappconfiguration/CHANGELOG.md | 19 +++++++++++++++ .../armappconfiguration/autorest.md | 2 +- .../armappconfiguration/constants.go | 24 ++++++++++++++++++- .../armappconfiguration/models.go | 20 ++++++++-------- 4 files changed, 53 insertions(+), 12 deletions(-) diff --git a/sdk/resourcemanager/appconfiguration/armappconfiguration/CHANGELOG.md b/sdk/resourcemanager/appconfiguration/armappconfiguration/CHANGELOG.md index 83742fd7278f..6a90eac4bd4b 100644 --- a/sdk/resourcemanager/appconfiguration/armappconfiguration/CHANGELOG.md +++ b/sdk/resourcemanager/appconfiguration/armappconfiguration/CHANGELOG.md @@ -1,5 +1,24 @@ # Release History +## 2.0.0 (2023-04-28) +### Breaking Changes + +- Function `*KeyValuesClient.NewListByConfigurationStorePager` has been removed + +### Features Added + +- New enum type `ReplicaProvisioningState` with values `ReplicaProvisioningStateCanceled`, `ReplicaProvisioningStateCreating`, `ReplicaProvisioningStateDeleting`, `ReplicaProvisioningStateFailed`, `ReplicaProvisioningStateSucceeded` +- New function `*ClientFactory.NewReplicasClient() *ReplicasClient` +- New function `NewReplicasClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ReplicasClient, error)` +- New function `*ReplicasClient.BeginCreate(context.Context, string, string, string, Replica, *ReplicasClientBeginCreateOptions) (*runtime.Poller[ReplicasClientCreateResponse], error)` +- New function `*ReplicasClient.BeginDelete(context.Context, string, string, string, *ReplicasClientBeginDeleteOptions) (*runtime.Poller[ReplicasClientDeleteResponse], error)` +- New function `*ReplicasClient.Get(context.Context, string, string, string, *ReplicasClientGetOptions) (ReplicasClientGetResponse, error)` +- New function `*ReplicasClient.NewListByConfigurationStorePager(string, string, *ReplicasClientListByConfigurationStoreOptions) *runtime.Pager[ReplicasClientListByConfigurationStoreResponse]` +- New struct `Replica` +- New struct `ReplicaListResult` +- New struct `ReplicaProperties` + + ## 1.1.1 (2023-04-14) ### Bug Fixes diff --git a/sdk/resourcemanager/appconfiguration/armappconfiguration/autorest.md b/sdk/resourcemanager/appconfiguration/armappconfiguration/autorest.md index aa2f43226bc1..cb5f774cf8ce 100644 --- a/sdk/resourcemanager/appconfiguration/armappconfiguration/autorest.md +++ b/sdk/resourcemanager/appconfiguration/armappconfiguration/autorest.md @@ -8,6 +8,6 @@ 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 license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.1.1 +module-version: 2.0.0 tag: package-2023-03-01 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/appconfiguration/armappconfiguration/constants.go b/sdk/resourcemanager/appconfiguration/armappconfiguration/constants.go index ea68be78c23c..a93a5cbb8349 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 = "v1.1.1" + moduleVersion = "v2.0.0" ) // ActionsRequired - Any action that is required beyond basic workflow (approve/ reject/ disconnect) @@ -161,3 +161,25 @@ func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { PublicNetworkAccessEnabled, } } + +// ReplicaProvisioningState - The provisioning state of the replica. +type ReplicaProvisioningState string + +const ( + ReplicaProvisioningStateCanceled ReplicaProvisioningState = "Canceled" + ReplicaProvisioningStateCreating ReplicaProvisioningState = "Creating" + ReplicaProvisioningStateDeleting ReplicaProvisioningState = "Deleting" + ReplicaProvisioningStateFailed ReplicaProvisioningState = "Failed" + ReplicaProvisioningStateSucceeded ReplicaProvisioningState = "Succeeded" +) + +// PossibleReplicaProvisioningStateValues returns the possible values for the ReplicaProvisioningState const type. +func PossibleReplicaProvisioningStateValues() []ReplicaProvisioningState { + return []ReplicaProvisioningState{ + ReplicaProvisioningStateCanceled, + ReplicaProvisioningStateCreating, + ReplicaProvisioningStateDeleting, + ReplicaProvisioningStateFailed, + ReplicaProvisioningStateSucceeded, + } +} diff --git a/sdk/resourcemanager/appconfiguration/armappconfiguration/models.go b/sdk/resourcemanager/appconfiguration/armappconfiguration/models.go index eac7a297a7bd..59cde7901692 100644 --- a/sdk/resourcemanager/appconfiguration/armappconfiguration/models.go +++ b/sdk/resourcemanager/appconfiguration/armappconfiguration/models.go @@ -669,40 +669,40 @@ type RegenerateKeyParameters struct { // Replica - The replica resource. type Replica struct { // The location of the replica. - Location *string `json:"location,omitempty"` + Location *string // READ-ONLY; The resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the replica. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; All replica properties. - Properties *ReplicaProperties `json:"properties,omitempty" azure:"ro"` + Properties *ReplicaProperties // READ-ONLY; Resource system metadata. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ReplicaListResult - The result of a request to list replicas. type ReplicaListResult struct { // The URI that can be used to request the next set of paged results. - NextLink *string `json:"nextLink,omitempty"` + NextLink *string // The collection value. - Value []*Replica `json:"value,omitempty"` + Value []*Replica } // ReplicaProperties - All replica properties. type ReplicaProperties struct { // READ-ONLY; The URI of the replica where the replica API will be available. - Endpoint *string `json:"endpoint,omitempty" azure:"ro"` + Endpoint *string // READ-ONLY; The provisioning state of the replica. - ProvisioningState *ReplicaProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *ReplicaProvisioningState } // ReplicasClientBeginCreateOptions contains the optional parameters for the ReplicasClient.BeginCreate method.