diff --git a/sdk/resourcemanager/healthbot/armhealthbot/CHANGELOG.md b/sdk/resourcemanager/healthbot/armhealthbot/CHANGELOG.md index c6ed52937197..f713c1bb7388 100644 --- a/sdk/resourcemanager/healthbot/armhealthbot/CHANGELOG.md +++ b/sdk/resourcemanager/healthbot/armhealthbot/CHANGELOG.md @@ -1,5 +1,22 @@ # Release History +## 2.0.0 (2023-06-08) +### Breaking Changes + +- Operation `*BotsClient.Update` has been changed to LRO, use `*BotsClient.BeginUpdate` instead. + +### Features Added + +- New value `SKUNamePES` added to enum type `SKUName` +- New function `*BotsClient.ListSecrets(context.Context, string, string, *BotsClientListSecretsOptions) (BotsClientListSecretsResponse, error)` +- New function `*BotsClient.RegenerateAPIJwtSecret(context.Context, string, string, *BotsClientRegenerateAPIJwtSecretOptions) (BotsClientRegenerateAPIJwtSecretResponse, error)` +- New struct `Key` +- New struct `KeyVaultProperties` +- New struct `KeysResponse` +- New field `KeyVaultProperties` in struct `Properties` +- New field `Properties` in struct `UpdateParameters` + + ## 1.1.1 (2023-04-14) ### Bug Fixes diff --git a/sdk/resourcemanager/healthbot/armhealthbot/autorest.md b/sdk/resourcemanager/healthbot/armhealthbot/autorest.md index 3e3f9c519c94..2610996912c3 100644 --- a/sdk/resourcemanager/healthbot/armhealthbot/autorest.md +++ b/sdk/resourcemanager/healthbot/armhealthbot/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthbot/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthbot/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/healthbot/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/healthbot/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.1.1 +module-version: 2.0.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/healthbot/armhealthbot/bots_client.go b/sdk/resourcemanager/healthbot/armhealthbot/bots_client.go index a5ab136740aa..73f2d3176b8b 100644 --- a/sdk/resourcemanager/healthbot/armhealthbot/bots_client.go +++ b/sdk/resourcemanager/healthbot/armhealthbot/bots_client.go @@ -47,7 +47,7 @@ func NewBotsClient(subscriptionID string, credential azcore.TokenCredential, opt // BeginCreate - Create a new Azure Health Bot. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-10 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the Bot resource group in the user subscription. // - botName - The name of the Bot resource. // - parameters - The parameters to provide for the created Azure Health Bot. @@ -69,7 +69,7 @@ func (client *BotsClient) BeginCreate(ctx context.Context, resourceGroupName str // Create - Create a new Azure Health Bot. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-10 +// Generated from API version 2023-05-01 func (client *BotsClient) create(ctx context.Context, resourceGroupName string, botName string, parameters HealthBot, options *BotsClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, botName, parameters, options) if err != nil { @@ -105,7 +105,7 @@ func (client *BotsClient) createCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-10") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -114,7 +114,7 @@ func (client *BotsClient) createCreateRequest(ctx context.Context, resourceGroup // BeginDelete - Delete a HealthBot. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-10 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the Bot resource group in the user subscription. // - botName - The name of the Bot resource. // - options - BotsClientBeginDeleteOptions contains the optional parameters for the BotsClient.BeginDelete method. @@ -133,7 +133,7 @@ func (client *BotsClient) BeginDelete(ctx context.Context, resourceGroupName str // Delete - Delete a HealthBot. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-10 +// Generated from API version 2023-05-01 func (client *BotsClient) deleteOperation(ctx context.Context, resourceGroupName string, botName string, options *BotsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, botName, options) if err != nil { @@ -169,7 +169,7 @@ func (client *BotsClient) deleteCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-10") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -178,7 +178,7 @@ func (client *BotsClient) deleteCreateRequest(ctx context.Context, resourceGroup // Get - Get a HealthBot. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-10 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the Bot resource group in the user subscription. // - botName - The name of the Bot resource. // - options - BotsClientGetOptions contains the optional parameters for the BotsClient.Get method. @@ -217,7 +217,7 @@ func (client *BotsClient) getCreateRequest(ctx context.Context, resourceGroupNam return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-10") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -234,7 +234,7 @@ func (client *BotsClient) getHandleResponse(resp *http.Response) (BotsClientGetR // NewListPager - Returns all the resources of a particular type belonging to a subscription. // -// Generated from API version 2021-06-10 +// Generated from API version 2023-05-01 // - options - BotsClientListOptions contains the optional parameters for the BotsClient.NewListPager method. func (client *BotsClient) NewListPager(options *BotsClientListOptions) *runtime.Pager[BotsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[BotsClientListResponse]{ @@ -276,7 +276,7 @@ func (client *BotsClient) listCreateRequest(ctx context.Context, options *BotsCl return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-10") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -293,7 +293,7 @@ func (client *BotsClient) listHandleResponse(resp *http.Response) (BotsClientLis // NewListByResourceGroupPager - Returns all the resources of a particular type belonging to a resource group // -// Generated from API version 2021-06-10 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the Bot resource group in the user subscription. // - options - BotsClientListByResourceGroupOptions contains the optional parameters for the BotsClient.NewListByResourceGroupPager // method. @@ -341,7 +341,7 @@ func (client *BotsClient) listByResourceGroupCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-10") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -356,31 +356,162 @@ func (client *BotsClient) listByResourceGroupHandleResponse(resp *http.Response) return result, nil } -// Update - Patch a HealthBot. +// ListSecrets - List all secrets of a HealthBot. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the Bot resource group in the user subscription. +// - botName - The name of the Bot resource. +// - options - BotsClientListSecretsOptions contains the optional parameters for the BotsClient.ListSecrets method. +func (client *BotsClient) ListSecrets(ctx context.Context, resourceGroupName string, botName string, options *BotsClientListSecretsOptions) (BotsClientListSecretsResponse, error) { + req, err := client.listSecretsCreateRequest(ctx, resourceGroupName, botName, options) + if err != nil { + return BotsClientListSecretsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return BotsClientListSecretsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return BotsClientListSecretsResponse{}, runtime.NewResponseError(resp) + } + return client.listSecretsHandleResponse(resp) +} + +// listSecretsCreateRequest creates the ListSecrets request. +func (client *BotsClient) listSecretsCreateRequest(ctx context.Context, resourceGroupName string, botName string, options *BotsClientListSecretsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots/{botName}/listSecrets" + 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 botName == "" { + return nil, errors.New("parameter botName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{botName}", url.PathEscape(botName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listSecretsHandleResponse handles the ListSecrets response. +func (client *BotsClient) listSecretsHandleResponse(resp *http.Response) (BotsClientListSecretsResponse, error) { + result := BotsClientListSecretsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.KeysResponse); err != nil { + return BotsClientListSecretsResponse{}, err + } + return result, nil +} + +// RegenerateAPIJwtSecret - Regenerate the API JWT Secret of a HealthBot. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the Bot resource group in the user subscription. +// - botName - The name of the Bot resource. +// - options - BotsClientRegenerateAPIJwtSecretOptions contains the optional parameters for the BotsClient.RegenerateAPIJwtSecret +// method. +func (client *BotsClient) RegenerateAPIJwtSecret(ctx context.Context, resourceGroupName string, botName string, options *BotsClientRegenerateAPIJwtSecretOptions) (BotsClientRegenerateAPIJwtSecretResponse, error) { + req, err := client.regenerateAPIJwtSecretCreateRequest(ctx, resourceGroupName, botName, options) + if err != nil { + return BotsClientRegenerateAPIJwtSecretResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return BotsClientRegenerateAPIJwtSecretResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return BotsClientRegenerateAPIJwtSecretResponse{}, runtime.NewResponseError(resp) + } + return client.regenerateAPIJwtSecretHandleResponse(resp) +} + +// regenerateAPIJwtSecretCreateRequest creates the RegenerateAPIJwtSecret request. +func (client *BotsClient) regenerateAPIJwtSecretCreateRequest(ctx context.Context, resourceGroupName string, botName string, options *BotsClientRegenerateAPIJwtSecretOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots/{botName}/regenerateApiJwtSecret" + 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 botName == "" { + return nil, errors.New("parameter botName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{botName}", url.PathEscape(botName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// regenerateAPIJwtSecretHandleResponse handles the RegenerateAPIJwtSecret response. +func (client *BotsClient) regenerateAPIJwtSecretHandleResponse(resp *http.Response) (BotsClientRegenerateAPIJwtSecretResponse, error) { + result := BotsClientRegenerateAPIJwtSecretResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Key); err != nil { + return BotsClientRegenerateAPIJwtSecretResponse{}, err + } + return result, nil +} + +// BeginUpdate - Patch a HealthBot. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-10 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the Bot resource group in the user subscription. // - botName - The name of the Bot resource. // - parameters - The parameters to provide for the required Azure Health Bot. -// - options - BotsClientUpdateOptions contains the optional parameters for the BotsClient.Update method. -func (client *BotsClient) Update(ctx context.Context, resourceGroupName string, botName string, parameters UpdateParameters, options *BotsClientUpdateOptions) (BotsClientUpdateResponse, error) { +// - options - BotsClientBeginUpdateOptions contains the optional parameters for the BotsClient.BeginUpdate method. +func (client *BotsClient) BeginUpdate(ctx context.Context, resourceGroupName string, botName string, parameters UpdateParameters, options *BotsClientBeginUpdateOptions) (*runtime.Poller[BotsClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, botName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[BotsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + } else { + return runtime.NewPollerFromResumeToken[BotsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Update - Patch a HealthBot. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +func (client *BotsClient) update(ctx context.Context, resourceGroupName string, botName string, parameters UpdateParameters, options *BotsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, botName, parameters, options) if err != nil { - return BotsClientUpdateResponse{}, err + return nil, err } resp, err := client.internal.Pipeline().Do(req) if err != nil { - return BotsClientUpdateResponse{}, err + return nil, err } if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return BotsClientUpdateResponse{}, runtime.NewResponseError(resp) + return nil, runtime.NewResponseError(resp) } - return client.updateHandleResponse(resp) + return resp, nil } // updateCreateRequest creates the Update request. -func (client *BotsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, botName string, parameters UpdateParameters, options *BotsClientUpdateOptions) (*policy.Request, error) { +func (client *BotsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, botName string, parameters UpdateParameters, options *BotsClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots/{botName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -399,17 +530,8 @@ func (client *BotsClient) updateCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-10") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) } - -// updateHandleResponse handles the Update response. -func (client *BotsClient) updateHandleResponse(resp *http.Response) (BotsClientUpdateResponse, error) { - result := BotsClientUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.HealthBot); err != nil { - return BotsClientUpdateResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/healthbot/armhealthbot/bots_client_example_test.go b/sdk/resourcemanager/healthbot/armhealthbot/bots_client_example_test.go deleted file mode 100644 index b3c450ab89bd..000000000000 --- a/sdk/resourcemanager/healthbot/armhealthbot/bots_client_example_test.go +++ /dev/null @@ -1,351 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armhealthbot_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/healthbot/armhealthbot" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2021-06-10/examples/ResourceCreationPut.json -func ExampleBotsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthbot.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewBotsClient().BeginCreate(ctx, "healthbotClient", "samplebotname", armhealthbot.HealthBot{ - Location: to.Ptr("East US"), - Identity: &armhealthbot.Identity{ - Type: to.Ptr(armhealthbot.ResourceIdentityTypeSystemAssignedUserAssigned), - UserAssignedIdentities: map[string]*armhealthbot.UserAssignedIdentity{ - "/subscriptions/subscription-id/resourcegroups/myrg/providers/microsoft.managedidentity/userassignedidentities/my-mi": {}, - "/subscriptions/subscription-id/resourcegroups/myrg/providers/microsoft.managedidentity/userassignedidentities/my-mi2": {}, - }, - }, - SKU: &armhealthbot.SKU{ - Name: to.Ptr(armhealthbot.SKUNameF0), - }, - }, 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.HealthBot = armhealthbot.HealthBot{ - // Name: to.Ptr("samplebotname"), - // Type: to.Ptr("Microsoft.HealthBot/healthBots"), - // ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/OneResourceGroupName/providers/Microsoft.HealthBot/healthBots/samplebotname"), - // SystemData: &armhealthbot.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-05T17:18:19.1234567Z"); return t}()), - // CreatedBy: to.Ptr("jack@outlook.com"), - // CreatedByType: to.Ptr(armhealthbot.IdentityTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-06T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("ryan@outlook.com"), - // LastModifiedByType: to.Ptr(armhealthbot.IdentityTypeUser), - // }, - // Location: to.Ptr("East US"), - // Identity: &armhealthbot.Identity{ - // Type: to.Ptr(armhealthbot.ResourceIdentityTypeSystemAssignedUserAssigned), - // PrincipalID: to.Ptr("principalId"), - // TenantID: to.Ptr("tenantId"), - // UserAssignedIdentities: map[string]*armhealthbot.UserAssignedIdentity{ - // "/subscriptions/subscription-id/resourcegroups/myrg/providers/microsoft.managedidentity/userassignedidentities/my-mi": &armhealthbot.UserAssignedIdentity{ - // }, - // "/subscriptions/subscription-id/resourcegroups/myrg/providers/microsoft.managedidentity/userassignedidentities/my-mi2": &armhealthbot.UserAssignedIdentity{ - // }, - // }, - // }, - // Properties: &armhealthbot.Properties{ - // BotManagementPortalLink: to.Ptr("https://us.healthbot.microsoft.com/account/contoso"), - // }, - // SKU: &armhealthbot.SKU{ - // Name: to.Ptr(armhealthbot.SKUNameF0), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2021-06-10/examples/ResourceInfoGet.json -func ExampleBotsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthbot.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBotsClient().Get(ctx, "healthbotClient", "samplebotname", 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.HealthBot = armhealthbot.HealthBot{ - // Name: to.Ptr("samplebotname"), - // Type: to.Ptr("Microsoft.HealthBot/healthBots"), - // ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/OneResourceGroupName/providers/Microsoft.HealthBot/healthBots/samplebotname"), - // SystemData: &armhealthbot.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-05T17:18:19.1234567Z"); return t}()), - // CreatedBy: to.Ptr("jack@outlook.com"), - // CreatedByType: to.Ptr(armhealthbot.IdentityTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-06T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("ryan@outlook.com"), - // LastModifiedByType: to.Ptr(armhealthbot.IdentityTypeUser), - // }, - // Location: to.Ptr("East US"), - // Identity: &armhealthbot.Identity{ - // Type: to.Ptr(armhealthbot.ResourceIdentityTypeSystemAssignedUserAssigned), - // PrincipalID: to.Ptr("principalId"), - // TenantID: to.Ptr("tenantId"), - // UserAssignedIdentities: map[string]*armhealthbot.UserAssignedIdentity{ - // "/subscriptions/subscription-id/resourcegroups/myrg/providers/microsoft.managedidentity/userassignedidentities/my-mi": &armhealthbot.UserAssignedIdentity{ - // }, - // "/subscriptions/subscription-id/resourcegroups/myrg/providers/microsoft.managedidentity/userassignedidentities/my-mi2": &armhealthbot.UserAssignedIdentity{ - // }, - // }, - // }, - // Properties: &armhealthbot.Properties{ - // BotManagementPortalLink: to.Ptr("https://us.healthbot.microsoft.com/account/contoso"), - // }, - // SKU: &armhealthbot.SKU{ - // Name: to.Ptr(armhealthbot.SKUNameF0), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2021-06-10/examples/ResourceUpdatePatch.json -func ExampleBotsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthbot.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBotsClient().Update(ctx, "healthbotClient", "samplebotname", armhealthbot.UpdateParameters{ - SKU: &armhealthbot.SKU{ - Name: to.Ptr(armhealthbot.SKUNameF0), - }, - }, 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.HealthBot = armhealthbot.HealthBot{ - // Name: to.Ptr("samplebotname"), - // Type: to.Ptr("Microsoft.HealthBot/healthBots"), - // ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/OneResourceGroupName/providers/Microsoft.HealthBot/healthBots/samplebotname"), - // SystemData: &armhealthbot.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-05T17:18:19.1234567Z"); return t}()), - // CreatedBy: to.Ptr("jack@outlook.com"), - // CreatedByType: to.Ptr(armhealthbot.IdentityTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-06T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("ryan@outlook.com"), - // LastModifiedByType: to.Ptr(armhealthbot.IdentityTypeUser), - // }, - // Location: to.Ptr("East US"), - // Identity: &armhealthbot.Identity{ - // Type: to.Ptr(armhealthbot.ResourceIdentityTypeSystemAssignedUserAssigned), - // PrincipalID: to.Ptr("principalId"), - // TenantID: to.Ptr("tenantId"), - // UserAssignedIdentities: map[string]*armhealthbot.UserAssignedIdentity{ - // "/subscriptions/subscription-id/resourcegroups/myrg/providers/microsoft.managedidentity/userassignedidentities/my-mi": &armhealthbot.UserAssignedIdentity{ - // }, - // "/subscriptions/subscription-id/resourcegroups/myrg/providers/microsoft.managedidentity/userassignedidentities/my-mi2": &armhealthbot.UserAssignedIdentity{ - // }, - // }, - // }, - // Properties: &armhealthbot.Properties{ - // BotManagementPortalLink: to.Ptr("https://us.healthbot.microsoft.com/account/contoso"), - // }, - // SKU: &armhealthbot.SKU{ - // Name: to.Ptr(armhealthbot.SKUNameF0), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2021-06-10/examples/ResourceDeletionDelete.json -func ExampleBotsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthbot.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewBotsClient().BeginDelete(ctx, "healthbotClient", "samplebotname", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2021-06-10/examples/ListBotsByResourceGroup.json -func ExampleBotsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthbot.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBotsClient().NewListByResourceGroupPager("OneResourceGroupName", 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.BotResponseList = armhealthbot.BotResponseList{ - // Value: []*armhealthbot.HealthBot{ - // { - // Name: to.Ptr("samplebotname"), - // Type: to.Ptr("Microsoft.HealthBot/healthBots"), - // ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/OneResourceGroupName/providers/Microsoft.HealthBot/healthBots/samplebotname"), - // SystemData: &armhealthbot.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-05T17:18:19.1234567Z"); return t}()), - // CreatedBy: to.Ptr("jack@outlook.com"), - // CreatedByType: to.Ptr(armhealthbot.IdentityTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-06T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("ryan@outlook.com"), - // LastModifiedByType: to.Ptr(armhealthbot.IdentityTypeUser), - // }, - // Location: to.Ptr("East US"), - // Properties: &armhealthbot.Properties{ - // BotManagementPortalLink: to.Ptr("https://us.healthbot.microsoft.com/account/samplebotname-1yhd91k"), - // }, - // SKU: &armhealthbot.SKU{ - // Name: to.Ptr(armhealthbot.SKUNameF0), - // }, - // }, - // { - // Name: to.Ptr("samplebotname2"), - // Type: to.Ptr("Microsoft.HealthBot/healthBots"), - // ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/OneResourceGroupName/providers/Microsoft.HealthBot/healthBots/samplebotname2"), - // SystemData: &armhealthbot.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-05T17:18:19.1234567Z"); return t}()), - // CreatedBy: to.Ptr("jack@outlook.com"), - // CreatedByType: to.Ptr(armhealthbot.IdentityTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-06T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("ryan@outlook.com"), - // LastModifiedByType: to.Ptr(armhealthbot.IdentityTypeUser), - // }, - // Location: to.Ptr("East US"), - // Identity: &armhealthbot.Identity{ - // Type: to.Ptr(armhealthbot.ResourceIdentityTypeSystemAssignedUserAssigned), - // PrincipalID: to.Ptr("principalId"), - // TenantID: to.Ptr("tenantId"), - // UserAssignedIdentities: map[string]*armhealthbot.UserAssignedIdentity{ - // "/subscriptions/subscription-id/resourcegroups/myrg/providers/microsoft.managedidentity/userassignedidentities/my-mi": &armhealthbot.UserAssignedIdentity{ - // }, - // "/subscriptions/subscription-id/resourcegroups/myrg/providers/microsoft.managedidentity/userassignedidentities/my-mi2": &armhealthbot.UserAssignedIdentity{ - // }, - // }, - // }, - // Properties: &armhealthbot.Properties{ - // BotManagementPortalLink: to.Ptr("https://us.healthbot.microsoft.com/account/samplebotname2-hdi1osc"), - // }, - // SKU: &armhealthbot.SKU{ - // Name: to.Ptr(armhealthbot.SKUNameS1), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2021-06-10/examples/ListBotsBySubscription.json -func ExampleBotsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthbot.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBotsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.BotResponseList = armhealthbot.BotResponseList{ - // Value: []*armhealthbot.HealthBot{ - // { - // Name: to.Ptr("samplebotname2"), - // Type: to.Ptr("Microsoft.HealthBot/healthBots"), - // ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/OneResourceGroupName/providers/Microsoft.HealthBot/healthBots/samplebotname2"), - // SystemData: &armhealthbot.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-05T17:18:19.1234567Z"); return t}()), - // CreatedBy: to.Ptr("jack@outlook.com"), - // CreatedByType: to.Ptr(armhealthbot.IdentityTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-06T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("ryan@outlook.com"), - // LastModifiedByType: to.Ptr(armhealthbot.IdentityTypeUser), - // }, - // Location: to.Ptr("East US"), - // Identity: &armhealthbot.Identity{ - // Type: to.Ptr(armhealthbot.ResourceIdentityTypeSystemAssignedUserAssigned), - // PrincipalID: to.Ptr("principalId"), - // TenantID: to.Ptr("tenantId"), - // UserAssignedIdentities: map[string]*armhealthbot.UserAssignedIdentity{ - // "/subscriptions/subscription-id/resourcegroups/myrg/providers/microsoft.managedidentity/userassignedidentities/my-mi": &armhealthbot.UserAssignedIdentity{ - // }, - // "/subscriptions/subscription-id/resourcegroups/myrg/providers/microsoft.managedidentity/userassignedidentities/my-mi2": &armhealthbot.UserAssignedIdentity{ - // }, - // }, - // }, - // Properties: &armhealthbot.Properties{ - // BotManagementPortalLink: to.Ptr("https://us.healthbot.microsoft.com/account/samplebotname2-hdi1osc"), - // }, - // SKU: &armhealthbot.SKU{ - // Name: to.Ptr(armhealthbot.SKUNameS1), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/healthbot/armhealthbot/constants.go b/sdk/resourcemanager/healthbot/armhealthbot/constants.go index 74298ae1200d..bef0bdce9287 100644 --- a/sdk/resourcemanager/healthbot/armhealthbot/constants.go +++ b/sdk/resourcemanager/healthbot/armhealthbot/constants.go @@ -11,7 +11,7 @@ package armhealthbot const ( moduleName = "armhealthbot" - moduleVersion = "v1.1.1" + moduleVersion = "v2.0.0" ) // IdentityType - The type of identity that creates/modifies resources @@ -60,9 +60,10 @@ func PossibleResourceIdentityTypeValues() []ResourceIdentityType { type SKUName string const ( - SKUNameF0 SKUName = "F0" - SKUNameS1 SKUName = "S1" - SKUNameC0 SKUName = "C0" + SKUNameF0 SKUName = "F0" + SKUNameS1 SKUName = "S1" + SKUNameC0 SKUName = "C0" + SKUNamePES SKUName = "PES" ) // PossibleSKUNameValues returns the possible values for the SKUName const type. @@ -71,5 +72,6 @@ func PossibleSKUNameValues() []SKUName { SKUNameF0, SKUNameS1, SKUNameC0, + SKUNamePES, } } diff --git a/sdk/resourcemanager/healthbot/armhealthbot/go.mod b/sdk/resourcemanager/healthbot/armhealthbot/go.mod index b3fec22debc7..966a0adffc71 100644 --- a/sdk/resourcemanager/healthbot/armhealthbot/go.mod +++ b/sdk/resourcemanager/healthbot/armhealthbot/go.mod @@ -1,21 +1,13 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/healthbot/armhealthbot +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/healthbot/armhealthbot/v2 go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 // indirect - github.com/golang-jwt/jwt/v4 v4.5.0 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect - golang.org/x/crypto v0.6.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.7.0 // indirect - golang.org/x/sys v0.5.0 // indirect golang.org/x/text v0.7.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/healthbot/armhealthbot/go.sum b/sdk/resourcemanager/healthbot/armhealthbot/go.sum index 8ba445a8c4da..b6bd7eaad1ba 100644 --- a/sdk/resourcemanager/healthbot/armhealthbot/go.sum +++ b/sdk/resourcemanager/healthbot/armhealthbot/go.sum @@ -1,31 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 h1:rTnT/Jrcm+figWlYz4Ixzt0SJVR2cMC8lvZcimipiEY= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0/go.mod h1:ON4tFdPTwRcgWEaVDrN3584Ef+b7GgSJaXxe5fW9t4M= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 h1:uqM+VoHjVH6zdlkLF2b6O0ZANcHoj3rO0PoQ3jglUJA= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2/go.mod h1:twTKAa1E6hLmSDjLhaCkbTMQKc7p/rNLU40rLxGEOCI= github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 h1:leh5DwKv6Ihwi+h60uHtn6UWAxBbZ0q8DwQVMzf61zw= github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 h1:UE9n9rkJF62ArLb1F3DEjRt8O3jLwMWdSoypKV4f3MU= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= -github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= -golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/healthbot/armhealthbot/models.go b/sdk/resourcemanager/healthbot/armhealthbot/models.go index df58cda16655..dd995b5d65cc 100644 --- a/sdk/resourcemanager/healthbot/armhealthbot/models.go +++ b/sdk/resourcemanager/healthbot/armhealthbot/models.go @@ -41,6 +41,12 @@ type BotsClientBeginDeleteOptions struct { ResumeToken string } +// BotsClientBeginUpdateOptions contains the optional parameters for the BotsClient.BeginUpdate method. +type BotsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // BotsClientGetOptions contains the optional parameters for the BotsClient.Get method. type BotsClientGetOptions struct { // placeholder for future optional parameters @@ -56,8 +62,13 @@ type BotsClientListOptions struct { // placeholder for future optional parameters } -// BotsClientUpdateOptions contains the optional parameters for the BotsClient.Update method. -type BotsClientUpdateOptions struct { +// BotsClientListSecretsOptions contains the optional parameters for the BotsClient.ListSecrets method. +type BotsClientListSecretsOptions struct { + // placeholder for future optional parameters +} + +// BotsClientRegenerateAPIJwtSecretOptions contains the optional parameters for the BotsClient.RegenerateAPIJwtSecret method. +type BotsClientRegenerateAPIJwtSecretOptions struct { // placeholder for future optional parameters } @@ -143,6 +154,36 @@ type Identity struct { TenantID *string } +// Key - An entry of HealthBotKeysResponse +type Key struct { + // The name of the key. + KeyName *string + + // The value of the key. + Value *string +} + +// KeyVaultProperties - Properties of the key vault. +type KeyVaultProperties struct { + // REQUIRED; The name of the key vault key. + KeyName *string + + // REQUIRED; The Uri of the key vault. + KeyVaultURI *string + + // The version of the key vault key. + KeyVersion *string + + // The user assigned identity (ARM resource id) that has access to the key. + UserIdentity *string +} + +// KeysResponse - Health Bot Keys Response. +type KeysResponse struct { + // Array of Azure Health Bot Secrets. + Secrets []*Key +} + // OperationDetail - Operation detail payload type OperationDetail struct { // Display of the operation @@ -185,6 +226,9 @@ type OperationsClientListOptions struct { // in Healthcare organizations to build and deploy their compliant, AI-powered virtual health // assistants and health bots, that help them improve processes and reduce costs. type Properties struct { + // KeyVault properties for the resource encryption. + KeyVaultProperties *KeyVaultProperties + // READ-ONLY; The link. BotManagementPortalLink *string @@ -261,6 +305,9 @@ type UpdateParameters struct { Identity *Identity Location *string + // Properties of Azure Health Bot. + Properties *Properties + // SKU of the Azure Health Bot. SKU *SKU diff --git a/sdk/resourcemanager/healthbot/armhealthbot/models_serde.go b/sdk/resourcemanager/healthbot/armhealthbot/models_serde.go index d63ec26277af..df5c275399bc 100644 --- a/sdk/resourcemanager/healthbot/armhealthbot/models_serde.go +++ b/sdk/resourcemanager/healthbot/armhealthbot/models_serde.go @@ -277,6 +277,103 @@ func (i *Identity) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type Key. +func (k Key) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "keyName", k.KeyName) + populate(objectMap, "value", k.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Key. +func (k *Key) 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", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "keyName": + err = unpopulate(val, "KeyName", &k.KeyName) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &k.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type KeyVaultProperties. +func (k KeyVaultProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "keyName", k.KeyName) + populate(objectMap, "keyVaultUri", k.KeyVaultURI) + populate(objectMap, "keyVersion", k.KeyVersion) + populate(objectMap, "userIdentity", k.UserIdentity) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultProperties. +func (k *KeyVaultProperties) 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", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "keyName": + err = unpopulate(val, "KeyName", &k.KeyName) + delete(rawMsg, key) + case "keyVaultUri": + err = unpopulate(val, "KeyVaultURI", &k.KeyVaultURI) + delete(rawMsg, key) + case "keyVersion": + err = unpopulate(val, "KeyVersion", &k.KeyVersion) + delete(rawMsg, key) + case "userIdentity": + err = unpopulate(val, "UserIdentity", &k.UserIdentity) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type KeysResponse. +func (k KeysResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "secrets", k.Secrets) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KeysResponse. +func (k *KeysResponse) 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", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "secrets": + err = unpopulate(val, "Secrets", &k.Secrets) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type OperationDetail. func (o OperationDetail) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -363,6 +460,7 @@ func (o *OperationDisplay) UnmarshalJSON(data []byte) error { func (p Properties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "botManagementPortalLink", p.BotManagementPortalLink) + populate(objectMap, "keyVaultProperties", p.KeyVaultProperties) populate(objectMap, "provisioningState", p.ProvisioningState) return json.Marshal(objectMap) } @@ -379,6 +477,9 @@ func (p *Properties) UnmarshalJSON(data []byte) error { case "botManagementPortalLink": err = unpopulate(val, "BotManagementPortalLink", &p.BotManagementPortalLink) delete(rawMsg, key) + case "keyVaultProperties": + err = unpopulate(val, "KeyVaultProperties", &p.KeyVaultProperties) + delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) delete(rawMsg, key) @@ -555,6 +656,7 @@ func (u UpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "identity", u.Identity) populate(objectMap, "location", u.Location) + populate(objectMap, "properties", u.Properties) populate(objectMap, "sku", u.SKU) populate(objectMap, "tags", u.Tags) return json.Marshal(objectMap) @@ -575,6 +677,9 @@ func (u *UpdateParameters) UnmarshalJSON(data []byte) error { case "location": err = unpopulate(val, "Location", &u.Location) delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &u.Properties) + delete(rawMsg, key) case "sku": err = unpopulate(val, "SKU", &u.SKU) delete(rawMsg, key) diff --git a/sdk/resourcemanager/healthbot/armhealthbot/operations_client.go b/sdk/resourcemanager/healthbot/armhealthbot/operations_client.go index e2a6ee0885c4..9dac270b4fa5 100644 --- a/sdk/resourcemanager/healthbot/armhealthbot/operations_client.go +++ b/sdk/resourcemanager/healthbot/armhealthbot/operations_client.go @@ -40,7 +40,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Lists all the available Azure Health Bot operations. // -// Generated from API version 2021-06-10 +// Generated from API version 2023-05-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]{ @@ -78,7 +78,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-10") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/healthbot/armhealthbot/operations_client_example_test.go b/sdk/resourcemanager/healthbot/armhealthbot/operations_client_example_test.go deleted file mode 100644 index 0036e3709f6b..000000000000 --- a/sdk/resourcemanager/healthbot/armhealthbot/operations_client_example_test.go +++ /dev/null @@ -1,76 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armhealthbot_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/healthbot/armhealthbot" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2021-06-10/examples/GetOperations.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 := armhealthbot.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AvailableOperations = armhealthbot.AvailableOperations{ - // Value: []*armhealthbot.OperationDetail{ - // { - // Name: to.Ptr("Microsoft.Healthbot/healthbots/read"), - // Display: &armhealthbot.OperationDisplay{ - // Description: to.Ptr("Read Azure Health Bot"), - // Operation: to.Ptr("Read Azure Health Bot"), - // Provider: to.Ptr("Azure Health Bot"), - // Resource: to.Ptr("Azure Health Bot"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Healthbot/healthbots/write"), - // Display: &armhealthbot.OperationDisplay{ - // Description: to.Ptr("Writes Azure Health Bot"), - // Operation: to.Ptr("Write Azure Health Bot"), - // Provider: to.Ptr("Azure Health Bot"), - // Resource: to.Ptr("Azure Health Bot"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Healthbot/healthbots/delete"), - // Display: &armhealthbot.OperationDisplay{ - // Description: to.Ptr("Deletes Azure Health Bot"), - // Operation: to.Ptr("Delete Azure Health Bot"), - // Provider: to.Ptr("Azure Health Bot"), - // Resource: to.Ptr("Azure Health Bot"), - // }, - // Origin: to.Ptr("user,system"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/healthbot/armhealthbot/response_types.go b/sdk/resourcemanager/healthbot/armhealthbot/response_types.go index 90560119ebe2..79adb91efecd 100644 --- a/sdk/resourcemanager/healthbot/armhealthbot/response_types.go +++ b/sdk/resourcemanager/healthbot/armhealthbot/response_types.go @@ -34,7 +34,17 @@ type BotsClientListResponse struct { BotResponseList } -// BotsClientUpdateResponse contains the response from method BotsClient.Update. +// BotsClientListSecretsResponse contains the response from method BotsClient.ListSecrets. +type BotsClientListSecretsResponse struct { + KeysResponse +} + +// BotsClientRegenerateAPIJwtSecretResponse contains the response from method BotsClient.RegenerateAPIJwtSecret. +type BotsClientRegenerateAPIJwtSecretResponse struct { + Key +} + +// BotsClientUpdateResponse contains the response from method BotsClient.BeginUpdate. type BotsClientUpdateResponse struct { HealthBot }