diff --git a/go.mod b/go.mod index aa3963b8..3284f417 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/hashicorp/terraform-exec v0.21.0 github.com/hashicorp/terraform-json v0.22.1 github.com/hashicorp/terraform-plugin-sdk/v2 v2.34.0 - github.com/magodo/aztft v0.3.1-0.20240802001407-2834614c6d9c + github.com/magodo/aztft v0.3.1-0.20241011060757-310738ca90dd github.com/magodo/tfadd v0.10.1-0.20240902124619-bd18a56f410d github.com/mitchellh/cli v1.1.5 github.com/zclconf/go-cty v1.15.0 @@ -29,6 +29,7 @@ require ( github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automation/armautomation v0.8.1 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice v1.1.1 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn v1.1.1 // indirect + github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices v1.6.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5 v5.7.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/costmanagement/armcostmanagement/v2 v2.0.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datafactory/armdatafactory/v7 v7.0.0 // indirect diff --git a/go.sum b/go.sum index d0f74bc7..8aa44444 100644 --- a/go.sum +++ b/go.sum @@ -24,6 +24,8 @@ github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice v github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice v1.1.1/go.mod h1:ojs9TglxCeuWMnDYKzvkpye1rT3w6NKoNcuo4TqzaD4= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn v1.1.1 h1:CtE6GCP9YEDF6DjpFxl7xQBqklqfyCC/xkBKUGa/IAc= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn v1.1.1/go.mod h1:b9yk+8vyxSsBsiEjk9kzrwxgyn+7+J4HzDOYUPznES4= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices v1.6.0 h1:TiYjDq0LCNgtee1teMayYT5FjHmlunWUpthVANUXYPM= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices v1.6.0/go.mod h1:yErdzWZBzjNJCnbC1DcUcSVhjTgllT4PyOenFSeXSJI= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5 v5.7.0 h1:LkHbJbgF3YyvC53aqYGR+wWQDn2Rdp9AQdGndf9QvY4= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5 v5.7.0/go.mod h1:QyiQdW4f4/BIfB8ZutZ2s+28RAgfa/pT+zS++ZHyM1I= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/costmanagement/armcostmanagement/v2 v2.0.0 h1:xHWCrCQT1TUlDZ5yJ2kOilHx1FNSb0Y4vpPDL6EXfmk= @@ -227,8 +229,8 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0 github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/magodo/armid v0.0.0-20230511151020-27880e5961c3 h1:ob6vk6PlChZvutcxcLnmPH/VNmJEuwz+TmCYCVtJqeA= github.com/magodo/armid v0.0.0-20230511151020-27880e5961c3/go.mod h1:rR8E7zfGMbmfnSQvrkFiWYdhrfTqsVSltelnZB09BwA= -github.com/magodo/aztft v0.3.1-0.20240802001407-2834614c6d9c h1:6H0Rxt63ep2TlQVbevMfOId7cojsp9FzKkNDFR0rnco= -github.com/magodo/aztft v0.3.1-0.20240802001407-2834614c6d9c/go.mod h1:CHeYYR+/RTjUry+0bpkI49PvQ/1sTe7itA+9BqKE1/8= +github.com/magodo/aztft v0.3.1-0.20241011060757-310738ca90dd h1:6UcyxroC+nV2KcalwYWrkD011QXTHyEwEF2JcoYeRjU= +github.com/magodo/aztft v0.3.1-0.20241011060757-310738ca90dd/go.mod h1:KQixUbCSpXiFkjLyy0lrtZY+2doHvJ1EIdtyhmVs3KQ= github.com/magodo/tfadd v0.10.1-0.20240902124619-bd18a56f410d h1:dmS4jSfNIfshWkh43yK4n1Qx0BsaKrfxMiqRg0fKKYw= github.com/magodo/tfadd v0.10.1-0.20240902124619-bd18a56f410d/go.mod h1:G2Hc13YaLGHa+CPEP/HZzj9sIGyKDM5ZXInzQ8Dp86s= github.com/magodo/tfpluginschema v0.0.0-20240902090353-0525d7d8c1c2 h1:Unxx8WLxzSxINnq7hItp4cXD7drihgfPltTd91efoBo= diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/CHANGELOG.md new file mode 100644 index 00000000..a0697812 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/CHANGELOG.md @@ -0,0 +1,113 @@ +# Release History + +## 1.6.0 (2023-11-24) +### Features Added + +- Support for test fakes and OpenTelemetry trace spans. + + +## 1.5.0 (2023-07-28) +### Features Added + +- New value `DeploymentProvisioningStateCanceled`, `DeploymentProvisioningStateDisabled` added to enum type `DeploymentProvisioningState` +- New value `HostingModelProvisionedWeb` added to enum type `HostingModel` +- New enum type `AbusePenaltyAction` with values `AbusePenaltyActionBlock`, `AbusePenaltyActionThrottle` +- New enum type `DeploymentModelVersionUpgradeOption` with values `DeploymentModelVersionUpgradeOptionNoAutoUpgrade`, `DeploymentModelVersionUpgradeOptionOnceCurrentVersionExpired`, `DeploymentModelVersionUpgradeOptionOnceNewDefaultVersionAvailable` +- New function `*ClientFactory.NewModelsClient() *ModelsClient` +- New function `*ClientFactory.NewUsagesClient() *UsagesClient` +- New function `NewModelsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ModelsClient, error)` +- New function `*ModelsClient.NewListPager(string, *ModelsClientListOptions) *runtime.Pager[ModelsClientListResponse]` +- New function `NewUsagesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*UsagesClient, error)` +- New function `*UsagesClient.NewListPager(string, *UsagesClientListOptions) *runtime.Pager[UsagesClientListResponse]` +- New struct `AbusePenalty` +- New struct `CapacityConfig` +- New struct `Model` +- New struct `ModelListResult` +- New struct `ModelSKU` +- New field `IsDefaultVersion`, `SKUs`, `Source` in struct `AccountModel` +- New field `AbusePenalty` in struct `AccountProperties` +- New field `ProvisioningIssues` in struct `CommitmentPlanProperties` +- New field `SKU` in struct `Deployment` +- New field `Source` in struct `DeploymentModel` +- New field `RateLimits`, `VersionUpgradeOption` in struct `DeploymentProperties` +- New field `NextLink` in struct `UsageListResult` + + +## 1.4.1 (2023-04-14) +### Bug Fixes + +- Fix serialization bug of empty value of `any` type. + +## 1.4.0 (2023-03-28) +### Features Added + +- New struct `ClientFactory` which is a client factory used to create any client in this module + + +## 1.3.0 (2023-02-24) +### Features Added + +- New type alias `CommitmentPlanProvisioningState` with values `CommitmentPlanProvisioningStateAccepted`, `CommitmentPlanProvisioningStateCanceled`, `CommitmentPlanProvisioningStateCreating`, `CommitmentPlanProvisioningStateDeleting`, `CommitmentPlanProvisioningStateFailed`, `CommitmentPlanProvisioningStateMoving`, `CommitmentPlanProvisioningStateSucceeded` +- New type alias `ModelLifecycleStatus` with values `ModelLifecycleStatusGenerallyAvailable`, `ModelLifecycleStatusPreview` +- New type alias `RoutingMethods` with values `RoutingMethodsPerformance`, `RoutingMethodsPriority`, `RoutingMethodsWeighted` +- New function `*CommitmentPlansClient.BeginCreateOrUpdateAssociation(context.Context, string, string, string, CommitmentPlanAccountAssociation, *CommitmentPlansClientBeginCreateOrUpdateAssociationOptions) (*runtime.Poller[CommitmentPlansClientCreateOrUpdateAssociationResponse], error)` +- New function `*CommitmentPlansClient.BeginCreateOrUpdatePlan(context.Context, string, string, CommitmentPlan, *CommitmentPlansClientBeginCreateOrUpdatePlanOptions) (*runtime.Poller[CommitmentPlansClientCreateOrUpdatePlanResponse], error)` +- New function `*CommitmentPlansClient.BeginDeleteAssociation(context.Context, string, string, string, *CommitmentPlansClientBeginDeleteAssociationOptions) (*runtime.Poller[CommitmentPlansClientDeleteAssociationResponse], error)` +- New function `*CommitmentPlansClient.BeginDeletePlan(context.Context, string, string, *CommitmentPlansClientBeginDeletePlanOptions) (*runtime.Poller[CommitmentPlansClientDeletePlanResponse], error)` +- New function `*CommitmentPlansClient.GetAssociation(context.Context, string, string, string, *CommitmentPlansClientGetAssociationOptions) (CommitmentPlansClientGetAssociationResponse, error)` +- New function `*CommitmentPlansClient.GetPlan(context.Context, string, string, *CommitmentPlansClientGetPlanOptions) (CommitmentPlansClientGetPlanResponse, error)` +- New function `*CommitmentPlansClient.NewListAssociationsPager(string, string, *CommitmentPlansClientListAssociationsOptions) *runtime.Pager[CommitmentPlansClientListAssociationsResponse]` +- New function `*CommitmentPlansClient.NewListPlansByResourceGroupPager(string, *CommitmentPlansClientListPlansByResourceGroupOptions) *runtime.Pager[CommitmentPlansClientListPlansByResourceGroupResponse]` +- New function `*CommitmentPlansClient.NewListPlansBySubscriptionPager(*CommitmentPlansClientListPlansBySubscriptionOptions) *runtime.Pager[CommitmentPlansClientListPlansBySubscriptionResponse]` +- New function `*CommitmentPlansClient.BeginUpdatePlan(context.Context, string, string, PatchResourceTagsAndSKU, *CommitmentPlansClientBeginUpdatePlanOptions) (*runtime.Poller[CommitmentPlansClientUpdatePlanResponse], error)` +- New struct `CommitmentPlanAccountAssociation` +- New struct `CommitmentPlanAccountAssociationListResult` +- New struct `CommitmentPlanAccountAssociationProperties` +- New struct `CommitmentPlanAssociation` +- New struct `CommitmentPlansClientCreateOrUpdateAssociationResponse` +- New struct `CommitmentPlansClientCreateOrUpdatePlanResponse` +- New struct `CommitmentPlansClientDeleteAssociationResponse` +- New struct `CommitmentPlansClientDeletePlanResponse` +- New struct `CommitmentPlansClientListAssociationsResponse` +- New struct `CommitmentPlansClientListPlansByResourceGroupResponse` +- New struct `CommitmentPlansClientListPlansBySubscriptionResponse` +- New struct `CommitmentPlansClientUpdatePlanResponse` +- New struct `MultiRegionSettings` +- New struct `PatchResourceTags` +- New struct `PatchResourceTagsAndSKU` +- New struct `RegionSetting` +- New field `FinetuneCapabilities` in struct `AccountModel` +- New field `LifecycleStatus` in struct `AccountModel` +- New field `CommitmentPlanAssociations` in struct `AccountProperties` +- New field `Locations` in struct `AccountProperties` +- New field `Kind` in struct `CommitmentPlan` +- New field `Location` in struct `CommitmentPlan` +- New field `SKU` in struct `CommitmentPlan` +- New field `Tags` in struct `CommitmentPlan` +- New field `CommitmentPlanGUID` in struct `CommitmentPlanProperties` +- New field `ProvisioningState` in struct `CommitmentPlanProperties` + + +## 1.2.0 (2022-10-20) +### Features Added + +- New field `CallRateLimit` in struct `DeploymentProperties` +- New field `Capabilities` in struct `DeploymentProperties` +- New field `RaiPolicyName` in struct `DeploymentProperties` +- New field `CallRateLimit` in struct `AccountModel` +- New field `CallRateLimit` in struct `DeploymentModel` + + +## 1.1.0 (2022-06-09) +### Features Added + +- New const `DeploymentScaleTypeStandard` + + +## 1.0.0 (2022-05-17) + +The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices` is using our [next generation design principles](https://azure.github.io/azure-sdk/general_introduction.html) since version 1.0.0, which contains breaking changes. + +To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/azsdk/go/mgmt/migration). + +To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/go/mgmt). \ No newline at end of file diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/LICENSE.txt b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/LICENSE.txt new file mode 100644 index 00000000..dc0c2ffb --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/LICENSE.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Microsoft Corporation. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/README.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/README.md new file mode 100644 index 00000000..86e50136 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/README.md @@ -0,0 +1,92 @@ +# Azure Cognitive Services Module for Go + +[![PkgGoDev](https://pkg.go.dev/badge/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices)](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices) + +The `armcognitiveservices` module provides operations for working with Azure Cognitive Services. + +[Source code](https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/resourcemanager/cognitiveservices/armcognitiveservices) + +# Getting started + +## Prerequisites + +- an [Azure subscription](https://azure.microsoft.com/free/) +- Go 1.18 or above (You could download and install the latest version of Go from [here](https://go.dev/doc/install). It will replace the existing Go on your machine. If you want to install multiple Go versions on the same machine, you could refer this [doc](https://go.dev/doc/manage-install).) + +## Install the package + +This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for versioning and dependency management. + +Install the Azure Cognitive Services module: + +```sh +go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices +``` + +## Authorization + +When creating a client, you will need to provide a credential for authenticating with Azure Cognitive Services. The `azidentity` module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more. + +```go +cred, err := azidentity.NewDefaultAzureCredential(nil) +``` + +For more information on authentication, please see the documentation for `azidentity` at [pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity). + +## Client Factory + +Azure Cognitive Services module consists of one or more clients. We provide a client factory which could be used to create any client in this module. + +```go +clientFactory, err := armX.NewClientFactory(, cred, nil) +``` + +You can use `ClientOptions` in package `github.com/Azure/azure-sdk-for-go/sdk/azcore/arm` to set endpoint to connect with public and sovereign clouds as well as Azure Stack. For more information, please see the documentation for `azcore` at [pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore). + +```go +options := armcognitiveservices.ClientOptions { + ClientOptions: azcore.ClientOptions { + Cloud: cloud.AzureChina, + }, +} +clientFactory, err := armcognitiveservices.NewClientFactory(, cred, &options) +``` + +## Clients + +A client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory. + +```go +client := clientFactory.NewAccountsClient() +``` + +## Fakes + +The fake package contains types used for constructing in-memory fake servers used in unit tests. +This allows writing tests to cover various success/error conditions without the need for connecting to a live service. + +Please see https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/samples/fakes for details and examples on how to use fakes. + +## Provide Feedback + +If you encounter bugs or have suggestions, please +[open an issue](https://github.com/Azure/azure-sdk-for-go/issues) and assign the `Cognitive Services` label. + +# Contributing + +This project welcomes contributions and suggestions. Most contributions require +you to agree to a Contributor License Agreement (CLA) declaring that you have +the right to, and actually do, grant us the rights to use your contribution. +For details, visit [https://cla.microsoft.com](https://cla.microsoft.com). + +When you submit a pull request, a CLA-bot will automatically determine whether +you need to provide a CLA and decorate the PR appropriately (e.g., label, +comment). Simply follow the instructions provided by the bot. You will only +need to do this once across all repos using our CLA. + +This project has adopted the +[Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). +For more information, see the +[Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) +or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any +additional questions or comments. \ No newline at end of file diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/accounts_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/accounts_client.go new file mode 100644 index 00000000..bd3916f2 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/accounts_client.go @@ -0,0 +1,784 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armcognitiveservices + +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" +) + +// AccountsClient contains the methods for the Accounts group. +// Don't use this type directly, use NewAccountsClient() instead. +type AccountsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewAccountsClient creates a new instance of AccountsClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewAccountsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AccountsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &AccountsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreate - Create Cognitive Services Account. Accounts is a resource group wide resource type. It holds the keys for +// developer to access intelligent APIs. It's also the resource type for billing. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of Cognitive Services account. +// - account - The parameters to provide for the created account. +// - options - AccountsClientBeginCreateOptions contains the optional parameters for the AccountsClient.BeginCreate method. +func (client *AccountsClient) BeginCreate(ctx context.Context, resourceGroupName string, accountName string, account Account, options *AccountsClientBeginCreateOptions) (*runtime.Poller[AccountsClientCreateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.create(ctx, resourceGroupName, accountName, account, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccountsClientCreateResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[AccountsClientCreateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Create - Create Cognitive Services Account. Accounts is a resource group wide resource type. It holds the keys for developer +// to access intelligent APIs. It's also the resource type for billing. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +func (client *AccountsClient) create(ctx context.Context, resourceGroupName string, accountName string, account Account, options *AccountsClientBeginCreateOptions) (*http.Response, error) { + var err error + const operationName = "AccountsClient.BeginCreate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createCreateRequest(ctx, resourceGroupName, accountName, account, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createCreateRequest creates the Create request. +func (client *AccountsClient) createCreateRequest(ctx context.Context, resourceGroupName string, accountName string, account Account, options *AccountsClientBeginCreateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + 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-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, account); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Deletes a Cognitive Services account from the resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of Cognitive Services account. +// - options - AccountsClientBeginDeleteOptions contains the optional parameters for the AccountsClient.BeginDelete method. +func (client *AccountsClient) BeginDelete(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientBeginDeleteOptions) (*runtime.Poller[AccountsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, accountName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccountsClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[AccountsClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Deletes a Cognitive Services account from the resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +func (client *AccountsClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "AccountsClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *AccountsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + 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-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Returns a Cognitive Services account specified by the parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of Cognitive Services account. +// - options - AccountsClientGetOptions contains the optional parameters for the AccountsClient.Get method. +func (client *AccountsClient) Get(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientGetOptions) (AccountsClientGetResponse, error) { + var err error + const operationName = "AccountsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, options) + if err != nil { + return AccountsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AccountsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AccountsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *AccountsClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + 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-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *AccountsClient) getHandleResponse(resp *http.Response) (AccountsClientGetResponse, error) { + result := AccountsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Account); err != nil { + return AccountsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Returns all the resources of a particular type belonging to a subscription. +// +// Generated from API version 2023-05-01 +// - options - AccountsClientListOptions contains the optional parameters for the AccountsClient.NewListPager method. +func (client *AccountsClient) NewListPager(options *AccountsClientListOptions) *runtime.Pager[AccountsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[AccountsClientListResponse]{ + More: func(page AccountsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *AccountsClientListResponse) (AccountsClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "AccountsClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, options) + }, nil) + if err != nil { + return AccountsClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *AccountsClient) listCreateRequest(ctx context.Context, options *AccountsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/accounts" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + 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-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *AccountsClient) listHandleResponse(resp *http.Response) (AccountsClientListResponse, error) { + result := AccountsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AccountListResult); err != nil { + return AccountsClientListResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - Returns all the resources of a particular type belonging to a resource group +// +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - options - AccountsClientListByResourceGroupOptions contains the optional parameters for the AccountsClient.NewListByResourceGroupPager +// method. +func (client *AccountsClient) NewListByResourceGroupPager(resourceGroupName string, options *AccountsClientListByResourceGroupOptions) *runtime.Pager[AccountsClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[AccountsClientListByResourceGroupResponse]{ + More: func(page AccountsClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *AccountsClientListByResourceGroupResponse) (AccountsClientListByResourceGroupResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "AccountsClient.NewListByResourceGroupPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + }, nil) + if err != nil { + return AccountsClientListByResourceGroupResponse{}, err + } + return client.listByResourceGroupHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *AccountsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *AccountsClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + 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-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *AccountsClient) listByResourceGroupHandleResponse(resp *http.Response) (AccountsClientListByResourceGroupResponse, error) { + result := AccountsClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AccountListResult); err != nil { + return AccountsClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// ListKeys - Lists the account keys for the specified Cognitive Services account. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of Cognitive Services account. +// - options - AccountsClientListKeysOptions contains the optional parameters for the AccountsClient.ListKeys method. +func (client *AccountsClient) ListKeys(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientListKeysOptions) (AccountsClientListKeysResponse, error) { + var err error + const operationName = "AccountsClient.ListKeys" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.listKeysCreateRequest(ctx, resourceGroupName, accountName, options) + if err != nil { + return AccountsClientListKeysResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AccountsClientListKeysResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AccountsClientListKeysResponse{}, err + } + resp, err := client.listKeysHandleResponse(httpResp) + return resp, err +} + +// listKeysCreateRequest creates the ListKeys request. +func (client *AccountsClient) listKeysCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientListKeysOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/listKeys" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + 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 +} + +// listKeysHandleResponse handles the ListKeys response. +func (client *AccountsClient) listKeysHandleResponse(resp *http.Response) (AccountsClientListKeysResponse, error) { + result := AccountsClientListKeysResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.APIKeys); err != nil { + return AccountsClientListKeysResponse{}, err + } + return result, nil +} + +// NewListModelsPager - List available Models for the requested Cognitive Services account +// +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of Cognitive Services account. +// - options - AccountsClientListModelsOptions contains the optional parameters for the AccountsClient.NewListModelsPager method. +func (client *AccountsClient) NewListModelsPager(resourceGroupName string, accountName string, options *AccountsClientListModelsOptions) *runtime.Pager[AccountsClientListModelsResponse] { + return runtime.NewPager(runtime.PagingHandler[AccountsClientListModelsResponse]{ + More: func(page AccountsClientListModelsResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *AccountsClientListModelsResponse) (AccountsClientListModelsResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "AccountsClient.NewListModelsPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listModelsCreateRequest(ctx, resourceGroupName, accountName, options) + }, nil) + if err != nil { + return AccountsClientListModelsResponse{}, err + } + return client.listModelsHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listModelsCreateRequest creates the ListModels request. +func (client *AccountsClient) listModelsCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientListModelsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/models" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + 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-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listModelsHandleResponse handles the ListModels response. +func (client *AccountsClient) listModelsHandleResponse(resp *http.Response) (AccountsClientListModelsResponse, error) { + result := AccountsClientListModelsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AccountModelListResult); err != nil { + return AccountsClientListModelsResponse{}, err + } + return result, nil +} + +// ListSKUs - List available SKUs for the requested Cognitive Services account +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of Cognitive Services account. +// - options - AccountsClientListSKUsOptions contains the optional parameters for the AccountsClient.ListSKUs method. +func (client *AccountsClient) ListSKUs(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientListSKUsOptions) (AccountsClientListSKUsResponse, error) { + var err error + const operationName = "AccountsClient.ListSKUs" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.listSKUsCreateRequest(ctx, resourceGroupName, accountName, options) + if err != nil { + return AccountsClientListSKUsResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AccountsClientListSKUsResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AccountsClientListSKUsResponse{}, err + } + resp, err := client.listSKUsHandleResponse(httpResp) + return resp, err +} + +// listSKUsCreateRequest creates the ListSKUs request. +func (client *AccountsClient) listSKUsCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientListSKUsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/skus" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + 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-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listSKUsHandleResponse handles the ListSKUs response. +func (client *AccountsClient) listSKUsHandleResponse(resp *http.Response) (AccountsClientListSKUsResponse, error) { + result := AccountsClientListSKUsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AccountSKUListResult); err != nil { + return AccountsClientListSKUsResponse{}, err + } + return result, nil +} + +// ListUsages - Get usages for the requested Cognitive Services account +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of Cognitive Services account. +// - options - AccountsClientListUsagesOptions contains the optional parameters for the AccountsClient.ListUsages method. +func (client *AccountsClient) ListUsages(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientListUsagesOptions) (AccountsClientListUsagesResponse, error) { + var err error + const operationName = "AccountsClient.ListUsages" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.listUsagesCreateRequest(ctx, resourceGroupName, accountName, options) + if err != nil { + return AccountsClientListUsagesResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AccountsClientListUsagesResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AccountsClientListUsagesResponse{}, err + } + resp, err := client.listUsagesHandleResponse(httpResp) + return resp, err +} + +// listUsagesCreateRequest creates the ListUsages request. +func (client *AccountsClient) listUsagesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientListUsagesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/usages" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + 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-05-01") + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listUsagesHandleResponse handles the ListUsages response. +func (client *AccountsClient) listUsagesHandleResponse(resp *http.Response) (AccountsClientListUsagesResponse, error) { + result := AccountsClientListUsagesResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.UsageListResult); err != nil { + return AccountsClientListUsagesResponse{}, err + } + return result, nil +} + +// RegenerateKey - Regenerates the specified account key for the specified Cognitive Services account. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of Cognitive Services account. +// - parameters - regenerate key parameters. +// - options - AccountsClientRegenerateKeyOptions contains the optional parameters for the AccountsClient.RegenerateKey method. +func (client *AccountsClient) RegenerateKey(ctx context.Context, resourceGroupName string, accountName string, parameters RegenerateKeyParameters, options *AccountsClientRegenerateKeyOptions) (AccountsClientRegenerateKeyResponse, error) { + var err error + const operationName = "AccountsClient.RegenerateKey" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.regenerateKeyCreateRequest(ctx, resourceGroupName, accountName, parameters, options) + if err != nil { + return AccountsClientRegenerateKeyResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AccountsClientRegenerateKeyResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AccountsClientRegenerateKeyResponse{}, err + } + resp, err := client.regenerateKeyHandleResponse(httpResp) + return resp, err +} + +// regenerateKeyCreateRequest creates the RegenerateKey request. +func (client *AccountsClient) regenerateKeyCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters RegenerateKeyParameters, options *AccountsClientRegenerateKeyOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/regenerateKey" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + 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"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// regenerateKeyHandleResponse handles the RegenerateKey response. +func (client *AccountsClient) regenerateKeyHandleResponse(resp *http.Response) (AccountsClientRegenerateKeyResponse, error) { + result := AccountsClientRegenerateKeyResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.APIKeys); err != nil { + return AccountsClientRegenerateKeyResponse{}, err + } + return result, nil +} + +// BeginUpdate - Updates a Cognitive Services account +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of Cognitive Services account. +// - account - The parameters to provide for the created account. +// - options - AccountsClientBeginUpdateOptions contains the optional parameters for the AccountsClient.BeginUpdate method. +func (client *AccountsClient) BeginUpdate(ctx context.Context, resourceGroupName string, accountName string, account Account, options *AccountsClientBeginUpdateOptions) (*runtime.Poller[AccountsClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, accountName, account, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccountsClientUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[AccountsClientUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Update - Updates a Cognitive Services account +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +func (client *AccountsClient) update(ctx context.Context, resourceGroupName string, accountName string, account Account, options *AccountsClientBeginUpdateOptions) (*http.Response, error) { + var err error + const operationName = "AccountsClient.BeginUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, account, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// updateCreateRequest creates the Update request. +func (client *AccountsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, account Account, options *AccountsClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, 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"} + if err := runtime.MarshalAsJSON(req, account); err != nil { + return nil, err + } + return req, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/autorest.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/autorest.md new file mode 100644 index 00000000..900c143a --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/autorest.md @@ -0,0 +1,13 @@ +### AutoRest Configuration + +> see https://aka.ms/autorest + +``` yaml +azure-arm: true +require: +- https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/cognitiveservices/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/cognitiveservices/resource-manager/readme.go.md +license-header: MICROSOFT_MIT_NO_VERSION +module-version: 1.6.0 +tag: package-2023-05 +``` \ No newline at end of file diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/build.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/build.go new file mode 100644 index 00000000..e7c96219 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/build.go @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +// This file enables 'go generate' to regenerate this specific SDK +//go:generate pwsh ../../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate resourcemanager/cognitiveservices/armcognitiveservices + +package armcognitiveservices diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/ci.yml b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/ci.yml new file mode 100644 index 00000000..7b3b514d --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/ci.yml @@ -0,0 +1,28 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. +trigger: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourcemanager/cognitiveservices/armcognitiveservices/ + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourcemanager/cognitiveservices/armcognitiveservices/ + +stages: +- template: /eng/pipelines/templates/jobs/archetype-sdk-client.yml + parameters: + IncludeRelease: true + ServiceDirectory: 'resourcemanager/cognitiveservices/armcognitiveservices' diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/client_factory.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/client_factory.go new file mode 100644 index 00000000..eda98b5e --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/client_factory.go @@ -0,0 +1,110 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armcognitiveservices + +import ( + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" +) + +// ClientFactory is a client factory used to create any client in this module. +// Don't use this type directly, use NewClientFactory instead. +type ClientFactory struct { + subscriptionID string + credential azcore.TokenCredential + options *arm.ClientOptions +} + +// NewClientFactory creates a new instance of ClientFactory with the specified values. +// The parameter values will be propagated to any client created from this factory. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) { + _, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + return &ClientFactory{ + subscriptionID: subscriptionID, credential: credential, + options: options.Clone(), + }, nil +} + +// NewAccountsClient creates a new instance of AccountsClient. +func (c *ClientFactory) NewAccountsClient() *AccountsClient { + subClient, _ := NewAccountsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +// NewCommitmentPlansClient creates a new instance of CommitmentPlansClient. +func (c *ClientFactory) NewCommitmentPlansClient() *CommitmentPlansClient { + subClient, _ := NewCommitmentPlansClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +// NewCommitmentTiersClient creates a new instance of CommitmentTiersClient. +func (c *ClientFactory) NewCommitmentTiersClient() *CommitmentTiersClient { + subClient, _ := NewCommitmentTiersClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +// NewDeletedAccountsClient creates a new instance of DeletedAccountsClient. +func (c *ClientFactory) NewDeletedAccountsClient() *DeletedAccountsClient { + subClient, _ := NewDeletedAccountsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +// NewDeploymentsClient creates a new instance of DeploymentsClient. +func (c *ClientFactory) NewDeploymentsClient() *DeploymentsClient { + subClient, _ := NewDeploymentsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +// NewManagementClient creates a new instance of ManagementClient. +func (c *ClientFactory) NewManagementClient() *ManagementClient { + subClient, _ := NewManagementClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +// NewModelsClient creates a new instance of ModelsClient. +func (c *ClientFactory) NewModelsClient() *ModelsClient { + subClient, _ := NewModelsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +// NewOperationsClient creates a new instance of OperationsClient. +func (c *ClientFactory) NewOperationsClient() *OperationsClient { + subClient, _ := NewOperationsClient(c.credential, c.options) + return subClient +} + +// NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient. +func (c *ClientFactory) NewPrivateEndpointConnectionsClient() *PrivateEndpointConnectionsClient { + subClient, _ := NewPrivateEndpointConnectionsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +// NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient. +func (c *ClientFactory) NewPrivateLinkResourcesClient() *PrivateLinkResourcesClient { + subClient, _ := NewPrivateLinkResourcesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +// NewResourceSKUsClient creates a new instance of ResourceSKUsClient. +func (c *ClientFactory) NewResourceSKUsClient() *ResourceSKUsClient { + subClient, _ := NewResourceSKUsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +// NewUsagesClient creates a new instance of UsagesClient. +func (c *ClientFactory) NewUsagesClient() *UsagesClient { + subClient, _ := NewUsagesClient(c.subscriptionID, c.credential, c.options) + return subClient +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/commitmentplans_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/commitmentplans_client.go new file mode 100644 index 00000000..8ec8b1b0 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/commitmentplans_client.go @@ -0,0 +1,1054 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armcognitiveservices + +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" +) + +// CommitmentPlansClient contains the methods for the CommitmentPlans group. +// Don't use this type directly, use NewCommitmentPlansClient() instead. +type CommitmentPlansClient struct { + internal *arm.Client + subscriptionID string +} + +// NewCommitmentPlansClient creates a new instance of CommitmentPlansClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewCommitmentPlansClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CommitmentPlansClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &CommitmentPlansClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CreateOrUpdate - Update the state of specified commitmentPlans associated with the Cognitive Services account. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of Cognitive Services account. +// - commitmentPlanName - The name of the commitmentPlan associated with the Cognitive Services Account +// - commitmentPlan - The commitmentPlan properties. +// - options - CommitmentPlansClientCreateOrUpdateOptions contains the optional parameters for the CommitmentPlansClient.CreateOrUpdate +// method. +func (client *CommitmentPlansClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, commitmentPlanName string, commitmentPlan CommitmentPlan, options *CommitmentPlansClientCreateOrUpdateOptions) (CommitmentPlansClientCreateOrUpdateResponse, error) { + var err error + const operationName = "CommitmentPlansClient.CreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, accountName, commitmentPlanName, commitmentPlan, options) + if err != nil { + return CommitmentPlansClientCreateOrUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return CommitmentPlansClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return CommitmentPlansClientCreateOrUpdateResponse{}, err + } + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *CommitmentPlansClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, commitmentPlanName string, commitmentPlan CommitmentPlan, options *CommitmentPlansClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/commitmentPlans/{commitmentPlanName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if commitmentPlanName == "" { + return nil, errors.New("parameter commitmentPlanName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{commitmentPlanName}", url.PathEscape(commitmentPlanName)) + 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-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, commitmentPlan); err != nil { + return nil, err + } + return req, nil +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *CommitmentPlansClient) createOrUpdateHandleResponse(resp *http.Response) (CommitmentPlansClientCreateOrUpdateResponse, error) { + result := CommitmentPlansClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CommitmentPlan); err != nil { + return CommitmentPlansClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// BeginCreateOrUpdateAssociation - Create or update the association of the Cognitive Services commitment plan. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - commitmentPlanName - The name of the commitmentPlan associated with the Cognitive Services Account +// - commitmentPlanAssociationName - The name of the commitment plan association with the Cognitive Services Account +// - association - The commitmentPlan properties. +// - options - CommitmentPlansClientBeginCreateOrUpdateAssociationOptions contains the optional parameters for the CommitmentPlansClient.BeginCreateOrUpdateAssociation +// method. +func (client *CommitmentPlansClient) BeginCreateOrUpdateAssociation(ctx context.Context, resourceGroupName string, commitmentPlanName string, commitmentPlanAssociationName string, association CommitmentPlanAccountAssociation, options *CommitmentPlansClientBeginCreateOrUpdateAssociationOptions) (*runtime.Poller[CommitmentPlansClientCreateOrUpdateAssociationResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdateAssociation(ctx, resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, association, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CommitmentPlansClientCreateOrUpdateAssociationResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CommitmentPlansClientCreateOrUpdateAssociationResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdateAssociation - Create or update the association of the Cognitive Services commitment plan. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +func (client *CommitmentPlansClient) createOrUpdateAssociation(ctx context.Context, resourceGroupName string, commitmentPlanName string, commitmentPlanAssociationName string, association CommitmentPlanAccountAssociation, options *CommitmentPlansClientBeginCreateOrUpdateAssociationOptions) (*http.Response, error) { + var err error + const operationName = "CommitmentPlansClient.BeginCreateOrUpdateAssociation" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateAssociationCreateRequest(ctx, resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, association, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateAssociationCreateRequest creates the CreateOrUpdateAssociation request. +func (client *CommitmentPlansClient) createOrUpdateAssociationCreateRequest(ctx context.Context, resourceGroupName string, commitmentPlanName string, commitmentPlanAssociationName string, association CommitmentPlanAccountAssociation, options *CommitmentPlansClientBeginCreateOrUpdateAssociationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}/accountAssociations/{commitmentPlanAssociationName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if commitmentPlanName == "" { + return nil, errors.New("parameter commitmentPlanName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{commitmentPlanName}", url.PathEscape(commitmentPlanName)) + if commitmentPlanAssociationName == "" { + return nil, errors.New("parameter commitmentPlanAssociationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{commitmentPlanAssociationName}", url.PathEscape(commitmentPlanAssociationName)) + 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-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, association); err != nil { + return nil, err + } + return req, nil +} + +// BeginCreateOrUpdatePlan - Create Cognitive Services commitment plan. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - commitmentPlanName - The name of the commitmentPlan associated with the Cognitive Services Account +// - commitmentPlan - The parameters to provide for the created commitment plan. +// - options - CommitmentPlansClientBeginCreateOrUpdatePlanOptions contains the optional parameters for the CommitmentPlansClient.BeginCreateOrUpdatePlan +// method. +func (client *CommitmentPlansClient) BeginCreateOrUpdatePlan(ctx context.Context, resourceGroupName string, commitmentPlanName string, commitmentPlan CommitmentPlan, options *CommitmentPlansClientBeginCreateOrUpdatePlanOptions) (*runtime.Poller[CommitmentPlansClientCreateOrUpdatePlanResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdatePlan(ctx, resourceGroupName, commitmentPlanName, commitmentPlan, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CommitmentPlansClientCreateOrUpdatePlanResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CommitmentPlansClientCreateOrUpdatePlanResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdatePlan - Create Cognitive Services commitment plan. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +func (client *CommitmentPlansClient) createOrUpdatePlan(ctx context.Context, resourceGroupName string, commitmentPlanName string, commitmentPlan CommitmentPlan, options *CommitmentPlansClientBeginCreateOrUpdatePlanOptions) (*http.Response, error) { + var err error + const operationName = "CommitmentPlansClient.BeginCreateOrUpdatePlan" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdatePlanCreateRequest(ctx, resourceGroupName, commitmentPlanName, commitmentPlan, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdatePlanCreateRequest creates the CreateOrUpdatePlan request. +func (client *CommitmentPlansClient) createOrUpdatePlanCreateRequest(ctx context.Context, resourceGroupName string, commitmentPlanName string, commitmentPlan CommitmentPlan, options *CommitmentPlansClientBeginCreateOrUpdatePlanOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if commitmentPlanName == "" { + return nil, errors.New("parameter commitmentPlanName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{commitmentPlanName}", url.PathEscape(commitmentPlanName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + 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-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, commitmentPlan); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Deletes the specified commitmentPlan associated with the Cognitive Services account. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of Cognitive Services account. +// - commitmentPlanName - The name of the commitmentPlan associated with the Cognitive Services Account +// - options - CommitmentPlansClientBeginDeleteOptions contains the optional parameters for the CommitmentPlansClient.BeginDelete +// method. +func (client *CommitmentPlansClient) BeginDelete(ctx context.Context, resourceGroupName string, accountName string, commitmentPlanName string, options *CommitmentPlansClientBeginDeleteOptions) (*runtime.Poller[CommitmentPlansClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, accountName, commitmentPlanName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CommitmentPlansClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CommitmentPlansClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Deletes the specified commitmentPlan associated with the Cognitive Services account. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +func (client *CommitmentPlansClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, commitmentPlanName string, options *CommitmentPlansClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "CommitmentPlansClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, commitmentPlanName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *CommitmentPlansClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, commitmentPlanName string, options *CommitmentPlansClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/commitmentPlans/{commitmentPlanName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if commitmentPlanName == "" { + return nil, errors.New("parameter commitmentPlanName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{commitmentPlanName}", url.PathEscape(commitmentPlanName)) + 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-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginDeleteAssociation - Deletes the association of the Cognitive Services commitment plan. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - commitmentPlanName - The name of the commitmentPlan associated with the Cognitive Services Account +// - commitmentPlanAssociationName - The name of the commitment plan association with the Cognitive Services Account +// - options - CommitmentPlansClientBeginDeleteAssociationOptions contains the optional parameters for the CommitmentPlansClient.BeginDeleteAssociation +// method. +func (client *CommitmentPlansClient) BeginDeleteAssociation(ctx context.Context, resourceGroupName string, commitmentPlanName string, commitmentPlanAssociationName string, options *CommitmentPlansClientBeginDeleteAssociationOptions) (*runtime.Poller[CommitmentPlansClientDeleteAssociationResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteAssociation(ctx, resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CommitmentPlansClientDeleteAssociationResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CommitmentPlansClientDeleteAssociationResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// DeleteAssociation - Deletes the association of the Cognitive Services commitment plan. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +func (client *CommitmentPlansClient) deleteAssociation(ctx context.Context, resourceGroupName string, commitmentPlanName string, commitmentPlanAssociationName string, options *CommitmentPlansClientBeginDeleteAssociationOptions) (*http.Response, error) { + var err error + const operationName = "CommitmentPlansClient.BeginDeleteAssociation" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteAssociationCreateRequest(ctx, resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteAssociationCreateRequest creates the DeleteAssociation request. +func (client *CommitmentPlansClient) deleteAssociationCreateRequest(ctx context.Context, resourceGroupName string, commitmentPlanName string, commitmentPlanAssociationName string, options *CommitmentPlansClientBeginDeleteAssociationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}/accountAssociations/{commitmentPlanAssociationName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if commitmentPlanName == "" { + return nil, errors.New("parameter commitmentPlanName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{commitmentPlanName}", url.PathEscape(commitmentPlanName)) + if commitmentPlanAssociationName == "" { + return nil, errors.New("parameter commitmentPlanAssociationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{commitmentPlanAssociationName}", url.PathEscape(commitmentPlanAssociationName)) + 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-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginDeletePlan - Deletes a Cognitive Services commitment plan from the resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - commitmentPlanName - The name of the commitmentPlan associated with the Cognitive Services Account +// - options - CommitmentPlansClientBeginDeletePlanOptions contains the optional parameters for the CommitmentPlansClient.BeginDeletePlan +// method. +func (client *CommitmentPlansClient) BeginDeletePlan(ctx context.Context, resourceGroupName string, commitmentPlanName string, options *CommitmentPlansClientBeginDeletePlanOptions) (*runtime.Poller[CommitmentPlansClientDeletePlanResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deletePlan(ctx, resourceGroupName, commitmentPlanName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CommitmentPlansClientDeletePlanResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CommitmentPlansClientDeletePlanResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// DeletePlan - Deletes a Cognitive Services commitment plan from the resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +func (client *CommitmentPlansClient) deletePlan(ctx context.Context, resourceGroupName string, commitmentPlanName string, options *CommitmentPlansClientBeginDeletePlanOptions) (*http.Response, error) { + var err error + const operationName = "CommitmentPlansClient.BeginDeletePlan" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deletePlanCreateRequest(ctx, resourceGroupName, commitmentPlanName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deletePlanCreateRequest creates the DeletePlan request. +func (client *CommitmentPlansClient) deletePlanCreateRequest(ctx context.Context, resourceGroupName string, commitmentPlanName string, options *CommitmentPlansClientBeginDeletePlanOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if commitmentPlanName == "" { + return nil, errors.New("parameter commitmentPlanName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{commitmentPlanName}", url.PathEscape(commitmentPlanName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + 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-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified commitmentPlans associated with the Cognitive Services account. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of Cognitive Services account. +// - commitmentPlanName - The name of the commitmentPlan associated with the Cognitive Services Account +// - options - CommitmentPlansClientGetOptions contains the optional parameters for the CommitmentPlansClient.Get method. +func (client *CommitmentPlansClient) Get(ctx context.Context, resourceGroupName string, accountName string, commitmentPlanName string, options *CommitmentPlansClientGetOptions) (CommitmentPlansClientGetResponse, error) { + var err error + const operationName = "CommitmentPlansClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, commitmentPlanName, options) + if err != nil { + return CommitmentPlansClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return CommitmentPlansClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return CommitmentPlansClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *CommitmentPlansClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, commitmentPlanName string, options *CommitmentPlansClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/commitmentPlans/{commitmentPlanName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if commitmentPlanName == "" { + return nil, errors.New("parameter commitmentPlanName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{commitmentPlanName}", url.PathEscape(commitmentPlanName)) + 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-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *CommitmentPlansClient) getHandleResponse(resp *http.Response) (CommitmentPlansClientGetResponse, error) { + result := CommitmentPlansClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CommitmentPlan); err != nil { + return CommitmentPlansClientGetResponse{}, err + } + return result, nil +} + +// GetAssociation - Gets the association of the Cognitive Services commitment plan. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - commitmentPlanName - The name of the commitmentPlan associated with the Cognitive Services Account +// - commitmentPlanAssociationName - The name of the commitment plan association with the Cognitive Services Account +// - options - CommitmentPlansClientGetAssociationOptions contains the optional parameters for the CommitmentPlansClient.GetAssociation +// method. +func (client *CommitmentPlansClient) GetAssociation(ctx context.Context, resourceGroupName string, commitmentPlanName string, commitmentPlanAssociationName string, options *CommitmentPlansClientGetAssociationOptions) (CommitmentPlansClientGetAssociationResponse, error) { + var err error + const operationName = "CommitmentPlansClient.GetAssociation" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getAssociationCreateRequest(ctx, resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, options) + if err != nil { + return CommitmentPlansClientGetAssociationResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return CommitmentPlansClientGetAssociationResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return CommitmentPlansClientGetAssociationResponse{}, err + } + resp, err := client.getAssociationHandleResponse(httpResp) + return resp, err +} + +// getAssociationCreateRequest creates the GetAssociation request. +func (client *CommitmentPlansClient) getAssociationCreateRequest(ctx context.Context, resourceGroupName string, commitmentPlanName string, commitmentPlanAssociationName string, options *CommitmentPlansClientGetAssociationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}/accountAssociations/{commitmentPlanAssociationName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if commitmentPlanName == "" { + return nil, errors.New("parameter commitmentPlanName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{commitmentPlanName}", url.PathEscape(commitmentPlanName)) + if commitmentPlanAssociationName == "" { + return nil, errors.New("parameter commitmentPlanAssociationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{commitmentPlanAssociationName}", url.PathEscape(commitmentPlanAssociationName)) + 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-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getAssociationHandleResponse handles the GetAssociation response. +func (client *CommitmentPlansClient) getAssociationHandleResponse(resp *http.Response) (CommitmentPlansClientGetAssociationResponse, error) { + result := CommitmentPlansClientGetAssociationResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CommitmentPlanAccountAssociation); err != nil { + return CommitmentPlansClientGetAssociationResponse{}, err + } + return result, nil +} + +// GetPlan - Returns a Cognitive Services commitment plan specified by the parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - commitmentPlanName - The name of the commitmentPlan associated with the Cognitive Services Account +// - options - CommitmentPlansClientGetPlanOptions contains the optional parameters for the CommitmentPlansClient.GetPlan method. +func (client *CommitmentPlansClient) GetPlan(ctx context.Context, resourceGroupName string, commitmentPlanName string, options *CommitmentPlansClientGetPlanOptions) (CommitmentPlansClientGetPlanResponse, error) { + var err error + const operationName = "CommitmentPlansClient.GetPlan" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getPlanCreateRequest(ctx, resourceGroupName, commitmentPlanName, options) + if err != nil { + return CommitmentPlansClientGetPlanResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return CommitmentPlansClientGetPlanResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return CommitmentPlansClientGetPlanResponse{}, err + } + resp, err := client.getPlanHandleResponse(httpResp) + return resp, err +} + +// getPlanCreateRequest creates the GetPlan request. +func (client *CommitmentPlansClient) getPlanCreateRequest(ctx context.Context, resourceGroupName string, commitmentPlanName string, options *CommitmentPlansClientGetPlanOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if commitmentPlanName == "" { + return nil, errors.New("parameter commitmentPlanName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{commitmentPlanName}", url.PathEscape(commitmentPlanName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + 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-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getPlanHandleResponse handles the GetPlan response. +func (client *CommitmentPlansClient) getPlanHandleResponse(resp *http.Response) (CommitmentPlansClientGetPlanResponse, error) { + result := CommitmentPlansClientGetPlanResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CommitmentPlan); err != nil { + return CommitmentPlansClientGetPlanResponse{}, err + } + return result, nil +} + +// NewListPager - Gets the commitmentPlans associated with the Cognitive Services account. +// +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of Cognitive Services account. +// - options - CommitmentPlansClientListOptions contains the optional parameters for the CommitmentPlansClient.NewListPager +// method. +func (client *CommitmentPlansClient) NewListPager(resourceGroupName string, accountName string, options *CommitmentPlansClientListOptions) *runtime.Pager[CommitmentPlansClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[CommitmentPlansClientListResponse]{ + More: func(page CommitmentPlansClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *CommitmentPlansClientListResponse) (CommitmentPlansClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CommitmentPlansClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, accountName, options) + }, nil) + if err != nil { + return CommitmentPlansClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *CommitmentPlansClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *CommitmentPlansClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/commitmentPlans" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + 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-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *CommitmentPlansClient) listHandleResponse(resp *http.Response) (CommitmentPlansClientListResponse, error) { + result := CommitmentPlansClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CommitmentPlanListResult); err != nil { + return CommitmentPlansClientListResponse{}, err + } + return result, nil +} + +// NewListAssociationsPager - Gets the associations of the Cognitive Services commitment plan. +// +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - commitmentPlanName - The name of the commitmentPlan associated with the Cognitive Services Account +// - options - CommitmentPlansClientListAssociationsOptions contains the optional parameters for the CommitmentPlansClient.NewListAssociationsPager +// method. +func (client *CommitmentPlansClient) NewListAssociationsPager(resourceGroupName string, commitmentPlanName string, options *CommitmentPlansClientListAssociationsOptions) *runtime.Pager[CommitmentPlansClientListAssociationsResponse] { + return runtime.NewPager(runtime.PagingHandler[CommitmentPlansClientListAssociationsResponse]{ + More: func(page CommitmentPlansClientListAssociationsResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *CommitmentPlansClientListAssociationsResponse) (CommitmentPlansClientListAssociationsResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CommitmentPlansClient.NewListAssociationsPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listAssociationsCreateRequest(ctx, resourceGroupName, commitmentPlanName, options) + }, nil) + if err != nil { + return CommitmentPlansClientListAssociationsResponse{}, err + } + return client.listAssociationsHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listAssociationsCreateRequest creates the ListAssociations request. +func (client *CommitmentPlansClient) listAssociationsCreateRequest(ctx context.Context, resourceGroupName string, commitmentPlanName string, options *CommitmentPlansClientListAssociationsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}/accountAssociations" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if commitmentPlanName == "" { + return nil, errors.New("parameter commitmentPlanName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{commitmentPlanName}", url.PathEscape(commitmentPlanName)) + 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-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listAssociationsHandleResponse handles the ListAssociations response. +func (client *CommitmentPlansClient) listAssociationsHandleResponse(resp *http.Response) (CommitmentPlansClientListAssociationsResponse, error) { + result := CommitmentPlansClientListAssociationsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CommitmentPlanAccountAssociationListResult); err != nil { + return CommitmentPlansClientListAssociationsResponse{}, err + } + return result, nil +} + +// NewListPlansByResourceGroupPager - Returns all the resources of a particular type belonging to a resource group +// +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - options - CommitmentPlansClientListPlansByResourceGroupOptions contains the optional parameters for the CommitmentPlansClient.NewListPlansByResourceGroupPager +// method. +func (client *CommitmentPlansClient) NewListPlansByResourceGroupPager(resourceGroupName string, options *CommitmentPlansClientListPlansByResourceGroupOptions) *runtime.Pager[CommitmentPlansClientListPlansByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[CommitmentPlansClientListPlansByResourceGroupResponse]{ + More: func(page CommitmentPlansClientListPlansByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *CommitmentPlansClientListPlansByResourceGroupResponse) (CommitmentPlansClientListPlansByResourceGroupResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CommitmentPlansClient.NewListPlansByResourceGroupPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listPlansByResourceGroupCreateRequest(ctx, resourceGroupName, options) + }, nil) + if err != nil { + return CommitmentPlansClientListPlansByResourceGroupResponse{}, err + } + return client.listPlansByResourceGroupHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listPlansByResourceGroupCreateRequest creates the ListPlansByResourceGroup request. +func (client *CommitmentPlansClient) listPlansByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *CommitmentPlansClientListPlansByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + 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-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listPlansByResourceGroupHandleResponse handles the ListPlansByResourceGroup response. +func (client *CommitmentPlansClient) listPlansByResourceGroupHandleResponse(resp *http.Response) (CommitmentPlansClientListPlansByResourceGroupResponse, error) { + result := CommitmentPlansClientListPlansByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CommitmentPlanListResult); err != nil { + return CommitmentPlansClientListPlansByResourceGroupResponse{}, err + } + return result, nil +} + +// NewListPlansBySubscriptionPager - Returns all the resources of a particular type belonging to a subscription. +// +// Generated from API version 2023-05-01 +// - options - CommitmentPlansClientListPlansBySubscriptionOptions contains the optional parameters for the CommitmentPlansClient.NewListPlansBySubscriptionPager +// method. +func (client *CommitmentPlansClient) NewListPlansBySubscriptionPager(options *CommitmentPlansClientListPlansBySubscriptionOptions) *runtime.Pager[CommitmentPlansClientListPlansBySubscriptionResponse] { + return runtime.NewPager(runtime.PagingHandler[CommitmentPlansClientListPlansBySubscriptionResponse]{ + More: func(page CommitmentPlansClientListPlansBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *CommitmentPlansClientListPlansBySubscriptionResponse) (CommitmentPlansClientListPlansBySubscriptionResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CommitmentPlansClient.NewListPlansBySubscriptionPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listPlansBySubscriptionCreateRequest(ctx, options) + }, nil) + if err != nil { + return CommitmentPlansClientListPlansBySubscriptionResponse{}, err + } + return client.listPlansBySubscriptionHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listPlansBySubscriptionCreateRequest creates the ListPlansBySubscription request. +func (client *CommitmentPlansClient) listPlansBySubscriptionCreateRequest(ctx context.Context, options *CommitmentPlansClientListPlansBySubscriptionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/commitmentPlans" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + 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-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listPlansBySubscriptionHandleResponse handles the ListPlansBySubscription response. +func (client *CommitmentPlansClient) listPlansBySubscriptionHandleResponse(resp *http.Response) (CommitmentPlansClientListPlansBySubscriptionResponse, error) { + result := CommitmentPlansClientListPlansBySubscriptionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CommitmentPlanListResult); err != nil { + return CommitmentPlansClientListPlansBySubscriptionResponse{}, err + } + return result, nil +} + +// BeginUpdatePlan - Create Cognitive Services commitment plan. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - commitmentPlanName - The name of the commitmentPlan associated with the Cognitive Services Account +// - commitmentPlan - The parameters to provide for the created commitment plan. +// - options - CommitmentPlansClientBeginUpdatePlanOptions contains the optional parameters for the CommitmentPlansClient.BeginUpdatePlan +// method. +func (client *CommitmentPlansClient) BeginUpdatePlan(ctx context.Context, resourceGroupName string, commitmentPlanName string, commitmentPlan PatchResourceTagsAndSKU, options *CommitmentPlansClientBeginUpdatePlanOptions) (*runtime.Poller[CommitmentPlansClientUpdatePlanResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.updatePlan(ctx, resourceGroupName, commitmentPlanName, commitmentPlan, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CommitmentPlansClientUpdatePlanResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CommitmentPlansClientUpdatePlanResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// UpdatePlan - Create Cognitive Services commitment plan. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +func (client *CommitmentPlansClient) updatePlan(ctx context.Context, resourceGroupName string, commitmentPlanName string, commitmentPlan PatchResourceTagsAndSKU, options *CommitmentPlansClientBeginUpdatePlanOptions) (*http.Response, error) { + var err error + const operationName = "CommitmentPlansClient.BeginUpdatePlan" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.updatePlanCreateRequest(ctx, resourceGroupName, commitmentPlanName, commitmentPlan, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// updatePlanCreateRequest creates the UpdatePlan request. +func (client *CommitmentPlansClient) updatePlanCreateRequest(ctx context.Context, resourceGroupName string, commitmentPlanName string, commitmentPlan PatchResourceTagsAndSKU, options *CommitmentPlansClientBeginUpdatePlanOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if commitmentPlanName == "" { + return nil, errors.New("parameter commitmentPlanName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{commitmentPlanName}", url.PathEscape(commitmentPlanName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, 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"} + if err := runtime.MarshalAsJSON(req, commitmentPlan); err != nil { + return nil, err + } + return req, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/commitmenttiers_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/commitmenttiers_client.go new file mode 100644 index 00000000..790015c0 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/commitmenttiers_client.go @@ -0,0 +1,104 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armcognitiveservices + +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" +) + +// CommitmentTiersClient contains the methods for the CommitmentTiers group. +// Don't use this type directly, use NewCommitmentTiersClient() instead. +type CommitmentTiersClient struct { + internal *arm.Client + subscriptionID string +} + +// NewCommitmentTiersClient creates a new instance of CommitmentTiersClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewCommitmentTiersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CommitmentTiersClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &CommitmentTiersClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// NewListPager - List Commitment Tiers. +// +// Generated from API version 2023-05-01 +// - location - Resource location. +// - options - CommitmentTiersClientListOptions contains the optional parameters for the CommitmentTiersClient.NewListPager +// method. +func (client *CommitmentTiersClient) NewListPager(location string, options *CommitmentTiersClientListOptions) *runtime.Pager[CommitmentTiersClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[CommitmentTiersClientListResponse]{ + More: func(page CommitmentTiersClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *CommitmentTiersClientListResponse) (CommitmentTiersClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CommitmentTiersClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, location, options) + }, nil) + if err != nil { + return CommitmentTiersClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *CommitmentTiersClient) listCreateRequest(ctx context.Context, location string, options *CommitmentTiersClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/commitmentTiers" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + 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-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *CommitmentTiersClient) listHandleResponse(resp *http.Response) (CommitmentTiersClientListResponse, error) { + result := CommitmentTiersClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CommitmentTierListResult); err != nil { + return CommitmentTiersClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/constants.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/constants.go new file mode 100644 index 00000000..e42f8185 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/constants.go @@ -0,0 +1,475 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armcognitiveservices + +const ( + moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices" + moduleVersion = "v1.6.0" +) + +// AbusePenaltyAction - The action of AbusePenalty. +type AbusePenaltyAction string + +const ( + AbusePenaltyActionBlock AbusePenaltyAction = "Block" + AbusePenaltyActionThrottle AbusePenaltyAction = "Throttle" +) + +// PossibleAbusePenaltyActionValues returns the possible values for the AbusePenaltyAction const type. +func PossibleAbusePenaltyActionValues() []AbusePenaltyAction { + return []AbusePenaltyAction{ + AbusePenaltyActionBlock, + AbusePenaltyActionThrottle, + } +} + +// ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. +type ActionType string + +const ( + ActionTypeInternal ActionType = "Internal" +) + +// PossibleActionTypeValues returns the possible values for the ActionType const type. +func PossibleActionTypeValues() []ActionType { + return []ActionType{ + ActionTypeInternal, + } +} + +// CommitmentPlanProvisioningState - Gets the status of the resource at the time the operation was called. +type CommitmentPlanProvisioningState string + +const ( + CommitmentPlanProvisioningStateAccepted CommitmentPlanProvisioningState = "Accepted" + CommitmentPlanProvisioningStateCanceled CommitmentPlanProvisioningState = "Canceled" + CommitmentPlanProvisioningStateCreating CommitmentPlanProvisioningState = "Creating" + CommitmentPlanProvisioningStateDeleting CommitmentPlanProvisioningState = "Deleting" + CommitmentPlanProvisioningStateFailed CommitmentPlanProvisioningState = "Failed" + CommitmentPlanProvisioningStateMoving CommitmentPlanProvisioningState = "Moving" + CommitmentPlanProvisioningStateSucceeded CommitmentPlanProvisioningState = "Succeeded" +) + +// PossibleCommitmentPlanProvisioningStateValues returns the possible values for the CommitmentPlanProvisioningState const type. +func PossibleCommitmentPlanProvisioningStateValues() []CommitmentPlanProvisioningState { + return []CommitmentPlanProvisioningState{ + CommitmentPlanProvisioningStateAccepted, + CommitmentPlanProvisioningStateCanceled, + CommitmentPlanProvisioningStateCreating, + CommitmentPlanProvisioningStateDeleting, + CommitmentPlanProvisioningStateFailed, + CommitmentPlanProvisioningStateMoving, + CommitmentPlanProvisioningStateSucceeded, + } +} + +// CreatedByType - The type of identity that created the resource. +type CreatedByType string + +const ( + CreatedByTypeApplication CreatedByType = "Application" + CreatedByTypeKey CreatedByType = "Key" + CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" + CreatedByTypeUser CreatedByType = "User" +) + +// PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type. +func PossibleCreatedByTypeValues() []CreatedByType { + return []CreatedByType{ + CreatedByTypeApplication, + CreatedByTypeKey, + CreatedByTypeManagedIdentity, + CreatedByTypeUser, + } +} + +// DeploymentModelVersionUpgradeOption - Deployment model version upgrade option. +type DeploymentModelVersionUpgradeOption string + +const ( + DeploymentModelVersionUpgradeOptionNoAutoUpgrade DeploymentModelVersionUpgradeOption = "NoAutoUpgrade" + DeploymentModelVersionUpgradeOptionOnceCurrentVersionExpired DeploymentModelVersionUpgradeOption = "OnceCurrentVersionExpired" + DeploymentModelVersionUpgradeOptionOnceNewDefaultVersionAvailable DeploymentModelVersionUpgradeOption = "OnceNewDefaultVersionAvailable" +) + +// PossibleDeploymentModelVersionUpgradeOptionValues returns the possible values for the DeploymentModelVersionUpgradeOption const type. +func PossibleDeploymentModelVersionUpgradeOptionValues() []DeploymentModelVersionUpgradeOption { + return []DeploymentModelVersionUpgradeOption{ + DeploymentModelVersionUpgradeOptionNoAutoUpgrade, + DeploymentModelVersionUpgradeOptionOnceCurrentVersionExpired, + DeploymentModelVersionUpgradeOptionOnceNewDefaultVersionAvailable, + } +} + +// DeploymentProvisioningState - Gets the status of the resource at the time the operation was called. +type DeploymentProvisioningState string + +const ( + DeploymentProvisioningStateAccepted DeploymentProvisioningState = "Accepted" + DeploymentProvisioningStateCanceled DeploymentProvisioningState = "Canceled" + DeploymentProvisioningStateCreating DeploymentProvisioningState = "Creating" + DeploymentProvisioningStateDeleting DeploymentProvisioningState = "Deleting" + DeploymentProvisioningStateDisabled DeploymentProvisioningState = "Disabled" + DeploymentProvisioningStateFailed DeploymentProvisioningState = "Failed" + DeploymentProvisioningStateMoving DeploymentProvisioningState = "Moving" + DeploymentProvisioningStateSucceeded DeploymentProvisioningState = "Succeeded" +) + +// PossibleDeploymentProvisioningStateValues returns the possible values for the DeploymentProvisioningState const type. +func PossibleDeploymentProvisioningStateValues() []DeploymentProvisioningState { + return []DeploymentProvisioningState{ + DeploymentProvisioningStateAccepted, + DeploymentProvisioningStateCanceled, + DeploymentProvisioningStateCreating, + DeploymentProvisioningStateDeleting, + DeploymentProvisioningStateDisabled, + DeploymentProvisioningStateFailed, + DeploymentProvisioningStateMoving, + DeploymentProvisioningStateSucceeded, + } +} + +// DeploymentScaleType - Deployment scale type. +type DeploymentScaleType string + +const ( + DeploymentScaleTypeManual DeploymentScaleType = "Manual" + DeploymentScaleTypeStandard DeploymentScaleType = "Standard" +) + +// PossibleDeploymentScaleTypeValues returns the possible values for the DeploymentScaleType const type. +func PossibleDeploymentScaleTypeValues() []DeploymentScaleType { + return []DeploymentScaleType{ + DeploymentScaleTypeManual, + DeploymentScaleTypeStandard, + } +} + +// HostingModel - Account hosting model. +type HostingModel string + +const ( + HostingModelConnectedContainer HostingModel = "ConnectedContainer" + HostingModelDisconnectedContainer HostingModel = "DisconnectedContainer" + HostingModelProvisionedWeb HostingModel = "ProvisionedWeb" + HostingModelWeb HostingModel = "Web" +) + +// PossibleHostingModelValues returns the possible values for the HostingModel const type. +func PossibleHostingModelValues() []HostingModel { + return []HostingModel{ + HostingModelConnectedContainer, + HostingModelDisconnectedContainer, + HostingModelProvisionedWeb, + HostingModelWeb, + } +} + +// KeyName - key name to generate (Key1|Key2) +type KeyName string + +const ( + KeyNameKey1 KeyName = "Key1" + KeyNameKey2 KeyName = "Key2" +) + +// PossibleKeyNameValues returns the possible values for the KeyName const type. +func PossibleKeyNameValues() []KeyName { + return []KeyName{ + KeyNameKey1, + KeyNameKey2, + } +} + +// KeySource - Enumerates the possible value of keySource for Encryption +type KeySource string + +const ( + KeySourceMicrosoftCognitiveServices KeySource = "Microsoft.CognitiveServices" + KeySourceMicrosoftKeyVault KeySource = "Microsoft.KeyVault" +) + +// PossibleKeySourceValues returns the possible values for the KeySource const type. +func PossibleKeySourceValues() []KeySource { + return []KeySource{ + KeySourceMicrosoftCognitiveServices, + KeySourceMicrosoftKeyVault, + } +} + +// ModelLifecycleStatus - Model lifecycle status. +type ModelLifecycleStatus string + +const ( + ModelLifecycleStatusGenerallyAvailable ModelLifecycleStatus = "GenerallyAvailable" + ModelLifecycleStatusPreview ModelLifecycleStatus = "Preview" +) + +// PossibleModelLifecycleStatusValues returns the possible values for the ModelLifecycleStatus const type. +func PossibleModelLifecycleStatusValues() []ModelLifecycleStatus { + return []ModelLifecycleStatus{ + ModelLifecycleStatusGenerallyAvailable, + ModelLifecycleStatusPreview, + } +} + +// NetworkRuleAction - The default action when no rule from ipRules and from virtualNetworkRules match. This is only used +// after the bypass property has been evaluated. +type NetworkRuleAction string + +const ( + NetworkRuleActionAllow NetworkRuleAction = "Allow" + NetworkRuleActionDeny NetworkRuleAction = "Deny" +) + +// PossibleNetworkRuleActionValues returns the possible values for the NetworkRuleAction const type. +func PossibleNetworkRuleActionValues() []NetworkRuleAction { + return []NetworkRuleAction{ + NetworkRuleActionAllow, + NetworkRuleActionDeny, + } +} + +// Origin - The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default +// value is "user,system" +type Origin string + +const ( + OriginSystem Origin = "system" + OriginUser Origin = "user" + OriginUserSystem Origin = "user,system" +) + +// PossibleOriginValues returns the possible values for the Origin const type. +func PossibleOriginValues() []Origin { + return []Origin{ + OriginSystem, + OriginUser, + OriginUserSystem, + } +} + +// PrivateEndpointConnectionProvisioningState - The current provisioning state. +type PrivateEndpointConnectionProvisioningState string + +const ( + PrivateEndpointConnectionProvisioningStateCreating PrivateEndpointConnectionProvisioningState = "Creating" + PrivateEndpointConnectionProvisioningStateDeleting PrivateEndpointConnectionProvisioningState = "Deleting" + PrivateEndpointConnectionProvisioningStateFailed PrivateEndpointConnectionProvisioningState = "Failed" + PrivateEndpointConnectionProvisioningStateSucceeded PrivateEndpointConnectionProvisioningState = "Succeeded" +) + +// PossiblePrivateEndpointConnectionProvisioningStateValues returns the possible values for the PrivateEndpointConnectionProvisioningState const type. +func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState { + return []PrivateEndpointConnectionProvisioningState{ + PrivateEndpointConnectionProvisioningStateCreating, + PrivateEndpointConnectionProvisioningStateDeleting, + PrivateEndpointConnectionProvisioningStateFailed, + PrivateEndpointConnectionProvisioningStateSucceeded, + } +} + +// PrivateEndpointServiceConnectionStatus - The private endpoint connection status. +type PrivateEndpointServiceConnectionStatus string + +const ( + PrivateEndpointServiceConnectionStatusApproved PrivateEndpointServiceConnectionStatus = "Approved" + PrivateEndpointServiceConnectionStatusPending PrivateEndpointServiceConnectionStatus = "Pending" + PrivateEndpointServiceConnectionStatusRejected PrivateEndpointServiceConnectionStatus = "Rejected" +) + +// PossiblePrivateEndpointServiceConnectionStatusValues returns the possible values for the PrivateEndpointServiceConnectionStatus const type. +func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointServiceConnectionStatus { + return []PrivateEndpointServiceConnectionStatus{ + PrivateEndpointServiceConnectionStatusApproved, + PrivateEndpointServiceConnectionStatusPending, + PrivateEndpointServiceConnectionStatusRejected, + } +} + +// ProvisioningState - Gets the status of the cognitive services account at the time the operation was called. +type ProvisioningState string + +const ( + ProvisioningStateAccepted ProvisioningState = "Accepted" + ProvisioningStateCreating ProvisioningState = "Creating" + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateMoving ProvisioningState = "Moving" + ProvisioningStateResolvingDNS ProvisioningState = "ResolvingDNS" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" +) + +// PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{ + ProvisioningStateAccepted, + ProvisioningStateCreating, + ProvisioningStateDeleting, + ProvisioningStateFailed, + ProvisioningStateMoving, + ProvisioningStateResolvingDNS, + ProvisioningStateSucceeded, + } +} + +// PublicNetworkAccess - Whether or not public endpoint access is allowed for this account. +type PublicNetworkAccess string + +const ( + PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled" + PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled" +) + +// PossiblePublicNetworkAccessValues returns the possible values for the PublicNetworkAccess const type. +func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { + return []PublicNetworkAccess{ + PublicNetworkAccessDisabled, + PublicNetworkAccessEnabled, + } +} + +// QuotaUsageStatus - Cognitive Services account quota usage status. +type QuotaUsageStatus string + +const ( + QuotaUsageStatusBlocked QuotaUsageStatus = "Blocked" + QuotaUsageStatusInOverage QuotaUsageStatus = "InOverage" + QuotaUsageStatusIncluded QuotaUsageStatus = "Included" + QuotaUsageStatusUnknown QuotaUsageStatus = "Unknown" +) + +// PossibleQuotaUsageStatusValues returns the possible values for the QuotaUsageStatus const type. +func PossibleQuotaUsageStatusValues() []QuotaUsageStatus { + return []QuotaUsageStatus{ + QuotaUsageStatusBlocked, + QuotaUsageStatusInOverage, + QuotaUsageStatusIncluded, + QuotaUsageStatusUnknown, + } +} + +// ResourceIdentityType - The identity type. +type ResourceIdentityType string + +const ( + ResourceIdentityTypeNone ResourceIdentityType = "None" + ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned" + ResourceIdentityTypeSystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned" + ResourceIdentityTypeUserAssigned ResourceIdentityType = "UserAssigned" +) + +// PossibleResourceIdentityTypeValues returns the possible values for the ResourceIdentityType const type. +func PossibleResourceIdentityTypeValues() []ResourceIdentityType { + return []ResourceIdentityType{ + ResourceIdentityTypeNone, + ResourceIdentityTypeSystemAssigned, + ResourceIdentityTypeSystemAssignedUserAssigned, + ResourceIdentityTypeUserAssigned, + } +} + +// ResourceSKURestrictionsReasonCode - The reason for restriction. +type ResourceSKURestrictionsReasonCode string + +const ( + ResourceSKURestrictionsReasonCodeNotAvailableForSubscription ResourceSKURestrictionsReasonCode = "NotAvailableForSubscription" + ResourceSKURestrictionsReasonCodeQuotaID ResourceSKURestrictionsReasonCode = "QuotaId" +) + +// PossibleResourceSKURestrictionsReasonCodeValues returns the possible values for the ResourceSKURestrictionsReasonCode const type. +func PossibleResourceSKURestrictionsReasonCodeValues() []ResourceSKURestrictionsReasonCode { + return []ResourceSKURestrictionsReasonCode{ + ResourceSKURestrictionsReasonCodeNotAvailableForSubscription, + ResourceSKURestrictionsReasonCodeQuotaID, + } +} + +// ResourceSKURestrictionsType - The type of restrictions. +type ResourceSKURestrictionsType string + +const ( + ResourceSKURestrictionsTypeLocation ResourceSKURestrictionsType = "Location" + ResourceSKURestrictionsTypeZone ResourceSKURestrictionsType = "Zone" +) + +// PossibleResourceSKURestrictionsTypeValues returns the possible values for the ResourceSKURestrictionsType const type. +func PossibleResourceSKURestrictionsTypeValues() []ResourceSKURestrictionsType { + return []ResourceSKURestrictionsType{ + ResourceSKURestrictionsTypeLocation, + ResourceSKURestrictionsTypeZone, + } +} + +// RoutingMethods - Multiregion routing methods. +type RoutingMethods string + +const ( + RoutingMethodsPerformance RoutingMethods = "Performance" + RoutingMethodsPriority RoutingMethods = "Priority" + RoutingMethodsWeighted RoutingMethods = "Weighted" +) + +// PossibleRoutingMethodsValues returns the possible values for the RoutingMethods const type. +func PossibleRoutingMethodsValues() []RoutingMethods { + return []RoutingMethods{ + RoutingMethodsPerformance, + RoutingMethodsPriority, + RoutingMethodsWeighted, + } +} + +// SKUTier - This field is required to be implemented by the Resource Provider if the service has more than one tier, but +// is not required on a PUT. +type SKUTier string + +const ( + SKUTierBasic SKUTier = "Basic" + SKUTierEnterprise SKUTier = "Enterprise" + SKUTierFree SKUTier = "Free" + SKUTierPremium SKUTier = "Premium" + SKUTierStandard SKUTier = "Standard" +) + +// PossibleSKUTierValues returns the possible values for the SKUTier const type. +func PossibleSKUTierValues() []SKUTier { + return []SKUTier{ + SKUTierBasic, + SKUTierEnterprise, + SKUTierFree, + SKUTierPremium, + SKUTierStandard, + } +} + +// UnitType - The unit of the metric. +type UnitType string + +const ( + UnitTypeBytes UnitType = "Bytes" + UnitTypeBytesPerSecond UnitType = "BytesPerSecond" + UnitTypeCount UnitType = "Count" + UnitTypeCountPerSecond UnitType = "CountPerSecond" + UnitTypeMilliseconds UnitType = "Milliseconds" + UnitTypePercent UnitType = "Percent" + UnitTypeSeconds UnitType = "Seconds" +) + +// PossibleUnitTypeValues returns the possible values for the UnitType const type. +func PossibleUnitTypeValues() []UnitType { + return []UnitType{ + UnitTypeBytes, + UnitTypeBytesPerSecond, + UnitTypeCount, + UnitTypeCountPerSecond, + UnitTypeMilliseconds, + UnitTypePercent, + UnitTypeSeconds, + } +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/deletedaccounts_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/deletedaccounts_client.go new file mode 100644 index 00000000..f3e3acb9 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/deletedaccounts_client.go @@ -0,0 +1,249 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armcognitiveservices + +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" +) + +// DeletedAccountsClient contains the methods for the DeletedAccounts group. +// Don't use this type directly, use NewDeletedAccountsClient() instead. +type DeletedAccountsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewDeletedAccountsClient creates a new instance of DeletedAccountsClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewDeletedAccountsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DeletedAccountsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &DeletedAccountsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Returns a Cognitive Services account specified by the parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +// - location - Resource location. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of Cognitive Services account. +// - options - DeletedAccountsClientGetOptions contains the optional parameters for the DeletedAccountsClient.Get method. +func (client *DeletedAccountsClient) Get(ctx context.Context, location string, resourceGroupName string, accountName string, options *DeletedAccountsClientGetOptions) (DeletedAccountsClientGetResponse, error) { + var err error + const operationName = "DeletedAccountsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, location, resourceGroupName, accountName, options) + if err != nil { + return DeletedAccountsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DeletedAccountsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DeletedAccountsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *DeletedAccountsClient) getCreateRequest(ctx context.Context, location string, resourceGroupName string, accountName string, options *DeletedAccountsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/resourceGroups/{resourceGroupName}/deletedAccounts/{accountName}" + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + 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-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *DeletedAccountsClient) getHandleResponse(resp *http.Response) (DeletedAccountsClientGetResponse, error) { + result := DeletedAccountsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Account); err != nil { + return DeletedAccountsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Returns all the resources of a particular type belonging to a subscription. +// +// Generated from API version 2023-05-01 +// - options - DeletedAccountsClientListOptions contains the optional parameters for the DeletedAccountsClient.NewListPager +// method. +func (client *DeletedAccountsClient) NewListPager(options *DeletedAccountsClientListOptions) *runtime.Pager[DeletedAccountsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[DeletedAccountsClientListResponse]{ + More: func(page DeletedAccountsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *DeletedAccountsClientListResponse) (DeletedAccountsClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DeletedAccountsClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, options) + }, nil) + if err != nil { + return DeletedAccountsClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *DeletedAccountsClient) listCreateRequest(ctx context.Context, options *DeletedAccountsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/deletedAccounts" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + 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-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *DeletedAccountsClient) listHandleResponse(resp *http.Response) (DeletedAccountsClientListResponse, error) { + result := DeletedAccountsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AccountListResult); err != nil { + return DeletedAccountsClientListResponse{}, err + } + return result, nil +} + +// BeginPurge - Deletes a Cognitive Services account from the resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +// - location - Resource location. +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of Cognitive Services account. +// - options - DeletedAccountsClientBeginPurgeOptions contains the optional parameters for the DeletedAccountsClient.BeginPurge +// method. +func (client *DeletedAccountsClient) BeginPurge(ctx context.Context, location string, resourceGroupName string, accountName string, options *DeletedAccountsClientBeginPurgeOptions) (*runtime.Poller[DeletedAccountsClientPurgeResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.purge(ctx, location, resourceGroupName, accountName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DeletedAccountsClientPurgeResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DeletedAccountsClientPurgeResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Purge - Deletes a Cognitive Services account from the resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +func (client *DeletedAccountsClient) purge(ctx context.Context, location string, resourceGroupName string, accountName string, options *DeletedAccountsClientBeginPurgeOptions) (*http.Response, error) { + var err error + const operationName = "DeletedAccountsClient.BeginPurge" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.purgeCreateRequest(ctx, location, resourceGroupName, accountName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// purgeCreateRequest creates the Purge request. +func (client *DeletedAccountsClient) purgeCreateRequest(ctx context.Context, location string, resourceGroupName string, accountName string, options *DeletedAccountsClientBeginPurgeOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/resourceGroups/{resourceGroupName}/deletedAccounts/{accountName}" + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + 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-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/deployments_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/deployments_client.go new file mode 100644 index 00000000..c045f05c --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/deployments_client.go @@ -0,0 +1,343 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armcognitiveservices + +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" +) + +// DeploymentsClient contains the methods for the Deployments group. +// Don't use this type directly, use NewDeploymentsClient() instead. +type DeploymentsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewDeploymentsClient creates a new instance of DeploymentsClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewDeploymentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DeploymentsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &DeploymentsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Update the state of specified deployments associated with the Cognitive Services account. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of Cognitive Services account. +// - deploymentName - The name of the deployment associated with the Cognitive Services Account +// - deployment - The deployment properties. +// - options - DeploymentsClientBeginCreateOrUpdateOptions contains the optional parameters for the DeploymentsClient.BeginCreateOrUpdate +// method. +func (client *DeploymentsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, deploymentName string, deployment Deployment, options *DeploymentsClientBeginCreateOrUpdateOptions) (*runtime.Poller[DeploymentsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, accountName, deploymentName, deployment, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DeploymentsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DeploymentsClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Update the state of specified deployments associated with the Cognitive Services account. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +func (client *DeploymentsClient) createOrUpdate(ctx context.Context, resourceGroupName string, accountName string, deploymentName string, deployment Deployment, options *DeploymentsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "DeploymentsClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, accountName, deploymentName, deployment, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *DeploymentsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, deploymentName string, deployment Deployment, options *DeploymentsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments/{deploymentName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if deploymentName == "" { + return nil, errors.New("parameter deploymentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName)) + 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-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, deployment); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Deletes the specified deployment associated with the Cognitive Services account. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of Cognitive Services account. +// - deploymentName - The name of the deployment associated with the Cognitive Services Account +// - options - DeploymentsClientBeginDeleteOptions contains the optional parameters for the DeploymentsClient.BeginDelete method. +func (client *DeploymentsClient) BeginDelete(ctx context.Context, resourceGroupName string, accountName string, deploymentName string, options *DeploymentsClientBeginDeleteOptions) (*runtime.Poller[DeploymentsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, accountName, deploymentName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DeploymentsClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DeploymentsClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Deletes the specified deployment associated with the Cognitive Services account. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +func (client *DeploymentsClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, deploymentName string, options *DeploymentsClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "DeploymentsClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, deploymentName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *DeploymentsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, deploymentName string, options *DeploymentsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments/{deploymentName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if deploymentName == "" { + return nil, errors.New("parameter deploymentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName)) + 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-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified deployments associated with the Cognitive Services account. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of Cognitive Services account. +// - deploymentName - The name of the deployment associated with the Cognitive Services Account +// - options - DeploymentsClientGetOptions contains the optional parameters for the DeploymentsClient.Get method. +func (client *DeploymentsClient) Get(ctx context.Context, resourceGroupName string, accountName string, deploymentName string, options *DeploymentsClientGetOptions) (DeploymentsClientGetResponse, error) { + var err error + const operationName = "DeploymentsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, deploymentName, options) + if err != nil { + return DeploymentsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DeploymentsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DeploymentsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *DeploymentsClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, deploymentName string, options *DeploymentsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments/{deploymentName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if deploymentName == "" { + return nil, errors.New("parameter deploymentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName)) + 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-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *DeploymentsClient) getHandleResponse(resp *http.Response) (DeploymentsClientGetResponse, error) { + result := DeploymentsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Deployment); err != nil { + return DeploymentsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets the deployments associated with the Cognitive Services account. +// +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of Cognitive Services account. +// - options - DeploymentsClientListOptions contains the optional parameters for the DeploymentsClient.NewListPager method. +func (client *DeploymentsClient) NewListPager(resourceGroupName string, accountName string, options *DeploymentsClientListOptions) *runtime.Pager[DeploymentsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[DeploymentsClientListResponse]{ + More: func(page DeploymentsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *DeploymentsClientListResponse) (DeploymentsClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DeploymentsClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, accountName, options) + }, nil) + if err != nil { + return DeploymentsClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *DeploymentsClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *DeploymentsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + 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-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *DeploymentsClient) listHandleResponse(resp *http.Response) (DeploymentsClientListResponse, error) { + result := DeploymentsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DeploymentListResult); err != nil { + return DeploymentsClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/management_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/management_client.go new file mode 100644 index 00000000..fb576233 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/management_client.go @@ -0,0 +1,167 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armcognitiveservices + +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" +) + +// ManagementClient contains the methods for the CognitiveServicesManagementClient group. +// Don't use this type directly, use NewManagementClient() instead. +type ManagementClient struct { + internal *arm.Client + subscriptionID string +} + +// NewManagementClient creates a new instance of ManagementClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewManagementClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagementClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ManagementClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CheckDomainAvailability - Check whether a domain is available. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +// - parameters - Check Domain Availability parameter. +// - options - ManagementClientCheckDomainAvailabilityOptions contains the optional parameters for the ManagementClient.CheckDomainAvailability +// method. +func (client *ManagementClient) CheckDomainAvailability(ctx context.Context, parameters CheckDomainAvailabilityParameter, options *ManagementClientCheckDomainAvailabilityOptions) (ManagementClientCheckDomainAvailabilityResponse, error) { + var err error + const operationName = "ManagementClient.CheckDomainAvailability" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.checkDomainAvailabilityCreateRequest(ctx, parameters, options) + if err != nil { + return ManagementClientCheckDomainAvailabilityResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ManagementClientCheckDomainAvailabilityResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagementClientCheckDomainAvailabilityResponse{}, err + } + resp, err := client.checkDomainAvailabilityHandleResponse(httpResp) + return resp, err +} + +// checkDomainAvailabilityCreateRequest creates the CheckDomainAvailability request. +func (client *ManagementClient) checkDomainAvailabilityCreateRequest(ctx context.Context, parameters CheckDomainAvailabilityParameter, options *ManagementClientCheckDomainAvailabilityOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/checkDomainAvailability" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + 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"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// checkDomainAvailabilityHandleResponse handles the CheckDomainAvailability response. +func (client *ManagementClient) checkDomainAvailabilityHandleResponse(resp *http.Response) (ManagementClientCheckDomainAvailabilityResponse, error) { + result := ManagementClientCheckDomainAvailabilityResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DomainAvailability); err != nil { + return ManagementClientCheckDomainAvailabilityResponse{}, err + } + return result, nil +} + +// CheckSKUAvailability - Check available SKUs. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +// - location - Resource location. +// - parameters - Check SKU Availability POST body. +// - options - ManagementClientCheckSKUAvailabilityOptions contains the optional parameters for the ManagementClient.CheckSKUAvailability +// method. +func (client *ManagementClient) CheckSKUAvailability(ctx context.Context, location string, parameters CheckSKUAvailabilityParameter, options *ManagementClientCheckSKUAvailabilityOptions) (ManagementClientCheckSKUAvailabilityResponse, error) { + var err error + const operationName = "ManagementClient.CheckSKUAvailability" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.checkSKUAvailabilityCreateRequest(ctx, location, parameters, options) + if err != nil { + return ManagementClientCheckSKUAvailabilityResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ManagementClientCheckSKUAvailabilityResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagementClientCheckSKUAvailabilityResponse{}, err + } + resp, err := client.checkSKUAvailabilityHandleResponse(httpResp) + return resp, err +} + +// checkSKUAvailabilityCreateRequest creates the CheckSKUAvailability request. +func (client *ManagementClient) checkSKUAvailabilityCreateRequest(ctx context.Context, location string, parameters CheckSKUAvailabilityParameter, options *ManagementClientCheckSKUAvailabilityOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/checkSkuAvailability" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + 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"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// checkSKUAvailabilityHandleResponse handles the CheckSKUAvailability response. +func (client *ManagementClient) checkSKUAvailabilityHandleResponse(resp *http.Response) (ManagementClientCheckSKUAvailabilityResponse, error) { + result := ManagementClientCheckSKUAvailabilityResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SKUAvailabilityListResult); err != nil { + return ManagementClientCheckSKUAvailabilityResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/models.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/models.go new file mode 100644 index 00000000..813eec5f --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/models.go @@ -0,0 +1,1220 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armcognitiveservices + +import "time" + +// APIKeys - The access keys for the cognitive services account. +type APIKeys struct { + // Gets the value of key 1. + Key1 *string + + // Gets the value of key 2. + Key2 *string +} + +// APIProperties - The api properties for special APIs. +type APIProperties struct { + // (Metrics Advisor Only) The Azure AD Client Id (Application Id). + AADClientID *string + + // (Metrics Advisor Only) The Azure AD Tenant Id. + AADTenantID *string + + // OPTIONAL; Contains additional key/value pairs not defined in the schema. + AdditionalProperties map[string]any + + // (Personalization Only) The flag to enable statistics of Bing Search. + EventHubConnectionString *string + + // (QnAMaker Only) The Azure Search endpoint id of QnAMaker. + QnaAzureSearchEndpointID *string + + // (QnAMaker Only) The Azure Search endpoint key of QnAMaker. + QnaAzureSearchEndpointKey *string + + // (QnAMaker Only) The runtime endpoint of QnAMaker. + QnaRuntimeEndpoint *string + + // (Bing Search Only) The flag to enable statistics of Bing Search. + StatisticsEnabled *bool + + // (Personalization Only) The storage account connection string. + StorageAccountConnectionString *string + + // (Metrics Advisor Only) The super user of Metrics Advisor. + SuperUser *string + + // (Metrics Advisor Only) The website name of Metrics Advisor. + WebsiteName *string +} + +// AbusePenalty - The abuse penalty. +type AbusePenalty struct { + // The action of AbusePenalty. + Action *AbusePenaltyAction + + // The datetime of expiration of the AbusePenalty. + Expiration *time.Time + + // The percentage of rate limit. + RateLimitPercentage *float32 +} + +// Account - Cognitive Services account is an Azure resource representing the provisioned account, it's type, location and +// SKU. +type Account struct { + // Identity for the resource. + Identity *Identity + + // The Kind of the resource. + Kind *string + + // The geo-location where the resource lives + Location *string + + // Properties of Cognitive Services account. + Properties *AccountProperties + + // The resource model definition representing SKU + SKU *SKU + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; Resource Etag. + Etag *string + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// AccountListResult - The list of cognitive services accounts operation response. +type AccountListResult struct { + // The link used to get the next page of accounts. + NextLink *string + + // READ-ONLY; Gets the list of Cognitive Services accounts and their properties. + Value []*Account +} + +// AccountModel - Cognitive Services account Model. +type AccountModel struct { + // Base Model Identifier. + BaseModel *DeploymentModel + + // The capabilities. + Capabilities map[string]*string + + // Cognitive Services account ModelDeprecationInfo. + Deprecation *ModelDeprecationInfo + + // The capabilities for finetune models. + FinetuneCapabilities map[string]*string + + // Deployment model format. + Format *string + + // If the model is default version. + IsDefaultVersion *bool + + // Model lifecycle status. + LifecycleStatus *ModelLifecycleStatus + + // The max capacity. + MaxCapacity *int32 + + // Deployment model name. + Name *string + + // The list of Model Sku. + SKUs []*ModelSKU + + // Optional. Deployment model source ARM resource ID. + Source *string + + // Optional. Deployment model version. If version is not specified, a default version will be assigned. The default version + // is different for different models and might change when there is new version + // available for a model. Default version for a model could be found from list models API. + Version *string + + // READ-ONLY; The call rate limit Cognitive Services account. + CallRateLimit *CallRateLimit + + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData +} + +// AccountModelListResult - The list of cognitive services accounts operation response. +type AccountModelListResult struct { + // The link used to get the next page of Model. + NextLink *string + + // Gets the list of Cognitive Services accounts Model and their properties. + Value []*AccountModel +} + +// AccountProperties - Properties of Cognitive Services account. +type AccountProperties struct { + // The api properties for special APIs. + APIProperties *APIProperties + AllowedFqdnList []*string + + // Optional subdomain name used for token-based authentication. + CustomSubDomainName *string + DisableLocalAuth *bool + + // The flag to enable dynamic throttling. + DynamicThrottlingEnabled *bool + + // The encryption properties for this resource. + Encryption *Encryption + + // The multiregion settings of Cognitive Services account. + Locations *MultiRegionSettings + + // Resource migration token. + MigrationToken *string + + // A collection of rules governing the accessibility from specific network locations. + NetworkACLs *NetworkRuleSet + + // Whether or not public endpoint access is allowed for this account. + PublicNetworkAccess *PublicNetworkAccess + Restore *bool + RestrictOutboundNetworkAccess *bool + + // The storage accounts for this resource. + UserOwnedStorage []*UserOwnedStorage + + // READ-ONLY; The abuse penalty. + AbusePenalty *AbusePenalty + + // READ-ONLY; The call rate limit Cognitive Services account. + CallRateLimit *CallRateLimit + + // READ-ONLY; Gets the capabilities of the cognitive services account. Each item indicates the capability of a specific feature. + // The values are read-only and for reference only. + Capabilities []*SKUCapability + + // READ-ONLY; The commitment plan associations of Cognitive Services account. + CommitmentPlanAssociations []*CommitmentPlanAssociation + + // READ-ONLY; Gets the date of cognitive services account creation. + DateCreated *string + + // READ-ONLY; The deletion date, only available for deleted account. + DeletionDate *string + + // READ-ONLY; Endpoint of the created account. + Endpoint *string + + // READ-ONLY; Dictionary of + Endpoints map[string]*string + + // READ-ONLY; The internal identifier (deprecated, do not use this property). + InternalID *string + + // READ-ONLY; If the resource is migrated from an existing key. + IsMigrated *bool + + // READ-ONLY; The private endpoint connection associated with the Cognitive Services account. + PrivateEndpointConnections []*PrivateEndpointConnection + + // READ-ONLY; Gets the status of the cognitive services account at the time the operation was called. + ProvisioningState *ProvisioningState + + // READ-ONLY + QuotaLimit *QuotaLimit + + // READ-ONLY; Sku change info of account. + SKUChangeInfo *SKUChangeInfo + + // READ-ONLY; The scheduled purge date, only available for deleted account. + ScheduledPurgeDate *string +} + +// AccountSKU - Cognitive Services resource type and SKU. +type AccountSKU struct { + // Resource Namespace and Type + ResourceType *string + + // The SKU of Cognitive Services account. + SKU *SKU +} + +// AccountSKUListResult - The list of cognitive services accounts operation response. +type AccountSKUListResult struct { + // Gets the list of Cognitive Services accounts and their properties. + Value []*AccountSKU +} + +// AzureEntityResource - The resource model definition for an Azure Resource Manager resource with an etag. +type AzureEntityResource struct { + // READ-ONLY; Resource Etag. + Etag *string + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// CallRateLimit - The call rate limit Cognitive Services account. +type CallRateLimit struct { + // The count value of Call Rate Limit. + Count *float32 + + // The renewal period in seconds of Call Rate Limit. + RenewalPeriod *float32 + Rules []*ThrottlingRule +} + +// CapacityConfig - The capacity configuration. +type CapacityConfig struct { + // The default capacity. + Default *int32 + + // The maximum capacity. + Maximum *int32 + + // The minimum capacity. + Minimum *int32 + + // The minimal incremental between allowed values for capacity. + Step *int32 +} + +// CheckDomainAvailabilityParameter - Check Domain availability parameter. +type CheckDomainAvailabilityParameter struct { + // REQUIRED; The subdomain name to use. + SubdomainName *string + + // REQUIRED; The Type of the resource. + Type *string + + // The Kind of the resource. + Kind *string +} + +// CheckSKUAvailabilityParameter - Check SKU availability parameter. +type CheckSKUAvailabilityParameter struct { + // REQUIRED; The Kind of the resource. + Kind *string + + // REQUIRED; The SKU of the resource. + SKUs []*string + + // REQUIRED; The Type of the resource. + Type *string +} + +// CommitmentCost - Cognitive Services account commitment cost. +type CommitmentCost struct { + // Commitment meter Id. + CommitmentMeterID *string + + // Overage meter Id. + OverageMeterID *string +} + +// CommitmentPeriod - Cognitive Services account commitment period. +type CommitmentPeriod struct { + // Commitment period commitment count. + Count *int32 + + // Commitment period commitment tier. + Tier *string + + // READ-ONLY; Commitment period end date. + EndDate *string + + // READ-ONLY; Cognitive Services account commitment quota. + Quota *CommitmentQuota + + // READ-ONLY; Commitment period start date. + StartDate *string +} + +// CommitmentPlan - Cognitive Services account commitment plan. +type CommitmentPlan struct { + // The Kind of the resource. + Kind *string + + // The geo-location where the resource lives + Location *string + + // Properties of Cognitive Services account commitment plan. + Properties *CommitmentPlanProperties + + // The resource model definition representing SKU + SKU *SKU + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; Resource Etag. + Etag *string + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// CommitmentPlanAccountAssociation - The commitment plan association. +type CommitmentPlanAccountAssociation struct { + // Properties of Cognitive Services account commitment plan association. + Properties *CommitmentPlanAccountAssociationProperties + + // READ-ONLY; Resource Etag. + Etag *string + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// CommitmentPlanAccountAssociationListResult - The list of cognitive services Commitment Plan Account Association operation +// response. +type CommitmentPlanAccountAssociationListResult struct { + // The link used to get the next page of Commitment Plan Account Association. + NextLink *string + + // READ-ONLY; Gets the list of Cognitive Services Commitment Plan Account Association and their properties. + Value []*CommitmentPlanAccountAssociation +} + +// CommitmentPlanAccountAssociationProperties - The commitment plan account association properties. +type CommitmentPlanAccountAssociationProperties struct { + // The Azure resource id of the account. + AccountID *string +} + +// CommitmentPlanAssociation - The commitment plan association. +type CommitmentPlanAssociation struct { + // The Azure resource id of the commitment plan. + CommitmentPlanID *string + + // The location of of the commitment plan. + CommitmentPlanLocation *string +} + +// CommitmentPlanListResult - The list of cognitive services accounts operation response. +type CommitmentPlanListResult struct { + // The link used to get the next page of CommitmentPlan. + NextLink *string + + // READ-ONLY; Gets the list of Cognitive Services accounts CommitmentPlan and their properties. + Value []*CommitmentPlan +} + +// CommitmentPlanProperties - Properties of Cognitive Services account commitment plan. +type CommitmentPlanProperties struct { + // AutoRenew commitment plan. + AutoRenew *bool + + // Commitment plan guid. + CommitmentPlanGUID *string + + // Cognitive Services account commitment period. + Current *CommitmentPeriod + + // Account hosting model. + HostingModel *HostingModel + + // Cognitive Services account commitment period. + Next *CommitmentPeriod + + // Commitment plan type. + PlanType *string + + // READ-ONLY; Cognitive Services account commitment period. + Last *CommitmentPeriod + + // READ-ONLY; The list of ProvisioningIssue. + ProvisioningIssues []*string + + // READ-ONLY; Gets the status of the resource at the time the operation was called. + ProvisioningState *CommitmentPlanProvisioningState +} + +// CommitmentQuota - Cognitive Services account commitment quota. +type CommitmentQuota struct { + // Commitment quota quantity. + Quantity *int64 + + // Commitment quota unit. + Unit *string +} + +// CommitmentTier - Cognitive Services account commitment tier. +type CommitmentTier struct { + // Cognitive Services account commitment cost. + Cost *CommitmentCost + + // Account hosting model. + HostingModel *HostingModel + + // The Kind of the resource. + Kind *string + + // Commitment period commitment max count. + MaxCount *int32 + + // Commitment plan type. + PlanType *string + + // Cognitive Services account commitment quota. + Quota *CommitmentQuota + + // The name of the SKU. Ex - P3. It is typically a letter+number code + SKUName *string + + // Commitment period commitment tier. + Tier *string +} + +// CommitmentTierListResult - The list of cognitive services accounts operation response. +type CommitmentTierListResult struct { + // The link used to get the next page of CommitmentTier. + NextLink *string + + // READ-ONLY; Gets the list of Cognitive Services accounts CommitmentTier and their properties. + Value []*CommitmentTier +} + +// Deployment - Cognitive Services account deployment. +type Deployment struct { + // Properties of Cognitive Services account deployment. + Properties *DeploymentProperties + + // The resource model definition representing SKU + SKU *SKU + + // READ-ONLY; Resource Etag. + Etag *string + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// DeploymentListResult - The list of cognitive services accounts operation response. +type DeploymentListResult struct { + // The link used to get the next page of Deployment. + NextLink *string + + // READ-ONLY; Gets the list of Cognitive Services accounts Deployment and their properties. + Value []*Deployment +} + +// DeploymentModel - Properties of Cognitive Services account deployment model. +type DeploymentModel struct { + // Deployment model format. + Format *string + + // Deployment model name. + Name *string + + // Optional. Deployment model source ARM resource ID. + Source *string + + // Optional. Deployment model version. If version is not specified, a default version will be assigned. The default version + // is different for different models and might change when there is new version + // available for a model. Default version for a model could be found from list models API. + Version *string + + // READ-ONLY; The call rate limit Cognitive Services account. + CallRateLimit *CallRateLimit +} + +// DeploymentProperties - Properties of Cognitive Services account deployment. +type DeploymentProperties struct { + // Properties of Cognitive Services account deployment model. + Model *DeploymentModel + + // The name of RAI policy. + RaiPolicyName *string + + // Properties of Cognitive Services account deployment model. + ScaleSettings *DeploymentScaleSettings + + // Deployment model version upgrade option. + VersionUpgradeOption *DeploymentModelVersionUpgradeOption + + // READ-ONLY; The call rate limit Cognitive Services account. + CallRateLimit *CallRateLimit + + // READ-ONLY; The capabilities. + Capabilities map[string]*string + + // READ-ONLY; Gets the status of the resource at the time the operation was called. + ProvisioningState *DeploymentProvisioningState + + // READ-ONLY + RateLimits []*ThrottlingRule +} + +// DeploymentScaleSettings - Properties of Cognitive Services account deployment model. +type DeploymentScaleSettings struct { + // Deployment capacity. + Capacity *int32 + + // Deployment scale type. + ScaleType *DeploymentScaleType + + // READ-ONLY; Deployment active capacity. This value might be different from capacity if customer recently updated capacity. + ActiveCapacity *int32 +} + +// DomainAvailability - Domain availability. +type DomainAvailability struct { + // Indicates the given SKU is available or not. + IsSubdomainAvailable *bool + + // The Kind of the resource. + Kind *string + + // Reason why the SKU is not available. + Reason *string + + // The subdomain name to use. + SubdomainName *string + + // The Type of the resource. + Type *string +} + +// Encryption - Properties to configure Encryption +type Encryption struct { + // Enumerates the possible value of keySource for Encryption + KeySource *KeySource + + // Properties of KeyVault + KeyVaultProperties *KeyVaultProperties +} + +// ErrorAdditionalInfo - The resource management error additional info. +type ErrorAdditionalInfo struct { + // READ-ONLY; The additional info. + Info any + + // READ-ONLY; The additional info type. + Type *string +} + +// ErrorDetail - The error detail. +type ErrorDetail struct { + // READ-ONLY; The error additional info. + AdditionalInfo []*ErrorAdditionalInfo + + // READ-ONLY; The error code. + Code *string + + // READ-ONLY; The error details. + Details []*ErrorDetail + + // READ-ONLY; The error message. + Message *string + + // READ-ONLY; The error target. + Target *string +} + +// ErrorResponse - Common error response for all Azure Resource Manager APIs to return error details for failed operations. +// (This also follows the OData error response format.). +type ErrorResponse struct { + // The error object. + Error *ErrorDetail +} + +// IPRule - A rule governing the accessibility from a specific ip address or ip range. +type IPRule struct { + // REQUIRED; An IPv4 address range in CIDR notation, such as '124.56.78.91' (simple IP address) or '124.56.78.0/24' (all addresses + // that start with 124.56.78). + Value *string +} + +// Identity for the resource. +type Identity struct { + // The identity type. + Type *ResourceIdentityType + + // The list of user assigned identities associated with the resource. The user identity dictionary key references will be + // ARM resource ids in the form: + // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName} + UserAssignedIdentities map[string]*UserAssignedIdentity + + // READ-ONLY; The principal ID of resource identity. + PrincipalID *string + + // READ-ONLY; The tenant ID of resource. + TenantID *string +} + +// KeyVaultProperties - Properties to configure keyVault Properties +type KeyVaultProperties struct { + IdentityClientID *string + + // Name of the Key from KeyVault + KeyName *string + + // Uri of KeyVault + KeyVaultURI *string + + // Version of the Key from KeyVault + KeyVersion *string +} + +// MetricName - A metric name. +type MetricName struct { + // The friendly name of the metric. + LocalizedValue *string + + // The name of the metric. + Value *string +} + +// Model - Cognitive Services Model. +type Model struct { + // The Kind of the Model. + Kind *string + + // Model Metadata. + Model *AccountModel + + // The SKU of the Model. + SKUName *string +} + +// ModelDeprecationInfo - Cognitive Services account ModelDeprecationInfo. +type ModelDeprecationInfo struct { + // The datetime of deprecation of the fineTune Model. + FineTune *string + + // The datetime of deprecation of the inference Model. + Inference *string +} + +// ModelListResult - The list of cognitive services models. +type ModelListResult struct { + // The link used to get the next page of Model. + NextLink *string + + // Gets the list of Cognitive Services accounts Model and their properties. + Value []*Model +} + +// ModelSKU - Describes an available Cognitive Services Model SKU. +type ModelSKU struct { + // The capacity configuration. + Capacity *CapacityConfig + + // The datetime of deprecation of the model SKU. + DeprecationDate *time.Time + + // The name of the model SKU. + Name *string + + // The list of rateLimit. + RateLimits []*CallRateLimit + + // The usage name of the model SKU. + UsageName *string +} + +// MultiRegionSettings - The multiregion settings Cognitive Services account. +type MultiRegionSettings struct { + Regions []*RegionSetting + + // Multiregion routing methods. + RoutingMethod *RoutingMethods +} + +// NetworkRuleSet - A set of rules governing the network accessibility. +type NetworkRuleSet struct { + // The default action when no rule from ipRules and from virtualNetworkRules match. This is only used after the bypass property + // has been evaluated. + DefaultAction *NetworkRuleAction + + // The list of IP address rules. + IPRules []*IPRule + + // The list of virtual network rules. + VirtualNetworkRules []*VirtualNetworkRule +} + +// Operation - Details of a REST API operation, returned from the Resource Provider Operations API +type Operation struct { + // Localized display information for this particular operation. + Display *OperationDisplay + + // READ-ONLY; Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + ActionType *ActionType + + // READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane + // operations. + IsDataAction *bool + + // READ-ONLY; The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", + // "Microsoft.Compute/virtualMachines/capture/action" + Name *string + + // READ-ONLY; The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default + // value is "user,system" + Origin *Origin +} + +// OperationDisplay - Localized display information for this particular operation. +type OperationDisplay struct { + // READ-ONLY; The short, localized friendly description of the operation; suitable for tool tips and detailed views. + Description *string + + // READ-ONLY; The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual + // Machine", "Restart Virtual Machine". + Operation *string + + // READ-ONLY; The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft + // Compute". + Provider *string + + // READ-ONLY; The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job + // Schedule Collections". + Resource *string +} + +// OperationListResult - A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to +// get the next set of results. +type OperationListResult struct { + // READ-ONLY; URL to get the next set of operation list results (if there are any). + NextLink *string + + // READ-ONLY; List of operations supported by the resource provider + Value []*Operation +} + +// PatchResourceTags - The object being used to update tags of a resource, in general used for PATCH operations. +type PatchResourceTags struct { + // Resource tags. + Tags map[string]*string +} + +// PatchResourceTagsAndSKU - The object being used to update tags and sku of a resource, in general used for PATCH operations. +type PatchResourceTagsAndSKU struct { + // The resource model definition representing SKU + SKU *SKU + + // Resource tags. + Tags map[string]*string +} + +// PrivateEndpoint - The Private Endpoint resource. +type PrivateEndpoint struct { + // READ-ONLY; The ARM identifier for Private Endpoint + ID *string +} + +// PrivateEndpointConnection - The Private Endpoint Connection resource. +type PrivateEndpointConnection struct { + // The location of the private endpoint connection + Location *string + + // Resource properties. + Properties *PrivateEndpointConnectionProperties + + // READ-ONLY; Resource Etag. + Etag *string + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// PrivateEndpointConnectionListResult - A list of private endpoint connections +type PrivateEndpointConnectionListResult struct { + // Array of private endpoint connections + Value []*PrivateEndpointConnection +} + +// PrivateEndpointConnectionProperties - Properties of the PrivateEndpointConnectProperties. +type PrivateEndpointConnectionProperties struct { + // REQUIRED; A collection of information about the state of the connection between service consumer and provider. + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState + + // The private link resource group ids. + GroupIDs []*string + + // The resource of private end point. + PrivateEndpoint *PrivateEndpoint + + // READ-ONLY; The provisioning state of the private endpoint connection resource. + ProvisioningState *PrivateEndpointConnectionProvisioningState +} + +// PrivateLinkResource - A private link resource +type PrivateLinkResource struct { + // Resource properties. + Properties *PrivateLinkResourceProperties + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// PrivateLinkResourceListResult - A list of private link resources +type PrivateLinkResourceListResult struct { + // Array of private link resources + Value []*PrivateLinkResource +} + +// PrivateLinkResourceProperties - Properties of a private link resource. +type PrivateLinkResourceProperties struct { + // The private link resource Private link DNS zone name. + RequiredZoneNames []*string + + // READ-ONLY; The private link resource display name. + DisplayName *string + + // READ-ONLY; The private link resource group id. + GroupID *string + + // READ-ONLY; The private link resource required member names. + RequiredMembers []*string +} + +// PrivateLinkServiceConnectionState - A collection of information about the state of the connection between service consumer +// and provider. +type PrivateLinkServiceConnectionState struct { + // A message indicating if changes on the service provider require any updates on the consumer. + ActionsRequired *string + + // The reason for approval/rejection of the connection. + Description *string + + // Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + Status *PrivateEndpointServiceConnectionStatus +} + +// ProxyResource - The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a +// location +type ProxyResource struct { + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +type QuotaLimit struct { + Count *float32 + RenewalPeriod *float32 + Rules []*ThrottlingRule +} + +// RegenerateKeyParameters - Regenerate key parameters. +type RegenerateKeyParameters struct { + // REQUIRED; key name to generate (Key1|Key2) + KeyName *KeyName +} + +// RegionSetting - The call rate limit Cognitive Services account. +type RegionSetting struct { + // Maps the region to the regional custom subdomain. + Customsubdomain *string + + // Name of the region. + Name *string + + // A value for priority or weighted routing methods. + Value *float32 +} + +type RequestMatchPattern struct { + Method *string + Path *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} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// ResourceSKU - Describes an available Cognitive Services SKU. +type ResourceSKU struct { + // The Kind of resources that are supported in this SKU. + Kind *string + + // The set of locations that the SKU is available. + Locations []*string + + // The name of SKU. + Name *string + + // The type of resource the SKU applies to. + ResourceType *string + + // The restrictions because of which SKU cannot be used. This is empty if there are no restrictions. + Restrictions []*ResourceSKURestrictions + + // Specifies the tier of Cognitive Services account. + Tier *string +} + +// ResourceSKUListResult - The Get Skus operation response. +type ResourceSKUListResult struct { + // REQUIRED; The list of skus available for the subscription. + Value []*ResourceSKU + + // The uri to fetch the next page of Skus. + NextLink *string +} + +type ResourceSKURestrictionInfo struct { + // Locations where the SKU is restricted + Locations []*string + + // List of availability zones where the SKU is restricted. + Zones []*string +} + +// ResourceSKURestrictions - Describes restrictions of a SKU. +type ResourceSKURestrictions struct { + // The reason for restriction. + ReasonCode *ResourceSKURestrictionsReasonCode + + // The information about the restriction where the SKU cannot be used. + RestrictionInfo *ResourceSKURestrictionInfo + + // The type of restrictions. + Type *ResourceSKURestrictionsType + + // The value of restrictions. If the restriction type is set to location. This would be different locations where the SKU + // is restricted. + Values []*string +} + +// SKU - The resource model definition representing SKU +type SKU struct { + // REQUIRED; The name of the SKU. Ex - P3. It is typically a letter+number code + Name *string + + // If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the + // resource this may be omitted. + Capacity *int32 + + // If the service has different generations of hardware, for the same SKU, then that can be captured here. + Family *string + + // The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. + Size *string + + // This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required + // on a PUT. + Tier *SKUTier +} + +// SKUAvailability - SKU availability. +type SKUAvailability struct { + // The Kind of the resource. + Kind *string + + // Additional error message. + Message *string + + // Reason why the SKU is not available. + Reason *string + + // Indicates the given SKU is available or not. + SKUAvailable *bool + + // The SKU of Cognitive Services account. + SKUName *string + + // The Type of the resource. + Type *string +} + +// SKUAvailabilityListResult - Check SKU availability result list. +type SKUAvailabilityListResult struct { + // Check SKU availability result list. + Value []*SKUAvailability +} + +// SKUCapability - SkuCapability indicates the capability of a certain feature. +type SKUCapability struct { + // The name of the SkuCapability. + Name *string + + // The value of the SkuCapability. + Value *string +} + +// SKUChangeInfo - Sku change info of account. +type SKUChangeInfo struct { + // Gets the count of downgrades. + CountOfDowngrades *float32 + + // Gets the count of upgrades after downgrades. + CountOfUpgradesAfterDowngrades *float32 + + // Gets the last change date. + LastChangeDate *string +} + +// SystemData - Metadata pertaining to creation and last modification of the resource. +type SystemData struct { + // The timestamp of resource creation (UTC). + CreatedAt *time.Time + + // The identity that created the resource. + CreatedBy *string + + // The type of identity that created the resource. + CreatedByType *CreatedByType + + // The timestamp of resource last modification (UTC) + LastModifiedAt *time.Time + + // The identity that last modified the resource. + LastModifiedBy *string + + // The type of identity that last modified the resource. + LastModifiedByType *CreatedByType +} + +type ThrottlingRule struct { + Count *float32 + DynamicThrottlingEnabled *bool + Key *string + MatchPatterns []*RequestMatchPattern + MinCount *float32 + RenewalPeriod *float32 +} + +// Usage - The usage data for a usage request. +type Usage struct { + // Current value for this metric. + CurrentValue *float64 + + // Maximum value for this metric. + Limit *float64 + + // The name information for the metric. + Name *MetricName + + // Next reset time for current quota. + NextResetTime *string + + // The quota period used to summarize the usage values. + QuotaPeriod *string + + // Cognitive Services account quota usage status. + Status *QuotaUsageStatus + + // The unit of the metric. + Unit *UnitType +} + +// UsageListResult - The response to a list usage request. +type UsageListResult struct { + // The link used to get the next page of Usages. + NextLink *string + + // The list of usages for Cognitive Service account. + Value []*Usage +} + +// UserAssignedIdentity - User-assigned managed identity. +type UserAssignedIdentity struct { + // READ-ONLY; Client App Id associated with this identity. + ClientID *string + + // READ-ONLY; Azure Active Directory principal ID associated with this Identity. + PrincipalID *string +} + +// UserOwnedStorage - The user owned storage for Cognitive Services account. +type UserOwnedStorage struct { + IdentityClientID *string + + // Full resource id of a Microsoft.Storage resource. + ResourceID *string +} + +// VirtualNetworkRule - A rule governing the accessibility from a specific virtual network. +type VirtualNetworkRule struct { + // REQUIRED; Full resource id of a vnet subnet, such as '/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1'. + ID *string + + // Ignore missing vnet service endpoint or not. + IgnoreMissingVnetServiceEndpoint *bool + + // Gets the state of virtual network rule. + State *string +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/models_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/models_client.go new file mode 100644 index 00000000..820c1ced --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/models_client.go @@ -0,0 +1,103 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armcognitiveservices + +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" +) + +// ModelsClient contains the methods for the Models group. +// Don't use this type directly, use NewModelsClient() instead. +type ModelsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewModelsClient creates a new instance of ModelsClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewModelsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ModelsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ModelsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// NewListPager - List Models. +// +// Generated from API version 2023-05-01 +// - location - Resource location. +// - options - ModelsClientListOptions contains the optional parameters for the ModelsClient.NewListPager method. +func (client *ModelsClient) NewListPager(location string, options *ModelsClientListOptions) *runtime.Pager[ModelsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ModelsClientListResponse]{ + More: func(page ModelsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ModelsClientListResponse) (ModelsClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ModelsClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, location, options) + }, nil) + if err != nil { + return ModelsClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *ModelsClient) listCreateRequest(ctx context.Context, location string, options *ModelsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/models" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + 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-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ModelsClient) listHandleResponse(resp *http.Response) (ModelsClientListResponse, error) { + result := ModelsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ModelListResult); err != nil { + return ModelsClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/models_serde.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/models_serde.go new file mode 100644 index 00000000..91ad242e --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/models_serde.go @@ -0,0 +1,3243 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armcognitiveservices + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" +) + +// MarshalJSON implements the json.Marshaller interface for type APIKeys. +func (a APIKeys) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "key1", a.Key1) + populate(objectMap, "key2", a.Key2) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type APIKeys. +func (a *APIKeys) 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", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "key1": + err = unpopulate(val, "Key1", &a.Key1) + delete(rawMsg, key) + case "key2": + err = unpopulate(val, "Key2", &a.Key2) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type APIProperties. +func (a APIProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "aadClientId", a.AADClientID) + populate(objectMap, "aadTenantId", a.AADTenantID) + populate(objectMap, "eventHubConnectionString", a.EventHubConnectionString) + populate(objectMap, "qnaAzureSearchEndpointId", a.QnaAzureSearchEndpointID) + populate(objectMap, "qnaAzureSearchEndpointKey", a.QnaAzureSearchEndpointKey) + populate(objectMap, "qnaRuntimeEndpoint", a.QnaRuntimeEndpoint) + populate(objectMap, "statisticsEnabled", a.StatisticsEnabled) + populate(objectMap, "storageAccountConnectionString", a.StorageAccountConnectionString) + populate(objectMap, "superUser", a.SuperUser) + populate(objectMap, "websiteName", a.WebsiteName) + if a.AdditionalProperties != nil { + for key, val := range a.AdditionalProperties { + objectMap[key] = val + } + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type APIProperties. +func (a *APIProperties) 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", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "aadClientId": + err = unpopulate(val, "AADClientID", &a.AADClientID) + delete(rawMsg, key) + case "aadTenantId": + err = unpopulate(val, "AADTenantID", &a.AADTenantID) + delete(rawMsg, key) + case "eventHubConnectionString": + err = unpopulate(val, "EventHubConnectionString", &a.EventHubConnectionString) + delete(rawMsg, key) + case "qnaAzureSearchEndpointId": + err = unpopulate(val, "QnaAzureSearchEndpointID", &a.QnaAzureSearchEndpointID) + delete(rawMsg, key) + case "qnaAzureSearchEndpointKey": + err = unpopulate(val, "QnaAzureSearchEndpointKey", &a.QnaAzureSearchEndpointKey) + delete(rawMsg, key) + case "qnaRuntimeEndpoint": + err = unpopulate(val, "QnaRuntimeEndpoint", &a.QnaRuntimeEndpoint) + delete(rawMsg, key) + case "statisticsEnabled": + err = unpopulate(val, "StatisticsEnabled", &a.StatisticsEnabled) + delete(rawMsg, key) + case "storageAccountConnectionString": + err = unpopulate(val, "StorageAccountConnectionString", &a.StorageAccountConnectionString) + delete(rawMsg, key) + case "superUser": + err = unpopulate(val, "SuperUser", &a.SuperUser) + delete(rawMsg, key) + case "websiteName": + err = unpopulate(val, "WebsiteName", &a.WebsiteName) + delete(rawMsg, key) + default: + if a.AdditionalProperties == nil { + a.AdditionalProperties = map[string]any{} + } + if val != nil { + var aux any + err = json.Unmarshal(val, &aux) + a.AdditionalProperties[key] = aux + } + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AbusePenalty. +func (a AbusePenalty) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "action", a.Action) + populateDateTimeRFC3339(objectMap, "expiration", a.Expiration) + populate(objectMap, "rateLimitPercentage", a.RateLimitPercentage) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AbusePenalty. +func (a *AbusePenalty) 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", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "action": + err = unpopulate(val, "Action", &a.Action) + delete(rawMsg, key) + case "expiration": + err = unpopulateDateTimeRFC3339(val, "Expiration", &a.Expiration) + delete(rawMsg, key) + case "rateLimitPercentage": + err = unpopulate(val, "RateLimitPercentage", &a.RateLimitPercentage) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Account. +func (a Account) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", a.Etag) + populate(objectMap, "id", a.ID) + populate(objectMap, "identity", a.Identity) + populate(objectMap, "kind", a.Kind) + populate(objectMap, "location", a.Location) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "sku", a.SKU) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "tags", a.Tags) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Account. +func (a *Account) 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", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &a.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &a.Identity) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &a.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &a.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &a.SKU) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &a.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AccountListResult. +func (a AccountListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccountListResult. +func (a *AccountListResult) 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", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AccountModel. +func (a AccountModel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "baseModel", a.BaseModel) + populate(objectMap, "callRateLimit", a.CallRateLimit) + populate(objectMap, "capabilities", a.Capabilities) + populate(objectMap, "deprecation", a.Deprecation) + populate(objectMap, "finetuneCapabilities", a.FinetuneCapabilities) + populate(objectMap, "format", a.Format) + populate(objectMap, "isDefaultVersion", a.IsDefaultVersion) + populate(objectMap, "lifecycleStatus", a.LifecycleStatus) + populate(objectMap, "maxCapacity", a.MaxCapacity) + populate(objectMap, "name", a.Name) + populate(objectMap, "skus", a.SKUs) + populate(objectMap, "source", a.Source) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "version", a.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccountModel. +func (a *AccountModel) 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", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "baseModel": + err = unpopulate(val, "BaseModel", &a.BaseModel) + delete(rawMsg, key) + case "callRateLimit": + err = unpopulate(val, "CallRateLimit", &a.CallRateLimit) + delete(rawMsg, key) + case "capabilities": + err = unpopulate(val, "Capabilities", &a.Capabilities) + delete(rawMsg, key) + case "deprecation": + err = unpopulate(val, "Deprecation", &a.Deprecation) + delete(rawMsg, key) + case "finetuneCapabilities": + err = unpopulate(val, "FinetuneCapabilities", &a.FinetuneCapabilities) + delete(rawMsg, key) + case "format": + err = unpopulate(val, "Format", &a.Format) + delete(rawMsg, key) + case "isDefaultVersion": + err = unpopulate(val, "IsDefaultVersion", &a.IsDefaultVersion) + delete(rawMsg, key) + case "lifecycleStatus": + err = unpopulate(val, "LifecycleStatus", &a.LifecycleStatus) + delete(rawMsg, key) + case "maxCapacity": + err = unpopulate(val, "MaxCapacity", &a.MaxCapacity) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "skus": + err = unpopulate(val, "SKUs", &a.SKUs) + delete(rawMsg, key) + case "source": + err = unpopulate(val, "Source", &a.Source) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &a.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AccountModelListResult. +func (a AccountModelListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccountModelListResult. +func (a *AccountModelListResult) 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", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AccountProperties. +func (a AccountProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "apiProperties", a.APIProperties) + populate(objectMap, "abusePenalty", a.AbusePenalty) + populate(objectMap, "allowedFqdnList", a.AllowedFqdnList) + populate(objectMap, "callRateLimit", a.CallRateLimit) + populate(objectMap, "capabilities", a.Capabilities) + populate(objectMap, "commitmentPlanAssociations", a.CommitmentPlanAssociations) + populate(objectMap, "customSubDomainName", a.CustomSubDomainName) + populate(objectMap, "dateCreated", a.DateCreated) + populate(objectMap, "deletionDate", a.DeletionDate) + populate(objectMap, "disableLocalAuth", a.DisableLocalAuth) + populate(objectMap, "dynamicThrottlingEnabled", a.DynamicThrottlingEnabled) + populate(objectMap, "encryption", a.Encryption) + populate(objectMap, "endpoint", a.Endpoint) + populate(objectMap, "endpoints", a.Endpoints) + populate(objectMap, "internalId", a.InternalID) + populate(objectMap, "isMigrated", a.IsMigrated) + populate(objectMap, "locations", a.Locations) + populate(objectMap, "migrationToken", a.MigrationToken) + populate(objectMap, "networkAcls", a.NetworkACLs) + populate(objectMap, "privateEndpointConnections", a.PrivateEndpointConnections) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "publicNetworkAccess", a.PublicNetworkAccess) + populate(objectMap, "quotaLimit", a.QuotaLimit) + populate(objectMap, "restore", a.Restore) + populate(objectMap, "restrictOutboundNetworkAccess", a.RestrictOutboundNetworkAccess) + populate(objectMap, "skuChangeInfo", a.SKUChangeInfo) + populate(objectMap, "scheduledPurgeDate", a.ScheduledPurgeDate) + populate(objectMap, "userOwnedStorage", a.UserOwnedStorage) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccountProperties. +func (a *AccountProperties) 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", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "apiProperties": + err = unpopulate(val, "APIProperties", &a.APIProperties) + delete(rawMsg, key) + case "abusePenalty": + err = unpopulate(val, "AbusePenalty", &a.AbusePenalty) + delete(rawMsg, key) + case "allowedFqdnList": + err = unpopulate(val, "AllowedFqdnList", &a.AllowedFqdnList) + delete(rawMsg, key) + case "callRateLimit": + err = unpopulate(val, "CallRateLimit", &a.CallRateLimit) + delete(rawMsg, key) + case "capabilities": + err = unpopulate(val, "Capabilities", &a.Capabilities) + delete(rawMsg, key) + case "commitmentPlanAssociations": + err = unpopulate(val, "CommitmentPlanAssociations", &a.CommitmentPlanAssociations) + delete(rawMsg, key) + case "customSubDomainName": + err = unpopulate(val, "CustomSubDomainName", &a.CustomSubDomainName) + delete(rawMsg, key) + case "dateCreated": + err = unpopulate(val, "DateCreated", &a.DateCreated) + delete(rawMsg, key) + case "deletionDate": + err = unpopulate(val, "DeletionDate", &a.DeletionDate) + delete(rawMsg, key) + case "disableLocalAuth": + err = unpopulate(val, "DisableLocalAuth", &a.DisableLocalAuth) + delete(rawMsg, key) + case "dynamicThrottlingEnabled": + err = unpopulate(val, "DynamicThrottlingEnabled", &a.DynamicThrottlingEnabled) + delete(rawMsg, key) + case "encryption": + err = unpopulate(val, "Encryption", &a.Encryption) + delete(rawMsg, key) + case "endpoint": + err = unpopulate(val, "Endpoint", &a.Endpoint) + delete(rawMsg, key) + case "endpoints": + err = unpopulate(val, "Endpoints", &a.Endpoints) + delete(rawMsg, key) + case "internalId": + err = unpopulate(val, "InternalID", &a.InternalID) + delete(rawMsg, key) + case "isMigrated": + err = unpopulate(val, "IsMigrated", &a.IsMigrated) + delete(rawMsg, key) + case "locations": + err = unpopulate(val, "Locations", &a.Locations) + delete(rawMsg, key) + case "migrationToken": + err = unpopulate(val, "MigrationToken", &a.MigrationToken) + delete(rawMsg, key) + case "networkAcls": + err = unpopulate(val, "NetworkACLs", &a.NetworkACLs) + delete(rawMsg, key) + case "privateEndpointConnections": + err = unpopulate(val, "PrivateEndpointConnections", &a.PrivateEndpointConnections) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "publicNetworkAccess": + err = unpopulate(val, "PublicNetworkAccess", &a.PublicNetworkAccess) + delete(rawMsg, key) + case "quotaLimit": + err = unpopulate(val, "QuotaLimit", &a.QuotaLimit) + delete(rawMsg, key) + case "restore": + err = unpopulate(val, "Restore", &a.Restore) + delete(rawMsg, key) + case "restrictOutboundNetworkAccess": + err = unpopulate(val, "RestrictOutboundNetworkAccess", &a.RestrictOutboundNetworkAccess) + delete(rawMsg, key) + case "skuChangeInfo": + err = unpopulate(val, "SKUChangeInfo", &a.SKUChangeInfo) + delete(rawMsg, key) + case "scheduledPurgeDate": + err = unpopulate(val, "ScheduledPurgeDate", &a.ScheduledPurgeDate) + delete(rawMsg, key) + case "userOwnedStorage": + err = unpopulate(val, "UserOwnedStorage", &a.UserOwnedStorage) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AccountSKU. +func (a AccountSKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "resourceType", a.ResourceType) + populate(objectMap, "sku", a.SKU) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccountSKU. +func (a *AccountSKU) 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", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "resourceType": + err = unpopulate(val, "ResourceType", &a.ResourceType) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &a.SKU) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AccountSKUListResult. +func (a AccountSKUListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccountSKUListResult. +func (a *AccountSKUListResult) 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", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AzureEntityResource. +func (a AzureEntityResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", a.Etag) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureEntityResource. +func (a *AzureEntityResource) 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", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &a.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CallRateLimit. +func (c CallRateLimit) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", c.Count) + populate(objectMap, "renewalPeriod", c.RenewalPeriod) + populate(objectMap, "rules", c.Rules) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CallRateLimit. +func (c *CallRateLimit) 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", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "count": + err = unpopulate(val, "Count", &c.Count) + delete(rawMsg, key) + case "renewalPeriod": + err = unpopulate(val, "RenewalPeriod", &c.RenewalPeriod) + delete(rawMsg, key) + case "rules": + err = unpopulate(val, "Rules", &c.Rules) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CapacityConfig. +func (c CapacityConfig) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "default", c.Default) + populate(objectMap, "maximum", c.Maximum) + populate(objectMap, "minimum", c.Minimum) + populate(objectMap, "step", c.Step) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CapacityConfig. +func (c *CapacityConfig) 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", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "default": + err = unpopulate(val, "Default", &c.Default) + delete(rawMsg, key) + case "maximum": + err = unpopulate(val, "Maximum", &c.Maximum) + delete(rawMsg, key) + case "minimum": + err = unpopulate(val, "Minimum", &c.Minimum) + delete(rawMsg, key) + case "step": + err = unpopulate(val, "Step", &c.Step) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CheckDomainAvailabilityParameter. +func (c CheckDomainAvailabilityParameter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "kind", c.Kind) + populate(objectMap, "subdomainName", c.SubdomainName) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CheckDomainAvailabilityParameter. +func (c *CheckDomainAvailabilityParameter) 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", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "kind": + err = unpopulate(val, "Kind", &c.Kind) + delete(rawMsg, key) + case "subdomainName": + err = unpopulate(val, "SubdomainName", &c.SubdomainName) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CheckSKUAvailabilityParameter. +func (c CheckSKUAvailabilityParameter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "kind", c.Kind) + populate(objectMap, "skus", c.SKUs) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CheckSKUAvailabilityParameter. +func (c *CheckSKUAvailabilityParameter) 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", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "kind": + err = unpopulate(val, "Kind", &c.Kind) + delete(rawMsg, key) + case "skus": + err = unpopulate(val, "SKUs", &c.SKUs) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CommitmentCost. +func (c CommitmentCost) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "commitmentMeterId", c.CommitmentMeterID) + populate(objectMap, "overageMeterId", c.OverageMeterID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CommitmentCost. +func (c *CommitmentCost) 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", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "commitmentMeterId": + err = unpopulate(val, "CommitmentMeterID", &c.CommitmentMeterID) + delete(rawMsg, key) + case "overageMeterId": + err = unpopulate(val, "OverageMeterID", &c.OverageMeterID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CommitmentPeriod. +func (c CommitmentPeriod) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", c.Count) + populate(objectMap, "endDate", c.EndDate) + populate(objectMap, "quota", c.Quota) + populate(objectMap, "startDate", c.StartDate) + populate(objectMap, "tier", c.Tier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CommitmentPeriod. +func (c *CommitmentPeriod) 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", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "count": + err = unpopulate(val, "Count", &c.Count) + delete(rawMsg, key) + case "endDate": + err = unpopulate(val, "EndDate", &c.EndDate) + delete(rawMsg, key) + case "quota": + err = unpopulate(val, "Quota", &c.Quota) + delete(rawMsg, key) + case "startDate": + err = unpopulate(val, "StartDate", &c.StartDate) + delete(rawMsg, key) + case "tier": + err = unpopulate(val, "Tier", &c.Tier) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CommitmentPlan. +func (c CommitmentPlan) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", c.Etag) + populate(objectMap, "id", c.ID) + populate(objectMap, "kind", c.Kind) + populate(objectMap, "location", c.Location) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "sku", c.SKU) + populate(objectMap, "systemData", c.SystemData) + populate(objectMap, "tags", c.Tags) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CommitmentPlan. +func (c *CommitmentPlan) 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", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &c.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &c.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &c.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &c.SKU) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &c.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CommitmentPlanAccountAssociation. +func (c CommitmentPlanAccountAssociation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", c.Etag) + populate(objectMap, "id", c.ID) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "systemData", c.SystemData) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CommitmentPlanAccountAssociation. +func (c *CommitmentPlanAccountAssociation) 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", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &c.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CommitmentPlanAccountAssociationListResult. +func (c CommitmentPlanAccountAssociationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CommitmentPlanAccountAssociationListResult. +func (c *CommitmentPlanAccountAssociationListResult) 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", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CommitmentPlanAccountAssociationProperties. +func (c CommitmentPlanAccountAssociationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "accountId", c.AccountID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CommitmentPlanAccountAssociationProperties. +func (c *CommitmentPlanAccountAssociationProperties) 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", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "accountId": + err = unpopulate(val, "AccountID", &c.AccountID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CommitmentPlanAssociation. +func (c CommitmentPlanAssociation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "commitmentPlanId", c.CommitmentPlanID) + populate(objectMap, "commitmentPlanLocation", c.CommitmentPlanLocation) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CommitmentPlanAssociation. +func (c *CommitmentPlanAssociation) 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", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "commitmentPlanId": + err = unpopulate(val, "CommitmentPlanID", &c.CommitmentPlanID) + delete(rawMsg, key) + case "commitmentPlanLocation": + err = unpopulate(val, "CommitmentPlanLocation", &c.CommitmentPlanLocation) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CommitmentPlanListResult. +func (c CommitmentPlanListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CommitmentPlanListResult. +func (c *CommitmentPlanListResult) 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", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CommitmentPlanProperties. +func (c CommitmentPlanProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "autoRenew", c.AutoRenew) + populate(objectMap, "commitmentPlanGuid", c.CommitmentPlanGUID) + populate(objectMap, "current", c.Current) + populate(objectMap, "hostingModel", c.HostingModel) + populate(objectMap, "last", c.Last) + populate(objectMap, "next", c.Next) + populate(objectMap, "planType", c.PlanType) + populate(objectMap, "provisioningIssues", c.ProvisioningIssues) + populate(objectMap, "provisioningState", c.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CommitmentPlanProperties. +func (c *CommitmentPlanProperties) 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", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "autoRenew": + err = unpopulate(val, "AutoRenew", &c.AutoRenew) + delete(rawMsg, key) + case "commitmentPlanGuid": + err = unpopulate(val, "CommitmentPlanGUID", &c.CommitmentPlanGUID) + delete(rawMsg, key) + case "current": + err = unpopulate(val, "Current", &c.Current) + delete(rawMsg, key) + case "hostingModel": + err = unpopulate(val, "HostingModel", &c.HostingModel) + delete(rawMsg, key) + case "last": + err = unpopulate(val, "Last", &c.Last) + delete(rawMsg, key) + case "next": + err = unpopulate(val, "Next", &c.Next) + delete(rawMsg, key) + case "planType": + err = unpopulate(val, "PlanType", &c.PlanType) + delete(rawMsg, key) + case "provisioningIssues": + err = unpopulate(val, "ProvisioningIssues", &c.ProvisioningIssues) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CommitmentQuota. +func (c CommitmentQuota) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "quantity", c.Quantity) + populate(objectMap, "unit", c.Unit) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CommitmentQuota. +func (c *CommitmentQuota) 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", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "quantity": + err = unpopulate(val, "Quantity", &c.Quantity) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &c.Unit) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CommitmentTier. +func (c CommitmentTier) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "cost", c.Cost) + populate(objectMap, "hostingModel", c.HostingModel) + populate(objectMap, "kind", c.Kind) + populate(objectMap, "maxCount", c.MaxCount) + populate(objectMap, "planType", c.PlanType) + populate(objectMap, "quota", c.Quota) + populate(objectMap, "skuName", c.SKUName) + populate(objectMap, "tier", c.Tier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CommitmentTier. +func (c *CommitmentTier) 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", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "cost": + err = unpopulate(val, "Cost", &c.Cost) + delete(rawMsg, key) + case "hostingModel": + err = unpopulate(val, "HostingModel", &c.HostingModel) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &c.Kind) + delete(rawMsg, key) + case "maxCount": + err = unpopulate(val, "MaxCount", &c.MaxCount) + delete(rawMsg, key) + case "planType": + err = unpopulate(val, "PlanType", &c.PlanType) + delete(rawMsg, key) + case "quota": + err = unpopulate(val, "Quota", &c.Quota) + delete(rawMsg, key) + case "skuName": + err = unpopulate(val, "SKUName", &c.SKUName) + delete(rawMsg, key) + case "tier": + err = unpopulate(val, "Tier", &c.Tier) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CommitmentTierListResult. +func (c CommitmentTierListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CommitmentTierListResult. +func (c *CommitmentTierListResult) 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", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Deployment. +func (d Deployment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", d.Etag) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "sku", d.SKU) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Deployment. +func (d *Deployment) 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &d.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &d.SKU) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &d.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeploymentListResult. +func (d DeploymentListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentListResult. +func (d *DeploymentListResult) 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &d.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeploymentModel. +func (d DeploymentModel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "callRateLimit", d.CallRateLimit) + populate(objectMap, "format", d.Format) + populate(objectMap, "name", d.Name) + populate(objectMap, "source", d.Source) + populate(objectMap, "version", d.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentModel. +func (d *DeploymentModel) 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "callRateLimit": + err = unpopulate(val, "CallRateLimit", &d.CallRateLimit) + delete(rawMsg, key) + case "format": + err = unpopulate(val, "Format", &d.Format) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "source": + err = unpopulate(val, "Source", &d.Source) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &d.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeploymentProperties. +func (d DeploymentProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "callRateLimit", d.CallRateLimit) + populate(objectMap, "capabilities", d.Capabilities) + populate(objectMap, "model", d.Model) + populate(objectMap, "provisioningState", d.ProvisioningState) + populate(objectMap, "raiPolicyName", d.RaiPolicyName) + populate(objectMap, "rateLimits", d.RateLimits) + populate(objectMap, "scaleSettings", d.ScaleSettings) + populate(objectMap, "versionUpgradeOption", d.VersionUpgradeOption) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentProperties. +func (d *DeploymentProperties) 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "callRateLimit": + err = unpopulate(val, "CallRateLimit", &d.CallRateLimit) + delete(rawMsg, key) + case "capabilities": + err = unpopulate(val, "Capabilities", &d.Capabilities) + delete(rawMsg, key) + case "model": + err = unpopulate(val, "Model", &d.Model) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) + delete(rawMsg, key) + case "raiPolicyName": + err = unpopulate(val, "RaiPolicyName", &d.RaiPolicyName) + delete(rawMsg, key) + case "rateLimits": + err = unpopulate(val, "RateLimits", &d.RateLimits) + delete(rawMsg, key) + case "scaleSettings": + err = unpopulate(val, "ScaleSettings", &d.ScaleSettings) + delete(rawMsg, key) + case "versionUpgradeOption": + err = unpopulate(val, "VersionUpgradeOption", &d.VersionUpgradeOption) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeploymentScaleSettings. +func (d DeploymentScaleSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "activeCapacity", d.ActiveCapacity) + populate(objectMap, "capacity", d.Capacity) + populate(objectMap, "scaleType", d.ScaleType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentScaleSettings. +func (d *DeploymentScaleSettings) 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "activeCapacity": + err = unpopulate(val, "ActiveCapacity", &d.ActiveCapacity) + delete(rawMsg, key) + case "capacity": + err = unpopulate(val, "Capacity", &d.Capacity) + delete(rawMsg, key) + case "scaleType": + err = unpopulate(val, "ScaleType", &d.ScaleType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DomainAvailability. +func (d DomainAvailability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "isSubdomainAvailable", d.IsSubdomainAvailable) + populate(objectMap, "kind", d.Kind) + populate(objectMap, "reason", d.Reason) + populate(objectMap, "subdomainName", d.SubdomainName) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DomainAvailability. +func (d *DomainAvailability) 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "isSubdomainAvailable": + err = unpopulate(val, "IsSubdomainAvailable", &d.IsSubdomainAvailable) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &d.Kind) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &d.Reason) + delete(rawMsg, key) + case "subdomainName": + err = unpopulate(val, "SubdomainName", &d.SubdomainName) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Encryption. +func (e Encryption) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "keySource", e.KeySource) + populate(objectMap, "keyVaultProperties", e.KeyVaultProperties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Encryption. +func (e *Encryption) 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", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "keySource": + err = unpopulate(val, "KeySource", &e.KeySource) + delete(rawMsg, key) + case "keyVaultProperties": + err = unpopulate(val, "KeyVaultProperties", &e.KeyVaultProperties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo. +func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateAny(objectMap, "info", e.Info) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo. +func (e *ErrorAdditionalInfo) 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", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "info": + err = unpopulate(val, "Info", &e.Info) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorDetail. +func (e ErrorDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "additionalInfo", e.AdditionalInfo) + populate(objectMap, "code", e.Code) + populate(objectMap, "details", e.Details) + populate(objectMap, "message", e.Message) + populate(objectMap, "target", e.Target) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail. +func (e *ErrorDetail) 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", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "additionalInfo": + err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) + delete(rawMsg, key) + case "code": + err = unpopulate(val, "Code", &e.Code) + delete(rawMsg, key) + case "details": + err = unpopulate(val, "Details", &e.Details) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &e.Message) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &e.Target) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorResponse. +func (e ErrorResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "error", e.Error) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse. +func (e *ErrorResponse) 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", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "error": + err = unpopulate(val, "Error", &e.Error) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IPRule. +func (i IPRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "value", i.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IPRule. +func (i *IPRule) 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", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &i.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Identity. +func (i Identity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "principalId", i.PrincipalID) + populate(objectMap, "tenantId", i.TenantID) + populate(objectMap, "type", i.Type) + populate(objectMap, "userAssignedIdentities", i.UserAssignedIdentities) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Identity. +func (i *Identity) 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", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "principalId": + err = unpopulate(val, "PrincipalID", &i.PrincipalID) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &i.TenantID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + delete(rawMsg, key) + case "userAssignedIdentities": + err = unpopulate(val, "UserAssignedIdentities", &i.UserAssignedIdentities) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, 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, "identityClientId", k.IdentityClientID) + populate(objectMap, "keyName", k.KeyName) + populate(objectMap, "keyVaultUri", k.KeyVaultURI) + populate(objectMap, "keyVersion", k.KeyVersion) + 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 "identityClientId": + err = unpopulate(val, "IdentityClientID", &k.IdentityClientID) + delete(rawMsg, 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) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MetricName. +func (m MetricName) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "localizedValue", m.LocalizedValue) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MetricName. +func (m *MetricName) 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", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "localizedValue": + err = unpopulate(val, "LocalizedValue", &m.LocalizedValue) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Model. +func (m Model) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "kind", m.Kind) + populate(objectMap, "model", m.Model) + populate(objectMap, "skuName", m.SKUName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Model. +func (m *Model) 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", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "kind": + err = unpopulate(val, "Kind", &m.Kind) + delete(rawMsg, key) + case "model": + err = unpopulate(val, "Model", &m.Model) + delete(rawMsg, key) + case "skuName": + err = unpopulate(val, "SKUName", &m.SKUName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ModelDeprecationInfo. +func (m ModelDeprecationInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "fineTune", m.FineTune) + populate(objectMap, "inference", m.Inference) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ModelDeprecationInfo. +func (m *ModelDeprecationInfo) 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", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "fineTune": + err = unpopulate(val, "FineTune", &m.FineTune) + delete(rawMsg, key) + case "inference": + err = unpopulate(val, "Inference", &m.Inference) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ModelListResult. +func (m ModelListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ModelListResult. +func (m *ModelListResult) 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", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ModelSKU. +func (m ModelSKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "capacity", m.Capacity) + populateDateTimeRFC3339(objectMap, "deprecationDate", m.DeprecationDate) + populate(objectMap, "name", m.Name) + populate(objectMap, "rateLimits", m.RateLimits) + populate(objectMap, "usageName", m.UsageName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ModelSKU. +func (m *ModelSKU) 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", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "capacity": + err = unpopulate(val, "Capacity", &m.Capacity) + delete(rawMsg, key) + case "deprecationDate": + err = unpopulateDateTimeRFC3339(val, "DeprecationDate", &m.DeprecationDate) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "rateLimits": + err = unpopulate(val, "RateLimits", &m.RateLimits) + delete(rawMsg, key) + case "usageName": + err = unpopulate(val, "UsageName", &m.UsageName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MultiRegionSettings. +func (m MultiRegionSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "regions", m.Regions) + populate(objectMap, "routingMethod", m.RoutingMethod) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MultiRegionSettings. +func (m *MultiRegionSettings) 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", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "regions": + err = unpopulate(val, "Regions", &m.Regions) + delete(rawMsg, key) + case "routingMethod": + err = unpopulate(val, "RoutingMethod", &m.RoutingMethod) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkRuleSet. +func (n NetworkRuleSet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "defaultAction", n.DefaultAction) + populate(objectMap, "ipRules", n.IPRules) + populate(objectMap, "virtualNetworkRules", n.VirtualNetworkRules) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkRuleSet. +func (n *NetworkRuleSet) 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "defaultAction": + err = unpopulate(val, "DefaultAction", &n.DefaultAction) + delete(rawMsg, key) + case "ipRules": + err = unpopulate(val, "IPRules", &n.IPRules) + delete(rawMsg, key) + case "virtualNetworkRules": + err = unpopulate(val, "VirtualNetworkRules", &n.VirtualNetworkRules) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "actionType", o.ActionType) + populate(objectMap, "display", o.Display) + populate(objectMap, "isDataAction", o.IsDataAction) + populate(objectMap, "name", o.Name) + populate(objectMap, "origin", o.Origin) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Operation. +func (o *Operation) 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "actionType": + err = unpopulate(val, "ActionType", &o.ActionType) + delete(rawMsg, key) + case "display": + err = unpopulate(val, "Display", &o.Display) + delete(rawMsg, key) + case "isDataAction": + err = unpopulate(val, "IsDataAction", &o.IsDataAction) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "origin": + err = unpopulate(val, "Origin", &o.Origin) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationDisplay. +func (o OperationDisplay) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", o.Description) + populate(objectMap, "operation", o.Operation) + populate(objectMap, "provider", o.Provider) + populate(objectMap, "resource", o.Resource) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay. +func (o *OperationDisplay) 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &o.Description) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &o.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &o.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &o.Resource) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationListResult. +func (o OperationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult. +func (o *OperationListResult) 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &o.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PatchResourceTags. +func (p PatchResourceTags) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "tags", p.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PatchResourceTags. +func (p *PatchResourceTags) 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "tags": + err = unpopulate(val, "Tags", &p.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PatchResourceTagsAndSKU. +func (p PatchResourceTagsAndSKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "sku", p.SKU) + populate(objectMap, "tags", p.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PatchResourceTagsAndSKU. +func (p *PatchResourceTagsAndSKU) 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "sku": + err = unpopulate(val, "SKU", &p.SKU) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &p.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpoint. +func (p PrivateEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpoint. +func (p *PrivateEndpoint) 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection. +func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", p.Etag) + populate(objectMap, "id", p.ID) + populate(objectMap, "location", p.Location) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnection. +func (p *PrivateEndpointConnection) 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &p.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &p.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult. +func (p PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionListResult. +func (p *PrivateEndpointConnectionListResult) 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &p.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties. +func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "groupIds", p.GroupIDs) + populate(objectMap, "privateEndpoint", p.PrivateEndpoint) + populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) + populate(objectMap, "provisioningState", p.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionProperties. +func (p *PrivateEndpointConnectionProperties) 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "groupIds": + err = unpopulate(val, "GroupIDs", &p.GroupIDs) + delete(rawMsg, key) + case "privateEndpoint": + err = unpopulate(val, "PrivateEndpoint", &p.PrivateEndpoint) + delete(rawMsg, key) + case "privateLinkServiceConnectionState": + err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource. +func (p PrivateLinkResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResource. +func (p *PrivateLinkResource) 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult. +func (p PrivateLinkResourceListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceListResult. +func (p *PrivateLinkResourceListResult) 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &p.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties. +func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "displayName", p.DisplayName) + populate(objectMap, "groupId", p.GroupID) + populate(objectMap, "requiredMembers", p.RequiredMembers) + populate(objectMap, "requiredZoneNames", p.RequiredZoneNames) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceProperties. +func (p *PrivateLinkResourceProperties) 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "displayName": + err = unpopulate(val, "DisplayName", &p.DisplayName) + delete(rawMsg, key) + case "groupId": + err = unpopulate(val, "GroupID", &p.GroupID) + delete(rawMsg, key) + case "requiredMembers": + err = unpopulate(val, "RequiredMembers", &p.RequiredMembers) + delete(rawMsg, key) + case "requiredZoneNames": + err = unpopulate(val, "RequiredZoneNames", &p.RequiredZoneNames) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionState. +func (p PrivateLinkServiceConnectionState) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "actionsRequired", p.ActionsRequired) + populate(objectMap, "description", p.Description) + populate(objectMap, "status", p.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceConnectionState. +func (p *PrivateLinkServiceConnectionState) 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "actionsRequired": + err = unpopulate(val, "ActionsRequired", &p.ActionsRequired) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &p.Description) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &p.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProxyResource. +func (p ProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource. +func (p *ProxyResource) 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type QuotaLimit. +func (q QuotaLimit) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", q.Count) + populate(objectMap, "renewalPeriod", q.RenewalPeriod) + populate(objectMap, "rules", q.Rules) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type QuotaLimit. +func (q *QuotaLimit) 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", q, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "count": + err = unpopulate(val, "Count", &q.Count) + delete(rawMsg, key) + case "renewalPeriod": + err = unpopulate(val, "RenewalPeriod", &q.RenewalPeriod) + delete(rawMsg, key) + case "rules": + err = unpopulate(val, "Rules", &q.Rules) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", q, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RegenerateKeyParameters. +func (r RegenerateKeyParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "keyName", r.KeyName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RegenerateKeyParameters. +func (r *RegenerateKeyParameters) 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 "keyName": + err = unpopulate(val, "KeyName", &r.KeyName) + 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 RegionSetting. +func (r RegionSetting) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "customsubdomain", r.Customsubdomain) + populate(objectMap, "name", r.Name) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RegionSetting. +func (r *RegionSetting) 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 "customsubdomain": + err = unpopulate(val, "Customsubdomain", &r.Customsubdomain) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + 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 RequestMatchPattern. +func (r RequestMatchPattern) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "method", r.Method) + populate(objectMap, "path", r.Path) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RequestMatchPattern. +func (r *RequestMatchPattern) 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 "method": + err = unpopulate(val, "Method", &r.Method) + delete(rawMsg, key) + case "path": + err = unpopulate(val, "Path", &r.Path) + 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) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Resource. +func (r *Resource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "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 ResourceSKU. +func (r ResourceSKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "kind", r.Kind) + populate(objectMap, "locations", r.Locations) + populate(objectMap, "name", r.Name) + populate(objectMap, "resourceType", r.ResourceType) + populate(objectMap, "restrictions", r.Restrictions) + populate(objectMap, "tier", r.Tier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKU. +func (r *ResourceSKU) 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 "kind": + err = unpopulate(val, "Kind", &r.Kind) + delete(rawMsg, key) + case "locations": + err = unpopulate(val, "Locations", &r.Locations) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "resourceType": + err = unpopulate(val, "ResourceType", &r.ResourceType) + delete(rawMsg, key) + case "restrictions": + err = unpopulate(val, "Restrictions", &r.Restrictions) + delete(rawMsg, key) + case "tier": + err = unpopulate(val, "Tier", &r.Tier) + 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 ResourceSKUListResult. +func (r ResourceSKUListResult) 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 ResourceSKUListResult. +func (r *ResourceSKUListResult) 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 ResourceSKURestrictionInfo. +func (r ResourceSKURestrictionInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "locations", r.Locations) + populate(objectMap, "zones", r.Zones) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKURestrictionInfo. +func (r *ResourceSKURestrictionInfo) 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 "locations": + err = unpopulate(val, "Locations", &r.Locations) + delete(rawMsg, key) + case "zones": + err = unpopulate(val, "Zones", &r.Zones) + 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 ResourceSKURestrictions. +func (r ResourceSKURestrictions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "reasonCode", r.ReasonCode) + populate(objectMap, "restrictionInfo", r.RestrictionInfo) + populate(objectMap, "type", r.Type) + populate(objectMap, "values", r.Values) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKURestrictions. +func (r *ResourceSKURestrictions) 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 "reasonCode": + err = unpopulate(val, "ReasonCode", &r.ReasonCode) + delete(rawMsg, key) + case "restrictionInfo": + err = unpopulate(val, "RestrictionInfo", &r.RestrictionInfo) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + case "values": + err = unpopulate(val, "Values", &r.Values) + 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 SKU. +func (s SKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "capacity", s.Capacity) + populate(objectMap, "family", s.Family) + populate(objectMap, "name", s.Name) + populate(objectMap, "size", s.Size) + populate(objectMap, "tier", s.Tier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SKU. +func (s *SKU) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "capacity": + err = unpopulate(val, "Capacity", &s.Capacity) + delete(rawMsg, key) + case "family": + err = unpopulate(val, "Family", &s.Family) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "size": + err = unpopulate(val, "Size", &s.Size) + delete(rawMsg, key) + case "tier": + err = unpopulate(val, "Tier", &s.Tier) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SKUAvailability. +func (s SKUAvailability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "kind", s.Kind) + populate(objectMap, "message", s.Message) + populate(objectMap, "reason", s.Reason) + populate(objectMap, "skuAvailable", s.SKUAvailable) + populate(objectMap, "skuName", s.SKUName) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SKUAvailability. +func (s *SKUAvailability) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "kind": + err = unpopulate(val, "Kind", &s.Kind) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &s.Message) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &s.Reason) + delete(rawMsg, key) + case "skuAvailable": + err = unpopulate(val, "SKUAvailable", &s.SKUAvailable) + delete(rawMsg, key) + case "skuName": + err = unpopulate(val, "SKUName", &s.SKUName) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SKUAvailabilityListResult. +func (s SKUAvailabilityListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SKUAvailabilityListResult. +func (s *SKUAvailabilityListResult) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SKUCapability. +func (s SKUCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", s.Name) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SKUCapability. +func (s *SKUCapability) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SKUChangeInfo. +func (s SKUChangeInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "countOfDowngrades", s.CountOfDowngrades) + populate(objectMap, "countOfUpgradesAfterDowngrades", s.CountOfUpgradesAfterDowngrades) + populate(objectMap, "lastChangeDate", s.LastChangeDate) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SKUChangeInfo. +func (s *SKUChangeInfo) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "countOfDowngrades": + err = unpopulate(val, "CountOfDowngrades", &s.CountOfDowngrades) + delete(rawMsg, key) + case "countOfUpgradesAfterDowngrades": + err = unpopulate(val, "CountOfUpgradesAfterDowngrades", &s.CountOfUpgradesAfterDowngrades) + delete(rawMsg, key) + case "lastChangeDate": + err = unpopulate(val, "LastChangeDate", &s.LastChangeDate) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SystemData. +func (s SystemData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateDateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populate(objectMap, "createdBy", s.CreatedBy) + populate(objectMap, "createdByType", s.CreatedByType) + populateDateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) + populate(objectMap, "lastModifiedBy", s.LastModifiedBy) + populate(objectMap, "lastModifiedByType", s.LastModifiedByType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. +func (s *SystemData) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "createdAt": + err = unpopulateDateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, "CreatedBy", &s.CreatedBy) + delete(rawMsg, key) + case "createdByType": + err = unpopulate(val, "CreatedByType", &s.CreatedByType) + delete(rawMsg, key) + case "lastModifiedAt": + err = unpopulateDateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) + delete(rawMsg, key) + case "lastModifiedBy": + err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) + delete(rawMsg, key) + case "lastModifiedByType": + err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ThrottlingRule. +func (t ThrottlingRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", t.Count) + populate(objectMap, "dynamicThrottlingEnabled", t.DynamicThrottlingEnabled) + populate(objectMap, "key", t.Key) + populate(objectMap, "matchPatterns", t.MatchPatterns) + populate(objectMap, "minCount", t.MinCount) + populate(objectMap, "renewalPeriod", t.RenewalPeriod) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ThrottlingRule. +func (t *ThrottlingRule) 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", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "count": + err = unpopulate(val, "Count", &t.Count) + delete(rawMsg, key) + case "dynamicThrottlingEnabled": + err = unpopulate(val, "DynamicThrottlingEnabled", &t.DynamicThrottlingEnabled) + delete(rawMsg, key) + case "key": + err = unpopulate(val, "Key", &t.Key) + delete(rawMsg, key) + case "matchPatterns": + err = unpopulate(val, "MatchPatterns", &t.MatchPatterns) + delete(rawMsg, key) + case "minCount": + err = unpopulate(val, "MinCount", &t.MinCount) + delete(rawMsg, key) + case "renewalPeriod": + err = unpopulate(val, "RenewalPeriod", &t.RenewalPeriod) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Usage. +func (u Usage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "currentValue", u.CurrentValue) + populate(objectMap, "limit", u.Limit) + populate(objectMap, "name", u.Name) + populate(objectMap, "nextResetTime", u.NextResetTime) + populate(objectMap, "quotaPeriod", u.QuotaPeriod) + populate(objectMap, "status", u.Status) + populate(objectMap, "unit", u.Unit) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Usage. +func (u *Usage) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "currentValue": + err = unpopulate(val, "CurrentValue", &u.CurrentValue) + delete(rawMsg, key) + case "limit": + err = unpopulate(val, "Limit", &u.Limit) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &u.Name) + delete(rawMsg, key) + case "nextResetTime": + err = unpopulate(val, "NextResetTime", &u.NextResetTime) + delete(rawMsg, key) + case "quotaPeriod": + err = unpopulate(val, "QuotaPeriod", &u.QuotaPeriod) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &u.Status) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &u.Unit) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UsageListResult. +func (u UsageListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", u.NextLink) + populate(objectMap, "value", u.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UsageListResult. +func (u *UsageListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &u.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &u.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UserAssignedIdentity. +func (u UserAssignedIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientId", u.ClientID) + populate(objectMap, "principalId", u.PrincipalID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserAssignedIdentity. +func (u *UserAssignedIdentity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clientId": + err = unpopulate(val, "ClientID", &u.ClientID) + delete(rawMsg, key) + case "principalId": + err = unpopulate(val, "PrincipalID", &u.PrincipalID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UserOwnedStorage. +func (u UserOwnedStorage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "identityClientId", u.IdentityClientID) + populate(objectMap, "resourceId", u.ResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserOwnedStorage. +func (u *UserOwnedStorage) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "identityClientId": + err = unpopulate(val, "IdentityClientID", &u.IdentityClientID) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &u.ResourceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkRule. +func (v VirtualNetworkRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", v.ID) + populate(objectMap, "ignoreMissingVnetServiceEndpoint", v.IgnoreMissingVnetServiceEndpoint) + populate(objectMap, "state", v.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkRule. +func (v *VirtualNetworkRule) 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", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "ignoreMissingVnetServiceEndpoint": + err = unpopulate(val, "IgnoreMissingVnetServiceEndpoint", &v.IgnoreMissingVnetServiceEndpoint) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &v.State) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +func populate(m map[string]any, k string, v any) { + if v == nil { + return + } else if azcore.IsNullValue(v) { + m[k] = nil + } else if !reflect.ValueOf(v).IsNil() { + m[k] = v + } +} + +func populateAny(m map[string]any, k string, v any) { + if v == nil { + return + } else if azcore.IsNullValue(v) { + m[k] = nil + } else { + m[k] = v + } +} + +func unpopulate(data json.RawMessage, fn string, v any) error { + if data == nil { + return nil + } + if err := json.Unmarshal(data, v); err != nil { + return fmt.Errorf("struct field %s: %v", fn, err) + } + return nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/operations_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/operations_client.go new file mode 100644 index 00000000..c20be400 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/operations_client.go @@ -0,0 +1,88 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armcognitiveservices + +import ( + "context" + "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" +) + +// OperationsClient contains the methods for the Operations group. +// Don't use this type directly, use NewOperationsClient() instead. +type OperationsClient struct { + internal *arm.Client +} + +// NewOperationsClient creates a new instance of OperationsClient with the specified values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &OperationsClient{ + internal: cl, + } + return client, nil +} + +// NewListPager - Lists all the available Cognitive Services account operations. +// +// 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]{ + More: func(page OperationsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *OperationsClientListResponse) (OperationsClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "OperationsClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, options) + }, nil) + if err != nil { + return OperationsClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *OperationsClient) listCreateRequest(ctx context.Context, options *OperationsClientListOptions) (*policy.Request, error) { + urlPath := "/providers/Microsoft.CognitiveServices/operations" + 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-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *OperationsClient) listHandleResponse(resp *http.Response) (OperationsClientListResponse, error) { + result := OperationsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.OperationListResult); err != nil { + return OperationsClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/options.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/options.go new file mode 100644 index 00000000..c76660eb --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/options.go @@ -0,0 +1,265 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armcognitiveservices + +// AccountsClientBeginCreateOptions contains the optional parameters for the AccountsClient.BeginCreate method. +type AccountsClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AccountsClientBeginDeleteOptions contains the optional parameters for the AccountsClient.BeginDelete method. +type AccountsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AccountsClientBeginUpdateOptions contains the optional parameters for the AccountsClient.BeginUpdate method. +type AccountsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AccountsClientGetOptions contains the optional parameters for the AccountsClient.Get method. +type AccountsClientGetOptions struct { + // placeholder for future optional parameters +} + +// AccountsClientListByResourceGroupOptions contains the optional parameters for the AccountsClient.NewListByResourceGroupPager +// method. +type AccountsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// AccountsClientListKeysOptions contains the optional parameters for the AccountsClient.ListKeys method. +type AccountsClientListKeysOptions struct { + // placeholder for future optional parameters +} + +// AccountsClientListModelsOptions contains the optional parameters for the AccountsClient.NewListModelsPager method. +type AccountsClientListModelsOptions struct { + // placeholder for future optional parameters +} + +// AccountsClientListOptions contains the optional parameters for the AccountsClient.NewListPager method. +type AccountsClientListOptions struct { + // placeholder for future optional parameters +} + +// AccountsClientListSKUsOptions contains the optional parameters for the AccountsClient.ListSKUs method. +type AccountsClientListSKUsOptions struct { + // placeholder for future optional parameters +} + +// AccountsClientListUsagesOptions contains the optional parameters for the AccountsClient.ListUsages method. +type AccountsClientListUsagesOptions struct { + // An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of + // the metric, can have an or of multiple names). + Filter *string +} + +// AccountsClientRegenerateKeyOptions contains the optional parameters for the AccountsClient.RegenerateKey method. +type AccountsClientRegenerateKeyOptions struct { + // placeholder for future optional parameters +} + +// CommitmentPlansClientBeginCreateOrUpdateAssociationOptions contains the optional parameters for the CommitmentPlansClient.BeginCreateOrUpdateAssociation +// method. +type CommitmentPlansClientBeginCreateOrUpdateAssociationOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// CommitmentPlansClientBeginCreateOrUpdatePlanOptions contains the optional parameters for the CommitmentPlansClient.BeginCreateOrUpdatePlan +// method. +type CommitmentPlansClientBeginCreateOrUpdatePlanOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// CommitmentPlansClientBeginDeleteAssociationOptions contains the optional parameters for the CommitmentPlansClient.BeginDeleteAssociation +// method. +type CommitmentPlansClientBeginDeleteAssociationOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// CommitmentPlansClientBeginDeleteOptions contains the optional parameters for the CommitmentPlansClient.BeginDelete method. +type CommitmentPlansClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// CommitmentPlansClientBeginDeletePlanOptions contains the optional parameters for the CommitmentPlansClient.BeginDeletePlan +// method. +type CommitmentPlansClientBeginDeletePlanOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// CommitmentPlansClientBeginUpdatePlanOptions contains the optional parameters for the CommitmentPlansClient.BeginUpdatePlan +// method. +type CommitmentPlansClientBeginUpdatePlanOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// CommitmentPlansClientCreateOrUpdateOptions contains the optional parameters for the CommitmentPlansClient.CreateOrUpdate +// method. +type CommitmentPlansClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// CommitmentPlansClientGetAssociationOptions contains the optional parameters for the CommitmentPlansClient.GetAssociation +// method. +type CommitmentPlansClientGetAssociationOptions struct { + // placeholder for future optional parameters +} + +// CommitmentPlansClientGetOptions contains the optional parameters for the CommitmentPlansClient.Get method. +type CommitmentPlansClientGetOptions struct { + // placeholder for future optional parameters +} + +// CommitmentPlansClientGetPlanOptions contains the optional parameters for the CommitmentPlansClient.GetPlan method. +type CommitmentPlansClientGetPlanOptions struct { + // placeholder for future optional parameters +} + +// CommitmentPlansClientListAssociationsOptions contains the optional parameters for the CommitmentPlansClient.NewListAssociationsPager +// method. +type CommitmentPlansClientListAssociationsOptions struct { + // placeholder for future optional parameters +} + +// CommitmentPlansClientListOptions contains the optional parameters for the CommitmentPlansClient.NewListPager method. +type CommitmentPlansClientListOptions struct { + // placeholder for future optional parameters +} + +// CommitmentPlansClientListPlansByResourceGroupOptions contains the optional parameters for the CommitmentPlansClient.NewListPlansByResourceGroupPager +// method. +type CommitmentPlansClientListPlansByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// CommitmentPlansClientListPlansBySubscriptionOptions contains the optional parameters for the CommitmentPlansClient.NewListPlansBySubscriptionPager +// method. +type CommitmentPlansClientListPlansBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// CommitmentTiersClientListOptions contains the optional parameters for the CommitmentTiersClient.NewListPager method. +type CommitmentTiersClientListOptions struct { + // placeholder for future optional parameters +} + +// DeletedAccountsClientBeginPurgeOptions contains the optional parameters for the DeletedAccountsClient.BeginPurge method. +type DeletedAccountsClientBeginPurgeOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DeletedAccountsClientGetOptions contains the optional parameters for the DeletedAccountsClient.Get method. +type DeletedAccountsClientGetOptions struct { + // placeholder for future optional parameters +} + +// DeletedAccountsClientListOptions contains the optional parameters for the DeletedAccountsClient.NewListPager method. +type DeletedAccountsClientListOptions struct { + // placeholder for future optional parameters +} + +// DeploymentsClientBeginCreateOrUpdateOptions contains the optional parameters for the DeploymentsClient.BeginCreateOrUpdate +// method. +type DeploymentsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DeploymentsClientBeginDeleteOptions contains the optional parameters for the DeploymentsClient.BeginDelete method. +type DeploymentsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DeploymentsClientGetOptions contains the optional parameters for the DeploymentsClient.Get method. +type DeploymentsClientGetOptions struct { + // placeholder for future optional parameters +} + +// DeploymentsClientListOptions contains the optional parameters for the DeploymentsClient.NewListPager method. +type DeploymentsClientListOptions struct { + // placeholder for future optional parameters +} + +// ManagementClientCheckDomainAvailabilityOptions contains the optional parameters for the ManagementClient.CheckDomainAvailability +// method. +type ManagementClientCheckDomainAvailabilityOptions struct { + // placeholder for future optional parameters +} + +// ManagementClientCheckSKUAvailabilityOptions contains the optional parameters for the ManagementClient.CheckSKUAvailability +// method. +type ManagementClientCheckSKUAvailabilityOptions struct { + // placeholder for future optional parameters +} + +// ModelsClientListOptions contains the optional parameters for the ModelsClient.NewListPager method. +type ModelsClientListOptions struct { + // placeholder for future optional parameters +} + +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. +type OperationsClientListOptions struct { + // placeholder for future optional parameters +} + +// PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginCreateOrUpdate +// method. +type PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete +// method. +type PrivateEndpointConnectionsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get +// method. +type PrivateEndpointConnectionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.List +// method. +type PrivateEndpointConnectionsClientListOptions struct { + // placeholder for future optional parameters +} + +// PrivateLinkResourcesClientListOptions contains the optional parameters for the PrivateLinkResourcesClient.List method. +type PrivateLinkResourcesClientListOptions struct { + // placeholder for future optional parameters +} + +// ResourceSKUsClientListOptions contains the optional parameters for the ResourceSKUsClient.NewListPager method. +type ResourceSKUsClientListOptions struct { + // placeholder for future optional parameters +} + +// UsagesClientListOptions contains the optional parameters for the UsagesClient.NewListPager method. +type UsagesClientListOptions struct { + // An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of + // the metric, can have an or of multiple names). + Filter *string +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/privateendpointconnections_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/privateendpointconnections_client.go new file mode 100644 index 00000000..8e4b9972 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/privateendpointconnections_client.go @@ -0,0 +1,346 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armcognitiveservices + +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" +) + +// PrivateEndpointConnectionsClient contains the methods for the PrivateEndpointConnections group. +// Don't use this type directly, use NewPrivateEndpointConnectionsClient() instead. +type PrivateEndpointConnectionsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateEndpointConnectionsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &PrivateEndpointConnectionsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Update the state of specified private endpoint connection associated with the Cognitive Services +// account. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of Cognitive Services account. +// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Cognitive Services Account +// - properties - The private endpoint connection properties. +// - options - PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginCreateOrUpdate +// method. +func (client *PrivateEndpointConnectionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, properties PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[PrivateEndpointConnectionsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, accountName, privateEndpointConnectionName, properties, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrivateEndpointConnectionsClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[PrivateEndpointConnectionsClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Update the state of specified private endpoint connection associated with the Cognitive Services account. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +func (client *PrivateEndpointConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, properties PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "PrivateEndpointConnectionsClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, accountName, privateEndpointConnectionName, properties, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, properties PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if privateEndpointConnectionName == "" { + return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) + 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-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, properties); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Deletes the specified private endpoint connection associated with the Cognitive Services account. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of Cognitive Services account. +// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Cognitive Services Account +// - options - PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete +// method. +func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*runtime.Poller[PrivateEndpointConnectionsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, accountName, privateEndpointConnectionName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrivateEndpointConnectionsClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[PrivateEndpointConnectionsClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Deletes the specified private endpoint connection associated with the Cognitive Services account. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "PrivateEndpointConnectionsClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, privateEndpointConnectionName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if privateEndpointConnectionName == "" { + return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) + 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-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified private endpoint connection associated with the Cognitive Services account. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of Cognitive Services account. +// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Cognitive Services Account +// - options - PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get +// method. +func (client *PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetOptions) (PrivateEndpointConnectionsClientGetResponse, error) { + var err error + const operationName = "PrivateEndpointConnectionsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, privateEndpointConnectionName, options) + if err != nil { + return PrivateEndpointConnectionsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PrivateEndpointConnectionsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PrivateEndpointConnectionsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if privateEndpointConnectionName == "" { + return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) + 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-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Response) (PrivateEndpointConnectionsClientGetResponse, error) { + result := PrivateEndpointConnectionsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnection); err != nil { + return PrivateEndpointConnectionsClientGetResponse{}, err + } + return result, nil +} + +// List - Gets the private endpoint connections associated with the Cognitive Services account. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of Cognitive Services account. +// - options - PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.List +// method. +func (client *PrivateEndpointConnectionsClient) List(ctx context.Context, resourceGroupName string, accountName string, options *PrivateEndpointConnectionsClientListOptions) (PrivateEndpointConnectionsClientListResponse, error) { + var err error + const operationName = "PrivateEndpointConnectionsClient.List" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.listCreateRequest(ctx, resourceGroupName, accountName, options) + if err != nil { + return PrivateEndpointConnectionsClientListResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PrivateEndpointConnectionsClientListResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PrivateEndpointConnectionsClientListResponse{}, err + } + resp, err := client.listHandleResponse(httpResp) + return resp, err +} + +// listCreateRequest creates the List request. +func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *PrivateEndpointConnectionsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + 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-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *PrivateEndpointConnectionsClient) listHandleResponse(resp *http.Response) (PrivateEndpointConnectionsClientListResponse, error) { + result := PrivateEndpointConnectionsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnectionListResult); err != nil { + return PrivateEndpointConnectionsClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/privatelinkresources_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/privatelinkresources_client.go new file mode 100644 index 00000000..2cb99f9c --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/privatelinkresources_client.go @@ -0,0 +1,109 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armcognitiveservices + +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" +) + +// PrivateLinkResourcesClient contains the methods for the PrivateLinkResources group. +// Don't use this type directly, use NewPrivateLinkResourcesClient() instead. +type PrivateLinkResourcesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateLinkResourcesClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &PrivateLinkResourcesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// List - Gets the private link resources that need to be created for a Cognitive Services account. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of Cognitive Services account. +// - options - PrivateLinkResourcesClientListOptions contains the optional parameters for the PrivateLinkResourcesClient.List +// method. +func (client *PrivateLinkResourcesClient) List(ctx context.Context, resourceGroupName string, accountName string, options *PrivateLinkResourcesClientListOptions) (PrivateLinkResourcesClientListResponse, error) { + var err error + const operationName = "PrivateLinkResourcesClient.List" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.listCreateRequest(ctx, resourceGroupName, accountName, options) + if err != nil { + return PrivateLinkResourcesClientListResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PrivateLinkResourcesClientListResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PrivateLinkResourcesClientListResponse{}, err + } + resp, err := client.listHandleResponse(httpResp) + return resp, err +} + +// listCreateRequest creates the List request. +func (client *PrivateLinkResourcesClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *PrivateLinkResourcesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateLinkResources" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + 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-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *PrivateLinkResourcesClient) listHandleResponse(resp *http.Response) (PrivateLinkResourcesClientListResponse, error) { + result := PrivateLinkResourcesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateLinkResourceListResult); err != nil { + return PrivateLinkResourcesClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/resourceskus_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/resourceskus_client.go new file mode 100644 index 00000000..78a95040 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/resourceskus_client.go @@ -0,0 +1,98 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armcognitiveservices + +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" +) + +// ResourceSKUsClient contains the methods for the ResourceSKUs group. +// Don't use this type directly, use NewResourceSKUsClient() instead. +type ResourceSKUsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewResourceSKUsClient creates a new instance of ResourceSKUsClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewResourceSKUsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ResourceSKUsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ResourceSKUsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// NewListPager - Gets the list of Microsoft.CognitiveServices SKUs available for your Subscription. +// +// Generated from API version 2023-05-01 +// - options - ResourceSKUsClientListOptions contains the optional parameters for the ResourceSKUsClient.NewListPager method. +func (client *ResourceSKUsClient) NewListPager(options *ResourceSKUsClientListOptions) *runtime.Pager[ResourceSKUsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ResourceSKUsClientListResponse]{ + More: func(page ResourceSKUsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ResourceSKUsClientListResponse) (ResourceSKUsClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ResourceSKUsClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, options) + }, nil) + if err != nil { + return ResourceSKUsClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *ResourceSKUsClient) listCreateRequest(ctx context.Context, options *ResourceSKUsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/skus" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + 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-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ResourceSKUsClient) listHandleResponse(resp *http.Response) (ResourceSKUsClientListResponse, error) { + result := ResourceSKUsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ResourceSKUListResult); err != nil { + return ResourceSKUsClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/response_types.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/response_types.go new file mode 100644 index 00000000..bbfb2256 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/response_types.go @@ -0,0 +1,266 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armcognitiveservices + +// AccountsClientCreateResponse contains the response from method AccountsClient.BeginCreate. +type AccountsClientCreateResponse struct { + // Cognitive Services account is an Azure resource representing the provisioned account, it's type, location and SKU. + Account +} + +// AccountsClientDeleteResponse contains the response from method AccountsClient.BeginDelete. +type AccountsClientDeleteResponse struct { + // placeholder for future response values +} + +// AccountsClientGetResponse contains the response from method AccountsClient.Get. +type AccountsClientGetResponse struct { + // Cognitive Services account is an Azure resource representing the provisioned account, it's type, location and SKU. + Account +} + +// AccountsClientListByResourceGroupResponse contains the response from method AccountsClient.NewListByResourceGroupPager. +type AccountsClientListByResourceGroupResponse struct { + // The list of cognitive services accounts operation response. + AccountListResult +} + +// AccountsClientListKeysResponse contains the response from method AccountsClient.ListKeys. +type AccountsClientListKeysResponse struct { + // The access keys for the cognitive services account. + APIKeys +} + +// AccountsClientListModelsResponse contains the response from method AccountsClient.NewListModelsPager. +type AccountsClientListModelsResponse struct { + // The list of cognitive services accounts operation response. + AccountModelListResult +} + +// AccountsClientListResponse contains the response from method AccountsClient.NewListPager. +type AccountsClientListResponse struct { + // The list of cognitive services accounts operation response. + AccountListResult +} + +// AccountsClientListSKUsResponse contains the response from method AccountsClient.ListSKUs. +type AccountsClientListSKUsResponse struct { + // The list of cognitive services accounts operation response. + AccountSKUListResult +} + +// AccountsClientListUsagesResponse contains the response from method AccountsClient.ListUsages. +type AccountsClientListUsagesResponse struct { + // The response to a list usage request. + UsageListResult +} + +// AccountsClientRegenerateKeyResponse contains the response from method AccountsClient.RegenerateKey. +type AccountsClientRegenerateKeyResponse struct { + // The access keys for the cognitive services account. + APIKeys +} + +// AccountsClientUpdateResponse contains the response from method AccountsClient.BeginUpdate. +type AccountsClientUpdateResponse struct { + // Cognitive Services account is an Azure resource representing the provisioned account, it's type, location and SKU. + Account +} + +// CommitmentPlansClientCreateOrUpdateAssociationResponse contains the response from method CommitmentPlansClient.BeginCreateOrUpdateAssociation. +type CommitmentPlansClientCreateOrUpdateAssociationResponse struct { + // The commitment plan association. + CommitmentPlanAccountAssociation +} + +// CommitmentPlansClientCreateOrUpdatePlanResponse contains the response from method CommitmentPlansClient.BeginCreateOrUpdatePlan. +type CommitmentPlansClientCreateOrUpdatePlanResponse struct { + // Cognitive Services account commitment plan. + CommitmentPlan +} + +// CommitmentPlansClientCreateOrUpdateResponse contains the response from method CommitmentPlansClient.CreateOrUpdate. +type CommitmentPlansClientCreateOrUpdateResponse struct { + // Cognitive Services account commitment plan. + CommitmentPlan +} + +// CommitmentPlansClientDeleteAssociationResponse contains the response from method CommitmentPlansClient.BeginDeleteAssociation. +type CommitmentPlansClientDeleteAssociationResponse struct { + // placeholder for future response values +} + +// CommitmentPlansClientDeletePlanResponse contains the response from method CommitmentPlansClient.BeginDeletePlan. +type CommitmentPlansClientDeletePlanResponse struct { + // placeholder for future response values +} + +// CommitmentPlansClientDeleteResponse contains the response from method CommitmentPlansClient.BeginDelete. +type CommitmentPlansClientDeleteResponse struct { + // placeholder for future response values +} + +// CommitmentPlansClientGetAssociationResponse contains the response from method CommitmentPlansClient.GetAssociation. +type CommitmentPlansClientGetAssociationResponse struct { + // The commitment plan association. + CommitmentPlanAccountAssociation +} + +// CommitmentPlansClientGetPlanResponse contains the response from method CommitmentPlansClient.GetPlan. +type CommitmentPlansClientGetPlanResponse struct { + // Cognitive Services account commitment plan. + CommitmentPlan +} + +// CommitmentPlansClientGetResponse contains the response from method CommitmentPlansClient.Get. +type CommitmentPlansClientGetResponse struct { + // Cognitive Services account commitment plan. + CommitmentPlan +} + +// CommitmentPlansClientListAssociationsResponse contains the response from method CommitmentPlansClient.NewListAssociationsPager. +type CommitmentPlansClientListAssociationsResponse struct { + // The list of cognitive services Commitment Plan Account Association operation response. + CommitmentPlanAccountAssociationListResult +} + +// CommitmentPlansClientListPlansByResourceGroupResponse contains the response from method CommitmentPlansClient.NewListPlansByResourceGroupPager. +type CommitmentPlansClientListPlansByResourceGroupResponse struct { + // The list of cognitive services accounts operation response. + CommitmentPlanListResult +} + +// CommitmentPlansClientListPlansBySubscriptionResponse contains the response from method CommitmentPlansClient.NewListPlansBySubscriptionPager. +type CommitmentPlansClientListPlansBySubscriptionResponse struct { + // The list of cognitive services accounts operation response. + CommitmentPlanListResult +} + +// CommitmentPlansClientListResponse contains the response from method CommitmentPlansClient.NewListPager. +type CommitmentPlansClientListResponse struct { + // The list of cognitive services accounts operation response. + CommitmentPlanListResult +} + +// CommitmentPlansClientUpdatePlanResponse contains the response from method CommitmentPlansClient.BeginUpdatePlan. +type CommitmentPlansClientUpdatePlanResponse struct { + // Cognitive Services account commitment plan. + CommitmentPlan +} + +// CommitmentTiersClientListResponse contains the response from method CommitmentTiersClient.NewListPager. +type CommitmentTiersClientListResponse struct { + // The list of cognitive services accounts operation response. + CommitmentTierListResult +} + +// DeletedAccountsClientGetResponse contains the response from method DeletedAccountsClient.Get. +type DeletedAccountsClientGetResponse struct { + // Cognitive Services account is an Azure resource representing the provisioned account, it's type, location and SKU. + Account +} + +// DeletedAccountsClientListResponse contains the response from method DeletedAccountsClient.NewListPager. +type DeletedAccountsClientListResponse struct { + // The list of cognitive services accounts operation response. + AccountListResult +} + +// DeletedAccountsClientPurgeResponse contains the response from method DeletedAccountsClient.BeginPurge. +type DeletedAccountsClientPurgeResponse struct { + // placeholder for future response values +} + +// DeploymentsClientCreateOrUpdateResponse contains the response from method DeploymentsClient.BeginCreateOrUpdate. +type DeploymentsClientCreateOrUpdateResponse struct { + // Cognitive Services account deployment. + Deployment +} + +// DeploymentsClientDeleteResponse contains the response from method DeploymentsClient.BeginDelete. +type DeploymentsClientDeleteResponse struct { + // placeholder for future response values +} + +// DeploymentsClientGetResponse contains the response from method DeploymentsClient.Get. +type DeploymentsClientGetResponse struct { + // Cognitive Services account deployment. + Deployment +} + +// DeploymentsClientListResponse contains the response from method DeploymentsClient.NewListPager. +type DeploymentsClientListResponse struct { + // The list of cognitive services accounts operation response. + DeploymentListResult +} + +// ManagementClientCheckDomainAvailabilityResponse contains the response from method ManagementClient.CheckDomainAvailability. +type ManagementClientCheckDomainAvailabilityResponse struct { + // Domain availability. + DomainAvailability +} + +// ManagementClientCheckSKUAvailabilityResponse contains the response from method ManagementClient.CheckSKUAvailability. +type ManagementClientCheckSKUAvailabilityResponse struct { + // Check SKU availability result list. + SKUAvailabilityListResult +} + +// ModelsClientListResponse contains the response from method ModelsClient.NewListPager. +type ModelsClientListResponse struct { + // The list of cognitive services models. + ModelListResult +} + +// OperationsClientListResponse contains the response from method OperationsClient.NewListPager. +type OperationsClientListResponse struct { + // A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. + OperationListResult +} + +// PrivateEndpointConnectionsClientCreateOrUpdateResponse contains the response from method PrivateEndpointConnectionsClient.BeginCreateOrUpdate. +type PrivateEndpointConnectionsClientCreateOrUpdateResponse struct { + // The Private Endpoint Connection resource. + PrivateEndpointConnection +} + +// PrivateEndpointConnectionsClientDeleteResponse contains the response from method PrivateEndpointConnectionsClient.BeginDelete. +type PrivateEndpointConnectionsClientDeleteResponse struct { + // placeholder for future response values +} + +// PrivateEndpointConnectionsClientGetResponse contains the response from method PrivateEndpointConnectionsClient.Get. +type PrivateEndpointConnectionsClientGetResponse struct { + // The Private Endpoint Connection resource. + PrivateEndpointConnection +} + +// PrivateEndpointConnectionsClientListResponse contains the response from method PrivateEndpointConnectionsClient.List. +type PrivateEndpointConnectionsClientListResponse struct { + // A list of private endpoint connections + PrivateEndpointConnectionListResult +} + +// PrivateLinkResourcesClientListResponse contains the response from method PrivateLinkResourcesClient.List. +type PrivateLinkResourcesClientListResponse struct { + // A list of private link resources + PrivateLinkResourceListResult +} + +// ResourceSKUsClientListResponse contains the response from method ResourceSKUsClient.NewListPager. +type ResourceSKUsClientListResponse struct { + // The Get Skus operation response. + ResourceSKUListResult +} + +// UsagesClientListResponse contains the response from method UsagesClient.NewListPager. +type UsagesClientListResponse struct { + // The response to a list usage request. + UsageListResult +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/time_rfc3339.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/time_rfc3339.go new file mode 100644 index 00000000..8e31b6f3 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/time_rfc3339.go @@ -0,0 +1,86 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armcognitiveservices + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" + "regexp" + "strings" + "time" +) + +// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. +var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`) + +const ( + utcDateTimeJSON = `"2006-01-02T15:04:05.999999999"` + utcDateTime = "2006-01-02T15:04:05.999999999" + dateTimeJSON = `"` + time.RFC3339Nano + `"` +) + +type dateTimeRFC3339 time.Time + +func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) { + tt := time.Time(t) + return tt.MarshalJSON() +} + +func (t dateTimeRFC3339) MarshalText() ([]byte, error) { + tt := time.Time(t) + return tt.MarshalText() +} + +func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { + layout := utcDateTimeJSON + if tzOffsetRegex.Match(data) { + layout = dateTimeJSON + } + return t.Parse(layout, string(data)) +} + +func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { + layout := utcDateTime + if tzOffsetRegex.Match(data) { + layout = time.RFC3339Nano + } + return t.Parse(layout, string(data)) +} + +func (t *dateTimeRFC3339) Parse(layout, value string) error { + p, err := time.Parse(layout, strings.ToUpper(value)) + *t = dateTimeRFC3339(p) + return err +} + +func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { + if t == nil { + return + } else if azcore.IsNullValue(t) { + m[k] = nil + return + } else if reflect.ValueOf(t).IsNil() { + return + } + m[k] = (*dateTimeRFC3339)(t) +} + +func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { + if data == nil || strings.EqualFold(string(data), "null") { + return nil + } + var aux dateTimeRFC3339 + if err := json.Unmarshal(data, &aux); err != nil { + return fmt.Errorf("struct field %s: %v", fn, err) + } + *t = (*time.Time)(&aux) + return nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/usages_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/usages_client.go new file mode 100644 index 00000000..429bc67d --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices/usages_client.go @@ -0,0 +1,106 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armcognitiveservices + +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" +) + +// UsagesClient contains the methods for the Usages group. +// Don't use this type directly, use NewUsagesClient() instead. +type UsagesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewUsagesClient creates a new instance of UsagesClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewUsagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*UsagesClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &UsagesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// NewListPager - Get usages for the requested subscription +// +// Generated from API version 2023-05-01 +// - location - Resource location. +// - options - UsagesClientListOptions contains the optional parameters for the UsagesClient.NewListPager method. +func (client *UsagesClient) NewListPager(location string, options *UsagesClientListOptions) *runtime.Pager[UsagesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[UsagesClientListResponse]{ + More: func(page UsagesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *UsagesClientListResponse) (UsagesClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "UsagesClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, location, options) + }, nil) + if err != nil { + return UsagesClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *UsagesClient) listCreateRequest(ctx context.Context, location string, options *UsagesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/usages" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + 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-05-01") + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *UsagesClient) listHandleResponse(resp *http.Response) (UsagesClientListResponse, error) { + result := UsagesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.UsageListResult); err != nil { + return UsagesClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/magodo/aztft/internal/client/client.go b/vendor/github.com/magodo/aztft/internal/client/client.go index 24a2554a..55e6aee9 100644 --- a/vendor/github.com/magodo/aztft/internal/client/client.go +++ b/vendor/github.com/magodo/aztft/internal/client/client.go @@ -12,6 +12,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automation/armautomation" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/costmanagement/armcostmanagement/v2" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datafactory/armdatafactory/v7" @@ -683,3 +684,7 @@ func (b *ClientBuilder) NewContainerAppEnvironmentsClient(subscriptionId string) &b.ClientOpt, ) } + +func (b *ClientBuilder) NewCognitiveServiceAccountsClient(subscriptionId string) (*armcognitiveservices.AccountsClient, error) { + return armcognitiveservices.NewAccountsClient(subscriptionId, b.Cred, &b.ClientOpt) +} diff --git a/vendor/github.com/magodo/aztft/internal/populate/populate.go b/vendor/github.com/magodo/aztft/internal/populate/populate.go index eab68c33..127437e6 100644 --- a/vendor/github.com/magodo/aztft/internal/populate/populate.go +++ b/vendor/github.com/magodo/aztft/internal/populate/populate.go @@ -16,8 +16,6 @@ var populaters = map[string]populateFunc{ "azurerm_network_interface": populateNetworkInterface, "azurerm_virtual_desktop_workspace": populateVirtualDesktopWorkspace, "azurerm_nat_gateway": populateNatGateway, - "azurerm_disk_pool": populateDiskPool, - "azurerm_disk_pool_iscsi_target": populateDiskPoolIscsiTarget, "azurerm_subnet": populateSubnet, "azurerm_logic_app_workflow": populateLogicAppWorkflow, "azurerm_iothub": populateIotHub, diff --git a/vendor/github.com/magodo/aztft/internal/populate/populate_disk_pool.go b/vendor/github.com/magodo/aztft/internal/populate/populate_disk_pool.go deleted file mode 100644 index 1bbba32d..00000000 --- a/vendor/github.com/magodo/aztft/internal/populate/populate_disk_pool.go +++ /dev/null @@ -1,61 +0,0 @@ -package populate - -import ( - "context" - "encoding/base64" - "fmt" - - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storagepool/armstoragepool" - "github.com/magodo/armid" - "github.com/magodo/aztft/internal/client" -) - -func populateDiskPool(b *client.ClientBuilder, id armid.ResourceId) ([]armid.ResourceId, error) { - resourceGroupId := id.RootScope().(*armid.ResourceGroup) - client, err := b.NewStoragePoolDiskPoolsClient(resourceGroupId.SubscriptionId) - if err != nil { - return nil, err - } - resp, err := client.Get(context.Background(), resourceGroupId.Name, id.Names()[0], nil) - if err != nil { - return nil, fmt.Errorf("retrieving %q: %v", id, err) - } - props := resp.DiskPool.Properties - if props == nil { - return nil, nil - } - - managedDiskAssociation, err := diskPoolPopulateManagedDiskAssociation(id, props) - if err != nil { - return nil, fmt.Errorf("populating for managed disk associations: %v", err) - } - - var result []armid.ResourceId - result = append(result, managedDiskAssociation...) - - return result, nil -} - -func diskPoolPopulateManagedDiskAssociation(id armid.ResourceId, props *armstoragepool.DiskPoolProperties) ([]armid.ResourceId, error) { - var result []armid.ResourceId - - for _, disk := range props.Disks { - if disk == nil { - continue - } - if disk.ID == nil { - continue - } - diskId, err := armid.ParseResourceId(*disk.ID) - if err != nil { - return nil, fmt.Errorf("parsing resource id %q: %v", *disk.ID, err) - } - azureId := id.Clone().(*armid.ScopedResourceId) - azureId.AttrTypes = append(azureId.AttrTypes, "disks") - azureId.AttrNames = append(azureId.AttrNames, base64.StdEncoding.EncodeToString([]byte(diskId.String()))) - - result = append(result, azureId) - } - - return result, nil -} diff --git a/vendor/github.com/magodo/aztft/internal/populate/populate_disk_pool_iscsi_target.go b/vendor/github.com/magodo/aztft/internal/populate/populate_disk_pool_iscsi_target.go deleted file mode 100644 index 75922c58..00000000 --- a/vendor/github.com/magodo/aztft/internal/populate/populate_disk_pool_iscsi_target.go +++ /dev/null @@ -1,48 +0,0 @@ -package populate - -import ( - "context" - "encoding/base64" - "fmt" - - "github.com/magodo/armid" - "github.com/magodo/aztft/internal/client" -) - -func populateDiskPoolIscsiTarget(b *client.ClientBuilder, id armid.ResourceId) ([]armid.ResourceId, error) { - resourceGroupId := id.RootScope().(*armid.ResourceGroup) - client, err := b.NewStoragePoolIscsiTargetsClient(resourceGroupId.SubscriptionId) - if err != nil { - return nil, err - } - resp, err := client.Get(context.Background(), resourceGroupId.Name, id.Names()[0], id.Names()[1], nil) - if err != nil { - return nil, fmt.Errorf("retrieving %q: %v", id, err) - } - props := resp.IscsiTarget.Properties - if props == nil { - return nil, nil - } - - var result []armid.ResourceId - - for _, lun := range props.Luns { - if lun == nil { - continue - } - if lun.ManagedDiskAzureResourceID == nil { - continue - } - diskId, err := armid.ParseResourceId(*lun.ManagedDiskAzureResourceID) - if err != nil { - return nil, fmt.Errorf("parsing resource id %q: %v", *lun.ManagedDiskAzureResourceID, err) - } - azureId := id.Clone().(*armid.ScopedResourceId) - azureId.AttrTypes = append(azureId.AttrTypes, "disks") - azureId.AttrNames = append(azureId.AttrNames, base64.StdEncoding.EncodeToString([]byte(diskId.String()))) - - result = append(result, azureId) - } - - return result, nil -} diff --git a/vendor/github.com/magodo/aztft/internal/resmap/map.json b/vendor/github.com/magodo/aztft/internal/resmap/map.json index 2c7bd8d7..f3724530 100644 --- a/vendor/github.com/magodo/aztft/internal/resmap/map.json +++ b/vendor/github.com/magodo/aztft/internal/resmap/map.json @@ -73,6 +73,35 @@ ] } }, + "azurerm_advisor_suppression": { + "management_plane": { + "scopes": [ + "/subscriptions" + ], + "provider": "Microsoft.Advisor", + "types": [ + "recommendations", + "suppressions" + ], + "import_specs": [ + "/subscriptions/Microsoft.Advisor/recommendations/suppressions" + ] + } + }, + "azurerm_ai_services": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "Microsoft.CognitiveServices", + "types": [ + "accounts" + ], + "import_specs": [ + "/subscriptions/resourceGroups/Microsoft.CognitiveServices/accounts" + ] + } + }, "azurerm_analysis_services_server": { "management_plane": { "scopes": [ @@ -945,20 +974,6 @@ ] } }, - "azurerm_app_service_environment": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Web", - "types": [ - "hostingEnvironments" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Web/hostingEnvironments" - ] - } - }, "azurerm_app_service_environment_v3": { "management_plane": { "scopes": [ @@ -1362,6 +1377,34 @@ ] } }, + "azurerm_arc_machine": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "Microsoft.HybridCompute", + "types": [ + "machines" + ], + "import_specs": [ + "/subscriptions/resourceGroups/Microsoft.HybridCompute/machines" + ] + } + }, + "azurerm_arc_machine_automanage_configuration_assignment": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups/Microsoft.HybridCompute/machines" + ], + "provider": "Microsoft.AutoManage", + "types": [ + "configurationProfileAssignments" + ], + "import_specs": [ + "/subscriptions/resourceGroups/Microsoft.HybridCompute/machines/Microsoft.AutoManage/configurationProfileAssignments" + ] + } + }, "azurerm_arc_machine_extension": { "management_plane": { "scopes": [ @@ -2453,23 +2496,6 @@ ] } }, - "azurerm_cdn_frontdoor_route_disable_link_to_default_domain": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Cdn", - "types": [ - "profiles", - "afdEndpoints", - "routes", - "disableLinkToDefaultDomain" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Cdn/profiles/afdEndpoints/routes/disableLinkToDefaultDomain" - ] - } - }, "azurerm_cdn_frontdoor_rule": { "management_plane": { "scopes": [ @@ -3129,21 +3155,6 @@ ] } }, - "azurerm_cosmosdb_notebook_workspace": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.DocumentDB", - "types": [ - "databaseAccounts", - "notebookWorkspaces" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.DocumentDB/databaseAccounts/notebookWorkspaces" - ] - } - }, "azurerm_cosmosdb_postgresql_cluster": { "management_plane": { "scopes": [ @@ -3416,22 +3427,6 @@ ] } }, - "azurerm_dashboard": { - "is_removed": true, - "remove_reason": "This is deprecated in favor of `azurerm_portal_dashboard`", - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Portal", - "types": [ - "dashboards" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Portal/dashboards" - ] - } - }, "azurerm_dashboard_grafana": { "management_plane": { "scopes": [ @@ -3745,23 +3740,6 @@ ] } }, - "azurerm_data_factory_integration_runtime_managed": { - "is_removed": true, - "remove_reason": "This is deprecated in favor of `azurerm_data_factory_integration_runtime_azure_ssis`", - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.DataFactory", - "types": [ - "factories", - "integrationruntimes" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.DataFactory/factories/integrationruntimes" - ] - } - }, "azurerm_data_factory_integration_runtime_self_hosted": { "management_plane": { "scopes": [ @@ -4318,6 +4296,21 @@ ] } }, + "azurerm_data_protection_backup_policy_mysql_flexible_server": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "Microsoft.DataProtection", + "types": [ + "backupVaults", + "backupPolicies" + ], + "import_specs": [ + "/subscriptions/resourceGroups/Microsoft.DataProtection/backupVaults/backupPolicies" + ] + } + }, "azurerm_data_protection_backup_policy_postgresql": { "management_plane": { "scopes": [ @@ -4512,22 +4505,6 @@ ] } }, - "azurerm_databox_edge_order": { - "is_removed": true, - "remove_reason": "Creation of Databox Edge Order is not supported by the Azure API - as such the azurerm_databox_edge_order resource is deprecated and will be removed in v4.0 of the AzureRM Provider.", - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.DataBoxEdge", - "types": [ - "dataBoxEdgeDevices" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.DataBoxEdge/dataBoxEdgeDevices" - ] - } - }, "azurerm_databricks_access_connector": { "management_plane": { "scopes": [ @@ -4571,22 +4548,6 @@ ] } }, - "azurerm_databricks_workspace_customer_managed_key": { - "is_removed": true, - "remove_reason": "This is a property rather than a resource", - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Databricks", - "types": [ - "workspaces" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Databricks/workspaces" - ] - } - }, "azurerm_databricks_workspace_root_dbfs_customer_managed_key": { "is_removed": true, "remove_reason": "This is a property rather than a resource", @@ -4792,6 +4753,21 @@ ] } }, + "azurerm_dev_center_project_environment_type": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "Microsoft.DevCenter", + "types": [ + "projects", + "environmentTypes" + ], + "import_specs": [ + "/subscriptions/resourceGroups/Microsoft.DevCenter/projects/environmentTypes" + ] + } + }, "azurerm_dev_test_global_vm_shutdown_schedule": { "management_plane": { "scopes": [ @@ -4998,48 +4974,6 @@ ] } }, - "azurerm_disk_pool": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.StoragePool", - "types": [ - "diskPools" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.StoragePool/diskPools" - ] - } - }, - "azurerm_disk_pool_iscsi_target": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.StoragePool", - "types": [ - "diskPools", - "iscsiTargets" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.StoragePool/diskPools/iscsiTargets" - ] - } - }, - "azurerm_disk_pool_iscsi_target_lun": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.StoragePool", - "types": [ - "diskPools", - "iscsiTargets", - "disks" - ] - } - }, "azurerm_dns_a_record": { "management_plane": { "scopes": [ @@ -5055,18 +4989,6 @@ ] } }, - "azurerm_disk_pool_managed_disk_attachment": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.StoragePool", - "types": [ - "diskPools", - "disks" - ] - } - }, "azurerm_dns_aaaa_record": { "management_plane": { "scopes": [ @@ -5626,6 +5548,20 @@ ] } }, + "azurerm_extended_location_custom_location": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "Microsoft.ExtendedLocation", + "types": [ + "customLocations" + ], + "import_specs": [ + "/subscriptions/resourceGroups/Microsoft.ExtendedLocation/customLocations" + ] + } + }, "azurerm_federated_identity_credential": { "management_plane": { "scopes": [ @@ -5926,22 +5862,6 @@ ] } }, - "azurerm_graph_account": { - "is_removed": true, - "remove_reason": "This is deprecated in favor of `azurerm_graph_service_account`", - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.GraphServices", - "types": [ - "accounts" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.GraphServices/accounts" - ] - } - }, "azurerm_graph_services_account": { "management_plane": { "scopes": [ @@ -6217,20 +6137,6 @@ ] } }, - "azurerm_integration_service_environment": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Logic", - "types": [ - "integrationServiceEnvironments" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Logic/integrationServiceEnvironments" - ] - } - }, "azurerm_iot_security_device_group": { "management_plane": { "scopes": [ @@ -6256,135 +6162,47 @@ ] } }, - "azurerm_iot_time_series_insights_access_policy": { + "azurerm_iotcentral_application": { "management_plane": { "scopes": [ "/subscriptions/resourceGroups" ], - "provider": "Microsoft.TimeSeriesInsights", + "provider": "Microsoft.IoTCentral", "types": [ - "environments", - "accessPolicies" + "iotApps" ], "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.TimeSeriesInsights/environments/accessPolicies" + "/subscriptions/resourceGroups/Microsoft.IoTCentral/iotApps" ] } }, - "azurerm_iot_time_series_insights_event_source_eventhub": { + "azurerm_iotcentral_application_network_rule_set": { "management_plane": { "scopes": [ "/subscriptions/resourceGroups" ], - "provider": "Microsoft.TimeSeriesInsights", + "provider": "Microsoft.IoTCentral", "types": [ - "environments", - "eventSources" + "iotApps", + "networkRuleSets" ], "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.TimeSeriesInsights/environments/eventSources" + "/subscriptions/resourceGroups/Microsoft.IoTCentral/iotApps" ] } }, - "azurerm_iot_time_series_insights_event_source_iothub": { + "azurerm_iotcentral_organization": { "management_plane": { "scopes": [ "/subscriptions/resourceGroups" ], - "provider": "Microsoft.TimeSeriesInsights", + "provider": "Microsoft.IoTCentral", "types": [ - "environments", - "eventSources" + "iotApps", + "organizations" ], "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.TimeSeriesInsights/environments/eventSources" - ] - } - }, - "azurerm_iot_time_series_insights_gen2_environment": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.TimeSeriesInsights", - "types": [ - "environments" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.TimeSeriesInsights/environments" - ] - } - }, - "azurerm_iot_time_series_insights_reference_data_set": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.TimeSeriesInsights", - "types": [ - "environments", - "referenceDataSets" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.TimeSeriesInsights/environments/referenceDataSets" - ] - } - }, - "azurerm_iot_time_series_insights_standard_environment": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.TimeSeriesInsights", - "types": [ - "environments" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.TimeSeriesInsights/environments" - ] - } - }, - "azurerm_iotcentral_application": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.IoTCentral", - "types": [ - "iotApps" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.IoTCentral/iotApps" - ] - } - }, - "azurerm_iotcentral_application_network_rule_set": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.IoTCentral", - "types": [ - "iotApps", - "networkRuleSets" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.IoTCentral/iotApps" - ] - } - }, - "azurerm_iotcentral_organization": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.IoTCentral", - "types": [ - "iotApps", - "organizations" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.IoTCentral/iotApps/organizations" + "/subscriptions/resourceGroups/Microsoft.IoTCentral/iotApps/organizations" ] } }, @@ -7133,64 +6951,6 @@ ] } }, - "azurerm_lab_service_lab": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.LabServices", - "types": [ - "labs" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.LabServices/labs" - ] - } - }, - "azurerm_lab_service_plan": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.LabServices", - "types": [ - "labPlans" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.LabServices/labPlans" - ] - } - }, - "azurerm_lab_service_schedule": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.LabServices", - "types": [ - "labs", - "schedules" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.LabServices/labs/schedules" - ] - } - }, - "azurerm_lab_service_user": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.LabServices", - "types": [ - "labs", - "users" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.LabServices/labs/users" - ] - } - }, "azurerm_lb": { "management_plane": { "scopes": [ @@ -7884,66 +7644,6 @@ ] } }, - "azurerm_logz_monitor": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Logz", - "types": [ - "monitors" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Logz/monitors" - ] - } - }, - "azurerm_logz_sub_account": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Logz", - "types": [ - "monitors", - "accounts" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Logz/monitors/accounts" - ] - } - }, - "azurerm_logz_sub_account_tag_rule": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Logz", - "types": [ - "monitors", - "accounts", - "tagRules" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Logz/monitors/accounts/tagRules" - ] - } - }, - "azurerm_logz_tag_rule": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Logz", - "types": [ - "monitors", - "tagRules" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Logz/monitors/tagRules" - ] - } - }, "azurerm_machine_learning_compute_cluster": { "management_plane": { "scopes": [ @@ -8312,80 +8012,6 @@ ] } }, - "azurerm_mariadb_configuration": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.DBforMariaDB", - "types": [ - "servers", - "configurations" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.DBforMariaDB/servers/configurations" - ] - } - }, - "azurerm_mariadb_database": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.DBforMariaDB", - "types": [ - "servers", - "databases" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.DBforMariaDB/servers/databases" - ] - } - }, - "azurerm_mariadb_firewall_rule": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.DBforMariaDB", - "types": [ - "servers", - "firewallRules" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.DBforMariaDB/servers/firewallRules" - ] - } - }, - "azurerm_mariadb_server": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.DBforMariaDB", - "types": [ - "servers" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.DBforMariaDB/servers" - ] - } - }, - "azurerm_mariadb_virtual_network_rule": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.DBforMariaDB", - "types": [ - "servers", - "virtualNetworkRules" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.DBforMariaDB/servers/virtualNetworkRules" - ] - } - }, "azurerm_marketplace_agreement": { "management_plane": { "scopes": [ @@ -8416,188 +8042,6 @@ ] } }, - "azurerm_media_asset": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Media", - "types": [ - "mediaServices", - "assets" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Media/mediaServices/assets" - ] - } - }, - "azurerm_media_asset_filter": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Media", - "types": [ - "mediaServices", - "assets", - "assetFilters" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Media/mediaServices/assets/assetFilters" - ] - } - }, - "azurerm_media_content_key_policy": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Media", - "types": [ - "mediaServices", - "contentKeyPolicies" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Media/mediaServices/contentKeyPolicies" - ] - } - }, - "azurerm_media_job": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Media", - "types": [ - "mediaServices", - "transforms", - "jobs" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Media/mediaServices/transforms/jobs" - ] - } - }, - "azurerm_media_live_event": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Media", - "types": [ - "mediaServices", - "liveEvents" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Media/mediaServices/liveEvents" - ] - } - }, - "azurerm_media_live_event_output": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Media", - "types": [ - "mediaServices", - "liveEvents", - "liveOutputs" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Media/mediaServices/liveEvents/liveOutputs" - ] - } - }, - "azurerm_media_services_account": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Media", - "types": [ - "mediaServices" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Media/mediaServices" - ] - } - }, - "azurerm_media_services_account_filter": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Media", - "types": [ - "mediaServices", - "accountFilters" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Media/mediaServices/accountFilters" - ] - } - }, - "azurerm_media_streaming_endpoint": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Media", - "types": [ - "mediaServices", - "streamingEndpoints" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Media/mediaServices/streamingEndpoints" - ] - } - }, - "azurerm_media_streaming_locator": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Media", - "types": [ - "mediaServices", - "streamingLocators" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Media/mediaServices/streamingLocators" - ] - } - }, - "azurerm_media_streaming_policy": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Media", - "types": [ - "mediaServices", - "streamingPolicies" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Media/mediaServices/streamingPolicies" - ] - } - }, - "azurerm_media_transform": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Media", - "types": [ - "mediaServices", - "transforms" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Media/mediaServices/transforms" - ] - } - }, "azurerm_mobile_network": { "management_plane": { "scopes": [ @@ -8789,38 +8233,6 @@ ] } }, - "azurerm_monitor_action_rule_action_group": { - "is_removed": true, - "remove_reason": "This is deprecated in favor of `azurerm_monitor_alert_processing_rule_action_group`", - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.AlertsManagement", - "types": [ - "actionRules" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.AlertsManagement/actionRules" - ] - } - }, - "azurerm_monitor_action_rule_suppression": { - "is_removed": true, - "remove_reason": "This is deprecated in favor of `azurerm_monitor_alert_processing_rule_suppression`", - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.AlertsManagement", - "types": [ - "actionRules" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.AlertsManagement/actionRules" - ] - } - }, "azurerm_monitor_activity_log_alert": { "management_plane": { "scopes": [ @@ -8944,20 +8356,6 @@ ] } }, - "azurerm_monitor_log_profile": { - "management_plane": { - "scopes": [ - "/subscriptions" - ], - "provider": "Microsoft.Insights", - "types": [ - "logProfiles" - ], - "import_specs": [ - "/subscriptions/Microsoft.Insights/logProfiles" - ] - } - }, "azurerm_monitor_metric_alert": { "management_plane": { "scopes": [ @@ -9479,66 +8877,6 @@ ] } }, - "azurerm_mysql_active_directory_administrator": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.DBforMySQL", - "types": [ - "servers", - "administrators" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.DBforMySQL/servers/administrators" - ] - } - }, - "azurerm_mysql_configuration": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.DBforMySQL", - "types": [ - "servers", - "configurations" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.DBforMySQL/servers/configurations" - ] - } - }, - "azurerm_mysql_database": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.DBforMySQL", - "types": [ - "servers", - "databases" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.DBforMySQL/servers/databases" - ] - } - }, - "azurerm_mysql_firewall_rule": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.DBforMySQL", - "types": [ - "servers", - "firewallRules" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.DBforMySQL/servers/firewallRules" - ] - } - }, "azurerm_mysql_flexible_database": { "management_plane": { "scopes": [ @@ -9547,113 +8885,69 @@ "provider": "Microsoft.DBforMySQL", "types": [ "flexibleServers", - "databases" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.DBforMySQL/flexibleServers/databases" - ] - } - }, - "azurerm_mysql_flexible_server": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.DBforMySQL", - "types": [ - "flexibleServers" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.DBforMySQL/flexibleServers" - ] - } - }, - "azurerm_mysql_flexible_server_active_directory_administrator": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.DBforMySQL", - "types": [ - "flexibleServers", - "administrators" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.DBforMySQL/flexibleServers/administrators" - ] - } - }, - "azurerm_mysql_flexible_server_configuration": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.DBforMySQL", - "types": [ - "flexibleServers", - "configurations" + "databases" ], "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.DBforMySQL/flexibleServers/configurations" + "/subscriptions/resourceGroups/Microsoft.DBforMySQL/flexibleServers/databases" ] } }, - "azurerm_mysql_flexible_server_firewall_rule": { + "azurerm_mysql_flexible_server": { "management_plane": { "scopes": [ "/subscriptions/resourceGroups" ], "provider": "Microsoft.DBforMySQL", "types": [ - "flexibleServers", - "firewallRules" + "flexibleServers" ], "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.DBforMySQL/flexibleServers/firewallRules" + "/subscriptions/resourceGroups/Microsoft.DBforMySQL/flexibleServers" ] } }, - "azurerm_mysql_server": { + "azurerm_mysql_flexible_server_active_directory_administrator": { "management_plane": { "scopes": [ "/subscriptions/resourceGroups" ], "provider": "Microsoft.DBforMySQL", "types": [ - "servers" + "flexibleServers", + "administrators" ], "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.DBforMySQL/servers" + "/subscriptions/resourceGroups/Microsoft.DBforMySQL/flexibleServers/administrators" ] } }, - "azurerm_mysql_server_key": { + "azurerm_mysql_flexible_server_configuration": { "management_plane": { "scopes": [ "/subscriptions/resourceGroups" ], "provider": "Microsoft.DBforMySQL", "types": [ - "servers", - "keys" + "flexibleServers", + "configurations" ], "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.DBforMySQL/servers/keys" + "/subscriptions/resourceGroups/Microsoft.DBforMySQL/flexibleServers/configurations" ] } }, - "azurerm_mysql_virtual_network_rule": { + "azurerm_mysql_flexible_server_firewall_rule": { "management_plane": { "scopes": [ "/subscriptions/resourceGroups" ], "provider": "Microsoft.DBforMySQL", "types": [ - "servers", - "virtualNetworkRules" + "flexibleServers", + "firewallRules" ], "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.DBforMySQL/servers/virtualNetworkRules" + "/subscriptions/resourceGroups/Microsoft.DBforMySQL/flexibleServers/firewallRules" ] } }, @@ -10136,23 +9430,6 @@ ] } }, - "azurerm_network_packet_capture": { - "is_removed": true, - "remove_reason": "This is deprecated in favor of `azurerm_virtual_machine_scale_set_packet_capture` and `azurerm_virtual_machine_packet_capture`", - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Network", - "types": [ - "networkWatchers", - "packetCaptures" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Network/networkWatchers/packetCaptures" - ] - } - }, "azurerm_network_profile": { "management_plane": { "scopes": [ @@ -10766,6 +10043,21 @@ ] } }, + "azurerm_postgresql_flexible_server_virtual_endpoint": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "Microsoft.DBforPostgreSQL", + "types": [ + "flexibleServers", + "virtualEndpoints" + ], + "import_specs": [ + "/subscriptions/resourceGroups/Microsoft.DBforPostgreSQL/flexibleServers/virtualEndpoints" + ] + } + }, "azurerm_postgresql_server": { "management_plane": { "scopes": [ @@ -11760,24 +11052,6 @@ ] } }, - "azurerm_security_center_server_vulnerability_assessment": { - "is_removed": true, - "remove_reason": "This is deprecated in favor of `azurerm_security_center_server_vulnerability_assessment_virtual_machine`", - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups/Microsoft.Compute/virtualMachines", - "/subscriptions/resourceGroups/Microsoft.HybridCompute/machines" - ], - "provider": "Microsoft.Security", - "types": [ - "serverVulnerabilityAssessments" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Compute/virtualMachines/Microsoft.Security/serverVulnerabilityAssessments", - "/subscriptions/resourceGroups/Microsoft.HybridCompute/machines/Microsoft.Security/serverVulnerabilityAssessments" - ] - } - }, "azurerm_security_center_server_vulnerability_assessment_virtual_machine": { "management_plane": { "scopes": [ @@ -12398,21 +11672,6 @@ ] } }, - "azurerm_servicebus_namespace_network_rule_set": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.ServiceBus", - "types": [ - "namespaces", - "networkRuleSets" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.ServiceBus/namespaces" - ] - } - }, "azurerm_servicebus_queue": { "management_plane": { "scopes": [ @@ -13359,228 +12618,88 @@ ] } }, - "azurerm_sql_active_directory_administrator": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Sql", - "types": [ - "servers", - "administrators" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Sql/servers/administrators" - ] - } - }, - "azurerm_sql_database": { - "is_removed": true, - "remove_reason": "This is deprecated in favor of `azurerm_mssql_database`", - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Sql", - "types": [ - "servers", - "databases" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Sql/servers/databases" - ] - } - }, - "azurerm_sql_elasticpool": { - "is_removed": true, - "remove_reason": "This is deprecated in favor of `azurerm_mssql_elasticpool`", - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Sql", - "types": [ - "servers", - "elasticPools" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Sql/servers/elasticPools" - ] - } - }, - "azurerm_sql_failover_group": { - "is_removed": true, - "remove_reason": "This is deprecated in favor of `azurerm_mssql_failover_group`", - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Sql", - "types": [ - "servers", - "failoverGroups" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Sql/servers/failoverGroups" - ] - } - }, - "azurerm_sql_firewall_rule": { - "is_removed": true, - "remove_reason": "This is deprecated in favor of `azurerm_mssql_firewall_rule`", - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Sql", - "types": [ - "servers", - "firewallRules" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Sql/servers/firewallRules" - ] - } - }, - "azurerm_sql_managed_database": { - "is_removed": true, - "remove_reason": "This is deprecated in favor of `azurerm_mssql_managed_database`", - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Sql", - "types": [ - "managedInstances", - "databases" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Sql/managedInstances/databases" - ] - } - }, - "azurerm_sql_managed_instance": { - "is_removed": true, - "remove_reason": "This is deprecated in favor of `azurerm_mssql_managed_instance`", - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Sql", - "types": [ - "managedInstances" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Sql/managedInstances" - ] - } - }, - "azurerm_sql_managed_instance_active_directory_administrator": { - "is_removed": true, - "remove_reason": "This is deprecated in favor of `azurerm_mssql_managed_instance_active_directory_administrator`", - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Sql", - "types": [ - "managedInstances", - "administrators" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Sql/managedInstances/administrators" - ] - } - }, - "azurerm_sql_managed_instance_failover_group": { - "is_removed": true, - "remove_reason": "This is deprecated in favor of `azurerm_mssql_managed_instance_failover_group`", + "azurerm_ssh_public_key": { "management_plane": { "scopes": [ "/subscriptions/resourceGroups" ], - "provider": "Microsoft.Sql", + "provider": "Microsoft.Compute", "types": [ - "locations", - "instanceFailoverGroups" + "sshPublicKeys" ], "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Sql/locations/instanceFailoverGroups" + "/subscriptions/resourceGroups/Microsoft.Compute/sshPublicKeys" ] } }, - "azurerm_sql_server": { - "is_removed": true, - "remove_reason": "This is deprecated in favor of `azurerm_mssql_server`", + "azurerm_stack_hci_cluster": { "management_plane": { "scopes": [ "/subscriptions/resourceGroups" ], - "provider": "Microsoft.Sql", + "provider": "Microsoft.AzureStackHCI", "types": [ - "servers" + "clusters" ], "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Sql/servers" + "/subscriptions/resourceGroups/Microsoft.AzureStackHCI/clusters" ] } }, - "azurerm_sql_virtual_network_rule": { - "is_removed": true, - "remove_reason": "This is deprecated in favor of `azurerm_mssql_virtual_network_rule`", + "azurerm_stack_hci_deployment_setting": { "management_plane": { "scopes": [ "/subscriptions/resourceGroups" ], - "provider": "Microsoft.Sql", + "provider": "Microsoft.AzureStackHCI", "types": [ - "servers", - "virtualNetworkRules" + "clusters", + "deploymentSettings" ], "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Sql/servers/virtualNetworkRules" + "/subscriptions/resourceGroups/Microsoft.AzureStackHCI/clusters/deploymentSettings" ] } }, - "azurerm_ssh_public_key": { + "azurerm_stack_hci_logical_network": { "management_plane": { "scopes": [ "/subscriptions/resourceGroups" ], - "provider": "Microsoft.Compute", + "provider": "Microsoft.AzureStackHCI", "types": [ - "sshPublicKeys" + "logicalNetworks" ], "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Compute/sshPublicKeys" + "/subscriptions/resourceGroups/Microsoft.AzureStackHCI/logicalNetworks" ] } }, - "azurerm_stack_hci_cluster": { + "azurerm_stack_hci_storage_path": { "management_plane": { "scopes": [ "/subscriptions/resourceGroups" ], "provider": "Microsoft.AzureStackHCI", "types": [ - "clusters" + "storageContainers" ], "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.AzureStackHCI/clusters" + "/subscriptions/resourceGroups/Microsoft.AzureStackHCI/storageContainers" ] } }, - "azurerm_stack_hci_logical_network": { + "azurerm_stack_hci_virtual_hard_disk": { "management_plane": { "scopes": [ "/subscriptions/resourceGroups" ], "provider": "Microsoft.AzureStackHCI", "types": [ - "logicalNetworks" + "virtualHardDisks" ], "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.AzureStackHCI/logicalNetworks" + "/subscriptions/resourceGroups/Microsoft.AzureStackHCI/virtualHardDisks" ] } }, @@ -15072,35 +14191,6 @@ ] } }, - "azurerm_video_analyzer": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Media", - "types": [ - "videoAnalyzers" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Media/videoAnalyzers" - ] - } - }, - "azurerm_video_analyzer_edge_module": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Media", - "types": [ - "videoAnalyzers", - "edgeModules" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Media/videoAnalyzers/edgeModules" - ] - } - }, "azurerm_virtual_desktop_application": { "management_plane": { "scopes": [ diff --git a/vendor/github.com/magodo/aztft/internal/resmap/map_gen.json b/vendor/github.com/magodo/aztft/internal/resmap/map_gen.json index d05ed62d..c2e41711 100644 --- a/vendor/github.com/magodo/aztft/internal/resmap/map_gen.json +++ b/vendor/github.com/magodo/aztft/internal/resmap/map_gen.json @@ -72,6 +72,35 @@ ] } }, + "azurerm_advisor_suppression": { + "management_plane": { + "scopes": [ + "/subscriptions" + ], + "provider": "Microsoft.Advisor", + "types": [ + "recommendations", + "suppressions" + ], + "import_specs": [ + "/subscriptions/Microsoft.Advisor/recommendations/suppressions" + ] + } + }, + "azurerm_ai_services": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "Microsoft.CognitiveServices", + "types": [ + "accounts" + ], + "import_specs": [ + "/subscriptions/resourceGroups/Microsoft.CognitiveServices/accounts" + ] + } + }, "azurerm_analysis_services_server": { "management_plane": { "scopes": [ @@ -938,20 +967,6 @@ ] } }, - "azurerm_app_service_environment": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Web", - "types": [ - "hostingEnvironments" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Web/hostingEnvironments" - ] - } - }, "azurerm_app_service_environment_v3": { "management_plane": { "scopes": [ @@ -1345,6 +1360,34 @@ ] } }, + "azurerm_arc_machine": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "Microsoft.HybridCompute", + "types": [ + "machines" + ], + "import_specs": [ + "/subscriptions/resourceGroups/Microsoft.HybridCompute/machines" + ] + } + }, + "azurerm_arc_machine_automanage_configuration_assignment": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups/Microsoft.HybridCompute/machines" + ], + "provider": "Microsoft.AutoManage", + "types": [ + "configurationProfileAssignments" + ], + "import_specs": [ + "/subscriptions/resourceGroups/Microsoft.HybridCompute/machines/Microsoft.AutoManage/configurationProfileAssignments" + ] + } + }, "azurerm_arc_machine_extension": { "management_plane": { "scopes": [ @@ -2431,23 +2474,6 @@ ] } }, - "azurerm_cdn_frontdoor_route_disable_link_to_default_domain": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Cdn", - "types": [ - "profiles", - "afdEndpoints", - "routes", - "disableLinkToDefaultDomain" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Cdn/profiles/afdEndpoints/routes/disableLinkToDefaultDomain" - ] - } - }, "azurerm_cdn_frontdoor_rule": { "management_plane": { "scopes": [ @@ -3104,21 +3130,6 @@ ] } }, - "azurerm_cosmosdb_notebook_workspace": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.DocumentDB", - "types": [ - "databaseAccounts", - "notebookWorkspaces" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.DocumentDB/databaseAccounts/notebookWorkspaces" - ] - } - }, "azurerm_cosmosdb_postgresql_cluster": { "management_plane": { "scopes": [ @@ -3391,20 +3402,6 @@ ] } }, - "azurerm_dashboard": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Portal", - "types": [ - "dashboards" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Portal/dashboards" - ] - } - }, "azurerm_dashboard_grafana": { "management_plane": { "scopes": [ @@ -3718,21 +3715,6 @@ ] } }, - "azurerm_data_factory_integration_runtime_managed": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.DataFactory", - "types": [ - "factories", - "integrationruntimes" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.DataFactory/factories/integrationruntimes" - ] - } - }, "azurerm_data_factory_integration_runtime_self_hosted": { "management_plane": { "scopes": [ @@ -4289,6 +4271,21 @@ ] } }, + "azurerm_data_protection_backup_policy_mysql_flexible_server": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "Microsoft.DataProtection", + "types": [ + "backupVaults", + "backupPolicies" + ], + "import_specs": [ + "/subscriptions/resourceGroups/Microsoft.DataProtection/backupVaults/backupPolicies" + ] + } + }, "azurerm_data_protection_backup_policy_postgresql": { "management_plane": { "scopes": [ @@ -4483,20 +4480,6 @@ ] } }, - "azurerm_databox_edge_order": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.DataBoxEdge", - "types": [ - "dataBoxEdgeDevices" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.DataBoxEdge/dataBoxEdgeDevices" - ] - } - }, "azurerm_databricks_access_connector": { "management_plane": { "scopes": [ @@ -4540,20 +4523,6 @@ ] } }, - "azurerm_databricks_workspace_customer_managed_key": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Databricks", - "types": [ - "workspaces" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Databricks/workspaces" - ] - } - }, "azurerm_databricks_workspace_root_dbfs_customer_managed_key": { "management_plane": { "scopes": [ @@ -4757,6 +4726,21 @@ ] } }, + "azurerm_dev_center_project_environment_type": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "Microsoft.DevCenter", + "types": [ + "projects", + "environmentTypes" + ], + "import_specs": [ + "/subscriptions/resourceGroups/Microsoft.DevCenter/projects/environmentTypes" + ] + } + }, "azurerm_dev_test_global_vm_shutdown_schedule": { "management_plane": { "scopes": [ @@ -4963,35 +4947,6 @@ ] } }, - "azurerm_disk_pool": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.StoragePool", - "types": [ - "diskPools" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.StoragePool/diskPools" - ] - } - }, - "azurerm_disk_pool_iscsi_target": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.StoragePool", - "types": [ - "diskPools", - "iscsiTargets" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.StoragePool/diskPools/iscsiTargets" - ] - } - }, "azurerm_dns_a_record": { "management_plane": { "scopes": [ @@ -5567,6 +5522,20 @@ ] } }, + "azurerm_extended_location_custom_location": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "Microsoft.ExtendedLocation", + "types": [ + "customLocations" + ], + "import_specs": [ + "/subscriptions/resourceGroups/Microsoft.ExtendedLocation/customLocations" + ] + } + }, "azurerm_federated_identity_credential": { "management_plane": { "scopes": [ @@ -5861,20 +5830,6 @@ ] } }, - "azurerm_graph_account": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.GraphServices", - "types": [ - "accounts" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.GraphServices/accounts" - ] - } - }, "azurerm_graph_services_account": { "management_plane": { "scopes": [ @@ -6150,20 +6105,6 @@ ] } }, - "azurerm_integration_service_environment": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Logic", - "types": [ - "integrationServiceEnvironments" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Logic/integrationServiceEnvironments" - ] - } - }, "azurerm_iot_security_device_group": { "management_plane": { "scopes": [ @@ -6192,193 +6133,105 @@ ] } }, - "azurerm_iot_time_series_insights_access_policy": { + "azurerm_iotcentral_application": { "management_plane": { "scopes": [ "/subscriptions/resourceGroups" ], - "provider": "Microsoft.TimeSeriesInsights", + "provider": "Microsoft.IoTCentral", "types": [ - "environments", - "accessPolicies" + "iotApps" ], "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.TimeSeriesInsights/environments/accessPolicies" + "/subscriptions/resourceGroups/Microsoft.IoTCentral/iotApps" ] } }, - "azurerm_iot_time_series_insights_event_source_eventhub": { + "azurerm_iotcentral_application_network_rule_set": { "management_plane": { "scopes": [ "/subscriptions/resourceGroups" ], - "provider": "Microsoft.TimeSeriesInsights", + "provider": "Microsoft.IoTCentral", "types": [ - "environments", - "eventSources" + "iotApps" ], "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.TimeSeriesInsights/environments/eventSources" + "/subscriptions/resourceGroups/Microsoft.IoTCentral/iotApps" ] } }, - "azurerm_iot_time_series_insights_event_source_iothub": { + "azurerm_iotcentral_organization": { "management_plane": { "scopes": [ "/subscriptions/resourceGroups" ], - "provider": "Microsoft.TimeSeriesInsights", + "provider": "Microsoft.IoTCentral", "types": [ - "environments", - "eventSources" + "iotApps", + "organizations" ], "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.TimeSeriesInsights/environments/eventSources" + "/subscriptions/resourceGroups/Microsoft.IoTCentral/iotApps/organizations" ] } }, - "azurerm_iot_time_series_insights_gen2_environment": { + "azurerm_iothub": { "management_plane": { "scopes": [ "/subscriptions/resourceGroups" ], - "provider": "Microsoft.TimeSeriesInsights", + "provider": "Microsoft.Devices", "types": [ - "environments" + "iotHubs" ], "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.TimeSeriesInsights/environments" + "/subscriptions/resourceGroups/Microsoft.Devices/iotHubs" ] } }, - "azurerm_iot_time_series_insights_reference_data_set": { + "azurerm_iothub_certificate": { "management_plane": { "scopes": [ "/subscriptions/resourceGroups" ], - "provider": "Microsoft.TimeSeriesInsights", + "provider": "Microsoft.Devices", "types": [ - "environments", - "referenceDataSets" + "iotHubs", + "certificates" ], "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.TimeSeriesInsights/environments/referenceDataSets" + "/subscriptions/resourceGroups/Microsoft.Devices/iotHubs/certificates" ] } }, - "azurerm_iot_time_series_insights_standard_environment": { + "azurerm_iothub_consumer_group": { "management_plane": { "scopes": [ "/subscriptions/resourceGroups" ], - "provider": "Microsoft.TimeSeriesInsights", + "provider": "Microsoft.Devices", "types": [ - "environments" + "iotHubs", + "eventHubEndpoints", + "consumerGroups" ], "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.TimeSeriesInsights/environments" + "/subscriptions/resourceGroups/Microsoft.Devices/iotHubs/eventHubEndpoints/consumerGroups" ] } }, - "azurerm_iotcentral_application": { + "azurerm_iothub_device_update_account": { "management_plane": { "scopes": [ "/subscriptions/resourceGroups" ], - "provider": "Microsoft.IoTCentral", + "provider": "Microsoft.DeviceUpdate", "types": [ - "iotApps" + "accounts" ], "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.IoTCentral/iotApps" - ] - } - }, - "azurerm_iotcentral_application_network_rule_set": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.IoTCentral", - "types": [ - "iotApps" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.IoTCentral/iotApps" - ] - } - }, - "azurerm_iotcentral_organization": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.IoTCentral", - "types": [ - "iotApps", - "organizations" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.IoTCentral/iotApps/organizations" - ] - } - }, - "azurerm_iothub": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Devices", - "types": [ - "iotHubs" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Devices/iotHubs" - ] - } - }, - "azurerm_iothub_certificate": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Devices", - "types": [ - "iotHubs", - "certificates" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Devices/iotHubs/certificates" - ] - } - }, - "azurerm_iothub_consumer_group": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Devices", - "types": [ - "iotHubs", - "eventHubEndpoints", - "consumerGroups" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Devices/iotHubs/eventHubEndpoints/consumerGroups" - ] - } - }, - "azurerm_iothub_device_update_account": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.DeviceUpdate", - "types": [ - "accounts" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.DeviceUpdate/accounts" + "/subscriptions/resourceGroups/Microsoft.DeviceUpdate/accounts" ] } }, @@ -7064,64 +6917,6 @@ ] } }, - "azurerm_lab_service_lab": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.LabServices", - "types": [ - "labs" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.LabServices/labs" - ] - } - }, - "azurerm_lab_service_plan": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.LabServices", - "types": [ - "labPlans" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.LabServices/labPlans" - ] - } - }, - "azurerm_lab_service_schedule": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.LabServices", - "types": [ - "labs", - "schedules" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.LabServices/labs/schedules" - ] - } - }, - "azurerm_lab_service_user": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.LabServices", - "types": [ - "labs", - "users" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.LabServices/labs/users" - ] - } - }, "azurerm_lb": { "management_plane": { "scopes": [ @@ -7811,66 +7606,6 @@ ] } }, - "azurerm_logz_monitor": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Logz", - "types": [ - "monitors" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Logz/monitors" - ] - } - }, - "azurerm_logz_sub_account": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Logz", - "types": [ - "monitors", - "accounts" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Logz/monitors/accounts" - ] - } - }, - "azurerm_logz_sub_account_tag_rule": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Logz", - "types": [ - "monitors", - "accounts", - "tagRules" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Logz/monitors/accounts/tagRules" - ] - } - }, - "azurerm_logz_tag_rule": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Logz", - "types": [ - "monitors", - "tagRules" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Logz/monitors/tagRules" - ] - } - }, "azurerm_machine_learning_compute_cluster": { "management_plane": { "scopes": [ @@ -8183,6 +7918,18 @@ ] } }, + "azurerm_management_group_subscription_association": { + "management_plane": { + "provider": "Microsoft.Management", + "types": [ + "managementGroups", + "subscriptions" + ], + "import_specs": [ + "/Microsoft.Management/managementGroups/subscriptions" + ] + } + }, "azurerm_management_group_template_deployment": { "management_plane": { "scopes": [ @@ -8240,80 +7987,6 @@ ] } }, - "azurerm_mariadb_configuration": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.DBforMariaDB", - "types": [ - "servers", - "configurations" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.DBforMariaDB/servers/configurations" - ] - } - }, - "azurerm_mariadb_database": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.DBforMariaDB", - "types": [ - "servers", - "databases" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.DBforMariaDB/servers/databases" - ] - } - }, - "azurerm_mariadb_firewall_rule": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.DBforMariaDB", - "types": [ - "servers", - "firewallRules" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.DBforMariaDB/servers/firewallRules" - ] - } - }, - "azurerm_mariadb_server": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.DBforMariaDB", - "types": [ - "servers" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.DBforMariaDB/servers" - ] - } - }, - "azurerm_mariadb_virtual_network_rule": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.DBforMariaDB", - "types": [ - "servers", - "virtualNetworkRules" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.DBforMariaDB/servers/virtualNetworkRules" - ] - } - }, "azurerm_marketplace_agreement": { "management_plane": { "scopes": [ @@ -8344,188 +8017,6 @@ ] } }, - "azurerm_media_asset": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Media", - "types": [ - "mediaServices", - "assets" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Media/mediaServices/assets" - ] - } - }, - "azurerm_media_asset_filter": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Media", - "types": [ - "mediaServices", - "assets", - "assetFilters" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Media/mediaServices/assets/assetFilters" - ] - } - }, - "azurerm_media_content_key_policy": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Media", - "types": [ - "mediaServices", - "contentKeyPolicies" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Media/mediaServices/contentKeyPolicies" - ] - } - }, - "azurerm_media_job": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Media", - "types": [ - "mediaServices", - "transforms", - "jobs" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Media/mediaServices/transforms/jobs" - ] - } - }, - "azurerm_media_live_event": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Media", - "types": [ - "mediaServices", - "liveEvents" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Media/mediaServices/liveEvents" - ] - } - }, - "azurerm_media_live_event_output": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Media", - "types": [ - "mediaServices", - "liveEvents", - "liveOutputs" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Media/mediaServices/liveEvents/liveOutputs" - ] - } - }, - "azurerm_media_services_account": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Media", - "types": [ - "mediaServices" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Media/mediaServices" - ] - } - }, - "azurerm_media_services_account_filter": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Media", - "types": [ - "mediaServices", - "accountFilters" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Media/mediaServices/accountFilters" - ] - } - }, - "azurerm_media_streaming_endpoint": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Media", - "types": [ - "mediaServices", - "streamingEndpoints" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Media/mediaServices/streamingEndpoints" - ] - } - }, - "azurerm_media_streaming_locator": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Media", - "types": [ - "mediaServices", - "streamingLocators" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Media/mediaServices/streamingLocators" - ] - } - }, - "azurerm_media_streaming_policy": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Media", - "types": [ - "mediaServices", - "streamingPolicies" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Media/mediaServices/streamingPolicies" - ] - } - }, - "azurerm_media_transform": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Media", - "types": [ - "mediaServices", - "transforms" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Media/mediaServices/transforms" - ] - } - }, "azurerm_mobile_network": { "management_plane": { "scopes": [ @@ -8717,34 +8208,6 @@ ] } }, - "azurerm_monitor_action_rule_action_group": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.AlertsManagement", - "types": [ - "actionRules" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.AlertsManagement/actionRules" - ] - } - }, - "azurerm_monitor_action_rule_suppression": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.AlertsManagement", - "types": [ - "actionRules" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.AlertsManagement/actionRules" - ] - } - }, "azurerm_monitor_activity_log_alert": { "management_plane": { "scopes": [ @@ -8868,20 +8331,6 @@ ] } }, - "azurerm_monitor_log_profile": { - "management_plane": { - "scopes": [ - "/subscriptions" - ], - "provider": "Microsoft.Insights", - "types": [ - "logProfiles" - ], - "import_specs": [ - "/subscriptions/Microsoft.Insights/logProfiles" - ] - } - }, "azurerm_monitor_metric_alert": { "management_plane": { "scopes": [ @@ -9394,70 +8843,10 @@ "provider": "Microsoft.Sql", "types": [ "servers", - "virtualNetworkRules" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Sql/servers/virtualNetworkRules" - ] - } - }, - "azurerm_mysql_active_directory_administrator": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.DBforMySQL", - "types": [ - "servers", - "administrators" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.DBforMySQL/servers/administrators" - ] - } - }, - "azurerm_mysql_configuration": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.DBforMySQL", - "types": [ - "servers", - "configurations" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.DBforMySQL/servers/configurations" - ] - } - }, - "azurerm_mysql_database": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.DBforMySQL", - "types": [ - "servers", - "databases" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.DBforMySQL/servers/databases" - ] - } - }, - "azurerm_mysql_firewall_rule": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.DBforMySQL", - "types": [ - "servers", - "firewallRules" + "virtualNetworkRules" ], "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.DBforMySQL/servers/firewallRules" + "/subscriptions/resourceGroups/Microsoft.Sql/servers/virtualNetworkRules" ] } }, @@ -9535,50 +8924,6 @@ ] } }, - "azurerm_mysql_server": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.DBforMySQL", - "types": [ - "servers" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.DBforMySQL/servers" - ] - } - }, - "azurerm_mysql_server_key": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.DBforMySQL", - "types": [ - "servers", - "keys" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.DBforMySQL/servers/keys" - ] - } - }, - "azurerm_mysql_virtual_network_rule": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.DBforMySQL", - "types": [ - "servers", - "virtualNetworkRules" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.DBforMySQL/servers/virtualNetworkRules" - ] - } - }, "azurerm_nat_gateway": { "management_plane": { "scopes": [ @@ -9955,21 +9300,6 @@ ] } }, - "azurerm_network_packet_capture": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Network", - "types": [ - "networkWatchers", - "packetCaptures" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Network/networkWatchers/packetCaptures" - ] - } - }, "azurerm_network_profile": { "management_plane": { "scopes": [ @@ -10582,6 +9912,21 @@ ] } }, + "azurerm_postgresql_flexible_server_virtual_endpoint": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "Microsoft.DBforPostgreSQL", + "types": [ + "flexibleServers", + "virtualEndpoints" + ], + "import_specs": [ + "/subscriptions/resourceGroups/Microsoft.DBforPostgreSQL/flexibleServers/virtualEndpoints" + ] + } + }, "azurerm_postgresql_server": { "management_plane": { "scopes": [ @@ -11577,22 +10922,6 @@ ] } }, - "azurerm_security_center_server_vulnerability_assessment": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups/Microsoft.Compute/virtualMachines", - "/subscriptions/resourceGroups/Microsoft.HybridCompute/machines" - ], - "provider": "Microsoft.Security", - "types": [ - "serverVulnerabilityAssessments" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Compute/virtualMachines/Microsoft.Security/serverVulnerabilityAssessments", - "/subscriptions/resourceGroups/Microsoft.HybridCompute/machines/Microsoft.Security/serverVulnerabilityAssessments" - ] - } - }, "azurerm_security_center_server_vulnerability_assessment_virtual_machine": { "management_plane": { "scopes": [ @@ -12213,20 +11542,6 @@ ] } }, - "azurerm_servicebus_namespace_network_rule_set": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.ServiceBus", - "types": [ - "namespaces" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.ServiceBus/namespaces" - ] - } - }, "azurerm_servicebus_queue": { "management_plane": { "scopes": [ @@ -13169,208 +12484,88 @@ ] } }, - "azurerm_sql_active_directory_administrator": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Sql", - "types": [ - "servers", - "administrators" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Sql/servers/administrators" - ] - } - }, - "azurerm_sql_database": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Sql", - "types": [ - "servers", - "databases" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Sql/servers/databases" - ] - } - }, - "azurerm_sql_elasticpool": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Sql", - "types": [ - "servers", - "elasticPools" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Sql/servers/elasticPools" - ] - } - }, - "azurerm_sql_failover_group": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Sql", - "types": [ - "servers", - "failoverGroups" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Sql/servers/failoverGroups" - ] - } - }, - "azurerm_sql_firewall_rule": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Sql", - "types": [ - "servers", - "firewallRules" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Sql/servers/firewallRules" - ] - } - }, - "azurerm_sql_managed_database": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Sql", - "types": [ - "managedInstances", - "databases" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Sql/managedInstances/databases" - ] - } - }, - "azurerm_sql_managed_instance": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Sql", - "types": [ - "managedInstances" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Sql/managedInstances" - ] - } - }, - "azurerm_sql_managed_instance_active_directory_administrator": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Sql", - "types": [ - "managedInstances", - "administrators" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Sql/managedInstances/administrators" - ] - } - }, - "azurerm_sql_managed_instance_failover_group": { + "azurerm_ssh_public_key": { "management_plane": { "scopes": [ "/subscriptions/resourceGroups" ], - "provider": "Microsoft.Sql", + "provider": "Microsoft.Compute", "types": [ - "locations", - "instanceFailoverGroups" + "sshPublicKeys" ], "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Sql/locations/instanceFailoverGroups" + "/subscriptions/resourceGroups/Microsoft.Compute/sshPublicKeys" ] } }, - "azurerm_sql_server": { + "azurerm_stack_hci_cluster": { "management_plane": { "scopes": [ "/subscriptions/resourceGroups" ], - "provider": "Microsoft.Sql", + "provider": "Microsoft.AzureStackHCI", "types": [ - "servers" + "clusters" ], "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Sql/servers" + "/subscriptions/resourceGroups/Microsoft.AzureStackHCI/clusters" ] } }, - "azurerm_sql_virtual_network_rule": { + "azurerm_stack_hci_deployment_setting": { "management_plane": { "scopes": [ "/subscriptions/resourceGroups" ], - "provider": "Microsoft.Sql", + "provider": "Microsoft.AzureStackHCI", "types": [ - "servers", - "virtualNetworkRules" + "clusters", + "deploymentSettings" ], "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Sql/servers/virtualNetworkRules" + "/subscriptions/resourceGroups/Microsoft.AzureStackHCI/clusters/deploymentSettings" ] } }, - "azurerm_ssh_public_key": { + "azurerm_stack_hci_logical_network": { "management_plane": { "scopes": [ "/subscriptions/resourceGroups" ], - "provider": "Microsoft.Compute", + "provider": "Microsoft.AzureStackHCI", "types": [ - "sshPublicKeys" + "logicalNetworks" ], "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Compute/sshPublicKeys" + "/subscriptions/resourceGroups/Microsoft.AzureStackHCI/logicalNetworks" ] } }, - "azurerm_stack_hci_cluster": { + "azurerm_stack_hci_storage_path": { "management_plane": { "scopes": [ "/subscriptions/resourceGroups" ], "provider": "Microsoft.AzureStackHCI", "types": [ - "clusters" + "storageContainers" ], "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.AzureStackHCI/clusters" + "/subscriptions/resourceGroups/Microsoft.AzureStackHCI/storageContainers" ] } }, - "azurerm_stack_hci_logical_network": { + "azurerm_stack_hci_virtual_hard_disk": { "management_plane": { "scopes": [ "/subscriptions/resourceGroups" ], "provider": "Microsoft.AzureStackHCI", "types": [ - "logicalNetworks" + "virtualHardDisks" ], "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.AzureStackHCI/logicalNetworks" + "/subscriptions/resourceGroups/Microsoft.AzureStackHCI/virtualHardDisks" ] } }, @@ -14857,35 +14052,6 @@ ] } }, - "azurerm_video_analyzer": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Media", - "types": [ - "videoAnalyzers" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Media/videoAnalyzers" - ] - } - }, - "azurerm_video_analyzer_edge_module": { - "management_plane": { - "scopes": [ - "/subscriptions/resourceGroups" - ], - "provider": "Microsoft.Media", - "types": [ - "videoAnalyzers", - "edgeModules" - ], - "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Media/videoAnalyzers/edgeModules" - ] - } - }, "azurerm_virtual_desktop_application": { "management_plane": { "scopes": [ diff --git a/vendor/github.com/magodo/aztft/internal/resolve/resolve.go b/vendor/github.com/magodo/aztft/internal/resolve/resolve.go index 974e8dab..b5657663 100644 --- a/vendor/github.com/magodo/aztft/internal/resolve/resolve.go +++ b/vendor/github.com/magodo/aztft/internal/resolve/resolve.go @@ -76,12 +76,6 @@ var Resolvers = map[string]map[string]resolver{ "/MICROSOFT.MACHINELEARNINGSERVICES/WORKSPACES/DATASTORES": { "/SUBSCRIPTIONS/RESOURCEGROUPS": machineLearningDataStoresResolver{}, }, - "/MICROSOFT.TIMESERIESINSIGHTS/ENVIRONMENTS": { - "/SUBSCRIPTIONS/RESOURCEGROUPS": timeSeriesInsightsEnvironmentResolver{}, - }, - "/MICROSOFT.TIMESERIESINSIGHTS/ENVIRONMENTS/EVENTSOURCES": { - "/SUBSCRIPTIONS/RESOURCEGROUPS": timeSeriesInsightsEventSourcesResolver{}, - }, "/MICROSOFT.STORAGECACHE/CACHES/STORAGETARGETS": { "/SUBSCRIPTIONS/RESOURCEGROUPS": storageCacheTargetsResolver{}, }, @@ -148,9 +142,6 @@ var Resolvers = map[string]map[string]resolver{ "/MICROSOFT.WEB/SITES/HYBRIDCONNECTIONNAMESPACES/RELAYS": { "/SUBSCRIPTIONS/RESOURCEGROUPS": appServiceSiteHybridConnectionsResolver{}, }, - "/MICROSOFT.WEB/HOSTINGENVIRONMENTS": { - "/SUBSCRIPTIONS/RESOURCEGROUPS": appServiceEnvironemntsResolver{}, - }, "/MICROSOFT.ALERTSMANAGEMENT/ACTIONRULES": { "/SUBSCRIPTIONS/RESOURCEGROUPS": alertsManagementProcessingRulesResolver{}, }, @@ -211,6 +202,9 @@ var Resolvers = map[string]map[string]resolver{ "/MICROSOFT.COMPUTE/VIRTUALMACHINES/DATADISKS": { "/SUBSCRIPTIONS/RESOURCEGROUPS": virutalMachineDataDiskResolver{}, }, + "/MICROSOFT.COGNITIVESERVICES/ACCOUNTS": { + "/SUBSCRIPTIONS/RESOURCEGROUPS": cognitiveAccountsResolver{}, + }, } type ResolveError struct { diff --git a/vendor/github.com/magodo/aztft/internal/resolve/resolve_appservice_environment.go b/vendor/github.com/magodo/aztft/internal/resolve/resolve_appservice_environment.go deleted file mode 100644 index 448bbb91..00000000 --- a/vendor/github.com/magodo/aztft/internal/resolve/resolve_appservice_environment.go +++ /dev/null @@ -1,39 +0,0 @@ -package resolve - -import ( - "context" - "fmt" - - "github.com/magodo/armid" - "github.com/magodo/aztft/internal/client" -) - -type appServiceEnvironemntsResolver struct{} - -func (appServiceEnvironemntsResolver) ResourceTypes() []string { - return []string{"azurerm_app_service_environment", "azurerm_app_service_environment_v3"} -} - -func (appServiceEnvironemntsResolver) Resolve(b *client.ClientBuilder, id armid.ResourceId) (string, error) { - resourceGroupId := id.RootScope().(*armid.ResourceGroup) - client, err := b.NewAppServiceEnvironmentsClient(resourceGroupId.SubscriptionId) - if err != nil { - return "", err - } - resp, err := client.Get(context.Background(), resourceGroupId.Name, id.Names()[0], nil) - if err != nil { - return "", fmt.Errorf("retrieving %q: %v", id, err) - } - kind := resp.EnvironmentResource.Kind - if kind == nil { - return "", fmt.Errorf("unexpected nil kind in response") - } - switch *kind { - case "ASEV2": - return "azurerm_app_service_environment", nil - case "ASEV3": - return "azurerm_app_service_environment_v3", nil - default: - return "", fmt.Errorf("unknown kind: %s", *kind) - } -} diff --git a/vendor/github.com/magodo/aztft/internal/resolve/resolve_cognitive_accounts.go b/vendor/github.com/magodo/aztft/internal/resolve/resolve_cognitive_accounts.go new file mode 100644 index 00000000..bdf97ffa --- /dev/null +++ b/vendor/github.com/magodo/aztft/internal/resolve/resolve_cognitive_accounts.go @@ -0,0 +1,37 @@ +package resolve + +import ( + "context" + "fmt" + "strings" + + "github.com/magodo/armid" + "github.com/magodo/aztft/internal/client" +) + +type cognitiveAccountsResolver struct{} + +func (cognitiveAccountsResolver) ResourceTypes() []string { + return []string{"azurerm_cognitive_account", "azurerm_ai_services"} +} + +func (cognitiveAccountsResolver) Resolve(b *client.ClientBuilder, id armid.ResourceId) (string, error) { + resourceGroupId := id.RootScope().(*armid.ResourceGroup) + client, err := b.NewCognitiveServiceAccountsClient(resourceGroupId.SubscriptionId) + if err != nil { + return "", err + } + resp, err := client.Get(context.Background(), resourceGroupId.Name, id.Names()[0], nil) + if err != nil { + return "", fmt.Errorf("retrieving %q: %v", id, err) + } + kind := resp.Account.Kind + if kind == nil { + return "", fmt.Errorf("unexpected nil kind in response") + } + + if strings.EqualFold(*kind, "AIServices") { + return "azurerm_ai_services", nil + } + return "azurerm_cognitive_account", nil +} diff --git a/vendor/github.com/magodo/aztft/internal/resolve/resolve_data_protection_backup_policies.go b/vendor/github.com/magodo/aztft/internal/resolve/resolve_data_protection_backup_policies.go index 8989630c..db13540f 100644 --- a/vendor/github.com/magodo/aztft/internal/resolve/resolve_data_protection_backup_policies.go +++ b/vendor/github.com/magodo/aztft/internal/resolve/resolve_data_protection_backup_policies.go @@ -19,6 +19,7 @@ func (dataProtectionBackupPoliciesResolver) ResourceTypes() []string { "azurerm_data_protection_backup_policy_blob_storage", "azurerm_data_protection_backup_policy_kubernetes_cluster", "azurerm_data_protection_backup_policy_postgresql_flexible_server", + "azurerm_data_protection_backup_policy_mysql_flexible_server", } } @@ -58,6 +59,8 @@ func (dataProtectionBackupPoliciesResolver) Resolve(b *client.ClientBuilder, id return "azurerm_data_protection_backup_policy_kubernetes_cluster", nil case "MICROSOFT.DBFORPOSTGRESQL/FLEXIBLESERVERS": return "azurerm_data_protection_backup_policy_postgresql_flexible_server", nil + case "MICROSOFT.DBFORMYSQL/FLEXIBLESERVERS": + return "azurerm_data_protection_backup_policy_mysql_flexible_server", nil default: return "", fmt.Errorf("unknown data source type: %s", *pdt) } diff --git a/vendor/github.com/magodo/aztft/internal/resolve/resolve_time_series_insights_environment.go b/vendor/github.com/magodo/aztft/internal/resolve/resolve_time_series_insights_environment.go deleted file mode 100644 index 91b25ac6..00000000 --- a/vendor/github.com/magodo/aztft/internal/resolve/resolve_time_series_insights_environment.go +++ /dev/null @@ -1,40 +0,0 @@ -package resolve - -import ( - "context" - "fmt" - - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/timeseriesinsights/armtimeseriesinsights" - "github.com/magodo/armid" - "github.com/magodo/aztft/internal/client" -) - -type timeSeriesInsightsEnvironmentResolver struct{} - -func (timeSeriesInsightsEnvironmentResolver) ResourceTypes() []string { - return []string{"azurerm_iot_time_series_insights_standard_environment", "azurerm_iot_time_series_insights_gen2_environment"} -} - -func (timeSeriesInsightsEnvironmentResolver) Resolve(b *client.ClientBuilder, id armid.ResourceId) (string, error) { - resourceGroupId := id.RootScope().(*armid.ResourceGroup) - client, err := b.NewTimeSeriesInsightEnvironmentsClient(resourceGroupId.SubscriptionId) - if err != nil { - return "", err - } - resp, err := client.Get(context.Background(), resourceGroupId.Name, id.Names()[0], nil) - if err != nil { - return "", fmt.Errorf("retrieving %q: %v", id, err) - } - model := resp.EnvironmentResourceClassification - if model == nil { - return "", fmt.Errorf("unexpected nil property in response") - } - switch model.(type) { - case *armtimeseriesinsights.Gen1EnvironmentResource: - return "azurerm_iot_time_series_insights_standard_environment", nil - case *armtimeseriesinsights.Gen2EnvironmentResource: - return "azurerm_iot_time_series_insights_gen2_environment", nil - default: - return "", fmt.Errorf("unknown environment type %T", model) - } -} diff --git a/vendor/github.com/magodo/aztft/internal/resolve/resolve_time_series_insights_event_source.go b/vendor/github.com/magodo/aztft/internal/resolve/resolve_time_series_insights_event_source.go deleted file mode 100644 index 1d16e083..00000000 --- a/vendor/github.com/magodo/aztft/internal/resolve/resolve_time_series_insights_event_source.go +++ /dev/null @@ -1,40 +0,0 @@ -package resolve - -import ( - "context" - "fmt" - - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/timeseriesinsights/armtimeseriesinsights" - "github.com/magodo/armid" - "github.com/magodo/aztft/internal/client" -) - -type timeSeriesInsightsEventSourcesResolver struct{} - -func (timeSeriesInsightsEventSourcesResolver) ResourceTypes() []string { - return []string{"azurerm_iot_time_series_insights_event_source_iothub", "azurerm_iot_time_series_insights_event_source_eventhub"} -} - -func (timeSeriesInsightsEventSourcesResolver) Resolve(b *client.ClientBuilder, id armid.ResourceId) (string, error) { - resourceGroupId := id.RootScope().(*armid.ResourceGroup) - client, err := b.NewTimeSeriesInsightEventSourcesClient(resourceGroupId.SubscriptionId) - if err != nil { - return "", err - } - resp, err := client.Get(context.Background(), resourceGroupId.Name, id.Names()[0], id.Names()[1], nil) - if err != nil { - return "", fmt.Errorf("retrieving %q: %v", id, err) - } - model := resp.EventSourceResourceClassification - if model == nil { - return "", fmt.Errorf("unexpected nil property in response") - } - switch model.(type) { - case *armtimeseriesinsights.IoTHubEventSourceResource: - return "azurerm_iot_time_series_insights_event_source_iothub", nil - case *armtimeseriesinsights.EventHubEventSourceResource: - return "azurerm_iot_time_series_insights_event_source_eventhub", nil - default: - return "", fmt.Errorf("unknown environment type %T", model) - } -} diff --git a/vendor/github.com/magodo/aztft/internal/tfid/tfid.go b/vendor/github.com/magodo/aztft/internal/tfid/tfid.go index 9ee6bdcc..1acc1319 100644 --- a/vendor/github.com/magodo/aztft/internal/tfid/tfid.go +++ b/vendor/github.com/magodo/aztft/internal/tfid/tfid.go @@ -109,12 +109,6 @@ func StaticBuild(id armid.ResourceId, rt string) (string, error) { return "", fmt.Errorf("normalizing id %q for %q with import spec %q: %v", pid.String(), rt, importSpec, err) } return pid.String(), nil - case "azurerm_servicebus_namespace_network_rule_set": - pid := id.Parent() - if err := pid.Normalize(importSpec); err != nil { - return "", fmt.Errorf("normalizing id %q for %q with import spec %q: %v", pid.String(), rt, importSpec, err) - } - return pid.String(), nil case "azurerm_iotcentral_application_network_rule_set": pid := id.Parent() if err := pid.Normalize(importSpec); err != nil { @@ -136,10 +130,6 @@ func StaticBuild(id armid.ResourceId, rt string) (string, error) { } return managerId.String() + "/commit|" + id.Names()[1] + "|" + id.Names()[2], nil // Porperty-like resources - case "azurerm_disk_pool_iscsi_target_lun": - return buildIdForPropertyLikeResource(id.Parent(), lastItem(id.Names()), "azurerm_disk_pool_iscsi_target", "azurerm_managed_disk", "/lun|") - case "azurerm_disk_pool_managed_disk_attachment": - return buildIdForPropertyLikeResource(id.Parent(), lastItem(id.Names()), "azurerm_disk_pool", "azurerm_managed_disk", "/managedDisk|") case "azurerm_nat_gateway_public_ip_association": return buildIdForPropertyLikeResource(id.Parent(), lastItem(id.Names()), "azurerm_nat_gateway", "azurerm_public_ip", "|") case "azurerm_nat_gateway_public_ip_prefix_association": diff --git a/vendor/modules.txt b/vendor/modules.txt index cb82331e..7aa13b9f 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -60,6 +60,9 @@ github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/botservice/armbotservice # github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn v1.1.1 ## explicit; go 1.18 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn +# github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices v1.6.0 +## explicit; go 1.18 +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices # github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5 v5.7.0 ## explicit; go 1.18 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5 @@ -281,7 +284,7 @@ github.com/huandu/xstrings # github.com/magodo/armid v0.0.0-20230511151020-27880e5961c3 ## explicit; go 1.18 github.com/magodo/armid -# github.com/magodo/aztft v0.3.1-0.20240802001407-2834614c6d9c +# github.com/magodo/aztft v0.3.1-0.20241011060757-310738ca90dd ## explicit; go 1.19 github.com/magodo/aztft/aztft github.com/magodo/aztft/internal/client