diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/CHANGELOG.md b/sdk/resourcemanager/machinelearning/armmachinelearning/CHANGELOG.md new file mode 100644 index 000000000000..6cbc90133bb1 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 0.1.0 (2022-05-30) + +- Init release. \ No newline at end of file diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/LICENSE.txt b/sdk/resourcemanager/machinelearning/armmachinelearning/LICENSE.txt new file mode 100644 index 000000000000..dc0c2ffb3dc1 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/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/sdk/resourcemanager/machinelearning/armmachinelearning/README.md b/sdk/resourcemanager/machinelearning/armmachinelearning/README.md new file mode 100644 index 000000000000..9b20042abe37 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/README.md @@ -0,0 +1,77 @@ +# Azure Machinelearning Module for Go + +[![PkgGoDev](https://pkg.go.dev/badge/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning)](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning) + +The `armmachinelearning` module provides operations for working with Azure Machinelearning. + +[Source code](https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/resourcemanager/machinelearning/armmachinelearning) + +# Getting started + +## Prerequisites + +- an [Azure subscription](https://azure.microsoft.com/free/) +- Go 1.18 or above + +## Install the package + +This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for versioning and dependency management. + +Install the Azure Machinelearning module: + +```sh +go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning +``` + +## Authorization + +When creating a client, you will need to provide a credential for authenticating with Azure Machinelearning. 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). + +## Clients + +Azure Machinelearning modules consist of one or more clients. A client groups a set of related APIs, providing access to its functionality within the specified subscription. Create one or more clients to access the APIs you require using your credential. + +```go +client, err := armmachinelearning.NewWorkspacesClient(, 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 := arm.ClientOptions{ + ClientOptions: azcore.ClientOptions { + Cloud: cloud.AzureChina, + }, +} +client, err := armmachinelearning.NewWorkspacesClient(, cred, &options) +``` + +## 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 `Machinelearning` 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/sdk/resourcemanager/machinelearning/armmachinelearning/autorest.md b/sdk/resourcemanager/machinelearning/armmachinelearning/autorest.md new file mode 100644 index 000000000000..abedcbaedc4b --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/autorest.md @@ -0,0 +1,13 @@ +### AutoRest Configuration + +> see https://aka.ms/autorest + +``` yaml +azure-arm: true +require: +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/machinelearningservices/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/machinelearningservices/resource-manager/readme.go.md +license-header: MICROSOFT_MIT_NO_VERSION +module-version: 0.1.0 + +``` \ No newline at end of file diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/build.go b/sdk/resourcemanager/machinelearning/armmachinelearning/build.go new file mode 100644 index 000000000000..5cf615b68d08 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/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.exe ../../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate resourcemanager/machinelearning/armmachinelearning + +package armmachinelearning diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/ci.yml b/sdk/resourcemanager/machinelearning/armmachinelearning/ci.yml new file mode 100644 index 000000000000..4117e0aff9b0 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/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/machinelearning/armmachinelearning/ + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourcemanager/machinelearning/armmachinelearning/ + +stages: +- template: /eng/pipelines/templates/jobs/archetype-sdk-client.yml + parameters: + IncludeRelease: true + ServiceDirectory: 'resourcemanager/machinelearning/armmachinelearning' diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/go.mod b/sdk/resourcemanager/machinelearning/armmachinelearning/go.mod new file mode 100644 index 000000000000..2bc914b0257f --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/go.mod @@ -0,0 +1,11 @@ +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning + +go 1.18 + +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 + +require ( + github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect + golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect + golang.org/x/text v0.3.7 // indirect +) diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/go.sum b/sdk/resourcemanager/machinelearning/armmachinelearning/go.sum new file mode 100644 index 000000000000..3f874a3bc5a6 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/go.sum @@ -0,0 +1,12 @@ +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 h1:sVPhtT2qjO86rTUaWMr4WoES4TkjGnzcioXcnHV9s5k= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= +golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_batchdeployments_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_batchdeployments_client.go new file mode 100644 index 000000000000..0c730a3dac34 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_batchdeployments_client.go @@ -0,0 +1,426 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// BatchDeploymentsClient contains the methods for the BatchDeployments group. +// Don't use this type directly, use NewBatchDeploymentsClient() instead. +type BatchDeploymentsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewBatchDeploymentsClient creates a new instance of BatchDeploymentsClient 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 NewBatchDeploymentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BatchDeploymentsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &BatchDeploymentsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates/updates a batch inference deployment (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// endpointName - Inference endpoint name +// deploymentName - The identifier for the Batch inference deployment. +// body - Batch inference deployment definition object. +// options - BatchDeploymentsClientBeginCreateOrUpdateOptions contains the optional parameters for the BatchDeploymentsClient.BeginCreateOrUpdate +// method. +func (client *BatchDeploymentsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, deploymentName string, body BatchDeployment, options *BatchDeploymentsClientBeginCreateOrUpdateOptions) (*runtime.Poller[BatchDeploymentsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, workspaceName, endpointName, deploymentName, body, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[BatchDeploymentsClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[BatchDeploymentsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateOrUpdate - Creates/updates a batch inference deployment (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +func (client *BatchDeploymentsClient) createOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, deploymentName string, body BatchDeployment, options *BatchDeploymentsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, deploymentName, body, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *BatchDeploymentsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, deploymentName string, body BatchDeployment, options *BatchDeploymentsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if endpointName == "" { + return nil, errors.New("parameter endpointName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{endpointName}", url.PathEscape(endpointName)) + 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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, body) +} + +// BeginDelete - Delete Batch Inference deployment (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// endpointName - Endpoint name +// deploymentName - Inference deployment identifier. +// options - BatchDeploymentsClientBeginDeleteOptions contains the optional parameters for the BatchDeploymentsClient.BeginDelete +// method. +func (client *BatchDeploymentsClient) BeginDelete(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, deploymentName string, options *BatchDeploymentsClientBeginDeleteOptions) (*runtime.Poller[BatchDeploymentsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, workspaceName, endpointName, deploymentName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[BatchDeploymentsClientDeleteResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[BatchDeploymentsClientDeleteResponse](options.ResumeToken, client.pl, nil) + } +} + +// Delete - Delete Batch Inference deployment (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +func (client *BatchDeploymentsClient) deleteOperation(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, deploymentName string, options *BatchDeploymentsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, deploymentName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *BatchDeploymentsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, deploymentName string, options *BatchDeploymentsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if endpointName == "" { + return nil, errors.New("parameter endpointName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{endpointName}", url.PathEscape(endpointName)) + 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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets a batch inference deployment by id. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// endpointName - Endpoint name +// deploymentName - The identifier for the Batch deployments. +// options - BatchDeploymentsClientGetOptions contains the optional parameters for the BatchDeploymentsClient.Get method. +func (client *BatchDeploymentsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, deploymentName string, options *BatchDeploymentsClientGetOptions) (BatchDeploymentsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, deploymentName, options) + if err != nil { + return BatchDeploymentsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return BatchDeploymentsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return BatchDeploymentsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *BatchDeploymentsClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, deploymentName string, options *BatchDeploymentsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if endpointName == "" { + return nil, errors.New("parameter endpointName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{endpointName}", url.PathEscape(endpointName)) + 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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-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 *BatchDeploymentsClient) getHandleResponse(resp *http.Response) (BatchDeploymentsClientGetResponse, error) { + result := BatchDeploymentsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.BatchDeployment); err != nil { + return BatchDeploymentsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Lists Batch inference deployments in the workspace. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// endpointName - Endpoint name +// options - BatchDeploymentsClientListOptions contains the optional parameters for the BatchDeploymentsClient.List method. +func (client *BatchDeploymentsClient) NewListPager(resourceGroupName string, workspaceName string, endpointName string, options *BatchDeploymentsClientListOptions) *runtime.Pager[BatchDeploymentsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[BatchDeploymentsClientListResponse]{ + More: func(page BatchDeploymentsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *BatchDeploymentsClientListResponse) (BatchDeploymentsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return BatchDeploymentsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return BatchDeploymentsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return BatchDeploymentsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *BatchDeploymentsClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, options *BatchDeploymentsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if endpointName == "" { + return nil, errors.New("parameter endpointName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{endpointName}", url.PathEscape(endpointName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + if options != nil && options.OrderBy != nil { + reqQP.Set("$orderBy", *options.OrderBy) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *BatchDeploymentsClient) listHandleResponse(resp *http.Response) (BatchDeploymentsClientListResponse, error) { + result := BatchDeploymentsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.BatchDeploymentTrackedResourceArmPaginatedResult); err != nil { + return BatchDeploymentsClientListResponse{}, err + } + return result, nil +} + +// BeginUpdate - Update a batch inference deployment (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// endpointName - Inference endpoint name +// deploymentName - The identifier for the Batch inference deployment. +// body - Batch inference deployment definition object. +// options - BatchDeploymentsClientBeginUpdateOptions contains the optional parameters for the BatchDeploymentsClient.BeginUpdate +// method. +func (client *BatchDeploymentsClient) BeginUpdate(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, deploymentName string, body PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, options *BatchDeploymentsClientBeginUpdateOptions) (*runtime.Poller[BatchDeploymentsClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, workspaceName, endpointName, deploymentName, body, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[BatchDeploymentsClientUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[BatchDeploymentsClientUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// Update - Update a batch inference deployment (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +func (client *BatchDeploymentsClient) update(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, deploymentName string, body PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, options *BatchDeploymentsClientBeginUpdateOptions) (*http.Response, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, deploymentName, body, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateCreateRequest creates the Update request. +func (client *BatchDeploymentsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, deploymentName string, body PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, options *BatchDeploymentsClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if endpointName == "" { + return nil, errors.New("parameter endpointName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{endpointName}", url.PathEscape(endpointName)) + 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.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, body) +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_batchendpoints_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_batchendpoints_client.go new file mode 100644 index 000000000000..c80276b7bcab --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_batchendpoints_client.go @@ -0,0 +1,459 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// BatchEndpointsClient contains the methods for the BatchEndpoints group. +// Don't use this type directly, use NewBatchEndpointsClient() instead. +type BatchEndpointsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewBatchEndpointsClient creates a new instance of BatchEndpointsClient 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 NewBatchEndpointsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BatchEndpointsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &BatchEndpointsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates a batch inference endpoint (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// endpointName - Name for the Batch inference endpoint. +// body - Batch inference endpoint definition object. +// options - BatchEndpointsClientBeginCreateOrUpdateOptions contains the optional parameters for the BatchEndpointsClient.BeginCreateOrUpdate +// method. +func (client *BatchEndpointsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, body BatchEndpoint, options *BatchEndpointsClientBeginCreateOrUpdateOptions) (*runtime.Poller[BatchEndpointsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, workspaceName, endpointName, body, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[BatchEndpointsClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[BatchEndpointsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateOrUpdate - Creates a batch inference endpoint (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +func (client *BatchEndpointsClient) createOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, body BatchEndpoint, options *BatchEndpointsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, body, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *BatchEndpointsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, body BatchEndpoint, options *BatchEndpointsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if endpointName == "" { + return nil, errors.New("parameter endpointName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{endpointName}", url.PathEscape(endpointName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, body) +} + +// BeginDelete - Delete Batch Inference Endpoint (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// endpointName - Inference Endpoint name. +// options - BatchEndpointsClientBeginDeleteOptions contains the optional parameters for the BatchEndpointsClient.BeginDelete +// method. +func (client *BatchEndpointsClient) BeginDelete(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, options *BatchEndpointsClientBeginDeleteOptions) (*runtime.Poller[BatchEndpointsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, workspaceName, endpointName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[BatchEndpointsClientDeleteResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[BatchEndpointsClientDeleteResponse](options.ResumeToken, client.pl, nil) + } +} + +// Delete - Delete Batch Inference Endpoint (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +func (client *BatchEndpointsClient) deleteOperation(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, options *BatchEndpointsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *BatchEndpointsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, options *BatchEndpointsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if endpointName == "" { + return nil, errors.New("parameter endpointName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{endpointName}", url.PathEscape(endpointName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets a batch inference endpoint by name. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// endpointName - Name for the Batch Endpoint. +// options - BatchEndpointsClientGetOptions contains the optional parameters for the BatchEndpointsClient.Get method. +func (client *BatchEndpointsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, options *BatchEndpointsClientGetOptions) (BatchEndpointsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, options) + if err != nil { + return BatchEndpointsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return BatchEndpointsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return BatchEndpointsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *BatchEndpointsClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, options *BatchEndpointsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if endpointName == "" { + return nil, errors.New("parameter endpointName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{endpointName}", url.PathEscape(endpointName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-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 *BatchEndpointsClient) getHandleResponse(resp *http.Response) (BatchEndpointsClientGetResponse, error) { + result := BatchEndpointsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.BatchEndpoint); err != nil { + return BatchEndpointsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Lists Batch inference endpoint in the workspace. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// options - BatchEndpointsClientListOptions contains the optional parameters for the BatchEndpointsClient.List method. +func (client *BatchEndpointsClient) NewListPager(resourceGroupName string, workspaceName string, options *BatchEndpointsClientListOptions) *runtime.Pager[BatchEndpointsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[BatchEndpointsClientListResponse]{ + More: func(page BatchEndpointsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *BatchEndpointsClientListResponse) (BatchEndpointsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return BatchEndpointsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return BatchEndpointsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return BatchEndpointsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *BatchEndpointsClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *BatchEndpointsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + if options != nil && options.Count != nil { + reqQP.Set("count", strconv.FormatInt(int64(*options.Count), 10)) + } + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *BatchEndpointsClient) listHandleResponse(resp *http.Response) (BatchEndpointsClientListResponse, error) { + result := BatchEndpointsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.BatchEndpointTrackedResourceArmPaginatedResult); err != nil { + return BatchEndpointsClientListResponse{}, err + } + return result, nil +} + +// ListKeys - Lists batch Inference Endpoint keys. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// endpointName - Inference Endpoint name. +// options - BatchEndpointsClientListKeysOptions contains the optional parameters for the BatchEndpointsClient.ListKeys method. +func (client *BatchEndpointsClient) ListKeys(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, options *BatchEndpointsClientListKeysOptions) (BatchEndpointsClientListKeysResponse, error) { + req, err := client.listKeysCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, options) + if err != nil { + return BatchEndpointsClientListKeysResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return BatchEndpointsClientListKeysResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return BatchEndpointsClientListKeysResponse{}, runtime.NewResponseError(resp) + } + return client.listKeysHandleResponse(resp) +} + +// listKeysCreateRequest creates the ListKeys request. +func (client *BatchEndpointsClient) listKeysCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, options *BatchEndpointsClientListKeysOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if endpointName == "" { + return nil, errors.New("parameter endpointName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{endpointName}", url.PathEscape(endpointName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-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 *BatchEndpointsClient) listKeysHandleResponse(resp *http.Response) (BatchEndpointsClientListKeysResponse, error) { + result := BatchEndpointsClientListKeysResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.EndpointAuthKeys); err != nil { + return BatchEndpointsClientListKeysResponse{}, err + } + return result, nil +} + +// BeginUpdate - Update a batch inference endpoint (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// endpointName - Name for the Batch inference endpoint. +// body - Mutable batch inference endpoint definition object. +// options - BatchEndpointsClientBeginUpdateOptions contains the optional parameters for the BatchEndpointsClient.BeginUpdate +// method. +func (client *BatchEndpointsClient) BeginUpdate(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, body PartialMinimalTrackedResourceWithIdentity, options *BatchEndpointsClientBeginUpdateOptions) (*runtime.Poller[BatchEndpointsClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, workspaceName, endpointName, body, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[BatchEndpointsClientUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[BatchEndpointsClientUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// Update - Update a batch inference endpoint (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +func (client *BatchEndpointsClient) update(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, body PartialMinimalTrackedResourceWithIdentity, options *BatchEndpointsClientBeginUpdateOptions) (*http.Response, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, body, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateCreateRequest creates the Update request. +func (client *BatchEndpointsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, body PartialMinimalTrackedResourceWithIdentity, options *BatchEndpointsClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if endpointName == "" { + return nil, errors.New("parameter endpointName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{endpointName}", url.PathEscape(endpointName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, body) +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_codecontainers_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_codecontainers_client.go new file mode 100644 index 000000000000..3e4b88f73a5d --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_codecontainers_client.go @@ -0,0 +1,303 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "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" +) + +// CodeContainersClient contains the methods for the CodeContainers group. +// Don't use this type directly, use NewCodeContainersClient() instead. +type CodeContainersClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewCodeContainersClient creates a new instance of CodeContainersClient 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 NewCodeContainersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CodeContainersClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &CodeContainersClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// CreateOrUpdate - Create or update container. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// name - Container name. This is case-sensitive. +// body - Container entity to create or update. +// options - CodeContainersClientCreateOrUpdateOptions contains the optional parameters for the CodeContainersClient.CreateOrUpdate +// method. +func (client *CodeContainersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, name string, body CodeContainer, options *CodeContainersClientCreateOrUpdateOptions) (CodeContainersClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, name, body, options) + if err != nil { + return CodeContainersClientCreateOrUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return CodeContainersClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return CodeContainersClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *CodeContainersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, body CodeContainer, options *CodeContainersClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, body) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *CodeContainersClient) createOrUpdateHandleResponse(resp *http.Response) (CodeContainersClientCreateOrUpdateResponse, error) { + result := CodeContainersClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CodeContainer); err != nil { + return CodeContainersClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Delete container. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// name - Container name. This is case-sensitive. +// options - CodeContainersClientDeleteOptions contains the optional parameters for the CodeContainersClient.Delete method. +func (client *CodeContainersClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *CodeContainersClientDeleteOptions) (CodeContainersClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, name, options) + if err != nil { + return CodeContainersClientDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return CodeContainersClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return CodeContainersClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return CodeContainersClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *CodeContainersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *CodeContainersClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get container. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// name - Container name. This is case-sensitive. +// options - CodeContainersClientGetOptions contains the optional parameters for the CodeContainersClient.Get method. +func (client *CodeContainersClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *CodeContainersClientGetOptions) (CodeContainersClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, name, options) + if err != nil { + return CodeContainersClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return CodeContainersClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return CodeContainersClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *CodeContainersClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *CodeContainersClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-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 *CodeContainersClient) getHandleResponse(resp *http.Response) (CodeContainersClientGetResponse, error) { + result := CodeContainersClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CodeContainer); err != nil { + return CodeContainersClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List containers. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// options - CodeContainersClientListOptions contains the optional parameters for the CodeContainersClient.List method. +func (client *CodeContainersClient) NewListPager(resourceGroupName string, workspaceName string, options *CodeContainersClientListOptions) *runtime.Pager[CodeContainersClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[CodeContainersClientListResponse]{ + More: func(page CodeContainersClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *CodeContainersClientListResponse) (CodeContainersClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return CodeContainersClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return CodeContainersClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return CodeContainersClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *CodeContainersClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *CodeContainersClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *CodeContainersClient) listHandleResponse(resp *http.Response) (CodeContainersClientListResponse, error) { + result := CodeContainersClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CodeContainerResourceArmPaginatedResult); err != nil { + return CodeContainersClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_codeversions_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_codeversions_client.go new file mode 100644 index 000000000000..e06a3619a594 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_codeversions_client.go @@ -0,0 +1,330 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// CodeVersionsClient contains the methods for the CodeVersions group. +// Don't use this type directly, use NewCodeVersionsClient() instead. +type CodeVersionsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewCodeVersionsClient creates a new instance of CodeVersionsClient 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 NewCodeVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CodeVersionsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &CodeVersionsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// CreateOrUpdate - Create or update version. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// name - Container name. This is case-sensitive. +// version - Version identifier. This is case-sensitive. +// body - Version entity to create or update. +// options - CodeVersionsClientCreateOrUpdateOptions contains the optional parameters for the CodeVersionsClient.CreateOrUpdate +// method. +func (client *CodeVersionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body CodeVersion, options *CodeVersionsClientCreateOrUpdateOptions) (CodeVersionsClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, name, version, body, options) + if err != nil { + return CodeVersionsClientCreateOrUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return CodeVersionsClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return CodeVersionsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *CodeVersionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body CodeVersion, options *CodeVersionsClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, body) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *CodeVersionsClient) createOrUpdateHandleResponse(resp *http.Response) (CodeVersionsClientCreateOrUpdateResponse, error) { + result := CodeVersionsClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CodeVersion); err != nil { + return CodeVersionsClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Delete version. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// name - Container name. This is case-sensitive. +// version - Version identifier. This is case-sensitive. +// options - CodeVersionsClientDeleteOptions contains the optional parameters for the CodeVersionsClient.Delete method. +func (client *CodeVersionsClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *CodeVersionsClientDeleteOptions) (CodeVersionsClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, name, version, options) + if err != nil { + return CodeVersionsClientDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return CodeVersionsClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return CodeVersionsClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return CodeVersionsClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *CodeVersionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *CodeVersionsClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get version. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// name - Container name. This is case-sensitive. +// version - Version identifier. This is case-sensitive. +// options - CodeVersionsClientGetOptions contains the optional parameters for the CodeVersionsClient.Get method. +func (client *CodeVersionsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *CodeVersionsClientGetOptions) (CodeVersionsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, name, version, options) + if err != nil { + return CodeVersionsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return CodeVersionsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return CodeVersionsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *CodeVersionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *CodeVersionsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-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 *CodeVersionsClient) getHandleResponse(resp *http.Response) (CodeVersionsClientGetResponse, error) { + result := CodeVersionsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CodeVersion); err != nil { + return CodeVersionsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List versions. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// name - Container name. This is case-sensitive. +// options - CodeVersionsClientListOptions contains the optional parameters for the CodeVersionsClient.List method. +func (client *CodeVersionsClient) NewListPager(resourceGroupName string, workspaceName string, name string, options *CodeVersionsClientListOptions) *runtime.Pager[CodeVersionsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[CodeVersionsClientListResponse]{ + More: func(page CodeVersionsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *CodeVersionsClientListResponse) (CodeVersionsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, name, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return CodeVersionsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return CodeVersionsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return CodeVersionsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *CodeVersionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *CodeVersionsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + if options != nil && options.OrderBy != nil { + reqQP.Set("$orderBy", *options.OrderBy) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *CodeVersionsClient) listHandleResponse(resp *http.Response) (CodeVersionsClientListResponse, error) { + result := CodeVersionsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CodeVersionResourceArmPaginatedResult); err != nil { + return CodeVersionsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_componentcontainers_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_componentcontainers_client.go new file mode 100644 index 000000000000..694ff37550eb --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_componentcontainers_client.go @@ -0,0 +1,308 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "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" +) + +// ComponentContainersClient contains the methods for the ComponentContainers group. +// Don't use this type directly, use NewComponentContainersClient() instead. +type ComponentContainersClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewComponentContainersClient creates a new instance of ComponentContainersClient 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 NewComponentContainersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ComponentContainersClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &ComponentContainersClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// CreateOrUpdate - Create or update container. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// name - Container name. +// body - Container entity to create or update. +// options - ComponentContainersClientCreateOrUpdateOptions contains the optional parameters for the ComponentContainersClient.CreateOrUpdate +// method. +func (client *ComponentContainersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, name string, body ComponentContainer, options *ComponentContainersClientCreateOrUpdateOptions) (ComponentContainersClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, name, body, options) + if err != nil { + return ComponentContainersClientCreateOrUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ComponentContainersClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return ComponentContainersClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ComponentContainersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, body ComponentContainer, options *ComponentContainersClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, body) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *ComponentContainersClient) createOrUpdateHandleResponse(resp *http.Response) (ComponentContainersClientCreateOrUpdateResponse, error) { + result := ComponentContainersClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ComponentContainer); err != nil { + return ComponentContainersClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Delete container. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// name - Container name. +// options - ComponentContainersClientDeleteOptions contains the optional parameters for the ComponentContainersClient.Delete +// method. +func (client *ComponentContainersClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *ComponentContainersClientDeleteOptions) (ComponentContainersClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, name, options) + if err != nil { + return ComponentContainersClientDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ComponentContainersClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return ComponentContainersClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return ComponentContainersClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ComponentContainersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *ComponentContainersClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get container. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// name - Container name. +// options - ComponentContainersClientGetOptions contains the optional parameters for the ComponentContainersClient.Get method. +func (client *ComponentContainersClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *ComponentContainersClientGetOptions) (ComponentContainersClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, name, options) + if err != nil { + return ComponentContainersClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ComponentContainersClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ComponentContainersClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ComponentContainersClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *ComponentContainersClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-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 *ComponentContainersClient) getHandleResponse(resp *http.Response) (ComponentContainersClientGetResponse, error) { + result := ComponentContainersClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ComponentContainer); err != nil { + return ComponentContainersClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List component containers. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// options - ComponentContainersClientListOptions contains the optional parameters for the ComponentContainersClient.List +// method. +func (client *ComponentContainersClient) NewListPager(resourceGroupName string, workspaceName string, options *ComponentContainersClientListOptions) *runtime.Pager[ComponentContainersClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ComponentContainersClientListResponse]{ + More: func(page ComponentContainersClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ComponentContainersClientListResponse) (ComponentContainersClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ComponentContainersClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ComponentContainersClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ComponentContainersClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *ComponentContainersClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *ComponentContainersClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + if options != nil && options.ListViewType != nil { + reqQP.Set("listViewType", string(*options.ListViewType)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ComponentContainersClient) listHandleResponse(resp *http.Response) (ComponentContainersClientListResponse, error) { + result := ComponentContainersClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ComponentContainerResourceArmPaginatedResult); err != nil { + return ComponentContainersClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_componentversions_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_componentversions_client.go new file mode 100644 index 000000000000..89df52ad7e2c --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_componentversions_client.go @@ -0,0 +1,334 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// ComponentVersionsClient contains the methods for the ComponentVersions group. +// Don't use this type directly, use NewComponentVersionsClient() instead. +type ComponentVersionsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewComponentVersionsClient creates a new instance of ComponentVersionsClient 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 NewComponentVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ComponentVersionsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &ComponentVersionsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// CreateOrUpdate - Create or update version. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// name - Container name. +// version - Version identifier. +// body - Version entity to create or update. +// options - ComponentVersionsClientCreateOrUpdateOptions contains the optional parameters for the ComponentVersionsClient.CreateOrUpdate +// method. +func (client *ComponentVersionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body ComponentVersion, options *ComponentVersionsClientCreateOrUpdateOptions) (ComponentVersionsClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, name, version, body, options) + if err != nil { + return ComponentVersionsClientCreateOrUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ComponentVersionsClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return ComponentVersionsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ComponentVersionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body ComponentVersion, options *ComponentVersionsClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, body) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *ComponentVersionsClient) createOrUpdateHandleResponse(resp *http.Response) (ComponentVersionsClientCreateOrUpdateResponse, error) { + result := ComponentVersionsClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ComponentVersion); err != nil { + return ComponentVersionsClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Delete version. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// name - Container name. +// version - Version identifier. +// options - ComponentVersionsClientDeleteOptions contains the optional parameters for the ComponentVersionsClient.Delete +// method. +func (client *ComponentVersionsClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *ComponentVersionsClientDeleteOptions) (ComponentVersionsClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, name, version, options) + if err != nil { + return ComponentVersionsClientDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ComponentVersionsClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return ComponentVersionsClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return ComponentVersionsClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ComponentVersionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *ComponentVersionsClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get version. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// name - Container name. +// version - Version identifier. +// options - ComponentVersionsClientGetOptions contains the optional parameters for the ComponentVersionsClient.Get method. +func (client *ComponentVersionsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *ComponentVersionsClientGetOptions) (ComponentVersionsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, name, version, options) + if err != nil { + return ComponentVersionsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ComponentVersionsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ComponentVersionsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ComponentVersionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *ComponentVersionsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-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 *ComponentVersionsClient) getHandleResponse(resp *http.Response) (ComponentVersionsClientGetResponse, error) { + result := ComponentVersionsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ComponentVersion); err != nil { + return ComponentVersionsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List component versions. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// name - Component name. +// options - ComponentVersionsClientListOptions contains the optional parameters for the ComponentVersionsClient.List method. +func (client *ComponentVersionsClient) NewListPager(resourceGroupName string, workspaceName string, name string, options *ComponentVersionsClientListOptions) *runtime.Pager[ComponentVersionsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ComponentVersionsClientListResponse]{ + More: func(page ComponentVersionsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ComponentVersionsClientListResponse) (ComponentVersionsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, name, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ComponentVersionsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ComponentVersionsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ComponentVersionsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *ComponentVersionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *ComponentVersionsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + if options != nil && options.OrderBy != nil { + reqQP.Set("$orderBy", *options.OrderBy) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + if options != nil && options.ListViewType != nil { + reqQP.Set("listViewType", string(*options.ListViewType)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ComponentVersionsClient) listHandleResponse(resp *http.Response) (ComponentVersionsClientListResponse, error) { + result := ComponentVersionsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ComponentVersionResourceArmPaginatedResult); err != nil { + return ComponentVersionsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_compute_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_compute_client.go new file mode 100644 index 000000000000..1165e96ea011 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_compute_client.go @@ -0,0 +1,737 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "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" +) + +// ComputeClient contains the methods for the Compute group. +// Don't use this type directly, use NewComputeClient() instead. +type ComputeClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewComputeClient creates a new instance of ComputeClient 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 NewComputeClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ComputeClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &ComputeClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates compute. This call will overwrite a compute if it exists. This is a nonrecoverable +// operation. If your intent is to create a new compute, do a GET first to verify that it does not +// exist yet. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// computeName - Name of the Azure Machine Learning compute. +// parameters - Payload with Machine Learning compute definition. +// options - ComputeClientBeginCreateOrUpdateOptions contains the optional parameters for the ComputeClient.BeginCreateOrUpdate +// method. +func (client *ComputeClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, parameters ComputeResource, options *ComputeClientBeginCreateOrUpdateOptions) (*runtime.Poller[ComputeClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, workspaceName, computeName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[ComputeClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[ComputeClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateOrUpdate - Creates or updates compute. This call will overwrite a compute if it exists. This is a nonrecoverable +// operation. If your intent is to create a new compute, do a GET first to verify that it does not +// exist yet. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +func (client *ComputeClient) createOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, parameters ComputeResource, options *ComputeClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, computeName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ComputeClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, parameters ComputeResource, options *ComputeClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if computeName == "" { + return nil, errors.New("parameter computeName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{computeName}", url.PathEscape(computeName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Deletes specified Machine Learning compute. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// computeName - Name of the Azure Machine Learning compute. +// underlyingResourceAction - Delete the underlying compute if 'Delete', or detach the underlying compute from workspace if +// 'Detach'. +// options - ComputeClientBeginDeleteOptions contains the optional parameters for the ComputeClient.BeginDelete method. +func (client *ComputeClient) BeginDelete(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, underlyingResourceAction UnderlyingResourceAction, options *ComputeClientBeginDeleteOptions) (*runtime.Poller[ComputeClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, workspaceName, computeName, underlyingResourceAction, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[ComputeClientDeleteResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[ComputeClientDeleteResponse](options.ResumeToken, client.pl, nil) + } +} + +// Delete - Deletes specified Machine Learning compute. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +func (client *ComputeClient) deleteOperation(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, underlyingResourceAction UnderlyingResourceAction, options *ComputeClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, computeName, underlyingResourceAction, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ComputeClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, underlyingResourceAction UnderlyingResourceAction, options *ComputeClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if computeName == "" { + return nil, errors.New("parameter computeName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{computeName}", url.PathEscape(computeName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + reqQP.Set("underlyingResourceAction", string(underlyingResourceAction)) + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are not returned - use +// 'keys' nested resource to get them. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// computeName - Name of the Azure Machine Learning compute. +// options - ComputeClientGetOptions contains the optional parameters for the ComputeClient.Get method. +func (client *ComputeClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, options *ComputeClientGetOptions) (ComputeClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, computeName, options) + if err != nil { + return ComputeClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ComputeClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ComputeClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ComputeClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, options *ComputeClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if computeName == "" { + return nil, errors.New("parameter computeName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{computeName}", url.PathEscape(computeName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-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 *ComputeClient) getHandleResponse(resp *http.Response) (ComputeClientGetResponse, error) { + result := ComputeClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ComputeResource); err != nil { + return ComputeClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets computes in specified workspace. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// options - ComputeClientListOptions contains the optional parameters for the ComputeClient.List method. +func (client *ComputeClient) NewListPager(resourceGroupName string, workspaceName string, options *ComputeClientListOptions) *runtime.Pager[ComputeClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ComputeClientListResponse]{ + More: func(page ComputeClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ComputeClientListResponse) (ComputeClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ComputeClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ComputeClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ComputeClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *ComputeClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *ComputeClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ComputeClient) listHandleResponse(resp *http.Response) (ComputeClientListResponse, error) { + result := ComputeClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PaginatedComputeResourcesList); err != nil { + return ComputeClientListResponse{}, err + } + return result, nil +} + +// ListKeys - Gets secrets related to Machine Learning compute (storage keys, service credentials, etc). +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// computeName - Name of the Azure Machine Learning compute. +// options - ComputeClientListKeysOptions contains the optional parameters for the ComputeClient.ListKeys method. +func (client *ComputeClient) ListKeys(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, options *ComputeClientListKeysOptions) (ComputeClientListKeysResponse, error) { + req, err := client.listKeysCreateRequest(ctx, resourceGroupName, workspaceName, computeName, options) + if err != nil { + return ComputeClientListKeysResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ComputeClientListKeysResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ComputeClientListKeysResponse{}, runtime.NewResponseError(resp) + } + return client.listKeysHandleResponse(resp) +} + +// listKeysCreateRequest creates the ListKeys request. +func (client *ComputeClient) listKeysCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, options *ComputeClientListKeysOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if computeName == "" { + return nil, errors.New("parameter computeName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{computeName}", url.PathEscape(computeName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-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 *ComputeClient) listKeysHandleResponse(resp *http.Response) (ComputeClientListKeysResponse, error) { + result := ComputeClientListKeysResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result); err != nil { + return ComputeClientListKeysResponse{}, err + } + return result, nil +} + +// NewListNodesPager - Get the details (e.g IP address, port etc) of all the compute nodes in the compute. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// computeName - Name of the Azure Machine Learning compute. +// options - ComputeClientListNodesOptions contains the optional parameters for the ComputeClient.ListNodes method. +func (client *ComputeClient) NewListNodesPager(resourceGroupName string, workspaceName string, computeName string, options *ComputeClientListNodesOptions) *runtime.Pager[ComputeClientListNodesResponse] { + return runtime.NewPager(runtime.PagingHandler[ComputeClientListNodesResponse]{ + More: func(page ComputeClientListNodesResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ComputeClientListNodesResponse) (ComputeClientListNodesResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listNodesCreateRequest(ctx, resourceGroupName, workspaceName, computeName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ComputeClientListNodesResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ComputeClientListNodesResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ComputeClientListNodesResponse{}, runtime.NewResponseError(resp) + } + return client.listNodesHandleResponse(resp) + }, + }) +} + +// listNodesCreateRequest creates the ListNodes request. +func (client *ComputeClient) listNodesCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, options *ComputeClientListNodesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if computeName == "" { + return nil, errors.New("parameter computeName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{computeName}", url.PathEscape(computeName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listNodesHandleResponse handles the ListNodes response. +func (client *ComputeClient) listNodesHandleResponse(resp *http.Response) (ComputeClientListNodesResponse, error) { + result := ComputeClientListNodesResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AmlComputeNodesInformation); err != nil { + return ComputeClientListNodesResponse{}, err + } + return result, nil +} + +// BeginRestart - Posts a restart action to a compute instance +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// computeName - Name of the Azure Machine Learning compute. +// options - ComputeClientBeginRestartOptions contains the optional parameters for the ComputeClient.BeginRestart method. +func (client *ComputeClient) BeginRestart(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, options *ComputeClientBeginRestartOptions) (*runtime.Poller[ComputeClientRestartResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.restart(ctx, resourceGroupName, workspaceName, computeName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[ComputeClientRestartResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[ComputeClientRestartResponse](options.ResumeToken, client.pl, nil) + } +} + +// Restart - Posts a restart action to a compute instance +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +func (client *ComputeClient) restart(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, options *ComputeClientBeginRestartOptions) (*http.Response, error) { + req, err := client.restartCreateRequest(ctx, resourceGroupName, workspaceName, computeName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// restartCreateRequest creates the Restart request. +func (client *ComputeClient) restartCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, options *ComputeClientBeginRestartOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if computeName == "" { + return nil, errors.New("parameter computeName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{computeName}", url.PathEscape(computeName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginStart - Posts a start action to a compute instance +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// computeName - Name of the Azure Machine Learning compute. +// options - ComputeClientBeginStartOptions contains the optional parameters for the ComputeClient.BeginStart method. +func (client *ComputeClient) BeginStart(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, options *ComputeClientBeginStartOptions) (*runtime.Poller[ComputeClientStartResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.start(ctx, resourceGroupName, workspaceName, computeName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[ComputeClientStartResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[ComputeClientStartResponse](options.ResumeToken, client.pl, nil) + } +} + +// Start - Posts a start action to a compute instance +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +func (client *ComputeClient) start(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, options *ComputeClientBeginStartOptions) (*http.Response, error) { + req, err := client.startCreateRequest(ctx, resourceGroupName, workspaceName, computeName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// startCreateRequest creates the Start request. +func (client *ComputeClient) startCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, options *ComputeClientBeginStartOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if computeName == "" { + return nil, errors.New("parameter computeName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{computeName}", url.PathEscape(computeName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginStop - Posts a stop action to a compute instance +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// computeName - Name of the Azure Machine Learning compute. +// options - ComputeClientBeginStopOptions contains the optional parameters for the ComputeClient.BeginStop method. +func (client *ComputeClient) BeginStop(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, options *ComputeClientBeginStopOptions) (*runtime.Poller[ComputeClientStopResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.stop(ctx, resourceGroupName, workspaceName, computeName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[ComputeClientStopResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[ComputeClientStopResponse](options.ResumeToken, client.pl, nil) + } +} + +// Stop - Posts a stop action to a compute instance +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +func (client *ComputeClient) stop(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, options *ComputeClientBeginStopOptions) (*http.Response, error) { + req, err := client.stopCreateRequest(ctx, resourceGroupName, workspaceName, computeName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// stopCreateRequest creates the Stop request. +func (client *ComputeClient) stopCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, options *ComputeClientBeginStopOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if computeName == "" { + return nil, errors.New("parameter computeName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{computeName}", url.PathEscape(computeName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginUpdate - Updates properties of a compute. This call will overwrite a compute if it exists. This is a nonrecoverable +// operation. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// computeName - Name of the Azure Machine Learning compute. +// parameters - Additional parameters for cluster update. +// options - ComputeClientBeginUpdateOptions contains the optional parameters for the ComputeClient.BeginUpdate method. +func (client *ComputeClient) BeginUpdate(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, parameters ClusterUpdateParameters, options *ComputeClientBeginUpdateOptions) (*runtime.Poller[ComputeClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, workspaceName, computeName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[ComputeClientUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[ComputeClientUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// Update - Updates properties of a compute. This call will overwrite a compute if it exists. This is a nonrecoverable operation. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +func (client *ComputeClient) update(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, parameters ClusterUpdateParameters, options *ComputeClientBeginUpdateOptions) (*http.Response, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, workspaceName, computeName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateCreateRequest creates the Update request. +func (client *ComputeClient) updateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, parameters ClusterUpdateParameters, options *ComputeClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if computeName == "" { + return nil, errors.New("parameter computeName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{computeName}", url.PathEscape(computeName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_constants.go b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_constants.go new file mode 100644 index 000000000000..4324922bad43 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_constants.go @@ -0,0 +1,1576 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +const ( + moduleName = "armmachinelearning" + moduleVersion = "v0.1.0" +) + +// AllocationState - Allocation state of the compute. Possible values are: steady - Indicates that the compute is not resizing. +// There are no changes to the number of compute nodes in the compute in progress. A compute +// enters this state when it is created and when no operations are being performed on the compute to change the number of +// compute nodes. resizing - Indicates that the compute is resizing; that is, +// compute nodes are being added to or removed from the compute. +type AllocationState string + +const ( + AllocationStateResizing AllocationState = "Resizing" + AllocationStateSteady AllocationState = "Steady" +) + +// PossibleAllocationStateValues returns the possible values for the AllocationState const type. +func PossibleAllocationStateValues() []AllocationState { + return []AllocationState{ + AllocationStateResizing, + AllocationStateSteady, + } +} + +// ApplicationSharingPolicy - Policy for sharing applications on this compute instance among users of parent workspace. If +// Personal, only the creator can access applications on this compute instance. When Shared, any workspace +// user can access applications on this instance depending on his/her assigned role. +type ApplicationSharingPolicy string + +const ( + ApplicationSharingPolicyPersonal ApplicationSharingPolicy = "Personal" + ApplicationSharingPolicyShared ApplicationSharingPolicy = "Shared" +) + +// PossibleApplicationSharingPolicyValues returns the possible values for the ApplicationSharingPolicy const type. +func PossibleApplicationSharingPolicyValues() []ApplicationSharingPolicy { + return []ApplicationSharingPolicy{ + ApplicationSharingPolicyPersonal, + ApplicationSharingPolicyShared, + } +} + +// Autosave - Auto save settings. +type Autosave string + +const ( + AutosaveLocal Autosave = "Local" + AutosaveNone Autosave = "None" + AutosaveRemote Autosave = "Remote" +) + +// PossibleAutosaveValues returns the possible values for the Autosave const type. +func PossibleAutosaveValues() []Autosave { + return []Autosave{ + AutosaveLocal, + AutosaveNone, + AutosaveRemote, + } +} + +// BatchLoggingLevel - Log verbosity for batch inferencing. Increasing verbosity order for logging is : Warning, Info and +// Debug. The default value is Info. +type BatchLoggingLevel string + +const ( + BatchLoggingLevelDebug BatchLoggingLevel = "Debug" + BatchLoggingLevelInfo BatchLoggingLevel = "Info" + BatchLoggingLevelWarning BatchLoggingLevel = "Warning" +) + +// PossibleBatchLoggingLevelValues returns the possible values for the BatchLoggingLevel const type. +func PossibleBatchLoggingLevelValues() []BatchLoggingLevel { + return []BatchLoggingLevel{ + BatchLoggingLevelDebug, + BatchLoggingLevelInfo, + BatchLoggingLevelWarning, + } +} + +// BatchOutputAction - Enum to determine how batch inferencing will handle output +type BatchOutputAction string + +const ( + BatchOutputActionAppendRow BatchOutputAction = "AppendRow" + BatchOutputActionSummaryOnly BatchOutputAction = "SummaryOnly" +) + +// PossibleBatchOutputActionValues returns the possible values for the BatchOutputAction const type. +func PossibleBatchOutputActionValues() []BatchOutputAction { + return []BatchOutputAction{ + BatchOutputActionAppendRow, + BatchOutputActionSummaryOnly, + } +} + +// BillingCurrency - Three lettered code specifying the currency of the VM price. Example: USD +type BillingCurrency string + +const ( + BillingCurrencyUSD BillingCurrency = "USD" +) + +// PossibleBillingCurrencyValues returns the possible values for the BillingCurrency const type. +func PossibleBillingCurrencyValues() []BillingCurrency { + return []BillingCurrency{ + BillingCurrencyUSD, + } +} + +// Caching - Caching type of Data Disk. +type Caching string + +const ( + CachingNone Caching = "None" + CachingReadOnly Caching = "ReadOnly" + CachingReadWrite Caching = "ReadWrite" +) + +// PossibleCachingValues returns the possible values for the Caching const type. +func PossibleCachingValues() []Caching { + return []Caching{ + CachingNone, + CachingReadOnly, + CachingReadWrite, + } +} + +// ClusterPurpose - Intended usage of the cluster +type ClusterPurpose string + +const ( + ClusterPurposeDenseProd ClusterPurpose = "DenseProd" + ClusterPurposeDevTest ClusterPurpose = "DevTest" + ClusterPurposeFastProd ClusterPurpose = "FastProd" +) + +// PossibleClusterPurposeValues returns the possible values for the ClusterPurpose const type. +func PossibleClusterPurposeValues() []ClusterPurpose { + return []ClusterPurpose{ + ClusterPurposeDenseProd, + ClusterPurposeDevTest, + ClusterPurposeFastProd, + } +} + +// ComputeInstanceAuthorizationType - The Compute Instance Authorization type. Available values are personal (default). +type ComputeInstanceAuthorizationType string + +const ( + ComputeInstanceAuthorizationTypePersonal ComputeInstanceAuthorizationType = "personal" +) + +// PossibleComputeInstanceAuthorizationTypeValues returns the possible values for the ComputeInstanceAuthorizationType const type. +func PossibleComputeInstanceAuthorizationTypeValues() []ComputeInstanceAuthorizationType { + return []ComputeInstanceAuthorizationType{ + ComputeInstanceAuthorizationTypePersonal, + } +} + +// ComputeInstanceState - Current state of an ComputeInstance. +type ComputeInstanceState string + +const ( + ComputeInstanceStateCreateFailed ComputeInstanceState = "CreateFailed" + ComputeInstanceStateCreating ComputeInstanceState = "Creating" + ComputeInstanceStateDeleting ComputeInstanceState = "Deleting" + ComputeInstanceStateJobRunning ComputeInstanceState = "JobRunning" + ComputeInstanceStateRestarting ComputeInstanceState = "Restarting" + ComputeInstanceStateRunning ComputeInstanceState = "Running" + ComputeInstanceStateSettingUp ComputeInstanceState = "SettingUp" + ComputeInstanceStateSetupFailed ComputeInstanceState = "SetupFailed" + ComputeInstanceStateStarting ComputeInstanceState = "Starting" + ComputeInstanceStateStopped ComputeInstanceState = "Stopped" + ComputeInstanceStateStopping ComputeInstanceState = "Stopping" + ComputeInstanceStateUnknown ComputeInstanceState = "Unknown" + ComputeInstanceStateUnusable ComputeInstanceState = "Unusable" + ComputeInstanceStateUserSettingUp ComputeInstanceState = "UserSettingUp" + ComputeInstanceStateUserSetupFailed ComputeInstanceState = "UserSetupFailed" +) + +// PossibleComputeInstanceStateValues returns the possible values for the ComputeInstanceState const type. +func PossibleComputeInstanceStateValues() []ComputeInstanceState { + return []ComputeInstanceState{ + ComputeInstanceStateCreateFailed, + ComputeInstanceStateCreating, + ComputeInstanceStateDeleting, + ComputeInstanceStateJobRunning, + ComputeInstanceStateRestarting, + ComputeInstanceStateRunning, + ComputeInstanceStateSettingUp, + ComputeInstanceStateSetupFailed, + ComputeInstanceStateStarting, + ComputeInstanceStateStopped, + ComputeInstanceStateStopping, + ComputeInstanceStateUnknown, + ComputeInstanceStateUnusable, + ComputeInstanceStateUserSettingUp, + ComputeInstanceStateUserSetupFailed, + } +} + +// ComputePowerAction - The compute power action. +type ComputePowerAction string + +const ( + ComputePowerActionStart ComputePowerAction = "Start" + ComputePowerActionStop ComputePowerAction = "Stop" +) + +// PossibleComputePowerActionValues returns the possible values for the ComputePowerAction const type. +func PossibleComputePowerActionValues() []ComputePowerAction { + return []ComputePowerAction{ + ComputePowerActionStart, + ComputePowerActionStop, + } +} + +// ComputeType - The type of compute +type ComputeType string + +const ( + ComputeTypeAKS ComputeType = "AKS" + ComputeTypeAmlCompute ComputeType = "AmlCompute" + ComputeTypeComputeInstance ComputeType = "ComputeInstance" + ComputeTypeDataFactory ComputeType = "DataFactory" + ComputeTypeDataLakeAnalytics ComputeType = "DataLakeAnalytics" + ComputeTypeDatabricks ComputeType = "Databricks" + ComputeTypeHDInsight ComputeType = "HDInsight" + ComputeTypeKubernetes ComputeType = "Kubernetes" + ComputeTypeSynapseSpark ComputeType = "SynapseSpark" + ComputeTypeVirtualMachine ComputeType = "VirtualMachine" +) + +// PossibleComputeTypeValues returns the possible values for the ComputeType const type. +func PossibleComputeTypeValues() []ComputeType { + return []ComputeType{ + ComputeTypeAKS, + ComputeTypeAmlCompute, + ComputeTypeComputeInstance, + ComputeTypeDataFactory, + ComputeTypeDataLakeAnalytics, + ComputeTypeDatabricks, + ComputeTypeHDInsight, + ComputeTypeKubernetes, + ComputeTypeSynapseSpark, + ComputeTypeVirtualMachine, + } +} + +// ConnectionAuthType - Authentication type of the connection target +type ConnectionAuthType string + +const ( + ConnectionAuthTypeManagedIdentity ConnectionAuthType = "ManagedIdentity" + ConnectionAuthTypeNone ConnectionAuthType = "None" + ConnectionAuthTypePAT ConnectionAuthType = "PAT" + ConnectionAuthTypeSAS ConnectionAuthType = "SAS" + ConnectionAuthTypeUsernamePassword ConnectionAuthType = "UsernamePassword" +) + +// PossibleConnectionAuthTypeValues returns the possible values for the ConnectionAuthType const type. +func PossibleConnectionAuthTypeValues() []ConnectionAuthType { + return []ConnectionAuthType{ + ConnectionAuthTypeManagedIdentity, + ConnectionAuthTypeNone, + ConnectionAuthTypePAT, + ConnectionAuthTypeSAS, + ConnectionAuthTypeUsernamePassword, + } +} + +// ConnectionCategory - Category of the connection +type ConnectionCategory string + +const ( + ConnectionCategoryContainerRegistry ConnectionCategory = "ContainerRegistry" + ConnectionCategoryGit ConnectionCategory = "Git" + ConnectionCategoryPythonFeed ConnectionCategory = "PythonFeed" +) + +// PossibleConnectionCategoryValues returns the possible values for the ConnectionCategory const type. +func PossibleConnectionCategoryValues() []ConnectionCategory { + return []ConnectionCategory{ + ConnectionCategoryContainerRegistry, + ConnectionCategoryGit, + ConnectionCategoryPythonFeed, + } +} + +type ContainerType string + +const ( + ContainerTypeInferenceServer ContainerType = "InferenceServer" + ContainerTypeStorageInitializer ContainerType = "StorageInitializer" +) + +// PossibleContainerTypeValues returns the possible values for the ContainerType const type. +func PossibleContainerTypeValues() []ContainerType { + return []ContainerType{ + ContainerTypeInferenceServer, + ContainerTypeStorageInitializer, + } +} + +// 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, + } +} + +// CredentialsType - Enum to determine the datastore credentials type. +type CredentialsType string + +const ( + CredentialsTypeAccountKey CredentialsType = "AccountKey" + CredentialsTypeCertificate CredentialsType = "Certificate" + CredentialsTypeNone CredentialsType = "None" + CredentialsTypeSas CredentialsType = "Sas" + CredentialsTypeServicePrincipal CredentialsType = "ServicePrincipal" +) + +// PossibleCredentialsTypeValues returns the possible values for the CredentialsType const type. +func PossibleCredentialsTypeValues() []CredentialsType { + return []CredentialsType{ + CredentialsTypeAccountKey, + CredentialsTypeCertificate, + CredentialsTypeNone, + CredentialsTypeSas, + CredentialsTypeServicePrincipal, + } +} + +// DataType - Enum to determine the type of data. +type DataType string + +const ( + DataTypeMltable DataType = "mltable" + DataTypeURIFile DataType = "uri_file" + DataTypeURIFolder DataType = "uri_folder" +) + +// PossibleDataTypeValues returns the possible values for the DataType const type. +func PossibleDataTypeValues() []DataType { + return []DataType{ + DataTypeMltable, + DataTypeURIFile, + DataTypeURIFolder, + } +} + +// DatastoreType - Enum to determine the datastore contents type. +type DatastoreType string + +const ( + DatastoreTypeAzureBlob DatastoreType = "AzureBlob" + DatastoreTypeAzureDataLakeGen1 DatastoreType = "AzureDataLakeGen1" + DatastoreTypeAzureDataLakeGen2 DatastoreType = "AzureDataLakeGen2" + DatastoreTypeAzureFile DatastoreType = "AzureFile" +) + +// PossibleDatastoreTypeValues returns the possible values for the DatastoreType const type. +func PossibleDatastoreTypeValues() []DatastoreType { + return []DatastoreType{ + DatastoreTypeAzureBlob, + DatastoreTypeAzureDataLakeGen1, + DatastoreTypeAzureDataLakeGen2, + DatastoreTypeAzureFile, + } +} + +// DeploymentProvisioningState - Possible values for DeploymentProvisioningState. +type DeploymentProvisioningState string + +const ( + DeploymentProvisioningStateCanceled DeploymentProvisioningState = "Canceled" + DeploymentProvisioningStateCreating DeploymentProvisioningState = "Creating" + DeploymentProvisioningStateDeleting DeploymentProvisioningState = "Deleting" + DeploymentProvisioningStateFailed DeploymentProvisioningState = "Failed" + DeploymentProvisioningStateScaling DeploymentProvisioningState = "Scaling" + DeploymentProvisioningStateSucceeded DeploymentProvisioningState = "Succeeded" + DeploymentProvisioningStateUpdating DeploymentProvisioningState = "Updating" +) + +// PossibleDeploymentProvisioningStateValues returns the possible values for the DeploymentProvisioningState const type. +func PossibleDeploymentProvisioningStateValues() []DeploymentProvisioningState { + return []DeploymentProvisioningState{ + DeploymentProvisioningStateCanceled, + DeploymentProvisioningStateCreating, + DeploymentProvisioningStateDeleting, + DeploymentProvisioningStateFailed, + DeploymentProvisioningStateScaling, + DeploymentProvisioningStateSucceeded, + DeploymentProvisioningStateUpdating, + } +} + +// DiagnoseResultLevel - Level of workspace setup error +type DiagnoseResultLevel string + +const ( + DiagnoseResultLevelError DiagnoseResultLevel = "Error" + DiagnoseResultLevelInformation DiagnoseResultLevel = "Information" + DiagnoseResultLevelWarning DiagnoseResultLevel = "Warning" +) + +// PossibleDiagnoseResultLevelValues returns the possible values for the DiagnoseResultLevel const type. +func PossibleDiagnoseResultLevelValues() []DiagnoseResultLevel { + return []DiagnoseResultLevel{ + DiagnoseResultLevelError, + DiagnoseResultLevelInformation, + DiagnoseResultLevelWarning, + } +} + +// DistributionType - Enum to determine the job distribution type. +type DistributionType string + +const ( + DistributionTypeMpi DistributionType = "Mpi" + DistributionTypePyTorch DistributionType = "PyTorch" + DistributionTypeTensorFlow DistributionType = "TensorFlow" +) + +// PossibleDistributionTypeValues returns the possible values for the DistributionType const type. +func PossibleDistributionTypeValues() []DistributionType { + return []DistributionType{ + DistributionTypeMpi, + DistributionTypePyTorch, + DistributionTypeTensorFlow, + } +} + +type EarlyTerminationPolicyType string + +const ( + EarlyTerminationPolicyTypeBandit EarlyTerminationPolicyType = "Bandit" + EarlyTerminationPolicyTypeMedianStopping EarlyTerminationPolicyType = "MedianStopping" + EarlyTerminationPolicyTypeTruncationSelection EarlyTerminationPolicyType = "TruncationSelection" +) + +// PossibleEarlyTerminationPolicyTypeValues returns the possible values for the EarlyTerminationPolicyType const type. +func PossibleEarlyTerminationPolicyTypeValues() []EarlyTerminationPolicyType { + return []EarlyTerminationPolicyType{ + EarlyTerminationPolicyTypeBandit, + EarlyTerminationPolicyTypeMedianStopping, + EarlyTerminationPolicyTypeTruncationSelection, + } +} + +// EncryptionStatus - Indicates whether or not the encryption is enabled for the workspace. +type EncryptionStatus string + +const ( + EncryptionStatusDisabled EncryptionStatus = "Disabled" + EncryptionStatusEnabled EncryptionStatus = "Enabled" +) + +// PossibleEncryptionStatusValues returns the possible values for the EncryptionStatus const type. +func PossibleEncryptionStatusValues() []EncryptionStatus { + return []EncryptionStatus{ + EncryptionStatusDisabled, + EncryptionStatusEnabled, + } +} + +// EndpointAuthMode - Enum to determine endpoint authentication mode. +type EndpointAuthMode string + +const ( + EndpointAuthModeAADToken EndpointAuthMode = "AADToken" + EndpointAuthModeAMLToken EndpointAuthMode = "AMLToken" + EndpointAuthModeKey EndpointAuthMode = "Key" +) + +// PossibleEndpointAuthModeValues returns the possible values for the EndpointAuthMode const type. +func PossibleEndpointAuthModeValues() []EndpointAuthMode { + return []EndpointAuthMode{ + EndpointAuthModeAADToken, + EndpointAuthModeAMLToken, + EndpointAuthModeKey, + } +} + +// EndpointComputeType - Enum to determine endpoint compute type. +type EndpointComputeType string + +const ( + EndpointComputeTypeAzureMLCompute EndpointComputeType = "AzureMLCompute" + EndpointComputeTypeKubernetes EndpointComputeType = "Kubernetes" + EndpointComputeTypeManaged EndpointComputeType = "Managed" +) + +// PossibleEndpointComputeTypeValues returns the possible values for the EndpointComputeType const type. +func PossibleEndpointComputeTypeValues() []EndpointComputeType { + return []EndpointComputeType{ + EndpointComputeTypeAzureMLCompute, + EndpointComputeTypeKubernetes, + EndpointComputeTypeManaged, + } +} + +// EndpointProvisioningState - State of endpoint provisioning. +type EndpointProvisioningState string + +const ( + EndpointProvisioningStateCanceled EndpointProvisioningState = "Canceled" + EndpointProvisioningStateCreating EndpointProvisioningState = "Creating" + EndpointProvisioningStateDeleting EndpointProvisioningState = "Deleting" + EndpointProvisioningStateFailed EndpointProvisioningState = "Failed" + EndpointProvisioningStateSucceeded EndpointProvisioningState = "Succeeded" + EndpointProvisioningStateUpdating EndpointProvisioningState = "Updating" +) + +// PossibleEndpointProvisioningStateValues returns the possible values for the EndpointProvisioningState const type. +func PossibleEndpointProvisioningStateValues() []EndpointProvisioningState { + return []EndpointProvisioningState{ + EndpointProvisioningStateCanceled, + EndpointProvisioningStateCreating, + EndpointProvisioningStateDeleting, + EndpointProvisioningStateFailed, + EndpointProvisioningStateSucceeded, + EndpointProvisioningStateUpdating, + } +} + +// EnvironmentType - Environment type is either user created or curated by Azure ML service +type EnvironmentType string + +const ( + EnvironmentTypeCurated EnvironmentType = "Curated" + EnvironmentTypeUserCreated EnvironmentType = "UserCreated" +) + +// PossibleEnvironmentTypeValues returns the possible values for the EnvironmentType const type. +func PossibleEnvironmentTypeValues() []EnvironmentType { + return []EnvironmentType{ + EnvironmentTypeCurated, + EnvironmentTypeUserCreated, + } +} + +// Goal - Defines supported metric goals for hyperparameter tuning +type Goal string + +const ( + GoalMaximize Goal = "Maximize" + GoalMinimize Goal = "Minimize" +) + +// PossibleGoalValues returns the possible values for the Goal const type. +func PossibleGoalValues() []Goal { + return []Goal{ + GoalMaximize, + GoalMinimize, + } +} + +// IdentityConfigurationType - Enum to determine identity framework. +type IdentityConfigurationType string + +const ( + IdentityConfigurationTypeAMLToken IdentityConfigurationType = "AMLToken" + IdentityConfigurationTypeManaged IdentityConfigurationType = "Managed" + IdentityConfigurationTypeUserIdentity IdentityConfigurationType = "UserIdentity" +) + +// PossibleIdentityConfigurationTypeValues returns the possible values for the IdentityConfigurationType const type. +func PossibleIdentityConfigurationTypeValues() []IdentityConfigurationType { + return []IdentityConfigurationType{ + IdentityConfigurationTypeAMLToken, + IdentityConfigurationTypeManaged, + IdentityConfigurationTypeUserIdentity, + } +} + +// InputDeliveryMode - Enum to determine the input data delivery mode. +type InputDeliveryMode string + +const ( + InputDeliveryModeDirect InputDeliveryMode = "Direct" + InputDeliveryModeDownload InputDeliveryMode = "Download" + InputDeliveryModeEvalDownload InputDeliveryMode = "EvalDownload" + InputDeliveryModeEvalMount InputDeliveryMode = "EvalMount" + InputDeliveryModeReadOnlyMount InputDeliveryMode = "ReadOnlyMount" + InputDeliveryModeReadWriteMount InputDeliveryMode = "ReadWriteMount" +) + +// PossibleInputDeliveryModeValues returns the possible values for the InputDeliveryMode const type. +func PossibleInputDeliveryModeValues() []InputDeliveryMode { + return []InputDeliveryMode{ + InputDeliveryModeDirect, + InputDeliveryModeDownload, + InputDeliveryModeEvalDownload, + InputDeliveryModeEvalMount, + InputDeliveryModeReadOnlyMount, + InputDeliveryModeReadWriteMount, + } +} + +// JobInputType - Enum to determine the Job Input Type. +type JobInputType string + +const ( + JobInputTypeCustomModel JobInputType = "custom_model" + JobInputTypeLiteral JobInputType = "literal" + JobInputTypeMlflowModel JobInputType = "mlflow_model" + JobInputTypeMltable JobInputType = "mltable" + JobInputTypeTritonModel JobInputType = "triton_model" + JobInputTypeURIFile JobInputType = "uri_file" + JobInputTypeURIFolder JobInputType = "uri_folder" +) + +// PossibleJobInputTypeValues returns the possible values for the JobInputType const type. +func PossibleJobInputTypeValues() []JobInputType { + return []JobInputType{ + JobInputTypeCustomModel, + JobInputTypeLiteral, + JobInputTypeMlflowModel, + JobInputTypeMltable, + JobInputTypeTritonModel, + JobInputTypeURIFile, + JobInputTypeURIFolder, + } +} + +type JobLimitsType string + +const ( + JobLimitsTypeCommand JobLimitsType = "Command" + JobLimitsTypeSweep JobLimitsType = "Sweep" +) + +// PossibleJobLimitsTypeValues returns the possible values for the JobLimitsType const type. +func PossibleJobLimitsTypeValues() []JobLimitsType { + return []JobLimitsType{ + JobLimitsTypeCommand, + JobLimitsTypeSweep, + } +} + +// JobOutputType - Enum to determine the Job Output Type. +type JobOutputType string + +const ( + JobOutputTypeCustomModel JobOutputType = "custom_model" + JobOutputTypeMlflowModel JobOutputType = "mlflow_model" + JobOutputTypeMltable JobOutputType = "mltable" + JobOutputTypeTritonModel JobOutputType = "triton_model" + JobOutputTypeURIFile JobOutputType = "uri_file" + JobOutputTypeURIFolder JobOutputType = "uri_folder" +) + +// PossibleJobOutputTypeValues returns the possible values for the JobOutputType const type. +func PossibleJobOutputTypeValues() []JobOutputType { + return []JobOutputType{ + JobOutputTypeCustomModel, + JobOutputTypeMlflowModel, + JobOutputTypeMltable, + JobOutputTypeTritonModel, + JobOutputTypeURIFile, + JobOutputTypeURIFolder, + } +} + +// JobStatus - The status of a job. +type JobStatus string + +const ( + // JobStatusCancelRequested - Cancellation has been requested for the job. + JobStatusCancelRequested JobStatus = "CancelRequested" + // JobStatusCanceled - Following cancellation request, the job is now successfully canceled. + JobStatusCanceled JobStatus = "Canceled" + // JobStatusCompleted - Job completed successfully. This reflects that both the job itself and output collection states completed + // successfully + JobStatusCompleted JobStatus = "Completed" + // JobStatusFailed - Job failed. + JobStatusFailed JobStatus = "Failed" + // JobStatusFinalizing - Job is completed in the target. It is in output collection state now. + JobStatusFinalizing JobStatus = "Finalizing" + // JobStatusNotResponding - When heartbeat is enabled, if the run isn't updating any information to RunHistory then the run + // goes to NotResponding state. + // NotResponding is the only state that is exempt from strict transition orders. A run can go from NotResponding to any of + // the previous states. + JobStatusNotResponding JobStatus = "NotResponding" + // JobStatusNotStarted - Run hasn't started yet. + JobStatusNotStarted JobStatus = "NotStarted" + // JobStatusPaused - The job is paused by users. Some adjustment to labeling jobs can be made only in paused state. + JobStatusPaused JobStatus = "Paused" + // JobStatusPreparing - The run environment is being prepared. + JobStatusPreparing JobStatus = "Preparing" + // JobStatusProvisioning - (Not used currently) It will be used if ES is creating the compute target. + JobStatusProvisioning JobStatus = "Provisioning" + // JobStatusQueued - The job is queued in the compute target. For example, in BatchAI the job is in queued state, while waiting + // for all required nodes to be ready. + JobStatusQueued JobStatus = "Queued" + // JobStatusRunning - The job started to run in the compute target. + JobStatusRunning JobStatus = "Running" + // JobStatusStarting - Run has started. The user has a run ID. + JobStatusStarting JobStatus = "Starting" + // JobStatusUnknown - Default job status if not mapped to all other statuses + JobStatusUnknown JobStatus = "Unknown" +) + +// PossibleJobStatusValues returns the possible values for the JobStatus const type. +func PossibleJobStatusValues() []JobStatus { + return []JobStatus{ + JobStatusCancelRequested, + JobStatusCanceled, + JobStatusCompleted, + JobStatusFailed, + JobStatusFinalizing, + JobStatusNotResponding, + JobStatusNotStarted, + JobStatusPaused, + JobStatusPreparing, + JobStatusProvisioning, + JobStatusQueued, + JobStatusRunning, + JobStatusStarting, + JobStatusUnknown, + } +} + +// JobType - Enum to determine the type of job. +type JobType string + +const ( + JobTypeCommand JobType = "Command" + JobTypePipeline JobType = "Pipeline" + JobTypeSweep JobType = "Sweep" +) + +// PossibleJobTypeValues returns the possible values for the JobType const type. +func PossibleJobTypeValues() []JobType { + return []JobType{ + JobTypeCommand, + JobTypePipeline, + JobTypeSweep, + } +} + +type KeyType string + +const ( + KeyTypePrimary KeyType = "Primary" + KeyTypeSecondary KeyType = "Secondary" +) + +// PossibleKeyTypeValues returns the possible values for the KeyType const type. +func PossibleKeyTypeValues() []KeyType { + return []KeyType{ + KeyTypePrimary, + KeyTypeSecondary, + } +} + +type ListViewType string + +const ( + ListViewTypeActiveOnly ListViewType = "ActiveOnly" + ListViewTypeAll ListViewType = "All" + ListViewTypeArchivedOnly ListViewType = "ArchivedOnly" +) + +// PossibleListViewTypeValues returns the possible values for the ListViewType const type. +func PossibleListViewTypeValues() []ListViewType { + return []ListViewType{ + ListViewTypeActiveOnly, + ListViewTypeAll, + ListViewTypeArchivedOnly, + } +} + +// LoadBalancerType - Load Balancer Type +type LoadBalancerType string + +const ( + LoadBalancerTypeInternalLoadBalancer LoadBalancerType = "InternalLoadBalancer" + LoadBalancerTypePublicIP LoadBalancerType = "PublicIp" +) + +// PossibleLoadBalancerTypeValues returns the possible values for the LoadBalancerType const type. +func PossibleLoadBalancerTypeValues() []LoadBalancerType { + return []LoadBalancerType{ + LoadBalancerTypeInternalLoadBalancer, + LoadBalancerTypePublicIP, + } +} + +// ManagedServiceIdentityType - Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). +type ManagedServiceIdentityType string + +const ( + ManagedServiceIdentityTypeNone ManagedServiceIdentityType = "None" + ManagedServiceIdentityTypeSystemAssigned ManagedServiceIdentityType = "SystemAssigned" + ManagedServiceIdentityTypeSystemAssignedUserAssigned ManagedServiceIdentityType = "SystemAssigned,UserAssigned" + ManagedServiceIdentityTypeUserAssigned ManagedServiceIdentityType = "UserAssigned" +) + +// PossibleManagedServiceIdentityTypeValues returns the possible values for the ManagedServiceIdentityType const type. +func PossibleManagedServiceIdentityTypeValues() []ManagedServiceIdentityType { + return []ManagedServiceIdentityType{ + ManagedServiceIdentityTypeNone, + ManagedServiceIdentityTypeSystemAssigned, + ManagedServiceIdentityTypeSystemAssignedUserAssigned, + ManagedServiceIdentityTypeUserAssigned, + } +} + +// MountAction - Mount Action. +type MountAction string + +const ( + MountActionMount MountAction = "Mount" + MountActionUnmount MountAction = "Unmount" +) + +// PossibleMountActionValues returns the possible values for the MountAction const type. +func PossibleMountActionValues() []MountAction { + return []MountAction{ + MountActionMount, + MountActionUnmount, + } +} + +// MountState - Mount state. +type MountState string + +const ( + MountStateMountFailed MountState = "MountFailed" + MountStateMountRequested MountState = "MountRequested" + MountStateMounted MountState = "Mounted" + MountStateUnmountFailed MountState = "UnmountFailed" + MountStateUnmountRequested MountState = "UnmountRequested" + MountStateUnmounted MountState = "Unmounted" +) + +// PossibleMountStateValues returns the possible values for the MountState const type. +func PossibleMountStateValues() []MountState { + return []MountState{ + MountStateMountFailed, + MountStateMountRequested, + MountStateMounted, + MountStateUnmountFailed, + MountStateUnmountRequested, + MountStateUnmounted, + } +} + +// Network - network of this container. +type Network string + +const ( + NetworkBridge Network = "Bridge" + NetworkHost Network = "Host" +) + +// PossibleNetworkValues returns the possible values for the Network const type. +func PossibleNetworkValues() []Network { + return []Network{ + NetworkBridge, + NetworkHost, + } +} + +// NodeState - State of the compute node. Values are idle, running, preparing, unusable, leaving and preempted. +type NodeState string + +const ( + NodeStateIdle NodeState = "idle" + NodeStateLeaving NodeState = "leaving" + NodeStatePreempted NodeState = "preempted" + NodeStatePreparing NodeState = "preparing" + NodeStateRunning NodeState = "running" + NodeStateUnusable NodeState = "unusable" +) + +// PossibleNodeStateValues returns the possible values for the NodeState const type. +func PossibleNodeStateValues() []NodeState { + return []NodeState{ + NodeStateIdle, + NodeStateLeaving, + NodeStatePreempted, + NodeStatePreparing, + NodeStateRunning, + NodeStateUnusable, + } +} + +// OperatingSystemType - The type of operating system. +type OperatingSystemType string + +const ( + OperatingSystemTypeLinux OperatingSystemType = "Linux" + OperatingSystemTypeWindows OperatingSystemType = "Windows" +) + +// PossibleOperatingSystemTypeValues returns the possible values for the OperatingSystemType const type. +func PossibleOperatingSystemTypeValues() []OperatingSystemType { + return []OperatingSystemType{ + OperatingSystemTypeLinux, + OperatingSystemTypeWindows, + } +} + +// OperationName - Name of the last operation. +type OperationName string + +const ( + OperationNameCreate OperationName = "Create" + OperationNameDelete OperationName = "Delete" + OperationNameReimage OperationName = "Reimage" + OperationNameRestart OperationName = "Restart" + OperationNameStart OperationName = "Start" + OperationNameStop OperationName = "Stop" +) + +// PossibleOperationNameValues returns the possible values for the OperationName const type. +func PossibleOperationNameValues() []OperationName { + return []OperationName{ + OperationNameCreate, + OperationNameDelete, + OperationNameReimage, + OperationNameRestart, + OperationNameStart, + OperationNameStop, + } +} + +// OperationStatus - Operation status. +type OperationStatus string + +const ( + OperationStatusCreateFailed OperationStatus = "CreateFailed" + OperationStatusDeleteFailed OperationStatus = "DeleteFailed" + OperationStatusInProgress OperationStatus = "InProgress" + OperationStatusReimageFailed OperationStatus = "ReimageFailed" + OperationStatusRestartFailed OperationStatus = "RestartFailed" + OperationStatusStartFailed OperationStatus = "StartFailed" + OperationStatusStopFailed OperationStatus = "StopFailed" + OperationStatusSucceeded OperationStatus = "Succeeded" +) + +// PossibleOperationStatusValues returns the possible values for the OperationStatus const type. +func PossibleOperationStatusValues() []OperationStatus { + return []OperationStatus{ + OperationStatusCreateFailed, + OperationStatusDeleteFailed, + OperationStatusInProgress, + OperationStatusReimageFailed, + OperationStatusRestartFailed, + OperationStatusStartFailed, + OperationStatusStopFailed, + OperationStatusSucceeded, + } +} + +// OperationTrigger - Trigger of operation. +type OperationTrigger string + +const ( + OperationTriggerIdleShutdown OperationTrigger = "IdleShutdown" + OperationTriggerSchedule OperationTrigger = "Schedule" + OperationTriggerUser OperationTrigger = "User" +) + +// PossibleOperationTriggerValues returns the possible values for the OperationTrigger const type. +func PossibleOperationTriggerValues() []OperationTrigger { + return []OperationTrigger{ + OperationTriggerIdleShutdown, + OperationTriggerSchedule, + OperationTriggerUser, + } +} + +type OrderString string + +const ( + OrderStringCreatedAtAsc OrderString = "CreatedAtAsc" + OrderStringCreatedAtDesc OrderString = "CreatedAtDesc" + OrderStringUpdatedAtAsc OrderString = "UpdatedAtAsc" + OrderStringUpdatedAtDesc OrderString = "UpdatedAtDesc" +) + +// PossibleOrderStringValues returns the possible values for the OrderString const type. +func PossibleOrderStringValues() []OrderString { + return []OrderString{ + OrderStringCreatedAtAsc, + OrderStringCreatedAtDesc, + OrderStringUpdatedAtAsc, + OrderStringUpdatedAtDesc, + } +} + +// OsType - Compute OS Type +type OsType string + +const ( + OsTypeLinux OsType = "Linux" + OsTypeWindows OsType = "Windows" +) + +// PossibleOsTypeValues returns the possible values for the OsType const type. +func PossibleOsTypeValues() []OsType { + return []OsType{ + OsTypeLinux, + OsTypeWindows, + } +} + +// OutputDeliveryMode - Output data delivery mode enums. +type OutputDeliveryMode string + +const ( + OutputDeliveryModeReadWriteMount OutputDeliveryMode = "ReadWriteMount" + OutputDeliveryModeUpload OutputDeliveryMode = "Upload" +) + +// PossibleOutputDeliveryModeValues returns the possible values for the OutputDeliveryMode const type. +func PossibleOutputDeliveryModeValues() []OutputDeliveryMode { + return []OutputDeliveryMode{ + OutputDeliveryModeReadWriteMount, + OutputDeliveryModeUpload, + } +} + +// 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" + PrivateEndpointServiceConnectionStatusDisconnected PrivateEndpointServiceConnectionStatus = "Disconnected" + PrivateEndpointServiceConnectionStatusPending PrivateEndpointServiceConnectionStatus = "Pending" + PrivateEndpointServiceConnectionStatusRejected PrivateEndpointServiceConnectionStatus = "Rejected" + PrivateEndpointServiceConnectionStatusTimeout PrivateEndpointServiceConnectionStatus = "Timeout" +) + +// PossiblePrivateEndpointServiceConnectionStatusValues returns the possible values for the PrivateEndpointServiceConnectionStatus const type. +func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointServiceConnectionStatus { + return []PrivateEndpointServiceConnectionStatus{ + PrivateEndpointServiceConnectionStatusApproved, + PrivateEndpointServiceConnectionStatusDisconnected, + PrivateEndpointServiceConnectionStatusPending, + PrivateEndpointServiceConnectionStatusRejected, + PrivateEndpointServiceConnectionStatusTimeout, + } +} + +// ProvisioningState - The current deployment state of workspace resource. The provisioningState is to indicate states for +// resource provisioning. +type ProvisioningState string + +const ( + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateCreating ProvisioningState = "Creating" + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUnknown ProvisioningState = "Unknown" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +// PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{ + ProvisioningStateCanceled, + ProvisioningStateCreating, + ProvisioningStateDeleting, + ProvisioningStateFailed, + ProvisioningStateSucceeded, + ProvisioningStateUnknown, + ProvisioningStateUpdating, + } +} + +// ProvisioningStatus - The current deployment state of schedule. +type ProvisioningStatus string + +const ( + ProvisioningStatusCompleted ProvisioningStatus = "Completed" + ProvisioningStatusFailed ProvisioningStatus = "Failed" + ProvisioningStatusProvisioning ProvisioningStatus = "Provisioning" +) + +// PossibleProvisioningStatusValues returns the possible values for the ProvisioningStatus const type. +func PossibleProvisioningStatusValues() []ProvisioningStatus { + return []ProvisioningStatus{ + ProvisioningStatusCompleted, + ProvisioningStatusFailed, + ProvisioningStatusProvisioning, + } +} + +// PublicNetworkAccess - Whether requests from Public Network are allowed. +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, + } +} + +// QuotaUnit - An enum describing the unit of quota measurement. +type QuotaUnit string + +const ( + QuotaUnitCount QuotaUnit = "Count" +) + +// PossibleQuotaUnitValues returns the possible values for the QuotaUnit const type. +func PossibleQuotaUnitValues() []QuotaUnit { + return []QuotaUnit{ + QuotaUnitCount, + } +} + +// RandomSamplingAlgorithmRule - The specific type of random algorithm +type RandomSamplingAlgorithmRule string + +const ( + RandomSamplingAlgorithmRuleRandom RandomSamplingAlgorithmRule = "Random" + RandomSamplingAlgorithmRuleSobol RandomSamplingAlgorithmRule = "Sobol" +) + +// PossibleRandomSamplingAlgorithmRuleValues returns the possible values for the RandomSamplingAlgorithmRule const type. +func PossibleRandomSamplingAlgorithmRuleValues() []RandomSamplingAlgorithmRule { + return []RandomSamplingAlgorithmRule{ + RandomSamplingAlgorithmRuleRandom, + RandomSamplingAlgorithmRuleSobol, + } +} + +// ReferenceType - Enum to determine which reference method to use for an asset. +type ReferenceType string + +const ( + ReferenceTypeDataPath ReferenceType = "DataPath" + ReferenceTypeID ReferenceType = "Id" + ReferenceTypeOutputPath ReferenceType = "OutputPath" +) + +// PossibleReferenceTypeValues returns the possible values for the ReferenceType const type. +func PossibleReferenceTypeValues() []ReferenceType { + return []ReferenceType{ + ReferenceTypeDataPath, + ReferenceTypeID, + ReferenceTypeOutputPath, + } +} + +// RemoteLoginPortPublicAccess - State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh +// port is closed on all nodes of the cluster. Enabled - Indicates that the public ssh port is open on all +// nodes of the cluster. NotSpecified - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is +// defined, else is open all public nodes. It can be default only during cluster +// creation time, after creation it will be either enabled or disabled. +type RemoteLoginPortPublicAccess string + +const ( + RemoteLoginPortPublicAccessDisabled RemoteLoginPortPublicAccess = "Disabled" + RemoteLoginPortPublicAccessEnabled RemoteLoginPortPublicAccess = "Enabled" + RemoteLoginPortPublicAccessNotSpecified RemoteLoginPortPublicAccess = "NotSpecified" +) + +// PossibleRemoteLoginPortPublicAccessValues returns the possible values for the RemoteLoginPortPublicAccess const type. +func PossibleRemoteLoginPortPublicAccessValues() []RemoteLoginPortPublicAccess { + return []RemoteLoginPortPublicAccess{ + RemoteLoginPortPublicAccessDisabled, + RemoteLoginPortPublicAccessEnabled, + RemoteLoginPortPublicAccessNotSpecified, + } +} + +// SKUScaleType - Node scaling setting for the compute sku. +type SKUScaleType string + +const ( + // SKUScaleTypeAutomatic - Automatically scales node count. + SKUScaleTypeAutomatic SKUScaleType = "Automatic" + // SKUScaleTypeManual - Node count scaled upon user request. + SKUScaleTypeManual SKUScaleType = "Manual" + // SKUScaleTypeNone - Fixed set of nodes. + SKUScaleTypeNone SKUScaleType = "None" +) + +// PossibleSKUScaleTypeValues returns the possible values for the SKUScaleType const type. +func PossibleSKUScaleTypeValues() []SKUScaleType { + return []SKUScaleType{ + SKUScaleTypeAutomatic, + SKUScaleTypeManual, + SKUScaleTypeNone, + } +} + +// 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 ( + SKUTierFree SKUTier = "Free" + SKUTierBasic SKUTier = "Basic" + SKUTierStandard SKUTier = "Standard" + SKUTierPremium SKUTier = "Premium" +) + +// PossibleSKUTierValues returns the possible values for the SKUTier const type. +func PossibleSKUTierValues() []SKUTier { + return []SKUTier{ + SKUTierFree, + SKUTierBasic, + SKUTierStandard, + SKUTierPremium, + } +} + +// SSHPublicAccess - State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed +// on this instance. Enabled - Indicates that the public ssh port is open and accessible +// according to the VNet/subnet policy if applicable. +type SSHPublicAccess string + +const ( + SSHPublicAccessDisabled SSHPublicAccess = "Disabled" + SSHPublicAccessEnabled SSHPublicAccess = "Enabled" +) + +// PossibleSSHPublicAccessValues returns the possible values for the SSHPublicAccess const type. +func PossibleSSHPublicAccessValues() []SSHPublicAccess { + return []SSHPublicAccess{ + SSHPublicAccessDisabled, + SSHPublicAccessEnabled, + } +} + +// SSLConfigStatus - Enable or disable ssl for scoring +type SSLConfigStatus string + +const ( + SSLConfigStatusAuto SSLConfigStatus = "Auto" + SSLConfigStatusDisabled SSLConfigStatus = "Disabled" + SSLConfigStatusEnabled SSLConfigStatus = "Enabled" +) + +// PossibleSSLConfigStatusValues returns the possible values for the SSLConfigStatus const type. +func PossibleSSLConfigStatusValues() []SSLConfigStatus { + return []SSLConfigStatus{ + SSLConfigStatusAuto, + SSLConfigStatusDisabled, + SSLConfigStatusEnabled, + } +} + +type SamplingAlgorithmType string + +const ( + SamplingAlgorithmTypeBayesian SamplingAlgorithmType = "Bayesian" + SamplingAlgorithmTypeGrid SamplingAlgorithmType = "Grid" + SamplingAlgorithmTypeRandom SamplingAlgorithmType = "Random" +) + +// PossibleSamplingAlgorithmTypeValues returns the possible values for the SamplingAlgorithmType const type. +func PossibleSamplingAlgorithmTypeValues() []SamplingAlgorithmType { + return []SamplingAlgorithmType{ + SamplingAlgorithmTypeBayesian, + SamplingAlgorithmTypeGrid, + SamplingAlgorithmTypeRandom, + } +} + +type ScaleType string + +const ( + ScaleTypeDefault ScaleType = "Default" + ScaleTypeTargetUtilization ScaleType = "TargetUtilization" +) + +// PossibleScaleTypeValues returns the possible values for the ScaleType const type. +func PossibleScaleTypeValues() []ScaleType { + return []ScaleType{ + ScaleTypeDefault, + ScaleTypeTargetUtilization, + } +} + +type ScheduleProvisioningState string + +const ( + ScheduleProvisioningStateCompleted ScheduleProvisioningState = "Completed" + ScheduleProvisioningStateFailed ScheduleProvisioningState = "Failed" + ScheduleProvisioningStateProvisioning ScheduleProvisioningState = "Provisioning" +) + +// PossibleScheduleProvisioningStateValues returns the possible values for the ScheduleProvisioningState const type. +func PossibleScheduleProvisioningStateValues() []ScheduleProvisioningState { + return []ScheduleProvisioningState{ + ScheduleProvisioningStateCompleted, + ScheduleProvisioningStateFailed, + ScheduleProvisioningStateProvisioning, + } +} + +type ScheduleStatus string + +const ( + ScheduleStatusDisabled ScheduleStatus = "Disabled" + ScheduleStatusEnabled ScheduleStatus = "Enabled" +) + +// PossibleScheduleStatusValues returns the possible values for the ScheduleStatus const type. +func PossibleScheduleStatusValues() []ScheduleStatus { + return []ScheduleStatus{ + ScheduleStatusDisabled, + ScheduleStatusEnabled, + } +} + +// SecretsType - Enum to determine the datastore secrets type. +type SecretsType string + +const ( + SecretsTypeAccountKey SecretsType = "AccountKey" + SecretsTypeCertificate SecretsType = "Certificate" + SecretsTypeSas SecretsType = "Sas" + SecretsTypeServicePrincipal SecretsType = "ServicePrincipal" +) + +// PossibleSecretsTypeValues returns the possible values for the SecretsType const type. +func PossibleSecretsTypeValues() []SecretsType { + return []SecretsType{ + SecretsTypeAccountKey, + SecretsTypeCertificate, + SecretsTypeSas, + SecretsTypeServicePrincipal, + } +} + +type ServiceDataAccessAuthIdentity string + +const ( + // ServiceDataAccessAuthIdentityNone - Do not use any identity for service data access. + ServiceDataAccessAuthIdentityNone ServiceDataAccessAuthIdentity = "None" + // ServiceDataAccessAuthIdentityWorkspaceSystemAssignedIdentity - Use the system assigned managed identity of the Workspace + // to authenticate service data access. + ServiceDataAccessAuthIdentityWorkspaceSystemAssignedIdentity ServiceDataAccessAuthIdentity = "WorkspaceSystemAssignedIdentity" + // ServiceDataAccessAuthIdentityWorkspaceUserAssignedIdentity - Use the user assigned managed identity of the Workspace to + // authenticate service data access. + ServiceDataAccessAuthIdentityWorkspaceUserAssignedIdentity ServiceDataAccessAuthIdentity = "WorkspaceUserAssignedIdentity" +) + +// PossibleServiceDataAccessAuthIdentityValues returns the possible values for the ServiceDataAccessAuthIdentity const type. +func PossibleServiceDataAccessAuthIdentityValues() []ServiceDataAccessAuthIdentity { + return []ServiceDataAccessAuthIdentity{ + ServiceDataAccessAuthIdentityNone, + ServiceDataAccessAuthIdentityWorkspaceSystemAssignedIdentity, + ServiceDataAccessAuthIdentityWorkspaceUserAssignedIdentity, + } +} + +// SourceType - Data source type. +type SourceType string + +const ( + SourceTypeDataset SourceType = "Dataset" + SourceTypeDatastore SourceType = "Datastore" + SourceTypeURI SourceType = "URI" +) + +// PossibleSourceTypeValues returns the possible values for the SourceType const type. +func PossibleSourceTypeValues() []SourceType { + return []SourceType{ + SourceTypeDataset, + SourceTypeDatastore, + SourceTypeURI, + } +} + +// Status - Status of update workspace quota. +type Status string + +const ( + StatusFailure Status = "Failure" + StatusInvalidQuotaBelowClusterMinimum Status = "InvalidQuotaBelowClusterMinimum" + StatusInvalidQuotaExceedsSubscriptionLimit Status = "InvalidQuotaExceedsSubscriptionLimit" + StatusInvalidVMFamilyName Status = "InvalidVMFamilyName" + StatusOperationNotEnabledForRegion Status = "OperationNotEnabledForRegion" + StatusOperationNotSupportedForSKU Status = "OperationNotSupportedForSku" + StatusSuccess Status = "Success" + StatusUndefined Status = "Undefined" +) + +// PossibleStatusValues returns the possible values for the Status const type. +func PossibleStatusValues() []Status { + return []Status{ + StatusFailure, + StatusInvalidQuotaBelowClusterMinimum, + StatusInvalidQuotaExceedsSubscriptionLimit, + StatusInvalidVMFamilyName, + StatusOperationNotEnabledForRegion, + StatusOperationNotSupportedForSKU, + StatusSuccess, + StatusUndefined, + } +} + +// StorageAccountType - type of this storage account. +type StorageAccountType string + +const ( + StorageAccountTypePremiumLRS StorageAccountType = "Premium_LRS" + StorageAccountTypeStandardLRS StorageAccountType = "Standard_LRS" +) + +// PossibleStorageAccountTypeValues returns the possible values for the StorageAccountType const type. +func PossibleStorageAccountTypeValues() []StorageAccountType { + return []StorageAccountType{ + StorageAccountTypePremiumLRS, + StorageAccountTypeStandardLRS, + } +} + +type UnderlyingResourceAction string + +const ( + UnderlyingResourceActionDelete UnderlyingResourceAction = "Delete" + UnderlyingResourceActionDetach UnderlyingResourceAction = "Detach" +) + +// PossibleUnderlyingResourceActionValues returns the possible values for the UnderlyingResourceAction const type. +func PossibleUnderlyingResourceActionValues() []UnderlyingResourceAction { + return []UnderlyingResourceAction{ + UnderlyingResourceActionDelete, + UnderlyingResourceActionDetach, + } +} + +// UnitOfMeasure - The unit of time measurement for the specified VM price. Example: OneHour +type UnitOfMeasure string + +const ( + UnitOfMeasureOneHour UnitOfMeasure = "OneHour" +) + +// PossibleUnitOfMeasureValues returns the possible values for the UnitOfMeasure const type. +func PossibleUnitOfMeasureValues() []UnitOfMeasure { + return []UnitOfMeasure{ + UnitOfMeasureOneHour, + } +} + +// UsageUnit - An enum describing the unit of usage measurement. +type UsageUnit string + +const ( + UsageUnitCount UsageUnit = "Count" +) + +// PossibleUsageUnitValues returns the possible values for the UsageUnit const type. +func PossibleUsageUnitValues() []UsageUnit { + return []UsageUnit{ + UsageUnitCount, + } +} + +// VMPriceOSType - Operating system type used by the VM. +type VMPriceOSType string + +const ( + VMPriceOSTypeLinux VMPriceOSType = "Linux" + VMPriceOSTypeWindows VMPriceOSType = "Windows" +) + +// PossibleVMPriceOSTypeValues returns the possible values for the VMPriceOSType const type. +func PossibleVMPriceOSTypeValues() []VMPriceOSType { + return []VMPriceOSType{ + VMPriceOSTypeLinux, + VMPriceOSTypeWindows, + } +} + +// VMPriority - Virtual Machine priority +type VMPriority string + +const ( + VMPriorityDedicated VMPriority = "Dedicated" + VMPriorityLowPriority VMPriority = "LowPriority" +) + +// PossibleVMPriorityValues returns the possible values for the VMPriority const type. +func PossibleVMPriorityValues() []VMPriority { + return []VMPriority{ + VMPriorityDedicated, + VMPriorityLowPriority, + } +} + +// VMTier - The type of the VM. +type VMTier string + +const ( + VMTierLowPriority VMTier = "LowPriority" + VMTierSpot VMTier = "Spot" + VMTierStandard VMTier = "Standard" +) + +// PossibleVMTierValues returns the possible values for the VMTier const type. +func PossibleVMTierValues() []VMTier { + return []VMTier{ + VMTierLowPriority, + VMTierSpot, + VMTierStandard, + } +} + +// ValueFormat - format for the workspace connection value +type ValueFormat string + +const ( + ValueFormatJSON ValueFormat = "JSON" +) + +// PossibleValueFormatValues returns the possible values for the ValueFormat const type. +func PossibleValueFormatValues() []ValueFormat { + return []ValueFormat{ + ValueFormatJSON, + } +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_datacontainers_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_datacontainers_client.go new file mode 100644 index 000000000000..47ad6af8ebad --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_datacontainers_client.go @@ -0,0 +1,306 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "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" +) + +// DataContainersClient contains the methods for the DataContainers group. +// Don't use this type directly, use NewDataContainersClient() instead. +type DataContainersClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewDataContainersClient creates a new instance of DataContainersClient 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 NewDataContainersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DataContainersClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &DataContainersClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// CreateOrUpdate - Create or update container. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// name - Container name. +// body - Container entity to create or update. +// options - DataContainersClientCreateOrUpdateOptions contains the optional parameters for the DataContainersClient.CreateOrUpdate +// method. +func (client *DataContainersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, name string, body DataContainer, options *DataContainersClientCreateOrUpdateOptions) (DataContainersClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, name, body, options) + if err != nil { + return DataContainersClientCreateOrUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DataContainersClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return DataContainersClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *DataContainersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, body DataContainer, options *DataContainersClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, body) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *DataContainersClient) createOrUpdateHandleResponse(resp *http.Response) (DataContainersClientCreateOrUpdateResponse, error) { + result := DataContainersClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DataContainer); err != nil { + return DataContainersClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Delete container. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// name - Container name. +// options - DataContainersClientDeleteOptions contains the optional parameters for the DataContainersClient.Delete method. +func (client *DataContainersClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *DataContainersClientDeleteOptions) (DataContainersClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, name, options) + if err != nil { + return DataContainersClientDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DataContainersClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return DataContainersClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return DataContainersClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *DataContainersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *DataContainersClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get container. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// name - Container name. +// options - DataContainersClientGetOptions contains the optional parameters for the DataContainersClient.Get method. +func (client *DataContainersClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *DataContainersClientGetOptions) (DataContainersClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, name, options) + if err != nil { + return DataContainersClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DataContainersClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DataContainersClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *DataContainersClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *DataContainersClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-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 *DataContainersClient) getHandleResponse(resp *http.Response) (DataContainersClientGetResponse, error) { + result := DataContainersClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DataContainer); err != nil { + return DataContainersClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List data containers. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// options - DataContainersClientListOptions contains the optional parameters for the DataContainersClient.List method. +func (client *DataContainersClient) NewListPager(resourceGroupName string, workspaceName string, options *DataContainersClientListOptions) *runtime.Pager[DataContainersClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[DataContainersClientListResponse]{ + More: func(page DataContainersClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *DataContainersClientListResponse) (DataContainersClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return DataContainersClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DataContainersClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DataContainersClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *DataContainersClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *DataContainersClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + if options != nil && options.ListViewType != nil { + reqQP.Set("listViewType", string(*options.ListViewType)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *DataContainersClient) listHandleResponse(resp *http.Response) (DataContainersClientListResponse, error) { + result := DataContainersClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DataContainerResourceArmPaginatedResult); err != nil { + return DataContainersClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_datastores_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_datastores_client.go new file mode 100644 index 000000000000..0a6ae716793c --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_datastores_client.go @@ -0,0 +1,386 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// DatastoresClient contains the methods for the Datastores group. +// Don't use this type directly, use NewDatastoresClient() instead. +type DatastoresClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewDatastoresClient creates a new instance of DatastoresClient 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 NewDatastoresClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DatastoresClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &DatastoresClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// CreateOrUpdate - Create or update datastore. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// name - Datastore name. +// body - Datastore entity to create or update. +// options - DatastoresClientCreateOrUpdateOptions contains the optional parameters for the DatastoresClient.CreateOrUpdate +// method. +func (client *DatastoresClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, name string, body Datastore, options *DatastoresClientCreateOrUpdateOptions) (DatastoresClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, name, body, options) + if err != nil { + return DatastoresClientCreateOrUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DatastoresClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return DatastoresClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *DatastoresClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, body Datastore, options *DatastoresClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + if options != nil && options.SkipValidation != nil { + reqQP.Set("skipValidation", strconv.FormatBool(*options.SkipValidation)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, body) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *DatastoresClient) createOrUpdateHandleResponse(resp *http.Response) (DatastoresClientCreateOrUpdateResponse, error) { + result := DatastoresClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Datastore); err != nil { + return DatastoresClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Delete datastore. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// name - Datastore name. +// options - DatastoresClientDeleteOptions contains the optional parameters for the DatastoresClient.Delete method. +func (client *DatastoresClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *DatastoresClientDeleteOptions) (DatastoresClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, name, options) + if err != nil { + return DatastoresClientDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DatastoresClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return DatastoresClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return DatastoresClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *DatastoresClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *DatastoresClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get datastore. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// name - Datastore name. +// options - DatastoresClientGetOptions contains the optional parameters for the DatastoresClient.Get method. +func (client *DatastoresClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *DatastoresClientGetOptions) (DatastoresClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, name, options) + if err != nil { + return DatastoresClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DatastoresClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DatastoresClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *DatastoresClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *DatastoresClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-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 *DatastoresClient) getHandleResponse(resp *http.Response) (DatastoresClientGetResponse, error) { + result := DatastoresClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Datastore); err != nil { + return DatastoresClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List datastores. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// options - DatastoresClientListOptions contains the optional parameters for the DatastoresClient.List method. +func (client *DatastoresClient) NewListPager(resourceGroupName string, workspaceName string, options *DatastoresClientListOptions) *runtime.Pager[DatastoresClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[DatastoresClientListResponse]{ + More: func(page DatastoresClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *DatastoresClientListResponse) (DatastoresClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return DatastoresClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DatastoresClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DatastoresClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *DatastoresClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *DatastoresClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + if options != nil && options.Count != nil { + reqQP.Set("count", strconv.FormatInt(int64(*options.Count), 10)) + } + if options != nil && options.IsDefault != nil { + reqQP.Set("isDefault", strconv.FormatBool(*options.IsDefault)) + } + if options != nil && options.Names != nil { + reqQP.Set("names", strings.Join(options.Names, ",")) + } + if options != nil && options.SearchText != nil { + reqQP.Set("searchText", *options.SearchText) + } + if options != nil && options.OrderBy != nil { + reqQP.Set("orderBy", *options.OrderBy) + } + if options != nil && options.OrderByAsc != nil { + reqQP.Set("orderByAsc", strconv.FormatBool(*options.OrderByAsc)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *DatastoresClient) listHandleResponse(resp *http.Response) (DatastoresClientListResponse, error) { + result := DatastoresClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DatastoreResourceArmPaginatedResult); err != nil { + return DatastoresClientListResponse{}, err + } + return result, nil +} + +// ListSecrets - Get datastore secrets. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// name - Datastore name. +// options - DatastoresClientListSecretsOptions contains the optional parameters for the DatastoresClient.ListSecrets method. +func (client *DatastoresClient) ListSecrets(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *DatastoresClientListSecretsOptions) (DatastoresClientListSecretsResponse, error) { + req, err := client.listSecretsCreateRequest(ctx, resourceGroupName, workspaceName, name, options) + if err != nil { + return DatastoresClientListSecretsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DatastoresClientListSecretsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DatastoresClientListSecretsResponse{}, runtime.NewResponseError(resp) + } + return client.listSecretsHandleResponse(resp) +} + +// listSecretsCreateRequest creates the ListSecrets request. +func (client *DatastoresClient) listSecretsCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *DatastoresClientListSecretsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listSecretsHandleResponse handles the ListSecrets response. +func (client *DatastoresClient) listSecretsHandleResponse(resp *http.Response) (DatastoresClientListSecretsResponse, error) { + result := DatastoresClientListSecretsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result); err != nil { + return DatastoresClientListSecretsResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_dataversions_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_dataversions_client.go new file mode 100644 index 000000000000..de206ed0be8e --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_dataversions_client.go @@ -0,0 +1,336 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// DataVersionsClient contains the methods for the DataVersions group. +// Don't use this type directly, use NewDataVersionsClient() instead. +type DataVersionsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewDataVersionsClient creates a new instance of DataVersionsClient 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 NewDataVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DataVersionsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &DataVersionsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// CreateOrUpdate - Create or update version. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// name - Container name. +// version - Version identifier. +// body - Version entity to create or update. +// options - DataVersionsClientCreateOrUpdateOptions contains the optional parameters for the DataVersionsClient.CreateOrUpdate +// method. +func (client *DataVersionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body DataVersionBase, options *DataVersionsClientCreateOrUpdateOptions) (DataVersionsClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, name, version, body, options) + if err != nil { + return DataVersionsClientCreateOrUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DataVersionsClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return DataVersionsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *DataVersionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body DataVersionBase, options *DataVersionsClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, body) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *DataVersionsClient) createOrUpdateHandleResponse(resp *http.Response) (DataVersionsClientCreateOrUpdateResponse, error) { + result := DataVersionsClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DataVersionBase); err != nil { + return DataVersionsClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Delete version. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// name - Container name. +// version - Version identifier. +// options - DataVersionsClientDeleteOptions contains the optional parameters for the DataVersionsClient.Delete method. +func (client *DataVersionsClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *DataVersionsClientDeleteOptions) (DataVersionsClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, name, version, options) + if err != nil { + return DataVersionsClientDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DataVersionsClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return DataVersionsClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return DataVersionsClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *DataVersionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *DataVersionsClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get version. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// name - Container name. +// version - Version identifier. +// options - DataVersionsClientGetOptions contains the optional parameters for the DataVersionsClient.Get method. +func (client *DataVersionsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *DataVersionsClientGetOptions) (DataVersionsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, name, version, options) + if err != nil { + return DataVersionsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DataVersionsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DataVersionsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *DataVersionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *DataVersionsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-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 *DataVersionsClient) getHandleResponse(resp *http.Response) (DataVersionsClientGetResponse, error) { + result := DataVersionsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DataVersionBase); err != nil { + return DataVersionsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List data versions in the data container +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// name - Data container's name +// options - DataVersionsClientListOptions contains the optional parameters for the DataVersionsClient.List method. +func (client *DataVersionsClient) NewListPager(resourceGroupName string, workspaceName string, name string, options *DataVersionsClientListOptions) *runtime.Pager[DataVersionsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[DataVersionsClientListResponse]{ + More: func(page DataVersionsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *DataVersionsClientListResponse) (DataVersionsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, name, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return DataVersionsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DataVersionsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DataVersionsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *DataVersionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *DataVersionsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + if options != nil && options.OrderBy != nil { + reqQP.Set("$orderBy", *options.OrderBy) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + if options != nil && options.Tags != nil { + reqQP.Set("$tags", *options.Tags) + } + if options != nil && options.ListViewType != nil { + reqQP.Set("listViewType", string(*options.ListViewType)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *DataVersionsClient) listHandleResponse(resp *http.Response) (DataVersionsClientListResponse, error) { + result := DataVersionsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DataVersionBaseResourceArmPaginatedResult); err != nil { + return DataVersionsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_environmentcontainers_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_environmentcontainers_client.go new file mode 100644 index 000000000000..babe01d06c2a --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_environmentcontainers_client.go @@ -0,0 +1,309 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "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" +) + +// EnvironmentContainersClient contains the methods for the EnvironmentContainers group. +// Don't use this type directly, use NewEnvironmentContainersClient() instead. +type EnvironmentContainersClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewEnvironmentContainersClient creates a new instance of EnvironmentContainersClient 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 NewEnvironmentContainersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*EnvironmentContainersClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &EnvironmentContainersClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// CreateOrUpdate - Create or update container. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// name - Container name. This is case-sensitive. +// body - Container entity to create or update. +// options - EnvironmentContainersClientCreateOrUpdateOptions contains the optional parameters for the EnvironmentContainersClient.CreateOrUpdate +// method. +func (client *EnvironmentContainersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, name string, body EnvironmentContainer, options *EnvironmentContainersClientCreateOrUpdateOptions) (EnvironmentContainersClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, name, body, options) + if err != nil { + return EnvironmentContainersClientCreateOrUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return EnvironmentContainersClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return EnvironmentContainersClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *EnvironmentContainersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, body EnvironmentContainer, options *EnvironmentContainersClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, body) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *EnvironmentContainersClient) createOrUpdateHandleResponse(resp *http.Response) (EnvironmentContainersClientCreateOrUpdateResponse, error) { + result := EnvironmentContainersClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.EnvironmentContainer); err != nil { + return EnvironmentContainersClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Delete container. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// name - Container name. This is case-sensitive. +// options - EnvironmentContainersClientDeleteOptions contains the optional parameters for the EnvironmentContainersClient.Delete +// method. +func (client *EnvironmentContainersClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *EnvironmentContainersClientDeleteOptions) (EnvironmentContainersClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, name, options) + if err != nil { + return EnvironmentContainersClientDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return EnvironmentContainersClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return EnvironmentContainersClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return EnvironmentContainersClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *EnvironmentContainersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *EnvironmentContainersClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get container. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// name - Container name. This is case-sensitive. +// options - EnvironmentContainersClientGetOptions contains the optional parameters for the EnvironmentContainersClient.Get +// method. +func (client *EnvironmentContainersClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *EnvironmentContainersClientGetOptions) (EnvironmentContainersClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, name, options) + if err != nil { + return EnvironmentContainersClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return EnvironmentContainersClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return EnvironmentContainersClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *EnvironmentContainersClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *EnvironmentContainersClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-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 *EnvironmentContainersClient) getHandleResponse(resp *http.Response) (EnvironmentContainersClientGetResponse, error) { + result := EnvironmentContainersClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.EnvironmentContainer); err != nil { + return EnvironmentContainersClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List environment containers. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// options - EnvironmentContainersClientListOptions contains the optional parameters for the EnvironmentContainersClient.List +// method. +func (client *EnvironmentContainersClient) NewListPager(resourceGroupName string, workspaceName string, options *EnvironmentContainersClientListOptions) *runtime.Pager[EnvironmentContainersClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[EnvironmentContainersClientListResponse]{ + More: func(page EnvironmentContainersClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *EnvironmentContainersClientListResponse) (EnvironmentContainersClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return EnvironmentContainersClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return EnvironmentContainersClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return EnvironmentContainersClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *EnvironmentContainersClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *EnvironmentContainersClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + if options != nil && options.ListViewType != nil { + reqQP.Set("listViewType", string(*options.ListViewType)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *EnvironmentContainersClient) listHandleResponse(resp *http.Response) (EnvironmentContainersClientListResponse, error) { + result := EnvironmentContainersClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.EnvironmentContainerResourceArmPaginatedResult); err != nil { + return EnvironmentContainersClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_environmentversions_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_environmentversions_client.go new file mode 100644 index 000000000000..1874154d6d67 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_environmentversions_client.go @@ -0,0 +1,335 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// EnvironmentVersionsClient contains the methods for the EnvironmentVersions group. +// Don't use this type directly, use NewEnvironmentVersionsClient() instead. +type EnvironmentVersionsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewEnvironmentVersionsClient creates a new instance of EnvironmentVersionsClient 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 NewEnvironmentVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*EnvironmentVersionsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &EnvironmentVersionsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// CreateOrUpdate - Creates or updates an EnvironmentVersion. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// name - Name of EnvironmentVersion. This is case-sensitive. +// version - Version of EnvironmentVersion. +// body - Definition of EnvironmentVersion. +// options - EnvironmentVersionsClientCreateOrUpdateOptions contains the optional parameters for the EnvironmentVersionsClient.CreateOrUpdate +// method. +func (client *EnvironmentVersionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body EnvironmentVersion, options *EnvironmentVersionsClientCreateOrUpdateOptions) (EnvironmentVersionsClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, name, version, body, options) + if err != nil { + return EnvironmentVersionsClientCreateOrUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return EnvironmentVersionsClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return EnvironmentVersionsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *EnvironmentVersionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body EnvironmentVersion, options *EnvironmentVersionsClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, body) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *EnvironmentVersionsClient) createOrUpdateHandleResponse(resp *http.Response) (EnvironmentVersionsClientCreateOrUpdateResponse, error) { + result := EnvironmentVersionsClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.EnvironmentVersion); err != nil { + return EnvironmentVersionsClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Delete version. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// name - Container name. This is case-sensitive. +// version - Version identifier. This is case-sensitive. +// options - EnvironmentVersionsClientDeleteOptions contains the optional parameters for the EnvironmentVersionsClient.Delete +// method. +func (client *EnvironmentVersionsClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *EnvironmentVersionsClientDeleteOptions) (EnvironmentVersionsClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, name, version, options) + if err != nil { + return EnvironmentVersionsClientDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return EnvironmentVersionsClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return EnvironmentVersionsClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return EnvironmentVersionsClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *EnvironmentVersionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *EnvironmentVersionsClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get version. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// name - Container name. This is case-sensitive. +// version - Version identifier. This is case-sensitive. +// options - EnvironmentVersionsClientGetOptions contains the optional parameters for the EnvironmentVersionsClient.Get method. +func (client *EnvironmentVersionsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *EnvironmentVersionsClientGetOptions) (EnvironmentVersionsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, name, version, options) + if err != nil { + return EnvironmentVersionsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return EnvironmentVersionsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return EnvironmentVersionsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *EnvironmentVersionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *EnvironmentVersionsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-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 *EnvironmentVersionsClient) getHandleResponse(resp *http.Response) (EnvironmentVersionsClientGetResponse, error) { + result := EnvironmentVersionsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.EnvironmentVersion); err != nil { + return EnvironmentVersionsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List versions. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// name - Container name. This is case-sensitive. +// options - EnvironmentVersionsClientListOptions contains the optional parameters for the EnvironmentVersionsClient.List +// method. +func (client *EnvironmentVersionsClient) NewListPager(resourceGroupName string, workspaceName string, name string, options *EnvironmentVersionsClientListOptions) *runtime.Pager[EnvironmentVersionsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[EnvironmentVersionsClientListResponse]{ + More: func(page EnvironmentVersionsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *EnvironmentVersionsClientListResponse) (EnvironmentVersionsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, name, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return EnvironmentVersionsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return EnvironmentVersionsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return EnvironmentVersionsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *EnvironmentVersionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *EnvironmentVersionsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + if options != nil && options.OrderBy != nil { + reqQP.Set("$orderBy", *options.OrderBy) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + if options != nil && options.ListViewType != nil { + reqQP.Set("listViewType", string(*options.ListViewType)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *EnvironmentVersionsClient) listHandleResponse(resp *http.Response) (EnvironmentVersionsClientListResponse, error) { + result := EnvironmentVersionsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.EnvironmentVersionResourceArmPaginatedResult); err != nil { + return EnvironmentVersionsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_jobs_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_jobs_client.go new file mode 100644 index 000000000000..836d0b560a82 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_jobs_client.go @@ -0,0 +1,395 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "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" +) + +// JobsClient contains the methods for the Jobs group. +// Don't use this type directly, use NewJobsClient() instead. +type JobsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewJobsClient creates a new instance of JobsClient 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 NewJobsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*JobsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &JobsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// BeginCancel - Cancels a Job (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// id - The name and identifier for the Job. This is case-sensitive. +// options - JobsClientBeginCancelOptions contains the optional parameters for the JobsClient.BeginCancel method. +func (client *JobsClient) BeginCancel(ctx context.Context, resourceGroupName string, workspaceName string, id string, options *JobsClientBeginCancelOptions) (*runtime.Poller[JobsClientCancelResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.cancel(ctx, resourceGroupName, workspaceName, id, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[JobsClientCancelResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[JobsClientCancelResponse](options.ResumeToken, client.pl, nil) + } +} + +// Cancel - Cancels a Job (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +func (client *JobsClient) cancel(ctx context.Context, resourceGroupName string, workspaceName string, id string, options *JobsClientBeginCancelOptions) (*http.Response, error) { + req, err := client.cancelCreateRequest(ctx, resourceGroupName, workspaceName, id, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// cancelCreateRequest creates the Cancel request. +func (client *JobsClient) cancelCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, id string, options *JobsClientBeginCancelOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if id == "" { + return nil, errors.New("parameter id cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{id}", url.PathEscape(id)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// CreateOrUpdate - Creates and executes a Job. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// id - The name and identifier for the Job. This is case-sensitive. +// body - Job definition object. +// options - JobsClientCreateOrUpdateOptions contains the optional parameters for the JobsClient.CreateOrUpdate method. +func (client *JobsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, id string, body JobBase, options *JobsClientCreateOrUpdateOptions) (JobsClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, id, body, options) + if err != nil { + return JobsClientCreateOrUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return JobsClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return JobsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *JobsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, id string, body JobBase, options *JobsClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if id == "" { + return nil, errors.New("parameter id cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{id}", url.PathEscape(id)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, body) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *JobsClient) createOrUpdateHandleResponse(resp *http.Response) (JobsClientCreateOrUpdateResponse, error) { + result := JobsClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.JobBase); err != nil { + return JobsClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// BeginDelete - Deletes a Job (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// id - The name and identifier for the Job. This is case-sensitive. +// options - JobsClientBeginDeleteOptions contains the optional parameters for the JobsClient.BeginDelete method. +func (client *JobsClient) BeginDelete(ctx context.Context, resourceGroupName string, workspaceName string, id string, options *JobsClientBeginDeleteOptions) (*runtime.Poller[JobsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, workspaceName, id, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[JobsClientDeleteResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[JobsClientDeleteResponse](options.ResumeToken, client.pl, nil) + } +} + +// Delete - Deletes a Job (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +func (client *JobsClient) deleteOperation(ctx context.Context, resourceGroupName string, workspaceName string, id string, options *JobsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, id, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *JobsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, id string, options *JobsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if id == "" { + return nil, errors.New("parameter id cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{id}", url.PathEscape(id)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets a Job by name/id. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// id - The name and identifier for the Job. This is case-sensitive. +// options - JobsClientGetOptions contains the optional parameters for the JobsClient.Get method. +func (client *JobsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, id string, options *JobsClientGetOptions) (JobsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, id, options) + if err != nil { + return JobsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return JobsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return JobsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *JobsClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, id string, options *JobsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if id == "" { + return nil, errors.New("parameter id cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{id}", url.PathEscape(id)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-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 *JobsClient) getHandleResponse(resp *http.Response) (JobsClientGetResponse, error) { + result := JobsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.JobBase); err != nil { + return JobsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Lists Jobs in the workspace. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// options - JobsClientListOptions contains the optional parameters for the JobsClient.List method. +func (client *JobsClient) NewListPager(resourceGroupName string, workspaceName string, options *JobsClientListOptions) *runtime.Pager[JobsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[JobsClientListResponse]{ + More: func(page JobsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *JobsClientListResponse) (JobsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return JobsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return JobsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return JobsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *JobsClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *JobsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + if options != nil && options.JobType != nil { + reqQP.Set("jobType", *options.JobType) + } + if options != nil && options.Tag != nil { + reqQP.Set("tag", *options.Tag) + } + if options != nil && options.ListViewType != nil { + reqQP.Set("listViewType", string(*options.ListViewType)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *JobsClient) listHandleResponse(resp *http.Response) (JobsClientListResponse, error) { + result := JobsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.JobBaseResourceArmPaginatedResult); err != nil { + return JobsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_modelcontainers_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_modelcontainers_client.go new file mode 100644 index 000000000000..e7bf36c9a230 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_modelcontainers_client.go @@ -0,0 +1,310 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// ModelContainersClient contains the methods for the ModelContainers group. +// Don't use this type directly, use NewModelContainersClient() instead. +type ModelContainersClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewModelContainersClient creates a new instance of ModelContainersClient 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 NewModelContainersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ModelContainersClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &ModelContainersClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// CreateOrUpdate - Create or update container. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// name - Container name. This is case-sensitive. +// body - Container entity to create or update. +// options - ModelContainersClientCreateOrUpdateOptions contains the optional parameters for the ModelContainersClient.CreateOrUpdate +// method. +func (client *ModelContainersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, name string, body ModelContainer, options *ModelContainersClientCreateOrUpdateOptions) (ModelContainersClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, name, body, options) + if err != nil { + return ModelContainersClientCreateOrUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ModelContainersClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return ModelContainersClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ModelContainersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, body ModelContainer, options *ModelContainersClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, body) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *ModelContainersClient) createOrUpdateHandleResponse(resp *http.Response) (ModelContainersClientCreateOrUpdateResponse, error) { + result := ModelContainersClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ModelContainer); err != nil { + return ModelContainersClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Delete container. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// name - Container name. This is case-sensitive. +// options - ModelContainersClientDeleteOptions contains the optional parameters for the ModelContainersClient.Delete method. +func (client *ModelContainersClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *ModelContainersClientDeleteOptions) (ModelContainersClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, name, options) + if err != nil { + return ModelContainersClientDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ModelContainersClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return ModelContainersClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return ModelContainersClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ModelContainersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *ModelContainersClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get container. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// name - Container name. This is case-sensitive. +// options - ModelContainersClientGetOptions contains the optional parameters for the ModelContainersClient.Get method. +func (client *ModelContainersClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *ModelContainersClientGetOptions) (ModelContainersClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, name, options) + if err != nil { + return ModelContainersClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ModelContainersClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ModelContainersClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ModelContainersClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *ModelContainersClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-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 *ModelContainersClient) getHandleResponse(resp *http.Response) (ModelContainersClientGetResponse, error) { + result := ModelContainersClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ModelContainer); err != nil { + return ModelContainersClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List model containers. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// options - ModelContainersClientListOptions contains the optional parameters for the ModelContainersClient.List method. +func (client *ModelContainersClient) NewListPager(resourceGroupName string, workspaceName string, options *ModelContainersClientListOptions) *runtime.Pager[ModelContainersClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ModelContainersClientListResponse]{ + More: func(page ModelContainersClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ModelContainersClientListResponse) (ModelContainersClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ModelContainersClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ModelContainersClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ModelContainersClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *ModelContainersClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *ModelContainersClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + if options != nil && options.Count != nil { + reqQP.Set("count", strconv.FormatInt(int64(*options.Count), 10)) + } + if options != nil && options.ListViewType != nil { + reqQP.Set("listViewType", string(*options.ListViewType)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ModelContainersClient) listHandleResponse(resp *http.Response) (ModelContainersClientListResponse, error) { + result := ModelContainersClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ModelContainerResourceArmPaginatedResult); err != nil { + return ModelContainersClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_models.go b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_models.go new file mode 100644 index 000000000000..003a9881315b --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_models.go @@ -0,0 +1,6444 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import "time" + +// AKS - A Machine Learning compute based on AKS. +type AKS struct { + // REQUIRED; The type of compute + ComputeType *ComputeType `json:"computeType,omitempty"` + + // The description of the Machine Learning compute. + Description *string `json:"description,omitempty"` + + // Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for authentication. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + + // AKS properties + Properties *AKSSchemaProperties `json:"properties,omitempty"` + + // ARM resource id of the underlying compute + ResourceID *string `json:"resourceId,omitempty"` + + // READ-ONLY; Location for the underlying compute + ComputeLocation *string `json:"computeLocation,omitempty" azure:"ro"` + + // READ-ONLY; The time at which the compute was created. + CreatedOn *time.Time `json:"createdOn,omitempty" azure:"ro"` + + // READ-ONLY; Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning + // service provisioned it if false. + IsAttachedCompute *bool `json:"isAttachedCompute,omitempty" azure:"ro"` + + // READ-ONLY; The time at which the compute was last modified. + ModifiedOn *time.Time `json:"modifiedOn,omitempty" azure:"ro"` + + // READ-ONLY; Errors during provisioning + ProvisioningErrors []*ErrorResponse `json:"provisioningErrors,omitempty" azure:"ro"` + + // READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` +} + +// GetCompute implements the ComputeClassification interface for type AKS. +func (a *AKS) GetCompute() *Compute { + return &Compute{ + ComputeType: a.ComputeType, + ComputeLocation: a.ComputeLocation, + ProvisioningState: a.ProvisioningState, + Description: a.Description, + CreatedOn: a.CreatedOn, + ModifiedOn: a.ModifiedOn, + ResourceID: a.ResourceID, + ProvisioningErrors: a.ProvisioningErrors, + IsAttachedCompute: a.IsAttachedCompute, + DisableLocalAuth: a.DisableLocalAuth, + } +} + +type AKSSchema struct { + // AKS properties + Properties *AKSSchemaProperties `json:"properties,omitempty"` +} + +// AKSSchemaProperties - AKS properties +type AKSSchemaProperties struct { + // Number of agents + AgentCount *int32 `json:"agentCount,omitempty"` + + // Agent virtual machine size + AgentVMSize *string `json:"agentVmSize,omitempty"` + + // AKS networking configuration for vnet + AksNetworkingConfiguration *AksNetworkingConfiguration `json:"aksNetworkingConfiguration,omitempty"` + + // Cluster full qualified domain name + ClusterFqdn *string `json:"clusterFqdn,omitempty"` + + // Intended usage of the cluster + ClusterPurpose *ClusterPurpose `json:"clusterPurpose,omitempty"` + + // Load Balancer Subnet + LoadBalancerSubnet *string `json:"loadBalancerSubnet,omitempty"` + + // Load Balancer Type + LoadBalancerType *LoadBalancerType `json:"loadBalancerType,omitempty"` + + // SSL configuration + SSLConfiguration *SSLConfiguration `json:"sslConfiguration,omitempty"` + + // READ-ONLY; System services + SystemServices []*SystemService `json:"systemServices,omitempty" azure:"ro"` +} + +// AccountKeyDatastoreCredentials - Account key datastore credentials configuration. +type AccountKeyDatastoreCredentials struct { + // REQUIRED; [Required] Credential type used to authentication with storage. + CredentialsType *CredentialsType `json:"credentialsType,omitempty"` + + // REQUIRED; [Required] Storage account secrets. + Secrets *AccountKeyDatastoreSecrets `json:"secrets,omitempty"` +} + +// GetDatastoreCredentials implements the DatastoreCredentialsClassification interface for type AccountKeyDatastoreCredentials. +func (a *AccountKeyDatastoreCredentials) GetDatastoreCredentials() *DatastoreCredentials { + return &DatastoreCredentials{ + CredentialsType: a.CredentialsType, + } +} + +// AccountKeyDatastoreSecrets - Datastore account key secrets. +type AccountKeyDatastoreSecrets struct { + // REQUIRED; [Required] Credential type used to authentication with storage. + SecretsType *SecretsType `json:"secretsType,omitempty"` + + // Storage account key. + Key *string `json:"key,omitempty"` +} + +// GetDatastoreSecrets implements the DatastoreSecretsClassification interface for type AccountKeyDatastoreSecrets. +func (a *AccountKeyDatastoreSecrets) GetDatastoreSecrets() *DatastoreSecrets { + return &DatastoreSecrets{ + SecretsType: a.SecretsType, + } +} + +// AksComputeSecrets - Secrets related to a Machine Learning compute based on AKS. +type AksComputeSecrets struct { + // REQUIRED; The type of compute + ComputeType *ComputeType `json:"computeType,omitempty"` + + // Content of kubeconfig file that can be used to connect to the Kubernetes cluster. + AdminKubeConfig *string `json:"adminKubeConfig,omitempty"` + + // Image registry pull secret. + ImagePullSecretName *string `json:"imagePullSecretName,omitempty"` + + // Content of kubeconfig file that can be used to connect to the Kubernetes cluster. + UserKubeConfig *string `json:"userKubeConfig,omitempty"` +} + +// GetComputeSecrets implements the ComputeSecretsClassification interface for type AksComputeSecrets. +func (a *AksComputeSecrets) GetComputeSecrets() *ComputeSecrets { + return &ComputeSecrets{ + ComputeType: a.ComputeType, + } +} + +// AksComputeSecretsProperties - Properties of AksComputeSecrets +type AksComputeSecretsProperties struct { + // Content of kubeconfig file that can be used to connect to the Kubernetes cluster. + AdminKubeConfig *string `json:"adminKubeConfig,omitempty"` + + // Image registry pull secret. + ImagePullSecretName *string `json:"imagePullSecretName,omitempty"` + + // Content of kubeconfig file that can be used to connect to the Kubernetes cluster. + UserKubeConfig *string `json:"userKubeConfig,omitempty"` +} + +// AksNetworkingConfiguration - Advance configuration for AKS networking +type AksNetworkingConfiguration struct { + // An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified + // in serviceCidr. + DNSServiceIP *string `json:"dnsServiceIP,omitempty"` + + // A CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any Subnet IP ranges or the Kubernetes + // service address range. + DockerBridgeCidr *string `json:"dockerBridgeCidr,omitempty"` + + // A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. + ServiceCidr *string `json:"serviceCidr,omitempty"` + + // Virtual network subnet resource ID the compute nodes belong to + SubnetID *string `json:"subnetId,omitempty"` +} + +// AmlCompute - An Azure Machine Learning compute. +type AmlCompute struct { + // REQUIRED; The type of compute + ComputeType *ComputeType `json:"computeType,omitempty"` + + // The description of the Machine Learning compute. + Description *string `json:"description,omitempty"` + + // Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for authentication. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + + // Properties of AmlCompute + Properties *AmlComputeProperties `json:"properties,omitempty"` + + // ARM resource id of the underlying compute + ResourceID *string `json:"resourceId,omitempty"` + + // READ-ONLY; Location for the underlying compute + ComputeLocation *string `json:"computeLocation,omitempty" azure:"ro"` + + // READ-ONLY; The time at which the compute was created. + CreatedOn *time.Time `json:"createdOn,omitempty" azure:"ro"` + + // READ-ONLY; Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning + // service provisioned it if false. + IsAttachedCompute *bool `json:"isAttachedCompute,omitempty" azure:"ro"` + + // READ-ONLY; The time at which the compute was last modified. + ModifiedOn *time.Time `json:"modifiedOn,omitempty" azure:"ro"` + + // READ-ONLY; Errors during provisioning + ProvisioningErrors []*ErrorResponse `json:"provisioningErrors,omitempty" azure:"ro"` + + // READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` +} + +// GetCompute implements the ComputeClassification interface for type AmlCompute. +func (a *AmlCompute) GetCompute() *Compute { + return &Compute{ + ComputeType: a.ComputeType, + ComputeLocation: a.ComputeLocation, + ProvisioningState: a.ProvisioningState, + Description: a.Description, + CreatedOn: a.CreatedOn, + ModifiedOn: a.ModifiedOn, + ResourceID: a.ResourceID, + ProvisioningErrors: a.ProvisioningErrors, + IsAttachedCompute: a.IsAttachedCompute, + DisableLocalAuth: a.DisableLocalAuth, + } +} + +// AmlComputeNodeInformation - Compute node information related to a AmlCompute. +type AmlComputeNodeInformation struct { + // READ-ONLY; ID of the compute node. + NodeID *string `json:"nodeId,omitempty" azure:"ro"` + + // READ-ONLY; State of the compute node. Values are idle, running, preparing, unusable, leaving and preempted. + NodeState *NodeState `json:"nodeState,omitempty" azure:"ro"` + + // READ-ONLY; SSH port number of the node. + Port *int32 `json:"port,omitempty" azure:"ro"` + + // READ-ONLY; Private IP address of the compute node. + PrivateIPAddress *string `json:"privateIpAddress,omitempty" azure:"ro"` + + // READ-ONLY; Public IP address of the compute node. + PublicIPAddress *string `json:"publicIpAddress,omitempty" azure:"ro"` + + // READ-ONLY; ID of the Experiment running on the node, if any else null. + RunID *string `json:"runId,omitempty" azure:"ro"` +} + +// AmlComputeNodesInformation - Result of AmlCompute Nodes +type AmlComputeNodesInformation struct { + // READ-ONLY; The continuation token. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` + + // READ-ONLY; The collection of returned AmlCompute nodes details. + Nodes []*AmlComputeNodeInformation `json:"nodes,omitempty" azure:"ro"` +} + +// AmlComputeProperties - AML Compute properties +type AmlComputeProperties struct { + // Enable or disable node public IP address provisioning. Possible values are: Possible values are: true - Indicates that + // the compute nodes will have public IPs provisioned. false - Indicates that the + // compute nodes will have a private endpoint and no public IPs. + EnableNodePublicIP *bool `json:"enableNodePublicIp,omitempty"` + + // Network is isolated or not + IsolatedNetwork *bool `json:"isolatedNetwork,omitempty"` + + // Compute OS Type + OSType *OsType `json:"osType,omitempty"` + + // A property bag containing additional properties. + PropertyBag interface{} `json:"propertyBag,omitempty"` + + // State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on all nodes + // of the cluster. Enabled - Indicates that the public ssh port is open on all + // nodes of the cluster. NotSpecified - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is + // defined, else is open all public nodes. It can be default only during cluster + // creation time, after creation it will be either enabled or disabled. + RemoteLoginPortPublicAccess *RemoteLoginPortPublicAccess `json:"remoteLoginPortPublicAccess,omitempty"` + + // Scale settings for AML Compute + ScaleSettings *ScaleSettings `json:"scaleSettings,omitempty"` + + // Virtual network subnet resource ID the compute nodes belong to. + Subnet *ResourceID `json:"subnet,omitempty"` + + // Credentials for an administrator user account that will be created on each compute node. + UserAccountCredentials *UserAccountCredentials `json:"userAccountCredentials,omitempty"` + + // Virtual Machine priority + VMPriority *VMPriority `json:"vmPriority,omitempty"` + + // Virtual Machine Size + VMSize *string `json:"vmSize,omitempty"` + + // Virtual Machine image for AML Compute - windows only + VirtualMachineImage *VirtualMachineImage `json:"virtualMachineImage,omitempty"` + + // READ-ONLY; Allocation state of the compute. Possible values are: steady - Indicates that the compute is not resizing. There + // are no changes to the number of compute nodes in the compute in progress. A compute + // enters this state when it is created and when no operations are being performed on the compute to change the number of + // compute nodes. resizing - Indicates that the compute is resizing; that is, + // compute nodes are being added to or removed from the compute. + AllocationState *AllocationState `json:"allocationState,omitempty" azure:"ro"` + + // READ-ONLY; The time at which the compute entered its current allocation state. + AllocationStateTransitionTime *time.Time `json:"allocationStateTransitionTime,omitempty" azure:"ro"` + + // READ-ONLY; The number of compute nodes currently assigned to the compute. + CurrentNodeCount *int32 `json:"currentNodeCount,omitempty" azure:"ro"` + + // READ-ONLY; Collection of errors encountered by various compute nodes during node setup. + Errors []*ErrorResponse `json:"errors,omitempty" azure:"ro"` + + // READ-ONLY; Counts of various node states on the compute. + NodeStateCounts *NodeStateCounts `json:"nodeStateCounts,omitempty" azure:"ro"` + + // READ-ONLY; The target number of compute nodes for the compute. If the allocationState is resizing, this property denotes + // the target node count for the ongoing resize operation. If the allocationState is steady, + // this property denotes the target node count for the previous resize operation. + TargetNodeCount *int32 `json:"targetNodeCount,omitempty" azure:"ro"` +} + +// AmlComputeSchema - Properties(top level) of AmlCompute +type AmlComputeSchema struct { + // Properties of AmlCompute + Properties *AmlComputeProperties `json:"properties,omitempty"` +} + +// AmlOperation - Azure Machine Learning workspace REST API operation +type AmlOperation struct { + // Display name of operation + Display *AmlOperationDisplay `json:"display,omitempty"` + + // Indicates whether the operation applies to data-plane + IsDataAction *bool `json:"isDataAction,omitempty"` + + // Operation name: {provider}/{resource}/{operation} + Name *string `json:"name,omitempty"` +} + +// AmlOperationDisplay - Display name of operation +type AmlOperationDisplay struct { + // The description for the operation. + Description *string `json:"description,omitempty"` + + // The operation that users can perform. + Operation *string `json:"operation,omitempty"` + + // The resource provider name: Microsoft.MachineLearningExperimentation + Provider *string `json:"provider,omitempty"` + + // The resource on which the operation is performed. + Resource *string `json:"resource,omitempty"` +} + +// AmlOperationListResult - An array of operations supported by the resource provider. +type AmlOperationListResult struct { + // List of AML workspace operations supported by the AML workspace resource provider. + Value []*AmlOperation `json:"value,omitempty"` +} + +// AmlToken - AML Token identity configuration. +type AmlToken struct { + // REQUIRED; [Required] Specifies the type of identity framework. + IdentityType *IdentityConfigurationType `json:"identityType,omitempty"` +} + +// GetIdentityConfiguration implements the IdentityConfigurationClassification interface for type AmlToken. +func (a *AmlToken) GetIdentityConfiguration() *IdentityConfiguration { + return &IdentityConfiguration{ + IdentityType: a.IdentityType, + } +} + +// AmlUserFeature - Features enabled for a workspace +type AmlUserFeature struct { + // Describes the feature for user experience + Description *string `json:"description,omitempty"` + + // Specifies the feature name + DisplayName *string `json:"displayName,omitempty"` + + // Specifies the feature ID + ID *string `json:"id,omitempty"` +} + +type AssetBase struct { + // The asset description text. + Description *string `json:"description,omitempty"` + + // If the name version are system generated (anonymous registration). + IsAnonymous *bool `json:"isAnonymous,omitempty"` + + // Is the asset archived? + IsArchived *bool `json:"isArchived,omitempty"` + + // The asset property dictionary. + Properties map[string]*string `json:"properties,omitempty"` + + // Tag dictionary. Tags can be added, removed, and updated. + Tags map[string]*string `json:"tags,omitempty"` +} + +type AssetContainer struct { + // The asset description text. + Description *string `json:"description,omitempty"` + + // Is the asset archived? + IsArchived *bool `json:"isArchived,omitempty"` + + // The asset property dictionary. + Properties map[string]*string `json:"properties,omitempty"` + + // Tag dictionary. Tags can be added, removed, and updated. + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; The latest version inside this container. + LatestVersion *string `json:"latestVersion,omitempty" azure:"ro"` + + // READ-ONLY; The next auto incremental version + NextVersion *string `json:"nextVersion,omitempty" azure:"ro"` +} + +// AssetJobInput - Asset input type. +type AssetJobInput struct { + // REQUIRED; [Required] Input Asset URI. + URI *string `json:"uri,omitempty"` + + // Input Asset Delivery Mode. + Mode *InputDeliveryMode `json:"mode,omitempty"` +} + +// AssetJobOutput - Asset output type. +type AssetJobOutput struct { + // Output Asset Delivery Mode. + Mode *OutputDeliveryMode `json:"mode,omitempty"` + + // Output Asset URI. + URI *string `json:"uri,omitempty"` +} + +// AssetReferenceBaseClassification provides polymorphic access to related types. +// Call the interface's GetAssetReferenceBase() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AssetReferenceBase, *DataPathAssetReference, *IDAssetReference, *OutputPathAssetReference +type AssetReferenceBaseClassification interface { + // GetAssetReferenceBase returns the AssetReferenceBase content of the underlying type. + GetAssetReferenceBase() *AssetReferenceBase +} + +// AssetReferenceBase - Base definition for asset references. +type AssetReferenceBase struct { + // REQUIRED; [Required] Specifies the type of asset reference. + ReferenceType *ReferenceType `json:"referenceType,omitempty"` +} + +// GetAssetReferenceBase implements the AssetReferenceBaseClassification interface for type AssetReferenceBase. +func (a *AssetReferenceBase) GetAssetReferenceBase() *AssetReferenceBase { return a } + +// AssignedUser - A user that can be assigned to a compute instance. +type AssignedUser struct { + // REQUIRED; User’s AAD Object Id. + ObjectID *string `json:"objectId,omitempty"` + + // REQUIRED; User’s AAD Tenant Id. + TenantID *string `json:"tenantId,omitempty"` +} + +// AutoPauseProperties - Auto pause properties +type AutoPauseProperties struct { + DelayInMinutes *int32 `json:"delayInMinutes,omitempty"` + Enabled *bool `json:"enabled,omitempty"` +} + +// AutoScaleProperties - Auto scale properties +type AutoScaleProperties struct { + Enabled *bool `json:"enabled,omitempty"` + MaxNodeCount *int32 `json:"maxNodeCount,omitempty"` + MinNodeCount *int32 `json:"minNodeCount,omitempty"` +} + +// AzureBlobDatastore - Azure Blob datastore configuration. +type AzureBlobDatastore struct { + // REQUIRED; [Required] Account credentials. + Credentials DatastoreCredentialsClassification `json:"credentials,omitempty"` + + // REQUIRED; [Required] Storage type backing the datastore. + DatastoreType *DatastoreType `json:"datastoreType,omitempty"` + + // Storage account name. + AccountName *string `json:"accountName,omitempty"` + + // Storage account container name. + ContainerName *string `json:"containerName,omitempty"` + + // The asset description text. + Description *string `json:"description,omitempty"` + + // Azure cloud endpoint for the storage account. + Endpoint *string `json:"endpoint,omitempty"` + + // The asset property dictionary. + Properties map[string]*string `json:"properties,omitempty"` + + // Protocol used to communicate with the storage account. + Protocol *string `json:"protocol,omitempty"` + + // Indicates which identity to use to authenticate service data access to customer's storage. + ServiceDataAccessAuthIdentity *ServiceDataAccessAuthIdentity `json:"serviceDataAccessAuthIdentity,omitempty"` + + // Tag dictionary. Tags can be added, removed, and updated. + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; Readonly property to indicate if datastore is the workspace default datastore + IsDefault *bool `json:"isDefault,omitempty" azure:"ro"` +} + +// GetDatastoreProperties implements the DatastorePropertiesClassification interface for type AzureBlobDatastore. +func (a *AzureBlobDatastore) GetDatastoreProperties() *DatastoreProperties { + return &DatastoreProperties{ + Credentials: a.Credentials, + DatastoreType: a.DatastoreType, + IsDefault: a.IsDefault, + Description: a.Description, + Properties: a.Properties, + Tags: a.Tags, + } +} + +// AzureDataLakeGen1Datastore - Azure Data Lake Gen1 datastore configuration. +type AzureDataLakeGen1Datastore struct { + // REQUIRED; [Required] Account credentials. + Credentials DatastoreCredentialsClassification `json:"credentials,omitempty"` + + // REQUIRED; [Required] Storage type backing the datastore. + DatastoreType *DatastoreType `json:"datastoreType,omitempty"` + + // REQUIRED; [Required] Azure Data Lake store name. + StoreName *string `json:"storeName,omitempty"` + + // The asset description text. + Description *string `json:"description,omitempty"` + + // The asset property dictionary. + Properties map[string]*string `json:"properties,omitempty"` + + // Indicates which identity to use to authenticate service data access to customer's storage. + ServiceDataAccessAuthIdentity *ServiceDataAccessAuthIdentity `json:"serviceDataAccessAuthIdentity,omitempty"` + + // Tag dictionary. Tags can be added, removed, and updated. + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; Readonly property to indicate if datastore is the workspace default datastore + IsDefault *bool `json:"isDefault,omitempty" azure:"ro"` +} + +// GetDatastoreProperties implements the DatastorePropertiesClassification interface for type AzureDataLakeGen1Datastore. +func (a *AzureDataLakeGen1Datastore) GetDatastoreProperties() *DatastoreProperties { + return &DatastoreProperties{ + Credentials: a.Credentials, + DatastoreType: a.DatastoreType, + IsDefault: a.IsDefault, + Description: a.Description, + Properties: a.Properties, + Tags: a.Tags, + } +} + +// AzureDataLakeGen2Datastore - Azure Data Lake Gen2 datastore configuration. +type AzureDataLakeGen2Datastore struct { + // REQUIRED; [Required] Storage account name. + AccountName *string `json:"accountName,omitempty"` + + // REQUIRED; [Required] Account credentials. + Credentials DatastoreCredentialsClassification `json:"credentials,omitempty"` + + // REQUIRED; [Required] Storage type backing the datastore. + DatastoreType *DatastoreType `json:"datastoreType,omitempty"` + + // REQUIRED; [Required] The name of the Data Lake Gen2 filesystem. + Filesystem *string `json:"filesystem,omitempty"` + + // The asset description text. + Description *string `json:"description,omitempty"` + + // Azure cloud endpoint for the storage account. + Endpoint *string `json:"endpoint,omitempty"` + + // The asset property dictionary. + Properties map[string]*string `json:"properties,omitempty"` + + // Protocol used to communicate with the storage account. + Protocol *string `json:"protocol,omitempty"` + + // Indicates which identity to use to authenticate service data access to customer's storage. + ServiceDataAccessAuthIdentity *ServiceDataAccessAuthIdentity `json:"serviceDataAccessAuthIdentity,omitempty"` + + // Tag dictionary. Tags can be added, removed, and updated. + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; Readonly property to indicate if datastore is the workspace default datastore + IsDefault *bool `json:"isDefault,omitempty" azure:"ro"` +} + +// GetDatastoreProperties implements the DatastorePropertiesClassification interface for type AzureDataLakeGen2Datastore. +func (a *AzureDataLakeGen2Datastore) GetDatastoreProperties() *DatastoreProperties { + return &DatastoreProperties{ + Credentials: a.Credentials, + DatastoreType: a.DatastoreType, + IsDefault: a.IsDefault, + Description: a.Description, + Properties: a.Properties, + Tags: a.Tags, + } +} + +// AzureFileDatastore - Azure File datastore configuration. +type AzureFileDatastore struct { + // REQUIRED; [Required] Storage account name. + AccountName *string `json:"accountName,omitempty"` + + // REQUIRED; [Required] Account credentials. + Credentials DatastoreCredentialsClassification `json:"credentials,omitempty"` + + // REQUIRED; [Required] Storage type backing the datastore. + DatastoreType *DatastoreType `json:"datastoreType,omitempty"` + + // REQUIRED; [Required] The name of the Azure file share that the datastore points to. + FileShareName *string `json:"fileShareName,omitempty"` + + // The asset description text. + Description *string `json:"description,omitempty"` + + // Azure cloud endpoint for the storage account. + Endpoint *string `json:"endpoint,omitempty"` + + // The asset property dictionary. + Properties map[string]*string `json:"properties,omitempty"` + + // Protocol used to communicate with the storage account. + Protocol *string `json:"protocol,omitempty"` + + // Indicates which identity to use to authenticate service data access to customer's storage. + ServiceDataAccessAuthIdentity *ServiceDataAccessAuthIdentity `json:"serviceDataAccessAuthIdentity,omitempty"` + + // Tag dictionary. Tags can be added, removed, and updated. + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; Readonly property to indicate if datastore is the workspace default datastore + IsDefault *bool `json:"isDefault,omitempty" azure:"ro"` +} + +// GetDatastoreProperties implements the DatastorePropertiesClassification interface for type AzureFileDatastore. +func (a *AzureFileDatastore) GetDatastoreProperties() *DatastoreProperties { + return &DatastoreProperties{ + Credentials: a.Credentials, + DatastoreType: a.DatastoreType, + IsDefault: a.IsDefault, + Description: a.Description, + Properties: a.Properties, + Tags: a.Tags, + } +} + +// BanditPolicy - Defines an early termination policy based on slack criteria, and a frequency and delay interval for evaluation +type BanditPolicy struct { + // REQUIRED; [Required] Name of policy configuration + PolicyType *EarlyTerminationPolicyType `json:"policyType,omitempty"` + + // Number of intervals by which to delay the first evaluation. + DelayEvaluation *int32 `json:"delayEvaluation,omitempty"` + + // Interval (number of runs) between policy evaluations. + EvaluationInterval *int32 `json:"evaluationInterval,omitempty"` + + // Absolute distance allowed from the best performing run. + SlackAmount *float32 `json:"slackAmount,omitempty"` + + // Ratio of the allowed distance from the best performing run. + SlackFactor *float32 `json:"slackFactor,omitempty"` +} + +// GetEarlyTerminationPolicy implements the EarlyTerminationPolicyClassification interface for type BanditPolicy. +func (b *BanditPolicy) GetEarlyTerminationPolicy() *EarlyTerminationPolicy { + return &EarlyTerminationPolicy{ + DelayEvaluation: b.DelayEvaluation, + EvaluationInterval: b.EvaluationInterval, + PolicyType: b.PolicyType, + } +} + +type BatchDeployment struct { + // REQUIRED; The geo-location where the resource lives + Location *string `json:"location,omitempty"` + + // REQUIRED; [Required] Additional attributes of the entity. + Properties *BatchDeploymentProperties `json:"properties,omitempty"` + + // Managed service identity (system assigned and/or user assigned identities) + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + + // Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. + Kind *string `json:"kind,omitempty"` + + // Sku details required for ARM contract for Autoscaling. + SKU *SKU `json:"sku,omitempty"` + + // Resource tags. + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +// BatchDeploymentProperties - Batch inference settings per deployment. +type BatchDeploymentProperties struct { + // Code configuration for the endpoint deployment. + CodeConfiguration *CodeConfiguration `json:"codeConfiguration,omitempty"` + + // Compute target for batch inference operation. + Compute *string `json:"compute,omitempty"` + + // Description of the endpoint deployment. + Description *string `json:"description,omitempty"` + + // ARM resource ID or AssetId of the environment specification for the endpoint deployment. + EnvironmentID *string `json:"environmentId,omitempty"` + + // Environment variables configuration for the deployment. + EnvironmentVariables map[string]*string `json:"environmentVariables,omitempty"` + + // Error threshold, if the error count for the entire input goes above this value, the batch inference will be aborted. Range + // is [-1, int.MaxValue]. For FileDataset, this value is the count of file + // failures. For TabularDataset, this value is the count of record failures. If set to -1 (the lower bound), all failures + // during batch inference will be ignored. + ErrorThreshold *int32 `json:"errorThreshold,omitempty"` + + // Logging level for batch inference operation. + LoggingLevel *BatchLoggingLevel `json:"loggingLevel,omitempty"` + + // Indicates maximum number of parallelism per instance. + MaxConcurrencyPerInstance *int32 `json:"maxConcurrencyPerInstance,omitempty"` + + // Size of the mini-batch passed to each batch invocation. For FileDataset, this is the number of files per mini-batch. For + // TabularDataset, this is the size of the records in bytes, per mini-batch. + MiniBatchSize *int64 `json:"miniBatchSize,omitempty"` + + // Reference to the model asset for the endpoint deployment. + Model AssetReferenceBaseClassification `json:"model,omitempty"` + + // Indicates how the output will be organized. + OutputAction *BatchOutputAction `json:"outputAction,omitempty"` + + // Customized output file name for append_row output action. + OutputFileName *string `json:"outputFileName,omitempty"` + + // Property dictionary. Properties can be added, but not removed or altered. + Properties map[string]*string `json:"properties,omitempty"` + + // Indicates compute configuration for the job. If not provided, will default to the defaults defined in ResourceConfiguration. + Resources *ResourceConfiguration `json:"resources,omitempty"` + + // Retry Settings for the batch inference operation. If not provided, will default to the defaults defined in BatchRetrySettings. + RetrySettings *BatchRetrySettings `json:"retrySettings,omitempty"` + + // READ-ONLY; Provisioning state for the endpoint deployment. + ProvisioningState *DeploymentProvisioningState `json:"provisioningState,omitempty" azure:"ro"` +} + +// BatchDeploymentTrackedResourceArmPaginatedResult - A paginated list of BatchDeployment entities. +type BatchDeploymentTrackedResourceArmPaginatedResult struct { + // The link to the next page of BatchDeployment objects. If null, there are no additional pages. + NextLink *string `json:"nextLink,omitempty"` + + // An array of objects of type BatchDeployment. + Value []*BatchDeployment `json:"value,omitempty"` +} + +// BatchDeploymentsClientBeginCreateOrUpdateOptions contains the optional parameters for the BatchDeploymentsClient.BeginCreateOrUpdate +// method. +type BatchDeploymentsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// BatchDeploymentsClientBeginDeleteOptions contains the optional parameters for the BatchDeploymentsClient.BeginDelete method. +type BatchDeploymentsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// BatchDeploymentsClientBeginUpdateOptions contains the optional parameters for the BatchDeploymentsClient.BeginUpdate method. +type BatchDeploymentsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// BatchDeploymentsClientGetOptions contains the optional parameters for the BatchDeploymentsClient.Get method. +type BatchDeploymentsClientGetOptions struct { + // placeholder for future optional parameters +} + +// BatchDeploymentsClientListOptions contains the optional parameters for the BatchDeploymentsClient.List method. +type BatchDeploymentsClientListOptions struct { + // Ordering of list. + OrderBy *string + // Continuation token for pagination. + Skip *string + // Top of list. + Top *int32 +} + +type BatchEndpoint struct { + // REQUIRED; The geo-location where the resource lives + Location *string `json:"location,omitempty"` + + // REQUIRED; [Required] Additional attributes of the entity. + Properties *BatchEndpointProperties `json:"properties,omitempty"` + + // Managed service identity (system assigned and/or user assigned identities) + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + + // Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. + Kind *string `json:"kind,omitempty"` + + // Sku details required for ARM contract for Autoscaling. + SKU *SKU `json:"sku,omitempty"` + + // Resource tags. + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +// BatchEndpointDefaults - Batch endpoint default values +type BatchEndpointDefaults struct { + // Name of the deployment that will be default for the endpoint. This deployment will end up getting 100% traffic when the + // endpoint scoring URL is invoked. + DeploymentName *string `json:"deploymentName,omitempty"` +} + +// BatchEndpointProperties - Batch endpoint configuration. +type BatchEndpointProperties struct { + // REQUIRED; [Required] Use 'Key' for key based authentication and 'AMLToken' for Azure Machine Learning token-based authentication. + // 'Key' doesn't expire but 'AMLToken' does. + AuthMode *EndpointAuthMode `json:"authMode,omitempty"` + + // Default values for Batch Endpoint + Defaults *BatchEndpointDefaults `json:"defaults,omitempty"` + + // Description of the inference endpoint. + Description *string `json:"description,omitempty"` + + // EndpointAuthKeys to set initially on an Endpoint. This property will always be returned as null. AuthKey values must be + // retrieved using the ListKeys API. + Keys *EndpointAuthKeys `json:"keys,omitempty"` + + // Property dictionary. Properties can be added, but not removed or altered. + Properties map[string]*string `json:"properties,omitempty"` + + // READ-ONLY; Provisioning state for the endpoint. + ProvisioningState *EndpointProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + + // READ-ONLY; Endpoint URI. + ScoringURI *string `json:"scoringUri,omitempty" azure:"ro"` + + // READ-ONLY; Endpoint Swagger URI. + SwaggerURI *string `json:"swaggerUri,omitempty" azure:"ro"` +} + +// BatchEndpointTrackedResourceArmPaginatedResult - A paginated list of BatchEndpoint entities. +type BatchEndpointTrackedResourceArmPaginatedResult struct { + // The link to the next page of BatchEndpoint objects. If null, there are no additional pages. + NextLink *string `json:"nextLink,omitempty"` + + // An array of objects of type BatchEndpoint. + Value []*BatchEndpoint `json:"value,omitempty"` +} + +// BatchEndpointsClientBeginCreateOrUpdateOptions contains the optional parameters for the BatchEndpointsClient.BeginCreateOrUpdate +// method. +type BatchEndpointsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// BatchEndpointsClientBeginDeleteOptions contains the optional parameters for the BatchEndpointsClient.BeginDelete method. +type BatchEndpointsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// BatchEndpointsClientBeginUpdateOptions contains the optional parameters for the BatchEndpointsClient.BeginUpdate method. +type BatchEndpointsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// BatchEndpointsClientGetOptions contains the optional parameters for the BatchEndpointsClient.Get method. +type BatchEndpointsClientGetOptions struct { + // placeholder for future optional parameters +} + +// BatchEndpointsClientListKeysOptions contains the optional parameters for the BatchEndpointsClient.ListKeys method. +type BatchEndpointsClientListKeysOptions struct { + // placeholder for future optional parameters +} + +// BatchEndpointsClientListOptions contains the optional parameters for the BatchEndpointsClient.List method. +type BatchEndpointsClientListOptions struct { + // Number of endpoints to be retrieved in a page of results. + Count *int32 + // Continuation token for pagination. + Skip *string +} + +// BatchRetrySettings - Retry settings for a batch inference operation. +type BatchRetrySettings struct { + // Maximum retry count for a mini-batch + MaxRetries *int32 `json:"maxRetries,omitempty"` + + // Invocation timeout for a mini-batch, in ISO 8601 format. + Timeout *string `json:"timeout,omitempty"` +} + +// BayesianSamplingAlgorithm - Defines a Sampling Algorithm that generates values based on previous values +type BayesianSamplingAlgorithm struct { + // REQUIRED; [Required] The algorithm used for generating hyperparameter values, along with configuration properties + SamplingAlgorithmType *SamplingAlgorithmType `json:"samplingAlgorithmType,omitempty"` +} + +// GetSamplingAlgorithm implements the SamplingAlgorithmClassification interface for type BayesianSamplingAlgorithm. +func (b *BayesianSamplingAlgorithm) GetSamplingAlgorithm() *SamplingAlgorithm { + return &SamplingAlgorithm{ + SamplingAlgorithmType: b.SamplingAlgorithmType, + } +} + +// BuildContext - Configuration settings for Docker build context +type BuildContext struct { + // REQUIRED; [Required] URI of the Docker build context used to build the image. Supports blob URIs on environment creation + // and may return blob or Git URIs. + ContextURI *string `json:"contextUri,omitempty"` + + // Path to the Dockerfile in the build context. + DockerfilePath *string `json:"dockerfilePath,omitempty"` +} + +// CertificateDatastoreCredentials - Certificate datastore credentials configuration. +type CertificateDatastoreCredentials struct { + // REQUIRED; [Required] Service principal client ID. + ClientID *string `json:"clientId,omitempty"` + + // REQUIRED; [Required] Credential type used to authentication with storage. + CredentialsType *CredentialsType `json:"credentialsType,omitempty"` + + // REQUIRED; [Required] Service principal secrets. + Secrets *CertificateDatastoreSecrets `json:"secrets,omitempty"` + + // REQUIRED; [Required] ID of the tenant to which the service principal belongs. + TenantID *string `json:"tenantId,omitempty"` + + // REQUIRED; [Required] Thumbprint of the certificate used for authentication. + Thumbprint *string `json:"thumbprint,omitempty"` + + // Authority URL used for authentication. + AuthorityURL *string `json:"authorityUrl,omitempty"` + + // Resource the service principal has access to. + ResourceURL *string `json:"resourceUrl,omitempty"` +} + +// GetDatastoreCredentials implements the DatastoreCredentialsClassification interface for type CertificateDatastoreCredentials. +func (c *CertificateDatastoreCredentials) GetDatastoreCredentials() *DatastoreCredentials { + return &DatastoreCredentials{ + CredentialsType: c.CredentialsType, + } +} + +// CertificateDatastoreSecrets - Datastore certificate secrets. +type CertificateDatastoreSecrets struct { + // REQUIRED; [Required] Credential type used to authentication with storage. + SecretsType *SecretsType `json:"secretsType,omitempty"` + + // Service principal certificate. + Certificate *string `json:"certificate,omitempty"` +} + +// GetDatastoreSecrets implements the DatastoreSecretsClassification interface for type CertificateDatastoreSecrets. +func (c *CertificateDatastoreSecrets) GetDatastoreSecrets() *DatastoreSecrets { + return &DatastoreSecrets{ + SecretsType: c.SecretsType, + } +} + +// ClusterUpdateParameters - AmlCompute update parameters. +type ClusterUpdateParameters struct { + // The properties of the amlCompute. + Properties *ClusterUpdateProperties `json:"properties,omitempty"` +} + +// ClusterUpdateProperties - The properties of a amlCompute that need to be updated. +type ClusterUpdateProperties struct { + // Properties of ClusterUpdate + Properties *ScaleSettingsInformation `json:"properties,omitempty"` +} + +// CodeConfiguration - Configuration for a scoring code asset. +type CodeConfiguration struct { + // REQUIRED; [Required] The script to execute on startup. eg. "score.py" + ScoringScript *string `json:"scoringScript,omitempty"` + + // ARM resource ID of the code asset. + CodeID *string `json:"codeId,omitempty"` +} + +// CodeContainer - Azure Resource Manager resource envelope. +type CodeContainer struct { + // REQUIRED; [Required] Additional attributes of the entity. + Properties *CodeContainerProperties `json:"properties,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +// CodeContainerProperties - Container for code asset versions. +type CodeContainerProperties struct { + // The asset description text. + Description *string `json:"description,omitempty"` + + // Is the asset archived? + IsArchived *bool `json:"isArchived,omitempty"` + + // The asset property dictionary. + Properties map[string]*string `json:"properties,omitempty"` + + // Tag dictionary. Tags can be added, removed, and updated. + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; The latest version inside this container. + LatestVersion *string `json:"latestVersion,omitempty" azure:"ro"` + + // READ-ONLY; The next auto incremental version + NextVersion *string `json:"nextVersion,omitempty" azure:"ro"` +} + +// CodeContainerResourceArmPaginatedResult - A paginated list of CodeContainer entities. +type CodeContainerResourceArmPaginatedResult struct { + // The link to the next page of CodeContainer objects. If null, there are no additional pages. + NextLink *string `json:"nextLink,omitempty"` + + // An array of objects of type CodeContainer. + Value []*CodeContainer `json:"value,omitempty"` +} + +// CodeContainersClientCreateOrUpdateOptions contains the optional parameters for the CodeContainersClient.CreateOrUpdate +// method. +type CodeContainersClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// CodeContainersClientDeleteOptions contains the optional parameters for the CodeContainersClient.Delete method. +type CodeContainersClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// CodeContainersClientGetOptions contains the optional parameters for the CodeContainersClient.Get method. +type CodeContainersClientGetOptions struct { + // placeholder for future optional parameters +} + +// CodeContainersClientListOptions contains the optional parameters for the CodeContainersClient.List method. +type CodeContainersClientListOptions struct { + // Continuation token for pagination. + Skip *string +} + +// CodeVersion - Azure Resource Manager resource envelope. +type CodeVersion struct { + // REQUIRED; [Required] Additional attributes of the entity. + Properties *CodeVersionProperties `json:"properties,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +// CodeVersionProperties - Code asset version details. +type CodeVersionProperties struct { + // Uri where code is located + CodeURI *string `json:"codeUri,omitempty"` + + // The asset description text. + Description *string `json:"description,omitempty"` + + // If the name version are system generated (anonymous registration). + IsAnonymous *bool `json:"isAnonymous,omitempty"` + + // Is the asset archived? + IsArchived *bool `json:"isArchived,omitempty"` + + // The asset property dictionary. + Properties map[string]*string `json:"properties,omitempty"` + + // Tag dictionary. Tags can be added, removed, and updated. + Tags map[string]*string `json:"tags,omitempty"` +} + +// CodeVersionResourceArmPaginatedResult - A paginated list of CodeVersion entities. +type CodeVersionResourceArmPaginatedResult struct { + // The link to the next page of CodeVersion objects. If null, there are no additional pages. + NextLink *string `json:"nextLink,omitempty"` + + // An array of objects of type CodeVersion. + Value []*CodeVersion `json:"value,omitempty"` +} + +// CodeVersionsClientCreateOrUpdateOptions contains the optional parameters for the CodeVersionsClient.CreateOrUpdate method. +type CodeVersionsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// CodeVersionsClientDeleteOptions contains the optional parameters for the CodeVersionsClient.Delete method. +type CodeVersionsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// CodeVersionsClientGetOptions contains the optional parameters for the CodeVersionsClient.Get method. +type CodeVersionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// CodeVersionsClientListOptions contains the optional parameters for the CodeVersionsClient.List method. +type CodeVersionsClientListOptions struct { + // Ordering of list. + OrderBy *string + // Continuation token for pagination. + Skip *string + // Maximum number of records to return. + Top *int32 +} + +// CommandJob - Command job definition. +type CommandJob struct { + // REQUIRED; [Required] The command to execute on startup of the job. eg. "python train.py" + Command *string `json:"command,omitempty"` + + // REQUIRED; [Required] The ARM resource ID of the Environment specification for the job. + EnvironmentID *string `json:"environmentId,omitempty"` + + // REQUIRED; [Required] Specifies the type of job. + JobType *JobType `json:"jobType,omitempty"` + + // ARM resource ID of the code asset. + CodeID *string `json:"codeId,omitempty"` + + // ARM resource ID of the compute resource. + ComputeID *string `json:"computeId,omitempty"` + + // The asset description text. + Description *string `json:"description,omitempty"` + + // Display name of job. + DisplayName *string `json:"displayName,omitempty"` + + // Distribution configuration of the job. If set, this should be one of Mpi, Tensorflow, PyTorch, or null. + Distribution DistributionConfigurationClassification `json:"distribution,omitempty"` + + // Environment variables included in the job. + EnvironmentVariables map[string]*string `json:"environmentVariables,omitempty"` + + // The name of the experiment the job belongs to. If not set, the job is placed in the "Default" experiment. + ExperimentName *string `json:"experimentName,omitempty"` + + // Identity configuration. If set, this should be one of AmlToken, ManagedIdentity, UserIdentity or null. Defaults to AmlToken + // if null. + Identity IdentityConfigurationClassification `json:"identity,omitempty"` + + // Mapping of input data bindings used in the job. + Inputs map[string]JobInputClassification `json:"inputs,omitempty"` + + // Is the asset archived? + IsArchived *bool `json:"isArchived,omitempty"` + + // Command Job limit. + Limits *CommandJobLimits `json:"limits,omitempty"` + + // Mapping of output data bindings used in the job. + Outputs map[string]JobOutputClassification `json:"outputs,omitempty"` + + // The asset property dictionary. + Properties map[string]*string `json:"properties,omitempty"` + + // Compute Resource configuration for the job. + Resources *ResourceConfiguration `json:"resources,omitempty"` + + // List of JobEndpoints. For local jobs, a job endpoint will have an endpoint value of FileStreamObject. + Services map[string]*JobService `json:"services,omitempty"` + + // Tag dictionary. Tags can be added, removed, and updated. + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; Input parameters. + Parameters interface{} `json:"parameters,omitempty" azure:"ro"` + + // READ-ONLY; Status of the job. + Status *JobStatus `json:"status,omitempty" azure:"ro"` +} + +// GetJobBaseProperties implements the JobBasePropertiesClassification interface for type CommandJob. +func (c *CommandJob) GetJobBaseProperties() *JobBaseProperties { + return &JobBaseProperties{ + ComputeID: c.ComputeID, + DisplayName: c.DisplayName, + ExperimentName: c.ExperimentName, + Identity: c.Identity, + IsArchived: c.IsArchived, + JobType: c.JobType, + Services: c.Services, + Status: c.Status, + Description: c.Description, + Properties: c.Properties, + Tags: c.Tags, + } +} + +// CommandJobLimits - Command Job limit class. +type CommandJobLimits struct { + // REQUIRED; [Required] JobLimit type. + JobLimitsType *JobLimitsType `json:"jobLimitsType,omitempty"` + + // The max run duration in ISO 8601 format, after which the job will be cancelled. Only supports duration with precision as + // low as Seconds. + Timeout *string `json:"timeout,omitempty"` +} + +// GetJobLimits implements the JobLimitsClassification interface for type CommandJobLimits. +func (c *CommandJobLimits) GetJobLimits() *JobLimits { + return &JobLimits{ + JobLimitsType: c.JobLimitsType, + Timeout: c.Timeout, + } +} + +// ComponentContainer - Azure Resource Manager resource envelope. +type ComponentContainer struct { + // REQUIRED; [Required] Additional attributes of the entity. + Properties *ComponentContainerProperties `json:"properties,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +// ComponentContainerProperties - Component container definition. +type ComponentContainerProperties struct { + // The asset description text. + Description *string `json:"description,omitempty"` + + // Is the asset archived? + IsArchived *bool `json:"isArchived,omitempty"` + + // The asset property dictionary. + Properties map[string]*string `json:"properties,omitempty"` + + // Tag dictionary. Tags can be added, removed, and updated. + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; The latest version inside this container. + LatestVersion *string `json:"latestVersion,omitempty" azure:"ro"` + + // READ-ONLY; The next auto incremental version + NextVersion *string `json:"nextVersion,omitempty" azure:"ro"` +} + +// ComponentContainerResourceArmPaginatedResult - A paginated list of ComponentContainer entities. +type ComponentContainerResourceArmPaginatedResult struct { + // The link to the next page of ComponentContainer objects. If null, there are no additional pages. + NextLink *string `json:"nextLink,omitempty"` + + // An array of objects of type ComponentContainer. + Value []*ComponentContainer `json:"value,omitempty"` +} + +// ComponentContainersClientCreateOrUpdateOptions contains the optional parameters for the ComponentContainersClient.CreateOrUpdate +// method. +type ComponentContainersClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// ComponentContainersClientDeleteOptions contains the optional parameters for the ComponentContainersClient.Delete method. +type ComponentContainersClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ComponentContainersClientGetOptions contains the optional parameters for the ComponentContainersClient.Get method. +type ComponentContainersClientGetOptions struct { + // placeholder for future optional parameters +} + +// ComponentContainersClientListOptions contains the optional parameters for the ComponentContainersClient.List method. +type ComponentContainersClientListOptions struct { + // View type for including/excluding (for example) archived entities. + ListViewType *ListViewType + // Continuation token for pagination. + Skip *string +} + +// ComponentVersion - Azure Resource Manager resource envelope. +type ComponentVersion struct { + // REQUIRED; [Required] Additional attributes of the entity. + Properties *ComponentVersionProperties `json:"properties,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +// ComponentVersionProperties - Definition of a component version: defines resources that span component types. +type ComponentVersionProperties struct { + // Defines Component definition details. + ComponentSpec interface{} `json:"componentSpec,omitempty"` + + // The asset description text. + Description *string `json:"description,omitempty"` + + // If the name version are system generated (anonymous registration). + IsAnonymous *bool `json:"isAnonymous,omitempty"` + + // Is the asset archived? + IsArchived *bool `json:"isArchived,omitempty"` + + // The asset property dictionary. + Properties map[string]*string `json:"properties,omitempty"` + + // Tag dictionary. Tags can be added, removed, and updated. + Tags map[string]*string `json:"tags,omitempty"` +} + +// ComponentVersionResourceArmPaginatedResult - A paginated list of ComponentVersion entities. +type ComponentVersionResourceArmPaginatedResult struct { + // The link to the next page of ComponentVersion objects. If null, there are no additional pages. + NextLink *string `json:"nextLink,omitempty"` + + // An array of objects of type ComponentVersion. + Value []*ComponentVersion `json:"value,omitempty"` +} + +// ComponentVersionsClientCreateOrUpdateOptions contains the optional parameters for the ComponentVersionsClient.CreateOrUpdate +// method. +type ComponentVersionsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// ComponentVersionsClientDeleteOptions contains the optional parameters for the ComponentVersionsClient.Delete method. +type ComponentVersionsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ComponentVersionsClientGetOptions contains the optional parameters for the ComponentVersionsClient.Get method. +type ComponentVersionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ComponentVersionsClientListOptions contains the optional parameters for the ComponentVersionsClient.List method. +type ComponentVersionsClientListOptions struct { + // View type for including/excluding (for example) archived entities. + ListViewType *ListViewType + // Ordering of list. + OrderBy *string + // Continuation token for pagination. + Skip *string + // Maximum number of records to return. + Top *int32 +} + +// ComputeClassification provides polymorphic access to related types. +// Call the interface's GetCompute() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AKS, *AmlCompute, *Compute, *ComputeInstance, *DataFactory, *DataLakeAnalytics, *Databricks, *HDInsight, *Kubernetes, +// - *SynapseSpark, *VirtualMachine +type ComputeClassification interface { + // GetCompute returns the Compute content of the underlying type. + GetCompute() *Compute +} + +// Compute - Machine Learning compute object. +type Compute struct { + // REQUIRED; The type of compute + ComputeType *ComputeType `json:"computeType,omitempty"` + + // The description of the Machine Learning compute. + Description *string `json:"description,omitempty"` + + // Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for authentication. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + + // ARM resource id of the underlying compute + ResourceID *string `json:"resourceId,omitempty"` + + // READ-ONLY; Location for the underlying compute + ComputeLocation *string `json:"computeLocation,omitempty" azure:"ro"` + + // READ-ONLY; The time at which the compute was created. + CreatedOn *time.Time `json:"createdOn,omitempty" azure:"ro"` + + // READ-ONLY; Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning + // service provisioned it if false. + IsAttachedCompute *bool `json:"isAttachedCompute,omitempty" azure:"ro"` + + // READ-ONLY; The time at which the compute was last modified. + ModifiedOn *time.Time `json:"modifiedOn,omitempty" azure:"ro"` + + // READ-ONLY; Errors during provisioning + ProvisioningErrors []*ErrorResponse `json:"provisioningErrors,omitempty" azure:"ro"` + + // READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` +} + +// GetCompute implements the ComputeClassification interface for type Compute. +func (c *Compute) GetCompute() *Compute { return c } + +// ComputeClientBeginCreateOrUpdateOptions contains the optional parameters for the ComputeClient.BeginCreateOrUpdate method. +type ComputeClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ComputeClientBeginDeleteOptions contains the optional parameters for the ComputeClient.BeginDelete method. +type ComputeClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ComputeClientBeginRestartOptions contains the optional parameters for the ComputeClient.BeginRestart method. +type ComputeClientBeginRestartOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ComputeClientBeginStartOptions contains the optional parameters for the ComputeClient.BeginStart method. +type ComputeClientBeginStartOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ComputeClientBeginStopOptions contains the optional parameters for the ComputeClient.BeginStop method. +type ComputeClientBeginStopOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ComputeClientBeginUpdateOptions contains the optional parameters for the ComputeClient.BeginUpdate method. +type ComputeClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ComputeClientGetOptions contains the optional parameters for the ComputeClient.Get method. +type ComputeClientGetOptions struct { + // placeholder for future optional parameters +} + +// ComputeClientListKeysOptions contains the optional parameters for the ComputeClient.ListKeys method. +type ComputeClientListKeysOptions struct { + // placeholder for future optional parameters +} + +// ComputeClientListNodesOptions contains the optional parameters for the ComputeClient.ListNodes method. +type ComputeClientListNodesOptions struct { + // placeholder for future optional parameters +} + +// ComputeClientListOptions contains the optional parameters for the ComputeClient.List method. +type ComputeClientListOptions struct { + // Continuation token for pagination. + Skip *string +} + +// ComputeInstance - An Azure Machine Learning compute instance. +type ComputeInstance struct { + // REQUIRED; The type of compute + ComputeType *ComputeType `json:"computeType,omitempty"` + + // The description of the Machine Learning compute. + Description *string `json:"description,omitempty"` + + // Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for authentication. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + + // Properties of ComputeInstance + Properties *ComputeInstanceProperties `json:"properties,omitempty"` + + // ARM resource id of the underlying compute + ResourceID *string `json:"resourceId,omitempty"` + + // READ-ONLY; Location for the underlying compute + ComputeLocation *string `json:"computeLocation,omitempty" azure:"ro"` + + // READ-ONLY; The time at which the compute was created. + CreatedOn *time.Time `json:"createdOn,omitempty" azure:"ro"` + + // READ-ONLY; Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning + // service provisioned it if false. + IsAttachedCompute *bool `json:"isAttachedCompute,omitempty" azure:"ro"` + + // READ-ONLY; The time at which the compute was last modified. + ModifiedOn *time.Time `json:"modifiedOn,omitempty" azure:"ro"` + + // READ-ONLY; Errors during provisioning + ProvisioningErrors []*ErrorResponse `json:"provisioningErrors,omitempty" azure:"ro"` + + // READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` +} + +// GetCompute implements the ComputeClassification interface for type ComputeInstance. +func (c *ComputeInstance) GetCompute() *Compute { + return &Compute{ + ComputeType: c.ComputeType, + ComputeLocation: c.ComputeLocation, + ProvisioningState: c.ProvisioningState, + Description: c.Description, + CreatedOn: c.CreatedOn, + ModifiedOn: c.ModifiedOn, + ResourceID: c.ResourceID, + ProvisioningErrors: c.ProvisioningErrors, + IsAttachedCompute: c.IsAttachedCompute, + DisableLocalAuth: c.DisableLocalAuth, + } +} + +// ComputeInstanceApplication - Defines an Aml Instance application and its connectivity endpoint URI. +type ComputeInstanceApplication struct { + // Name of the ComputeInstance application. + DisplayName *string `json:"displayName,omitempty"` + + // Application' endpoint URI. + EndpointURI *string `json:"endpointUri,omitempty"` +} + +// ComputeInstanceConnectivityEndpoints - Defines all connectivity endpoints and properties for an ComputeInstance. +type ComputeInstanceConnectivityEndpoints struct { + // READ-ONLY; Private IP Address of this ComputeInstance (local to the VNET in which the compute instance is deployed). + PrivateIPAddress *string `json:"privateIpAddress,omitempty" azure:"ro"` + + // READ-ONLY; Public IP Address of this ComputeInstance. + PublicIPAddress *string `json:"publicIpAddress,omitempty" azure:"ro"` +} + +// ComputeInstanceContainer - Defines an Aml Instance container. +type ComputeInstanceContainer struct { + // Auto save settings. + Autosave *Autosave `json:"autosave,omitempty"` + + // Environment information of this container. + Environment *ComputeInstanceEnvironmentInfo `json:"environment,omitempty"` + + // Information of GPU. + Gpu *string `json:"gpu,omitempty"` + + // Name of the ComputeInstance container. + Name *string `json:"name,omitempty"` + + // network of this container. + Network *Network `json:"network,omitempty"` + + // READ-ONLY; services of this containers. + Services []interface{} `json:"services,omitempty" azure:"ro"` +} + +// ComputeInstanceCreatedBy - Describes information on user who created this ComputeInstance. +type ComputeInstanceCreatedBy struct { + // READ-ONLY; Uniquely identifies the user within his/her organization. + UserID *string `json:"userId,omitempty" azure:"ro"` + + // READ-ONLY; Name of the user. + UserName *string `json:"userName,omitempty" azure:"ro"` + + // READ-ONLY; Uniquely identifies user' Azure Active Directory organization. + UserOrgID *string `json:"userOrgId,omitempty" azure:"ro"` +} + +// ComputeInstanceDataDisk - Defines an Aml Instance DataDisk. +type ComputeInstanceDataDisk struct { + // Caching type of Data Disk. + Caching *Caching `json:"caching,omitempty"` + + // The initial disk size in gigabytes. + DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` + + // The lun is used to uniquely identify each data disk. If attaching multiple disks, each should have a distinct lun. + Lun *int32 `json:"lun,omitempty"` + + // type of this storage account. + StorageAccountType *StorageAccountType `json:"storageAccountType,omitempty"` +} + +// ComputeInstanceDataMount - Defines an Aml Instance DataMount. +type ComputeInstanceDataMount struct { + // who this data mount created by. + CreatedBy *string `json:"createdBy,omitempty"` + + // Error of this data mount. + Error *string `json:"error,omitempty"` + + // Mount Action. + MountAction *MountAction `json:"mountAction,omitempty"` + + // name of the ComputeInstance data mount. + MountName *string `json:"mountName,omitempty"` + + // Path of this data mount. + MountPath *string `json:"mountPath,omitempty"` + + // Mount state. + MountState *MountState `json:"mountState,omitempty"` + + // The time when the disk mounted. + MountedOn *time.Time `json:"mountedOn,omitempty"` + + // Source of the ComputeInstance data mount. + Source *string `json:"source,omitempty"` + + // Data source type. + SourceType *SourceType `json:"sourceType,omitempty"` +} + +// ComputeInstanceEnvironmentInfo - Environment information +type ComputeInstanceEnvironmentInfo struct { + // name of environment. + Name *string `json:"name,omitempty"` + + // version of environment. + Version *string `json:"version,omitempty"` +} + +// ComputeInstanceLastOperation - The last operation on ComputeInstance. +type ComputeInstanceLastOperation struct { + // Name of the last operation. + OperationName *OperationName `json:"operationName,omitempty"` + + // Operation status. + OperationStatus *OperationStatus `json:"operationStatus,omitempty"` + + // Time of the last operation. + OperationTime *time.Time `json:"operationTime,omitempty"` + + // Trigger of operation. + OperationTrigger *OperationTrigger `json:"operationTrigger,omitempty"` +} + +// ComputeInstanceProperties - Compute Instance properties +type ComputeInstanceProperties struct { + // Policy for sharing applications on this compute instance among users of parent workspace. If Personal, only the creator + // can access applications on this compute instance. When Shared, any workspace + // user can access applications on this instance depending on his/her assigned role. + ApplicationSharingPolicy *ApplicationSharingPolicy `json:"applicationSharingPolicy,omitempty"` + + // The Compute Instance Authorization type. Available values are personal (default). + ComputeInstanceAuthorizationType *ComputeInstanceAuthorizationType `json:"computeInstanceAuthorizationType,omitempty"` + + // Enable or disable node public IP address provisioning. Possible values are: Possible values are: true - Indicates that + // the compute nodes will have public IPs provisioned. false - Indicates that the + // compute nodes will have a private endpoint and no public IPs. + EnableNodePublicIP *bool `json:"enableNodePublicIp,omitempty"` + + // Settings for a personal compute instance. + PersonalComputeInstanceSettings *PersonalComputeInstanceSettings `json:"personalComputeInstanceSettings,omitempty"` + + // Specifies policy and settings for SSH access. + SSHSettings *ComputeInstanceSSHSettings `json:"sshSettings,omitempty"` + + // Details of customized scripts to execute for setting up the cluster. + SetupScripts *SetupScripts `json:"setupScripts,omitempty"` + + // Virtual network subnet resource ID the compute nodes belong to. + Subnet *ResourceID `json:"subnet,omitempty"` + + // Virtual Machine Size + VMSize *string `json:"vmSize,omitempty"` + + // READ-ONLY; Describes available applications and their endpoints on this ComputeInstance. + Applications []*ComputeInstanceApplication `json:"applications,omitempty" azure:"ro"` + + // READ-ONLY; Describes all connectivity endpoints available for this ComputeInstance. + ConnectivityEndpoints *ComputeInstanceConnectivityEndpoints `json:"connectivityEndpoints,omitempty" azure:"ro"` + + // READ-ONLY; Describes informations of containers on this ComputeInstance. + Containers []*ComputeInstanceContainer `json:"containers,omitempty" azure:"ro"` + + // READ-ONLY; Describes information on user who created this ComputeInstance. + CreatedBy *ComputeInstanceCreatedBy `json:"createdBy,omitempty" azure:"ro"` + + // READ-ONLY; Describes informations of dataDisks on this ComputeInstance. + DataDisks []*ComputeInstanceDataDisk `json:"dataDisks,omitempty" azure:"ro"` + + // READ-ONLY; Describes informations of dataMounts on this ComputeInstance. + DataMounts []*ComputeInstanceDataMount `json:"dataMounts,omitempty" azure:"ro"` + + // READ-ONLY; Collection of errors encountered on this ComputeInstance. + Errors []*ErrorResponse `json:"errors,omitempty" azure:"ro"` + + // READ-ONLY; The last operation on ComputeInstance. + LastOperation *ComputeInstanceLastOperation `json:"lastOperation,omitempty" azure:"ro"` + + // READ-ONLY; The list of schedules to be applied on the computes. + Schedules *ComputeSchedules `json:"schedules,omitempty" azure:"ro"` + + // READ-ONLY; The current state of this ComputeInstance. + State *ComputeInstanceState `json:"state,omitempty" azure:"ro"` + + // READ-ONLY; ComputeInstance version. + Versions *ComputeInstanceVersion `json:"versions,omitempty" azure:"ro"` +} + +// ComputeInstanceSSHSettings - Specifies policy and settings for SSH access. +type ComputeInstanceSSHSettings struct { + // Specifies the SSH rsa public key file as a string. Use "ssh-keygen -t rsa -b 2048" to generate your SSH key pairs. + AdminPublicKey *string `json:"adminPublicKey,omitempty"` + + // State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on this instance. + // Enabled - Indicates that the public ssh port is open and accessible + // according to the VNet/subnet policy if applicable. + SSHPublicAccess *SSHPublicAccess `json:"sshPublicAccess,omitempty"` + + // READ-ONLY; Describes the admin user name. + AdminUserName *string `json:"adminUserName,omitempty" azure:"ro"` + + // READ-ONLY; Describes the port for connecting through SSH. + SSHPort *int32 `json:"sshPort,omitempty" azure:"ro"` +} + +// ComputeInstanceSchema - Properties(top level) of ComputeInstance +type ComputeInstanceSchema struct { + // Properties of ComputeInstance + Properties *ComputeInstanceProperties `json:"properties,omitempty"` +} + +// ComputeInstanceVersion - Version of computeInstance. +type ComputeInstanceVersion struct { + // Runtime of compute instance. + Runtime *string `json:"runtime,omitempty"` +} + +// ComputeResource - Machine Learning compute object wrapped into ARM resource envelope. +type ComputeResource struct { + // The identity of the resource. + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + + // Specifies the location of the resource. + Location *string `json:"location,omitempty"` + + // Compute properties + Properties ComputeClassification `json:"properties,omitempty"` + + // The sku of the workspace. + SKU *SKU `json:"sku,omitempty"` + + // Contains resource tags defined as key/value pairs. + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +type ComputeResourceSchema struct { + // Compute properties + Properties ComputeClassification `json:"properties,omitempty"` +} + +// ComputeSchedules - The list of schedules to be applied on the computes +type ComputeSchedules struct { + // The list of compute start stop schedules to be applied. + ComputeStartStop []*ComputeStartStopSchedule `json:"computeStartStop,omitempty"` +} + +// ComputeSecretsClassification provides polymorphic access to related types. +// Call the interface's GetComputeSecrets() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AksComputeSecrets, *ComputeSecrets, *DatabricksComputeSecrets, *VirtualMachineSecrets +type ComputeSecretsClassification interface { + // GetComputeSecrets returns the ComputeSecrets content of the underlying type. + GetComputeSecrets() *ComputeSecrets +} + +// ComputeSecrets - Secrets related to a Machine Learning compute. Might differ for every type of compute. +type ComputeSecrets struct { + // REQUIRED; The type of compute + ComputeType *ComputeType `json:"computeType,omitempty"` +} + +// GetComputeSecrets implements the ComputeSecretsClassification interface for type ComputeSecrets. +func (c *ComputeSecrets) GetComputeSecrets() *ComputeSecrets { return c } + +// ComputeStartStopSchedule - Compute start stop schedule properties +type ComputeStartStopSchedule struct { + // The compute power action. + Action *ComputePowerAction `json:"action,omitempty"` + Schedule *ScheduleBase `json:"schedule,omitempty"` + + // READ-ONLY; Schedule id. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The current deployment state of schedule. + ProvisioningStatus *ProvisioningStatus `json:"provisioningStatus,omitempty" azure:"ro"` +} + +// ContainerResourceRequirements - Resource requirements for each container instance within an online deployment. +type ContainerResourceRequirements struct { + // Container resource limit info: + ContainerResourceLimits *ContainerResourceSettings `json:"containerResourceLimits,omitempty"` + + // Container resource request info: + ContainerResourceRequests *ContainerResourceSettings `json:"containerResourceRequests,omitempty"` +} + +type ContainerResourceSettings struct { + // Number of vCPUs request/limit for container. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ + CPU *string `json:"cpu,omitempty"` + + // Number of Nvidia GPU cards request/limit for container. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ + Gpu *string `json:"gpu,omitempty"` + + // Memory size request/limit for container. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ + Memory *string `json:"memory,omitempty"` +} + +type CosmosDbSettings struct { + // The throughput of the collections in cosmosdb database + CollectionsThroughput *int32 `json:"collectionsThroughput,omitempty"` +} + +type CustomModelJobInput struct { + // REQUIRED; [Required] Specifies the type of job. + JobInputType *JobInputType `json:"jobInputType,omitempty"` + + // REQUIRED; [Required] Input Asset URI. + URI *string `json:"uri,omitempty"` + + // Description for the input. + Description *string `json:"description,omitempty"` + + // Input Asset Delivery Mode. + Mode *InputDeliveryMode `json:"mode,omitempty"` +} + +// GetJobInput implements the JobInputClassification interface for type CustomModelJobInput. +func (c *CustomModelJobInput) GetJobInput() *JobInput { + return &JobInput{ + Description: c.Description, + JobInputType: c.JobInputType, + } +} + +type CustomModelJobOutput struct { + // REQUIRED; [Required] Specifies the type of job. + JobOutputType *JobOutputType `json:"jobOutputType,omitempty"` + + // Description for the output. + Description *string `json:"description,omitempty"` + + // Output Asset Delivery Mode. + Mode *OutputDeliveryMode `json:"mode,omitempty"` + + // Output Asset URI. + URI *string `json:"uri,omitempty"` +} + +// GetJobOutput implements the JobOutputClassification interface for type CustomModelJobOutput. +func (c *CustomModelJobOutput) GetJobOutput() *JobOutput { + return &JobOutput{ + Description: c.Description, + JobOutputType: c.JobOutputType, + } +} + +// DataContainer - Azure Resource Manager resource envelope. +type DataContainer struct { + // REQUIRED; [Required] Additional attributes of the entity. + Properties *DataContainerProperties `json:"properties,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +// DataContainerProperties - Container for data asset versions. +type DataContainerProperties struct { + // REQUIRED; [Required] Specifies the type of data. + DataType *DataType `json:"dataType,omitempty"` + + // The asset description text. + Description *string `json:"description,omitempty"` + + // Is the asset archived? + IsArchived *bool `json:"isArchived,omitempty"` + + // The asset property dictionary. + Properties map[string]*string `json:"properties,omitempty"` + + // Tag dictionary. Tags can be added, removed, and updated. + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; The latest version inside this container. + LatestVersion *string `json:"latestVersion,omitempty" azure:"ro"` + + // READ-ONLY; The next auto incremental version + NextVersion *string `json:"nextVersion,omitempty" azure:"ro"` +} + +// DataContainerResourceArmPaginatedResult - A paginated list of DataContainer entities. +type DataContainerResourceArmPaginatedResult struct { + // The link to the next page of DataContainer objects. If null, there are no additional pages. + NextLink *string `json:"nextLink,omitempty"` + + // An array of objects of type DataContainer. + Value []*DataContainer `json:"value,omitempty"` +} + +// DataContainersClientCreateOrUpdateOptions contains the optional parameters for the DataContainersClient.CreateOrUpdate +// method. +type DataContainersClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// DataContainersClientDeleteOptions contains the optional parameters for the DataContainersClient.Delete method. +type DataContainersClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// DataContainersClientGetOptions contains the optional parameters for the DataContainersClient.Get method. +type DataContainersClientGetOptions struct { + // placeholder for future optional parameters +} + +// DataContainersClientListOptions contains the optional parameters for the DataContainersClient.List method. +type DataContainersClientListOptions struct { + // View type for including/excluding (for example) archived entities. + ListViewType *ListViewType + // Continuation token for pagination. + Skip *string +} + +// DataFactory - A DataFactory compute. +type DataFactory struct { + // REQUIRED; The type of compute + ComputeType *ComputeType `json:"computeType,omitempty"` + + // The description of the Machine Learning compute. + Description *string `json:"description,omitempty"` + + // Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for authentication. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + + // ARM resource id of the underlying compute + ResourceID *string `json:"resourceId,omitempty"` + + // READ-ONLY; Location for the underlying compute + ComputeLocation *string `json:"computeLocation,omitempty" azure:"ro"` + + // READ-ONLY; The time at which the compute was created. + CreatedOn *time.Time `json:"createdOn,omitempty" azure:"ro"` + + // READ-ONLY; Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning + // service provisioned it if false. + IsAttachedCompute *bool `json:"isAttachedCompute,omitempty" azure:"ro"` + + // READ-ONLY; The time at which the compute was last modified. + ModifiedOn *time.Time `json:"modifiedOn,omitempty" azure:"ro"` + + // READ-ONLY; Errors during provisioning + ProvisioningErrors []*ErrorResponse `json:"provisioningErrors,omitempty" azure:"ro"` + + // READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` +} + +// GetCompute implements the ComputeClassification interface for type DataFactory. +func (d *DataFactory) GetCompute() *Compute { + return &Compute{ + ComputeType: d.ComputeType, + ComputeLocation: d.ComputeLocation, + ProvisioningState: d.ProvisioningState, + Description: d.Description, + CreatedOn: d.CreatedOn, + ModifiedOn: d.ModifiedOn, + ResourceID: d.ResourceID, + ProvisioningErrors: d.ProvisioningErrors, + IsAttachedCompute: d.IsAttachedCompute, + DisableLocalAuth: d.DisableLocalAuth, + } +} + +// DataLakeAnalytics - A DataLakeAnalytics compute. +type DataLakeAnalytics struct { + // REQUIRED; The type of compute + ComputeType *ComputeType `json:"computeType,omitempty"` + + // The description of the Machine Learning compute. + Description *string `json:"description,omitempty"` + + // Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for authentication. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + Properties *DataLakeAnalyticsSchemaProperties `json:"properties,omitempty"` + + // ARM resource id of the underlying compute + ResourceID *string `json:"resourceId,omitempty"` + + // READ-ONLY; Location for the underlying compute + ComputeLocation *string `json:"computeLocation,omitempty" azure:"ro"` + + // READ-ONLY; The time at which the compute was created. + CreatedOn *time.Time `json:"createdOn,omitempty" azure:"ro"` + + // READ-ONLY; Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning + // service provisioned it if false. + IsAttachedCompute *bool `json:"isAttachedCompute,omitempty" azure:"ro"` + + // READ-ONLY; The time at which the compute was last modified. + ModifiedOn *time.Time `json:"modifiedOn,omitempty" azure:"ro"` + + // READ-ONLY; Errors during provisioning + ProvisioningErrors []*ErrorResponse `json:"provisioningErrors,omitempty" azure:"ro"` + + // READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` +} + +// GetCompute implements the ComputeClassification interface for type DataLakeAnalytics. +func (d *DataLakeAnalytics) GetCompute() *Compute { + return &Compute{ + ComputeType: d.ComputeType, + ComputeLocation: d.ComputeLocation, + ProvisioningState: d.ProvisioningState, + Description: d.Description, + CreatedOn: d.CreatedOn, + ModifiedOn: d.ModifiedOn, + ResourceID: d.ResourceID, + ProvisioningErrors: d.ProvisioningErrors, + IsAttachedCompute: d.IsAttachedCompute, + DisableLocalAuth: d.DisableLocalAuth, + } +} + +type DataLakeAnalyticsSchema struct { + Properties *DataLakeAnalyticsSchemaProperties `json:"properties,omitempty"` +} + +type DataLakeAnalyticsSchemaProperties struct { + // DataLake Store Account Name + DataLakeStoreAccountName *string `json:"dataLakeStoreAccountName,omitempty"` +} + +// DataPathAssetReference - Reference to an asset via its path in a datastore. +type DataPathAssetReference struct { + // REQUIRED; [Required] Specifies the type of asset reference. + ReferenceType *ReferenceType `json:"referenceType,omitempty"` + + // ARM resource ID of the datastore where the asset is located. + DatastoreID *string `json:"datastoreId,omitempty"` + + // The path of the file/directory in the datastore. + Path *string `json:"path,omitempty"` +} + +// GetAssetReferenceBase implements the AssetReferenceBaseClassification interface for type DataPathAssetReference. +func (d *DataPathAssetReference) GetAssetReferenceBase() *AssetReferenceBase { + return &AssetReferenceBase{ + ReferenceType: d.ReferenceType, + } +} + +// DataVersionBase - Azure Resource Manager resource envelope. +type DataVersionBase struct { + // REQUIRED; [Required] Additional attributes of the entity. + Properties DataVersionBasePropertiesClassification `json:"properties,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +// DataVersionBasePropertiesClassification provides polymorphic access to related types. +// Call the interface's GetDataVersionBaseProperties() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *DataVersionBaseProperties, *MLTableData, *URIFileDataVersion, *URIFolderDataVersion +type DataVersionBasePropertiesClassification interface { + // GetDataVersionBaseProperties returns the DataVersionBaseProperties content of the underlying type. + GetDataVersionBaseProperties() *DataVersionBaseProperties +} + +// DataVersionBaseProperties - Data version base definition +type DataVersionBaseProperties struct { + // REQUIRED; [Required] Specifies the type of data. + DataType *DataType `json:"dataType,omitempty"` + + // REQUIRED; [Required] Uri of the data. Usage/meaning depends on Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20220501.Assets.DataVersionBase.DataType + DataURI *string `json:"dataUri,omitempty"` + + // The asset description text. + Description *string `json:"description,omitempty"` + + // If the name version are system generated (anonymous registration). + IsAnonymous *bool `json:"isAnonymous,omitempty"` + + // Is the asset archived? + IsArchived *bool `json:"isArchived,omitempty"` + + // The asset property dictionary. + Properties map[string]*string `json:"properties,omitempty"` + + // Tag dictionary. Tags can be added, removed, and updated. + Tags map[string]*string `json:"tags,omitempty"` +} + +// GetDataVersionBaseProperties implements the DataVersionBasePropertiesClassification interface for type DataVersionBaseProperties. +func (d *DataVersionBaseProperties) GetDataVersionBaseProperties() *DataVersionBaseProperties { + return d +} + +// DataVersionBaseResourceArmPaginatedResult - A paginated list of DataVersionBase entities. +type DataVersionBaseResourceArmPaginatedResult struct { + // The link to the next page of DataVersionBase objects. If null, there are no additional pages. + NextLink *string `json:"nextLink,omitempty"` + + // An array of objects of type DataVersionBase. + Value []*DataVersionBase `json:"value,omitempty"` +} + +// DataVersionsClientCreateOrUpdateOptions contains the optional parameters for the DataVersionsClient.CreateOrUpdate method. +type DataVersionsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// DataVersionsClientDeleteOptions contains the optional parameters for the DataVersionsClient.Delete method. +type DataVersionsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// DataVersionsClientGetOptions contains the optional parameters for the DataVersionsClient.Get method. +type DataVersionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// DataVersionsClientListOptions contains the optional parameters for the DataVersionsClient.List method. +type DataVersionsClientListOptions struct { + // [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived + // entities. + ListViewType *ListViewType + // Please choose OrderBy value from ['createdtime', 'modifiedtime'] + OrderBy *string + // Continuation token for pagination. + Skip *string + // Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2 + Tags *string + // Top count of results, top count cannot be greater than the page size. If topCount > page size, results with be default + // page size count will be returned + Top *int32 +} + +// Databricks - A DataFactory compute. +type Databricks struct { + // REQUIRED; The type of compute + ComputeType *ComputeType `json:"computeType,omitempty"` + + // The description of the Machine Learning compute. + Description *string `json:"description,omitempty"` + + // Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for authentication. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + + // Properties of Databricks + Properties *DatabricksProperties `json:"properties,omitempty"` + + // ARM resource id of the underlying compute + ResourceID *string `json:"resourceId,omitempty"` + + // READ-ONLY; Location for the underlying compute + ComputeLocation *string `json:"computeLocation,omitempty" azure:"ro"` + + // READ-ONLY; The time at which the compute was created. + CreatedOn *time.Time `json:"createdOn,omitempty" azure:"ro"` + + // READ-ONLY; Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning + // service provisioned it if false. + IsAttachedCompute *bool `json:"isAttachedCompute,omitempty" azure:"ro"` + + // READ-ONLY; The time at which the compute was last modified. + ModifiedOn *time.Time `json:"modifiedOn,omitempty" azure:"ro"` + + // READ-ONLY; Errors during provisioning + ProvisioningErrors []*ErrorResponse `json:"provisioningErrors,omitempty" azure:"ro"` + + // READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` +} + +// GetCompute implements the ComputeClassification interface for type Databricks. +func (d *Databricks) GetCompute() *Compute { + return &Compute{ + ComputeType: d.ComputeType, + ComputeLocation: d.ComputeLocation, + ProvisioningState: d.ProvisioningState, + Description: d.Description, + CreatedOn: d.CreatedOn, + ModifiedOn: d.ModifiedOn, + ResourceID: d.ResourceID, + ProvisioningErrors: d.ProvisioningErrors, + IsAttachedCompute: d.IsAttachedCompute, + DisableLocalAuth: d.DisableLocalAuth, + } +} + +// DatabricksComputeSecrets - Secrets related to a Machine Learning compute based on Databricks. +type DatabricksComputeSecrets struct { + // REQUIRED; The type of compute + ComputeType *ComputeType `json:"computeType,omitempty"` + + // access token for databricks account. + DatabricksAccessToken *string `json:"databricksAccessToken,omitempty"` +} + +// GetComputeSecrets implements the ComputeSecretsClassification interface for type DatabricksComputeSecrets. +func (d *DatabricksComputeSecrets) GetComputeSecrets() *ComputeSecrets { + return &ComputeSecrets{ + ComputeType: d.ComputeType, + } +} + +// DatabricksComputeSecretsProperties - Properties of Databricks Compute Secrets +type DatabricksComputeSecretsProperties struct { + // access token for databricks account. + DatabricksAccessToken *string `json:"databricksAccessToken,omitempty"` +} + +// DatabricksProperties - Properties of Databricks +type DatabricksProperties struct { + // Databricks access token + DatabricksAccessToken *string `json:"databricksAccessToken,omitempty"` + + // Workspace Url + WorkspaceURL *string `json:"workspaceUrl,omitempty"` +} + +type DatabricksSchema struct { + // Properties of Databricks + Properties *DatabricksProperties `json:"properties,omitempty"` +} + +// Datastore - Azure Resource Manager resource envelope. +type Datastore struct { + // REQUIRED; [Required] Additional attributes of the entity. + Properties DatastorePropertiesClassification `json:"properties,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +// DatastoreCredentialsClassification provides polymorphic access to related types. +// Call the interface's GetDatastoreCredentials() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AccountKeyDatastoreCredentials, *CertificateDatastoreCredentials, *DatastoreCredentials, *NoneDatastoreCredentials, +// - *SasDatastoreCredentials, *ServicePrincipalDatastoreCredentials +type DatastoreCredentialsClassification interface { + // GetDatastoreCredentials returns the DatastoreCredentials content of the underlying type. + GetDatastoreCredentials() *DatastoreCredentials +} + +// DatastoreCredentials - Base definition for datastore credentials. +type DatastoreCredentials struct { + // REQUIRED; [Required] Credential type used to authentication with storage. + CredentialsType *CredentialsType `json:"credentialsType,omitempty"` +} + +// GetDatastoreCredentials implements the DatastoreCredentialsClassification interface for type DatastoreCredentials. +func (d *DatastoreCredentials) GetDatastoreCredentials() *DatastoreCredentials { return d } + +// DatastorePropertiesClassification provides polymorphic access to related types. +// Call the interface's GetDatastoreProperties() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureBlobDatastore, *AzureDataLakeGen1Datastore, *AzureDataLakeGen2Datastore, *AzureFileDatastore, *DatastoreProperties +type DatastorePropertiesClassification interface { + // GetDatastoreProperties returns the DatastoreProperties content of the underlying type. + GetDatastoreProperties() *DatastoreProperties +} + +// DatastoreProperties - Base definition for datastore contents configuration. +type DatastoreProperties struct { + // REQUIRED; [Required] Account credentials. + Credentials DatastoreCredentialsClassification `json:"credentials,omitempty"` + + // REQUIRED; [Required] Storage type backing the datastore. + DatastoreType *DatastoreType `json:"datastoreType,omitempty"` + + // The asset description text. + Description *string `json:"description,omitempty"` + + // The asset property dictionary. + Properties map[string]*string `json:"properties,omitempty"` + + // Tag dictionary. Tags can be added, removed, and updated. + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; Readonly property to indicate if datastore is the workspace default datastore + IsDefault *bool `json:"isDefault,omitempty" azure:"ro"` +} + +// GetDatastoreProperties implements the DatastorePropertiesClassification interface for type DatastoreProperties. +func (d *DatastoreProperties) GetDatastoreProperties() *DatastoreProperties { return d } + +// DatastoreResourceArmPaginatedResult - A paginated list of Datastore entities. +type DatastoreResourceArmPaginatedResult struct { + // The link to the next page of Datastore objects. If null, there are no additional pages. + NextLink *string `json:"nextLink,omitempty"` + + // An array of objects of type Datastore. + Value []*Datastore `json:"value,omitempty"` +} + +// DatastoreSecretsClassification provides polymorphic access to related types. +// Call the interface's GetDatastoreSecrets() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AccountKeyDatastoreSecrets, *CertificateDatastoreSecrets, *DatastoreSecrets, *SasDatastoreSecrets, *ServicePrincipalDatastoreSecrets +type DatastoreSecretsClassification interface { + // GetDatastoreSecrets returns the DatastoreSecrets content of the underlying type. + GetDatastoreSecrets() *DatastoreSecrets +} + +// DatastoreSecrets - Base definition for datastore secrets. +type DatastoreSecrets struct { + // REQUIRED; [Required] Credential type used to authentication with storage. + SecretsType *SecretsType `json:"secretsType,omitempty"` +} + +// GetDatastoreSecrets implements the DatastoreSecretsClassification interface for type DatastoreSecrets. +func (d *DatastoreSecrets) GetDatastoreSecrets() *DatastoreSecrets { return d } + +// DatastoresClientCreateOrUpdateOptions contains the optional parameters for the DatastoresClient.CreateOrUpdate method. +type DatastoresClientCreateOrUpdateOptions struct { + // Flag to skip validation. + SkipValidation *bool +} + +// DatastoresClientDeleteOptions contains the optional parameters for the DatastoresClient.Delete method. +type DatastoresClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// DatastoresClientGetOptions contains the optional parameters for the DatastoresClient.Get method. +type DatastoresClientGetOptions struct { + // placeholder for future optional parameters +} + +// DatastoresClientListOptions contains the optional parameters for the DatastoresClient.List method. +type DatastoresClientListOptions struct { + // Maximum number of results to return. + Count *int32 + // Filter down to the workspace default datastore. + IsDefault *bool + // Names of datastores to return. + Names []string + // Order by property (createdtime | modifiedtime | name). + OrderBy *string + // Order by property in ascending order. + OrderByAsc *bool + // Text to search for in the datastore names. + SearchText *string + // Continuation token for pagination. + Skip *string +} + +// DatastoresClientListSecretsOptions contains the optional parameters for the DatastoresClient.ListSecrets method. +type DatastoresClientListSecretsOptions struct { + // placeholder for future optional parameters +} + +type DefaultScaleSettings struct { + // REQUIRED; [Required] Type of deployment scaling algorithm + ScaleType *ScaleType `json:"scaleType,omitempty"` +} + +// GetOnlineScaleSettings implements the OnlineScaleSettingsClassification interface for type DefaultScaleSettings. +func (d *DefaultScaleSettings) GetOnlineScaleSettings() *OnlineScaleSettings { + return &OnlineScaleSettings{ + ScaleType: d.ScaleType, + } +} + +type DeploymentLogs struct { + // The retrieved online deployment logs. + Content *string `json:"content,omitempty"` +} + +type DeploymentLogsRequest struct { + // The type of container to retrieve logs from. + ContainerType *ContainerType `json:"containerType,omitempty"` + + // The maximum number of lines to tail. + Tail *int32 `json:"tail,omitempty"` +} + +type DiagnoseRequestProperties struct { + // Setting for diagnosing dependent application insights + ApplicationInsights map[string]interface{} `json:"applicationInsights,omitempty"` + + // Setting for diagnosing dependent container registry + ContainerRegistry map[string]interface{} `json:"containerRegistry,omitempty"` + + // Setting for diagnosing dns resolution + DNSResolution map[string]interface{} `json:"dnsResolution,omitempty"` + + // Setting for diagnosing dependent key vault + KeyVault map[string]interface{} `json:"keyVault,omitempty"` + + // Setting for diagnosing network security group + Nsg map[string]interface{} `json:"nsg,omitempty"` + + // Setting for diagnosing unclassified category of problems + Others map[string]interface{} `json:"others,omitempty"` + + // Setting for diagnosing resource lock + ResourceLock map[string]interface{} `json:"resourceLock,omitempty"` + + // Setting for diagnosing dependent storage account + StorageAccount map[string]interface{} `json:"storageAccount,omitempty"` + + // Setting for diagnosing user defined routing + Udr map[string]interface{} `json:"udr,omitempty"` +} + +type DiagnoseResponseResult struct { + Value *DiagnoseResponseResultValue `json:"value,omitempty"` +} + +type DiagnoseResponseResultValue struct { + ApplicationInsightsResults []*DiagnoseResult `json:"applicationInsightsResults,omitempty"` + ContainerRegistryResults []*DiagnoseResult `json:"containerRegistryResults,omitempty"` + DNSResolutionResults []*DiagnoseResult `json:"dnsResolutionResults,omitempty"` + KeyVaultResults []*DiagnoseResult `json:"keyVaultResults,omitempty"` + NetworkSecurityRuleResults []*DiagnoseResult `json:"networkSecurityRuleResults,omitempty"` + OtherResults []*DiagnoseResult `json:"otherResults,omitempty"` + ResourceLockResults []*DiagnoseResult `json:"resourceLockResults,omitempty"` + StorageAccountResults []*DiagnoseResult `json:"storageAccountResults,omitempty"` + UserDefinedRouteResults []*DiagnoseResult `json:"userDefinedRouteResults,omitempty"` +} + +// DiagnoseResult - Result of Diagnose +type DiagnoseResult struct { + // READ-ONLY; Code for workspace setup error + Code *string `json:"code,omitempty" azure:"ro"` + + // READ-ONLY; Level of workspace setup error + Level *DiagnoseResultLevel `json:"level,omitempty" azure:"ro"` + + // READ-ONLY; Message of workspace setup error + Message *string `json:"message,omitempty" azure:"ro"` +} + +// DiagnoseWorkspaceParameters - Parameters to diagnose a workspace +type DiagnoseWorkspaceParameters struct { + // Value of Parameters + Value *DiagnoseRequestProperties `json:"value,omitempty"` +} + +// DistributionConfigurationClassification provides polymorphic access to related types. +// Call the interface's GetDistributionConfiguration() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *DistributionConfiguration, *Mpi, *PyTorch, *TensorFlow +type DistributionConfigurationClassification interface { + // GetDistributionConfiguration returns the DistributionConfiguration content of the underlying type. + GetDistributionConfiguration() *DistributionConfiguration +} + +// DistributionConfiguration - Base definition for job distribution configuration. +type DistributionConfiguration struct { + // REQUIRED; [Required] Specifies the type of distribution framework. + DistributionType *DistributionType `json:"distributionType,omitempty"` +} + +// GetDistributionConfiguration implements the DistributionConfigurationClassification interface for type DistributionConfiguration. +func (d *DistributionConfiguration) GetDistributionConfiguration() *DistributionConfiguration { + return d +} + +// EarlyTerminationPolicyClassification provides polymorphic access to related types. +// Call the interface's GetEarlyTerminationPolicy() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *BanditPolicy, *EarlyTerminationPolicy, *MedianStoppingPolicy, *TruncationSelectionPolicy +type EarlyTerminationPolicyClassification interface { + // GetEarlyTerminationPolicy returns the EarlyTerminationPolicy content of the underlying type. + GetEarlyTerminationPolicy() *EarlyTerminationPolicy +} + +// EarlyTerminationPolicy - Early termination policies enable canceling poor-performing runs before they complete +type EarlyTerminationPolicy struct { + // REQUIRED; [Required] Name of policy configuration + PolicyType *EarlyTerminationPolicyType `json:"policyType,omitempty"` + + // Number of intervals by which to delay the first evaluation. + DelayEvaluation *int32 `json:"delayEvaluation,omitempty"` + + // Interval (number of runs) between policy evaluations. + EvaluationInterval *int32 `json:"evaluationInterval,omitempty"` +} + +// GetEarlyTerminationPolicy implements the EarlyTerminationPolicyClassification interface for type EarlyTerminationPolicy. +func (e *EarlyTerminationPolicy) GetEarlyTerminationPolicy() *EarlyTerminationPolicy { return e } + +type EncryptionKeyVaultProperties struct { + // REQUIRED; Key vault uri to access the encryption key. + KeyIdentifier *string `json:"keyIdentifier,omitempty"` + + // REQUIRED; The ArmId of the keyVault where the customer owned encryption key is present. + KeyVaultArmID *string `json:"keyVaultArmId,omitempty"` + + // For future use - The client id of the identity which will be used to access key vault. + IdentityClientID *string `json:"identityClientId,omitempty"` +} + +type EncryptionProperty struct { + // REQUIRED; Customer Key vault properties. + KeyVaultProperties *EncryptionKeyVaultProperties `json:"keyVaultProperties,omitempty"` + + // REQUIRED; Indicates whether or not the encryption is enabled for the workspace. + Status *EncryptionStatus `json:"status,omitempty"` + + // The identity that will be used to access the key vault for encryption at rest. + Identity *IdentityForCmk `json:"identity,omitempty"` +} + +// EndpointAuthKeys - Keys for endpoint authentication. +type EndpointAuthKeys struct { + // The primary key. + PrimaryKey *string `json:"primaryKey,omitempty"` + + // The secondary key. + SecondaryKey *string `json:"secondaryKey,omitempty"` +} + +// EndpointAuthToken - Service Token +type EndpointAuthToken struct { + // Access token for endpoint authentication. + AccessToken *string `json:"accessToken,omitempty"` + + // Access token expiry time (UTC). + ExpiryTimeUTC *int64 `json:"expiryTimeUtc,omitempty"` + + // Refresh access token after time (UTC). + RefreshAfterTimeUTC *int64 `json:"refreshAfterTimeUtc,omitempty"` + + // Access token type. + TokenType *string `json:"tokenType,omitempty"` +} + +// EndpointDeploymentPropertiesBase - Base definition for endpoint deployment. +type EndpointDeploymentPropertiesBase struct { + // Code configuration for the endpoint deployment. + CodeConfiguration *CodeConfiguration `json:"codeConfiguration,omitempty"` + + // Description of the endpoint deployment. + Description *string `json:"description,omitempty"` + + // ARM resource ID or AssetId of the environment specification for the endpoint deployment. + EnvironmentID *string `json:"environmentId,omitempty"` + + // Environment variables configuration for the deployment. + EnvironmentVariables map[string]*string `json:"environmentVariables,omitempty"` + + // Property dictionary. Properties can be added, but not removed or altered. + Properties map[string]*string `json:"properties,omitempty"` +} + +// EndpointPropertiesBase - Inference Endpoint base definition +type EndpointPropertiesBase struct { + // REQUIRED; [Required] Use 'Key' for key based authentication and 'AMLToken' for Azure Machine Learning token-based authentication. + // 'Key' doesn't expire but 'AMLToken' does. + AuthMode *EndpointAuthMode `json:"authMode,omitempty"` + + // Description of the inference endpoint. + Description *string `json:"description,omitempty"` + + // EndpointAuthKeys to set initially on an Endpoint. This property will always be returned as null. AuthKey values must be + // retrieved using the ListKeys API. + Keys *EndpointAuthKeys `json:"keys,omitempty"` + + // Property dictionary. Properties can be added, but not removed or altered. + Properties map[string]*string `json:"properties,omitempty"` + + // READ-ONLY; Endpoint URI. + ScoringURI *string `json:"scoringUri,omitempty" azure:"ro"` + + // READ-ONLY; Endpoint Swagger URI. + SwaggerURI *string `json:"swaggerUri,omitempty" azure:"ro"` +} + +// EnvironmentContainer - Azure Resource Manager resource envelope. +type EnvironmentContainer struct { + // REQUIRED; [Required] Additional attributes of the entity. + Properties *EnvironmentContainerProperties `json:"properties,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +// EnvironmentContainerProperties - Container for environment specification versions. +type EnvironmentContainerProperties struct { + // The asset description text. + Description *string `json:"description,omitempty"` + + // Is the asset archived? + IsArchived *bool `json:"isArchived,omitempty"` + + // The asset property dictionary. + Properties map[string]*string `json:"properties,omitempty"` + + // Tag dictionary. Tags can be added, removed, and updated. + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; The latest version inside this container. + LatestVersion *string `json:"latestVersion,omitempty" azure:"ro"` + + // READ-ONLY; The next auto incremental version + NextVersion *string `json:"nextVersion,omitempty" azure:"ro"` +} + +// EnvironmentContainerResourceArmPaginatedResult - A paginated list of EnvironmentContainer entities. +type EnvironmentContainerResourceArmPaginatedResult struct { + // The link to the next page of EnvironmentContainer objects. If null, there are no additional pages. + NextLink *string `json:"nextLink,omitempty"` + + // An array of objects of type EnvironmentContainer. + Value []*EnvironmentContainer `json:"value,omitempty"` +} + +// EnvironmentContainersClientCreateOrUpdateOptions contains the optional parameters for the EnvironmentContainersClient.CreateOrUpdate +// method. +type EnvironmentContainersClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// EnvironmentContainersClientDeleteOptions contains the optional parameters for the EnvironmentContainersClient.Delete method. +type EnvironmentContainersClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// EnvironmentContainersClientGetOptions contains the optional parameters for the EnvironmentContainersClient.Get method. +type EnvironmentContainersClientGetOptions struct { + // placeholder for future optional parameters +} + +// EnvironmentContainersClientListOptions contains the optional parameters for the EnvironmentContainersClient.List method. +type EnvironmentContainersClientListOptions struct { + // View type for including/excluding (for example) archived entities. + ListViewType *ListViewType + // Continuation token for pagination. + Skip *string +} + +// EnvironmentVersion - Azure Resource Manager resource envelope. +type EnvironmentVersion struct { + // REQUIRED; [Required] Additional attributes of the entity. + Properties *EnvironmentVersionProperties `json:"properties,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +// EnvironmentVersionProperties - Environment version details. +type EnvironmentVersionProperties struct { + // Configuration settings for Docker build context. + Build *BuildContext `json:"build,omitempty"` + + // Standard configuration file used by Conda that lets you install any kind of package, including Python, R, and C/C++ packages. + CondaFile *string `json:"condaFile,omitempty"` + + // The asset description text. + Description *string `json:"description,omitempty"` + + // Name of the image that will be used for the environment. + Image *string `json:"image,omitempty"` + + // Defines configuration specific to inference. + InferenceConfig *InferenceContainerProperties `json:"inferenceConfig,omitempty"` + + // If the name version are system generated (anonymous registration). + IsAnonymous *bool `json:"isAnonymous,omitempty"` + + // Is the asset archived? + IsArchived *bool `json:"isArchived,omitempty"` + + // The OS type of the environment. + OSType *OperatingSystemType `json:"osType,omitempty"` + + // The asset property dictionary. + Properties map[string]*string `json:"properties,omitempty"` + + // Tag dictionary. Tags can be added, removed, and updated. + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; Environment type is either user managed or curated by the Azure ML service + EnvironmentType *EnvironmentType `json:"environmentType,omitempty" azure:"ro"` +} + +// EnvironmentVersionResourceArmPaginatedResult - A paginated list of EnvironmentVersion entities. +type EnvironmentVersionResourceArmPaginatedResult struct { + // The link to the next page of EnvironmentVersion objects. If null, there are no additional pages. + NextLink *string `json:"nextLink,omitempty"` + + // An array of objects of type EnvironmentVersion. + Value []*EnvironmentVersion `json:"value,omitempty"` +} + +// EnvironmentVersionsClientCreateOrUpdateOptions contains the optional parameters for the EnvironmentVersionsClient.CreateOrUpdate +// method. +type EnvironmentVersionsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// EnvironmentVersionsClientDeleteOptions contains the optional parameters for the EnvironmentVersionsClient.Delete method. +type EnvironmentVersionsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// EnvironmentVersionsClientGetOptions contains the optional parameters for the EnvironmentVersionsClient.Get method. +type EnvironmentVersionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// EnvironmentVersionsClientListOptions contains the optional parameters for the EnvironmentVersionsClient.List method. +type EnvironmentVersionsClientListOptions struct { + // View type for including/excluding (for example) archived entities. + ListViewType *ListViewType + // Ordering of list. + OrderBy *string + // Continuation token for pagination. + Skip *string + // Maximum number of records to return. + Top *int32 +} + +// ErrorAdditionalInfo - The resource management error additional info. +type ErrorAdditionalInfo struct { + // READ-ONLY; The additional info. + Info interface{} `json:"info,omitempty" azure:"ro"` + + // READ-ONLY; The additional info type. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// ErrorDetail - The error detail. +type ErrorDetail struct { + // READ-ONLY; The error additional info. + AdditionalInfo []*ErrorAdditionalInfo `json:"additionalInfo,omitempty" azure:"ro"` + + // READ-ONLY; The error code. + Code *string `json:"code,omitempty" azure:"ro"` + + // READ-ONLY; The error details. + Details []*ErrorDetail `json:"details,omitempty" azure:"ro"` + + // READ-ONLY; The error message. + Message *string `json:"message,omitempty" azure:"ro"` + + // READ-ONLY; The error target. + Target *string `json:"target,omitempty" azure:"ro"` +} + +// 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 `json:"error,omitempty"` +} + +// EstimatedVMPrice - The estimated price info for using a VM of a particular OS type, tier, etc. +type EstimatedVMPrice struct { + // REQUIRED; Operating system type used by the VM. + OSType *VMPriceOSType `json:"osType,omitempty"` + + // REQUIRED; The price charged for using the VM. + RetailPrice *float64 `json:"retailPrice,omitempty"` + + // REQUIRED; The type of the VM. + VMTier *VMTier `json:"vmTier,omitempty"` +} + +// EstimatedVMPrices - The estimated price info for using a VM. +type EstimatedVMPrices struct { + // REQUIRED; Three lettered code specifying the currency of the VM price. Example: USD + BillingCurrency *BillingCurrency `json:"billingCurrency,omitempty"` + + // REQUIRED; The unit of time measurement for the specified VM price. Example: OneHour + UnitOfMeasure *UnitOfMeasure `json:"unitOfMeasure,omitempty"` + + // REQUIRED; The list of estimated prices for using a VM of a particular OS type, tier, etc. + Values []*EstimatedVMPrice `json:"values,omitempty"` +} + +type ExternalFQDNResponse struct { + Value []*FQDNEndpoints `json:"value,omitempty"` +} + +type FQDNEndpoint struct { + DomainName *string `json:"domainName,omitempty"` + EndpointDetails []*FQDNEndpointDetail `json:"endpointDetails,omitempty"` +} + +type FQDNEndpointDetail struct { + Port *int32 `json:"port,omitempty"` +} + +type FQDNEndpoints struct { + Properties *FQDNEndpointsProperties `json:"properties,omitempty"` +} + +type FQDNEndpointsProperties struct { + Category *string `json:"category,omitempty"` + Endpoints []*FQDNEndpoint `json:"endpoints,omitempty"` +} + +type FlavorData struct { + // Model flavor-specific data. + Data map[string]*string `json:"data,omitempty"` +} + +// GridSamplingAlgorithm - Defines a Sampling Algorithm that exhaustively generates every value combination in the space +type GridSamplingAlgorithm struct { + // REQUIRED; [Required] The algorithm used for generating hyperparameter values, along with configuration properties + SamplingAlgorithmType *SamplingAlgorithmType `json:"samplingAlgorithmType,omitempty"` +} + +// GetSamplingAlgorithm implements the SamplingAlgorithmClassification interface for type GridSamplingAlgorithm. +func (g *GridSamplingAlgorithm) GetSamplingAlgorithm() *SamplingAlgorithm { + return &SamplingAlgorithm{ + SamplingAlgorithmType: g.SamplingAlgorithmType, + } +} + +// HDInsight - A HDInsight compute. +type HDInsight struct { + // REQUIRED; The type of compute + ComputeType *ComputeType `json:"computeType,omitempty"` + + // The description of the Machine Learning compute. + Description *string `json:"description,omitempty"` + + // Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for authentication. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + + // HDInsight compute properties + Properties *HDInsightProperties `json:"properties,omitempty"` + + // ARM resource id of the underlying compute + ResourceID *string `json:"resourceId,omitempty"` + + // READ-ONLY; Location for the underlying compute + ComputeLocation *string `json:"computeLocation,omitempty" azure:"ro"` + + // READ-ONLY; The time at which the compute was created. + CreatedOn *time.Time `json:"createdOn,omitempty" azure:"ro"` + + // READ-ONLY; Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning + // service provisioned it if false. + IsAttachedCompute *bool `json:"isAttachedCompute,omitempty" azure:"ro"` + + // READ-ONLY; The time at which the compute was last modified. + ModifiedOn *time.Time `json:"modifiedOn,omitempty" azure:"ro"` + + // READ-ONLY; Errors during provisioning + ProvisioningErrors []*ErrorResponse `json:"provisioningErrors,omitempty" azure:"ro"` + + // READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` +} + +// GetCompute implements the ComputeClassification interface for type HDInsight. +func (h *HDInsight) GetCompute() *Compute { + return &Compute{ + ComputeType: h.ComputeType, + ComputeLocation: h.ComputeLocation, + ProvisioningState: h.ProvisioningState, + Description: h.Description, + CreatedOn: h.CreatedOn, + ModifiedOn: h.ModifiedOn, + ResourceID: h.ResourceID, + ProvisioningErrors: h.ProvisioningErrors, + IsAttachedCompute: h.IsAttachedCompute, + DisableLocalAuth: h.DisableLocalAuth, + } +} + +// HDInsightProperties - HDInsight compute properties +type HDInsightProperties struct { + // Public IP address of the master node of the cluster. + Address *string `json:"address,omitempty"` + + // Admin credentials for master node of the cluster + AdministratorAccount *VirtualMachineSSHCredentials `json:"administratorAccount,omitempty"` + + // Port open for ssh connections on the master node of the cluster. + SSHPort *int32 `json:"sshPort,omitempty"` +} + +type HDInsightSchema struct { + // HDInsight compute properties + Properties *HDInsightProperties `json:"properties,omitempty"` +} + +// IDAssetReference - Reference to an asset via its ARM resource ID. +type IDAssetReference struct { + // REQUIRED; [Required] ARM resource ID of the asset. + AssetID *string `json:"assetId,omitempty"` + + // REQUIRED; [Required] Specifies the type of asset reference. + ReferenceType *ReferenceType `json:"referenceType,omitempty"` +} + +// GetAssetReferenceBase implements the AssetReferenceBaseClassification interface for type IDAssetReference. +func (i *IDAssetReference) GetAssetReferenceBase() *AssetReferenceBase { + return &AssetReferenceBase{ + ReferenceType: i.ReferenceType, + } +} + +// IdentityConfigurationClassification provides polymorphic access to related types. +// Call the interface's GetIdentityConfiguration() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AmlToken, *IdentityConfiguration, *ManagedIdentity, *UserIdentity +type IdentityConfigurationClassification interface { + // GetIdentityConfiguration returns the IdentityConfiguration content of the underlying type. + GetIdentityConfiguration() *IdentityConfiguration +} + +// IdentityConfiguration - Base definition for identity configuration. +type IdentityConfiguration struct { + // REQUIRED; [Required] Specifies the type of identity framework. + IdentityType *IdentityConfigurationType `json:"identityType,omitempty"` +} + +// GetIdentityConfiguration implements the IdentityConfigurationClassification interface for type IdentityConfiguration. +func (i *IdentityConfiguration) GetIdentityConfiguration() *IdentityConfiguration { return i } + +// IdentityForCmk - Identity that will be used to access key vault for encryption at rest +type IdentityForCmk struct { + // The ArmId of the user assigned identity that will be used to access the customer managed key vault + UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"` +} + +type InferenceContainerProperties struct { + // The route to check the liveness of the inference server container. + LivenessRoute *Route `json:"livenessRoute,omitempty"` + + // The route to check the readiness of the inference server container. + ReadinessRoute *Route `json:"readinessRoute,omitempty"` + + // The port to send the scoring requests to, within the inference server container. + ScoringRoute *Route `json:"scoringRoute,omitempty"` +} + +// InstanceTypeSchema - Instance type schema. +type InstanceTypeSchema struct { + // Node Selector + NodeSelector map[string]*string `json:"nodeSelector,omitempty"` + + // Resource requests/limits for this instance type + Resources *InstanceTypeSchemaResources `json:"resources,omitempty"` +} + +// InstanceTypeSchemaResources - Resource requests/limits for this instance type +type InstanceTypeSchemaResources struct { + // Resource limits for this instance type + Limits map[string]*string `json:"limits,omitempty"` + + // Resource requests for this instance type + Requests map[string]*string `json:"requests,omitempty"` +} + +// JobBase - Azure Resource Manager resource envelope. +type JobBase struct { + // REQUIRED; [Required] Additional attributes of the entity. + Properties JobBasePropertiesClassification `json:"properties,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +// JobBasePropertiesClassification provides polymorphic access to related types. +// Call the interface's GetJobBaseProperties() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *CommandJob, *JobBaseProperties, *PipelineJob, *SweepJob +type JobBasePropertiesClassification interface { + // GetJobBaseProperties returns the JobBaseProperties content of the underlying type. + GetJobBaseProperties() *JobBaseProperties +} + +// JobBaseProperties - Base definition for a job. +type JobBaseProperties struct { + // REQUIRED; [Required] Specifies the type of job. + JobType *JobType `json:"jobType,omitempty"` + + // ARM resource ID of the compute resource. + ComputeID *string `json:"computeId,omitempty"` + + // The asset description text. + Description *string `json:"description,omitempty"` + + // Display name of job. + DisplayName *string `json:"displayName,omitempty"` + + // The name of the experiment the job belongs to. If not set, the job is placed in the "Default" experiment. + ExperimentName *string `json:"experimentName,omitempty"` + + // Identity configuration. If set, this should be one of AmlToken, ManagedIdentity, UserIdentity or null. Defaults to AmlToken + // if null. + Identity IdentityConfigurationClassification `json:"identity,omitempty"` + + // Is the asset archived? + IsArchived *bool `json:"isArchived,omitempty"` + + // The asset property dictionary. + Properties map[string]*string `json:"properties,omitempty"` + + // List of JobEndpoints. For local jobs, a job endpoint will have an endpoint value of FileStreamObject. + Services map[string]*JobService `json:"services,omitempty"` + + // Tag dictionary. Tags can be added, removed, and updated. + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; Status of the job. + Status *JobStatus `json:"status,omitempty" azure:"ro"` +} + +// GetJobBaseProperties implements the JobBasePropertiesClassification interface for type JobBaseProperties. +func (j *JobBaseProperties) GetJobBaseProperties() *JobBaseProperties { return j } + +// JobBaseResourceArmPaginatedResult - A paginated list of JobBase entities. +type JobBaseResourceArmPaginatedResult struct { + // The link to the next page of JobBase objects. If null, there are no additional pages. + NextLink *string `json:"nextLink,omitempty"` + + // An array of objects of type JobBase. + Value []*JobBase `json:"value,omitempty"` +} + +// JobInputClassification provides polymorphic access to related types. +// Call the interface's GetJobInput() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *CustomModelJobInput, *JobInput, *LiteralJobInput, *MLFlowModelJobInput, *MLTableJobInput, *TritonModelJobInput, *URIFileJobInput, +// - *URIFolderJobInput +type JobInputClassification interface { + // GetJobInput returns the JobInput content of the underlying type. + GetJobInput() *JobInput +} + +// JobInput - Command job definition. +type JobInput struct { + // REQUIRED; [Required] Specifies the type of job. + JobInputType *JobInputType `json:"jobInputType,omitempty"` + + // Description for the input. + Description *string `json:"description,omitempty"` +} + +// GetJobInput implements the JobInputClassification interface for type JobInput. +func (j *JobInput) GetJobInput() *JobInput { return j } + +// JobLimitsClassification provides polymorphic access to related types. +// Call the interface's GetJobLimits() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *CommandJobLimits, *JobLimits, *SweepJobLimits +type JobLimitsClassification interface { + // GetJobLimits returns the JobLimits content of the underlying type. + GetJobLimits() *JobLimits +} + +type JobLimits struct { + // REQUIRED; [Required] JobLimit type. + JobLimitsType *JobLimitsType `json:"jobLimitsType,omitempty"` + + // The max run duration in ISO 8601 format, after which the job will be cancelled. Only supports duration with precision as + // low as Seconds. + Timeout *string `json:"timeout,omitempty"` +} + +// GetJobLimits implements the JobLimitsClassification interface for type JobLimits. +func (j *JobLimits) GetJobLimits() *JobLimits { return j } + +// JobOutputClassification provides polymorphic access to related types. +// Call the interface's GetJobOutput() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *CustomModelJobOutput, *JobOutput, *MLFlowModelJobOutput, *MLTableJobOutput, *TritonModelJobOutput, *URIFileJobOutput, +// - *URIFolderJobOutput +type JobOutputClassification interface { + // GetJobOutput returns the JobOutput content of the underlying type. + GetJobOutput() *JobOutput +} + +// JobOutput - Job output definition container information on where to find job output/logs. +type JobOutput struct { + // REQUIRED; [Required] Specifies the type of job. + JobOutputType *JobOutputType `json:"jobOutputType,omitempty"` + + // Description for the output. + Description *string `json:"description,omitempty"` +} + +// GetJobOutput implements the JobOutputClassification interface for type JobOutput. +func (j *JobOutput) GetJobOutput() *JobOutput { return j } + +// JobService - Job endpoint definition +type JobService struct { + // Url for endpoint. + Endpoint *string `json:"endpoint,omitempty"` + + // Endpoint type. + JobServiceType *string `json:"jobServiceType,omitempty"` + + // Port for endpoint. + Port *int32 `json:"port,omitempty"` + + // Additional properties to set on the endpoint. + Properties map[string]*string `json:"properties,omitempty"` + + // READ-ONLY; Any error in the service. + ErrorMessage *string `json:"errorMessage,omitempty" azure:"ro"` + + // READ-ONLY; Status of endpoint. + Status *string `json:"status,omitempty" azure:"ro"` +} + +// JobsClientBeginCancelOptions contains the optional parameters for the JobsClient.BeginCancel method. +type JobsClientBeginCancelOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// JobsClientBeginDeleteOptions contains the optional parameters for the JobsClient.BeginDelete method. +type JobsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// JobsClientCreateOrUpdateOptions contains the optional parameters for the JobsClient.CreateOrUpdate method. +type JobsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// JobsClientGetOptions contains the optional parameters for the JobsClient.Get method. +type JobsClientGetOptions struct { + // placeholder for future optional parameters +} + +// JobsClientListOptions contains the optional parameters for the JobsClient.List method. +type JobsClientListOptions struct { + // Type of job to be returned. + JobType *string + // View type for including/excluding (for example) archived entities. + ListViewType *ListViewType + // Continuation token for pagination. + Skip *string + // Jobs returned will have this tag key. + Tag *string +} + +// Kubernetes - A Machine Learning compute based on Kubernetes Compute. +type Kubernetes struct { + // REQUIRED; The type of compute + ComputeType *ComputeType `json:"computeType,omitempty"` + + // The description of the Machine Learning compute. + Description *string `json:"description,omitempty"` + + // Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for authentication. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + + // Properties of Kubernetes + Properties *KubernetesProperties `json:"properties,omitempty"` + + // ARM resource id of the underlying compute + ResourceID *string `json:"resourceId,omitempty"` + + // READ-ONLY; Location for the underlying compute + ComputeLocation *string `json:"computeLocation,omitempty" azure:"ro"` + + // READ-ONLY; The time at which the compute was created. + CreatedOn *time.Time `json:"createdOn,omitempty" azure:"ro"` + + // READ-ONLY; Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning + // service provisioned it if false. + IsAttachedCompute *bool `json:"isAttachedCompute,omitempty" azure:"ro"` + + // READ-ONLY; The time at which the compute was last modified. + ModifiedOn *time.Time `json:"modifiedOn,omitempty" azure:"ro"` + + // READ-ONLY; Errors during provisioning + ProvisioningErrors []*ErrorResponse `json:"provisioningErrors,omitempty" azure:"ro"` + + // READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` +} + +// GetCompute implements the ComputeClassification interface for type Kubernetes. +func (k *Kubernetes) GetCompute() *Compute { + return &Compute{ + ComputeType: k.ComputeType, + ComputeLocation: k.ComputeLocation, + ProvisioningState: k.ProvisioningState, + Description: k.Description, + CreatedOn: k.CreatedOn, + ModifiedOn: k.ModifiedOn, + ResourceID: k.ResourceID, + ProvisioningErrors: k.ProvisioningErrors, + IsAttachedCompute: k.IsAttachedCompute, + DisableLocalAuth: k.DisableLocalAuth, + } +} + +// KubernetesOnlineDeployment - Properties specific to a KubernetesOnlineDeployment. +type KubernetesOnlineDeployment struct { + // REQUIRED; [Required] The compute type of the endpoint. + EndpointComputeType *EndpointComputeType `json:"endpointComputeType,omitempty"` + + // If true, enables Application Insights logging. + AppInsightsEnabled *bool `json:"appInsightsEnabled,omitempty"` + + // Code configuration for the endpoint deployment. + CodeConfiguration *CodeConfiguration `json:"codeConfiguration,omitempty"` + + // The resource requirements for the container (cpu and memory). + ContainerResourceRequirements *ContainerResourceRequirements `json:"containerResourceRequirements,omitempty"` + + // Description of the endpoint deployment. + Description *string `json:"description,omitempty"` + + // ARM resource ID or AssetId of the environment specification for the endpoint deployment. + EnvironmentID *string `json:"environmentId,omitempty"` + + // Environment variables configuration for the deployment. + EnvironmentVariables map[string]*string `json:"environmentVariables,omitempty"` + + // Compute instance type. + InstanceType *string `json:"instanceType,omitempty"` + + // Liveness probe monitors the health of the container regularly. + LivenessProbe *ProbeSettings `json:"livenessProbe,omitempty"` + + // The URI path to the model. + Model *string `json:"model,omitempty"` + + // The path to mount the model in custom container. + ModelMountPath *string `json:"modelMountPath,omitempty"` + + // Property dictionary. Properties can be added, but not removed or altered. + Properties map[string]*string `json:"properties,omitempty"` + + // Readiness probe validates if the container is ready to serve traffic. The properties and defaults are the same as liveness + // probe. + ReadinessProbe *ProbeSettings `json:"readinessProbe,omitempty"` + + // Request settings for the deployment. + RequestSettings *OnlineRequestSettings `json:"requestSettings,omitempty"` + + // Scale settings for the deployment. If it is null or not provided, it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment + // and to DefaultScaleSettings for ManagedOnlineDeployment. + ScaleSettings OnlineScaleSettingsClassification `json:"scaleSettings,omitempty"` + + // READ-ONLY; Provisioning state for the endpoint deployment. + ProvisioningState *DeploymentProvisioningState `json:"provisioningState,omitempty" azure:"ro"` +} + +// GetOnlineDeploymentProperties implements the OnlineDeploymentPropertiesClassification interface for type KubernetesOnlineDeployment. +func (k *KubernetesOnlineDeployment) GetOnlineDeploymentProperties() *OnlineDeploymentProperties { + return &OnlineDeploymentProperties{ + AppInsightsEnabled: k.AppInsightsEnabled, + EndpointComputeType: k.EndpointComputeType, + InstanceType: k.InstanceType, + LivenessProbe: k.LivenessProbe, + Model: k.Model, + ModelMountPath: k.ModelMountPath, + ProvisioningState: k.ProvisioningState, + ReadinessProbe: k.ReadinessProbe, + RequestSettings: k.RequestSettings, + ScaleSettings: k.ScaleSettings, + CodeConfiguration: k.CodeConfiguration, + Description: k.Description, + EnvironmentID: k.EnvironmentID, + EnvironmentVariables: k.EnvironmentVariables, + Properties: k.Properties, + } +} + +// KubernetesProperties - Kubernetes properties +type KubernetesProperties struct { + // Default instance type + DefaultInstanceType *string `json:"defaultInstanceType,omitempty"` + + // Extension instance release train. + ExtensionInstanceReleaseTrain *string `json:"extensionInstanceReleaseTrain,omitempty"` + + // Extension principal-id. + ExtensionPrincipalID *string `json:"extensionPrincipalId,omitempty"` + + // Instance Type Schema + InstanceTypes map[string]*InstanceTypeSchema `json:"instanceTypes,omitempty"` + + // Compute namespace + Namespace *string `json:"namespace,omitempty"` + + // Relay connection string. + RelayConnectionString *string `json:"relayConnectionString,omitempty"` + + // ServiceBus connection string. + ServiceBusConnectionString *string `json:"serviceBusConnectionString,omitempty"` + + // VC name. + VcName *string `json:"vcName,omitempty"` +} + +// KubernetesSchema - Kubernetes Compute Schema +type KubernetesSchema struct { + // Properties of Kubernetes + Properties *KubernetesProperties `json:"properties,omitempty"` +} + +// ListAmlUserFeatureResult - The List Aml user feature operation response. +type ListAmlUserFeatureResult struct { + // READ-ONLY; The URI to fetch the next page of AML user features information. Call ListNext() with this to fetch the next + // page of AML user features information. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` + + // READ-ONLY; The list of AML user facing features. + Value []*AmlUserFeature `json:"value,omitempty" azure:"ro"` +} + +type ListNotebookKeysResult struct { + // READ-ONLY + PrimaryAccessKey *string `json:"primaryAccessKey,omitempty" azure:"ro"` + + // READ-ONLY + SecondaryAccessKey *string `json:"secondaryAccessKey,omitempty" azure:"ro"` +} + +type ListStorageAccountKeysResult struct { + // READ-ONLY + UserStorageKey *string `json:"userStorageKey,omitempty" azure:"ro"` +} + +// ListUsagesResult - The List Usages operation response. +type ListUsagesResult struct { + // READ-ONLY; The URI to fetch the next page of AML resource usage information. Call ListNext() with this to fetch the next + // page of AML resource usage information. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` + + // READ-ONLY; The list of AML resource usages. + Value []*Usage `json:"value,omitempty" azure:"ro"` +} + +type ListWorkspaceKeysResult struct { + // READ-ONLY + AppInsightsInstrumentationKey *string `json:"appInsightsInstrumentationKey,omitempty" azure:"ro"` + + // READ-ONLY + ContainerRegistryCredentials *RegistryListCredentialsResult `json:"containerRegistryCredentials,omitempty" azure:"ro"` + + // READ-ONLY + NotebookAccessKeys *ListNotebookKeysResult `json:"notebookAccessKeys,omitempty" azure:"ro"` + + // READ-ONLY + UserStorageKey *string `json:"userStorageKey,omitempty" azure:"ro"` + + // READ-ONLY + UserStorageResourceID *string `json:"userStorageResourceId,omitempty" azure:"ro"` +} + +// ListWorkspaceQuotas - The List WorkspaceQuotasByVMFamily operation response. +type ListWorkspaceQuotas struct { + // READ-ONLY; The URI to fetch the next page of workspace quota information by VM Family. Call ListNext() with this to fetch + // the next page of Workspace Quota information. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` + + // READ-ONLY; The list of Workspace Quotas by VM Family + Value []*ResourceQuota `json:"value,omitempty" azure:"ro"` +} + +// LiteralJobInput - Literal input type. +type LiteralJobInput struct { + // REQUIRED; [Required] Specifies the type of job. + JobInputType *JobInputType `json:"jobInputType,omitempty"` + + // REQUIRED; [Required] Literal value for the input. + Value *string `json:"value,omitempty"` + + // Description for the input. + Description *string `json:"description,omitempty"` +} + +// GetJobInput implements the JobInputClassification interface for type LiteralJobInput. +func (l *LiteralJobInput) GetJobInput() *JobInput { + return &JobInput{ + Description: l.Description, + JobInputType: l.JobInputType, + } +} + +type MLFlowModelJobInput struct { + // REQUIRED; [Required] Specifies the type of job. + JobInputType *JobInputType `json:"jobInputType,omitempty"` + + // REQUIRED; [Required] Input Asset URI. + URI *string `json:"uri,omitempty"` + + // Description for the input. + Description *string `json:"description,omitempty"` + + // Input Asset Delivery Mode. + Mode *InputDeliveryMode `json:"mode,omitempty"` +} + +// GetJobInput implements the JobInputClassification interface for type MLFlowModelJobInput. +func (m *MLFlowModelJobInput) GetJobInput() *JobInput { + return &JobInput{ + Description: m.Description, + JobInputType: m.JobInputType, + } +} + +type MLFlowModelJobOutput struct { + // REQUIRED; [Required] Specifies the type of job. + JobOutputType *JobOutputType `json:"jobOutputType,omitempty"` + + // Description for the output. + Description *string `json:"description,omitempty"` + + // Output Asset Delivery Mode. + Mode *OutputDeliveryMode `json:"mode,omitempty"` + + // Output Asset URI. + URI *string `json:"uri,omitempty"` +} + +// GetJobOutput implements the JobOutputClassification interface for type MLFlowModelJobOutput. +func (m *MLFlowModelJobOutput) GetJobOutput() *JobOutput { + return &JobOutput{ + Description: m.Description, + JobOutputType: m.JobOutputType, + } +} + +// MLTableData - MLTable data definition +type MLTableData struct { + // REQUIRED; [Required] Specifies the type of data. + DataType *DataType `json:"dataType,omitempty"` + + // REQUIRED; [Required] Uri of the data. Usage/meaning depends on Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20220501.Assets.DataVersionBase.DataType + DataURI *string `json:"dataUri,omitempty"` + + // The asset description text. + Description *string `json:"description,omitempty"` + + // If the name version are system generated (anonymous registration). + IsAnonymous *bool `json:"isAnonymous,omitempty"` + + // Is the asset archived? + IsArchived *bool `json:"isArchived,omitempty"` + + // The asset property dictionary. + Properties map[string]*string `json:"properties,omitempty"` + + // Uris referenced in the MLTable definition (required for lineage) + ReferencedUris []*string `json:"referencedUris,omitempty"` + + // Tag dictionary. Tags can be added, removed, and updated. + Tags map[string]*string `json:"tags,omitempty"` +} + +// GetDataVersionBaseProperties implements the DataVersionBasePropertiesClassification interface for type MLTableData. +func (m *MLTableData) GetDataVersionBaseProperties() *DataVersionBaseProperties { + return &DataVersionBaseProperties{ + DataType: m.DataType, + DataURI: m.DataURI, + IsAnonymous: m.IsAnonymous, + IsArchived: m.IsArchived, + Description: m.Description, + Properties: m.Properties, + Tags: m.Tags, + } +} + +type MLTableJobInput struct { + // REQUIRED; [Required] Specifies the type of job. + JobInputType *JobInputType `json:"jobInputType,omitempty"` + + // REQUIRED; [Required] Input Asset URI. + URI *string `json:"uri,omitempty"` + + // Description for the input. + Description *string `json:"description,omitempty"` + + // Input Asset Delivery Mode. + Mode *InputDeliveryMode `json:"mode,omitempty"` +} + +// GetJobInput implements the JobInputClassification interface for type MLTableJobInput. +func (m *MLTableJobInput) GetJobInput() *JobInput { + return &JobInput{ + Description: m.Description, + JobInputType: m.JobInputType, + } +} + +type MLTableJobOutput struct { + // REQUIRED; [Required] Specifies the type of job. + JobOutputType *JobOutputType `json:"jobOutputType,omitempty"` + + // Description for the output. + Description *string `json:"description,omitempty"` + + // Output Asset Delivery Mode. + Mode *OutputDeliveryMode `json:"mode,omitempty"` + + // Output Asset URI. + URI *string `json:"uri,omitempty"` +} + +// GetJobOutput implements the JobOutputClassification interface for type MLTableJobOutput. +func (m *MLTableJobOutput) GetJobOutput() *JobOutput { + return &JobOutput{ + Description: m.Description, + JobOutputType: m.JobOutputType, + } +} + +// ManagedIdentity - Managed identity configuration. +type ManagedIdentity struct { + // REQUIRED; [Required] Specifies the type of identity framework. + IdentityType *IdentityConfigurationType `json:"identityType,omitempty"` + + // Specifies a user-assigned identity by client ID. For system-assigned, do not set this field. + ClientID *string `json:"clientId,omitempty"` + + // Specifies a user-assigned identity by object ID. For system-assigned, do not set this field. + ObjectID *string `json:"objectId,omitempty"` + + // Specifies a user-assigned identity by ARM resource ID. For system-assigned, do not set this field. + ResourceID *string `json:"resourceId,omitempty"` +} + +// GetIdentityConfiguration implements the IdentityConfigurationClassification interface for type ManagedIdentity. +func (m *ManagedIdentity) GetIdentityConfiguration() *IdentityConfiguration { + return &IdentityConfiguration{ + IdentityType: m.IdentityType, + } +} + +type ManagedIdentityAuthTypeWorkspaceConnectionProperties struct { + // REQUIRED; Authentication type of the connection target + AuthType *ConnectionAuthType `json:"authType,omitempty"` + + // Category of the connection + Category *ConnectionCategory `json:"category,omitempty"` + Credentials *WorkspaceConnectionManagedIdentity `json:"credentials,omitempty"` + Target *string `json:"target,omitempty"` + + // Value details of the workspace connection. + Value *string `json:"value,omitempty"` + + // format for the workspace connection value + ValueFormat *ValueFormat `json:"valueFormat,omitempty"` +} + +// GetWorkspaceConnectionPropertiesV2 implements the WorkspaceConnectionPropertiesV2Classification interface for type ManagedIdentityAuthTypeWorkspaceConnectionProperties. +func (m *ManagedIdentityAuthTypeWorkspaceConnectionProperties) GetWorkspaceConnectionPropertiesV2() *WorkspaceConnectionPropertiesV2 { + return &WorkspaceConnectionPropertiesV2{ + AuthType: m.AuthType, + Category: m.Category, + Target: m.Target, + Value: m.Value, + ValueFormat: m.ValueFormat, + } +} + +// ManagedOnlineDeployment - Properties specific to a ManagedOnlineDeployment. +type ManagedOnlineDeployment struct { + // REQUIRED; [Required] The compute type of the endpoint. + EndpointComputeType *EndpointComputeType `json:"endpointComputeType,omitempty"` + + // If true, enables Application Insights logging. + AppInsightsEnabled *bool `json:"appInsightsEnabled,omitempty"` + + // Code configuration for the endpoint deployment. + CodeConfiguration *CodeConfiguration `json:"codeConfiguration,omitempty"` + + // Description of the endpoint deployment. + Description *string `json:"description,omitempty"` + + // ARM resource ID or AssetId of the environment specification for the endpoint deployment. + EnvironmentID *string `json:"environmentId,omitempty"` + + // Environment variables configuration for the deployment. + EnvironmentVariables map[string]*string `json:"environmentVariables,omitempty"` + + // Compute instance type. + InstanceType *string `json:"instanceType,omitempty"` + + // Liveness probe monitors the health of the container regularly. + LivenessProbe *ProbeSettings `json:"livenessProbe,omitempty"` + + // The URI path to the model. + Model *string `json:"model,omitempty"` + + // The path to mount the model in custom container. + ModelMountPath *string `json:"modelMountPath,omitempty"` + + // Property dictionary. Properties can be added, but not removed or altered. + Properties map[string]*string `json:"properties,omitempty"` + + // Readiness probe validates if the container is ready to serve traffic. The properties and defaults are the same as liveness + // probe. + ReadinessProbe *ProbeSettings `json:"readinessProbe,omitempty"` + + // Request settings for the deployment. + RequestSettings *OnlineRequestSettings `json:"requestSettings,omitempty"` + + // Scale settings for the deployment. If it is null or not provided, it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment + // and to DefaultScaleSettings for ManagedOnlineDeployment. + ScaleSettings OnlineScaleSettingsClassification `json:"scaleSettings,omitempty"` + + // READ-ONLY; Provisioning state for the endpoint deployment. + ProvisioningState *DeploymentProvisioningState `json:"provisioningState,omitempty" azure:"ro"` +} + +// GetOnlineDeploymentProperties implements the OnlineDeploymentPropertiesClassification interface for type ManagedOnlineDeployment. +func (m *ManagedOnlineDeployment) GetOnlineDeploymentProperties() *OnlineDeploymentProperties { + return &OnlineDeploymentProperties{ + AppInsightsEnabled: m.AppInsightsEnabled, + EndpointComputeType: m.EndpointComputeType, + InstanceType: m.InstanceType, + LivenessProbe: m.LivenessProbe, + Model: m.Model, + ModelMountPath: m.ModelMountPath, + ProvisioningState: m.ProvisioningState, + ReadinessProbe: m.ReadinessProbe, + RequestSettings: m.RequestSettings, + ScaleSettings: m.ScaleSettings, + CodeConfiguration: m.CodeConfiguration, + Description: m.Description, + EnvironmentID: m.EnvironmentID, + EnvironmentVariables: m.EnvironmentVariables, + Properties: m.Properties, + } +} + +// ManagedServiceIdentity - Managed service identity (system assigned and/or user assigned identities) +type ManagedServiceIdentity struct { + // REQUIRED; Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + Type *ManagedServiceIdentityType `json:"type,omitempty"` + + // The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM + // resource ids in the form: + // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + // The dictionary values can be empty objects ({}) in + // requests. + UserAssignedIdentities map[string]*UserAssignedIdentity `json:"userAssignedIdentities,omitempty"` + + // READ-ONLY; The service principal ID of the system assigned identity. This property will only be provided for a system assigned + // identity. + PrincipalID *string `json:"principalId,omitempty" azure:"ro"` + + // READ-ONLY; The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. + TenantID *string `json:"tenantId,omitempty" azure:"ro"` +} + +// MedianStoppingPolicy - Defines an early termination policy based on running averages of the primary metric of all runs +type MedianStoppingPolicy struct { + // REQUIRED; [Required] Name of policy configuration + PolicyType *EarlyTerminationPolicyType `json:"policyType,omitempty"` + + // Number of intervals by which to delay the first evaluation. + DelayEvaluation *int32 `json:"delayEvaluation,omitempty"` + + // Interval (number of runs) between policy evaluations. + EvaluationInterval *int32 `json:"evaluationInterval,omitempty"` +} + +// GetEarlyTerminationPolicy implements the EarlyTerminationPolicyClassification interface for type MedianStoppingPolicy. +func (m *MedianStoppingPolicy) GetEarlyTerminationPolicy() *EarlyTerminationPolicy { + return &EarlyTerminationPolicy{ + DelayEvaluation: m.DelayEvaluation, + EvaluationInterval: m.EvaluationInterval, + PolicyType: m.PolicyType, + } +} + +// ModelContainer - Azure Resource Manager resource envelope. +type ModelContainer struct { + // REQUIRED; [Required] Additional attributes of the entity. + Properties *ModelContainerProperties `json:"properties,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +type ModelContainerProperties struct { + // The asset description text. + Description *string `json:"description,omitempty"` + + // Is the asset archived? + IsArchived *bool `json:"isArchived,omitempty"` + + // The asset property dictionary. + Properties map[string]*string `json:"properties,omitempty"` + + // Tag dictionary. Tags can be added, removed, and updated. + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; The latest version inside this container. + LatestVersion *string `json:"latestVersion,omitempty" azure:"ro"` + + // READ-ONLY; The next auto incremental version + NextVersion *string `json:"nextVersion,omitempty" azure:"ro"` +} + +// ModelContainerResourceArmPaginatedResult - A paginated list of ModelContainer entities. +type ModelContainerResourceArmPaginatedResult struct { + // The link to the next page of ModelContainer objects. If null, there are no additional pages. + NextLink *string `json:"nextLink,omitempty"` + + // An array of objects of type ModelContainer. + Value []*ModelContainer `json:"value,omitempty"` +} + +// ModelContainersClientCreateOrUpdateOptions contains the optional parameters for the ModelContainersClient.CreateOrUpdate +// method. +type ModelContainersClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// ModelContainersClientDeleteOptions contains the optional parameters for the ModelContainersClient.Delete method. +type ModelContainersClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ModelContainersClientGetOptions contains the optional parameters for the ModelContainersClient.Get method. +type ModelContainersClientGetOptions struct { + // placeholder for future optional parameters +} + +// ModelContainersClientListOptions contains the optional parameters for the ModelContainersClient.List method. +type ModelContainersClientListOptions struct { + // Maximum number of results to return. + Count *int32 + // View type for including/excluding (for example) archived entities. + ListViewType *ListViewType + // Continuation token for pagination. + Skip *string +} + +// ModelVersion - Azure Resource Manager resource envelope. +type ModelVersion struct { + // REQUIRED; [Required] Additional attributes of the entity. + Properties *ModelVersionProperties `json:"properties,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +// ModelVersionProperties - Model asset version details. +type ModelVersionProperties struct { + // The asset description text. + Description *string `json:"description,omitempty"` + + // Mapping of model flavors to their properties. + Flavors map[string]*FlavorData `json:"flavors,omitempty"` + + // If the name version are system generated (anonymous registration). + IsAnonymous *bool `json:"isAnonymous,omitempty"` + + // Is the asset archived? + IsArchived *bool `json:"isArchived,omitempty"` + + // Name of the training job which produced this model + JobName *string `json:"jobName,omitempty"` + + // The storage format for this entity. Used for NCD. + ModelType *string `json:"modelType,omitempty"` + + // The URI path to the model contents. + ModelURI *string `json:"modelUri,omitempty"` + + // The asset property dictionary. + Properties map[string]*string `json:"properties,omitempty"` + + // Tag dictionary. Tags can be added, removed, and updated. + Tags map[string]*string `json:"tags,omitempty"` +} + +// ModelVersionResourceArmPaginatedResult - A paginated list of ModelVersion entities. +type ModelVersionResourceArmPaginatedResult struct { + // The link to the next page of ModelVersion objects. If null, there are no additional pages. + NextLink *string `json:"nextLink,omitempty"` + + // An array of objects of type ModelVersion. + Value []*ModelVersion `json:"value,omitempty"` +} + +// ModelVersionsClientCreateOrUpdateOptions contains the optional parameters for the ModelVersionsClient.CreateOrUpdate method. +type ModelVersionsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// ModelVersionsClientDeleteOptions contains the optional parameters for the ModelVersionsClient.Delete method. +type ModelVersionsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ModelVersionsClientGetOptions contains the optional parameters for the ModelVersionsClient.Get method. +type ModelVersionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ModelVersionsClientListOptions contains the optional parameters for the ModelVersionsClient.List method. +type ModelVersionsClientListOptions struct { + // Model description. + Description *string + // Name of the feed. + Feed *string + // View type for including/excluding (for example) archived entities. + ListViewType *ListViewType + // Number of initial results to skip. + Offset *int32 + // Ordering of list. + OrderBy *string + // Comma-separated list of property names (and optionally values). Example: prop1,prop2=value2 + Properties *string + // Continuation token for pagination. + Skip *string + // Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2 + Tags *string + // Maximum number of records to return. + Top *int32 + // Model version. + Version *string +} + +// Mpi - MPI distribution configuration. +type Mpi struct { + // REQUIRED; [Required] Specifies the type of distribution framework. + DistributionType *DistributionType `json:"distributionType,omitempty"` + + // Number of processes per MPI node. + ProcessCountPerInstance *int32 `json:"processCountPerInstance,omitempty"` +} + +// GetDistributionConfiguration implements the DistributionConfigurationClassification interface for type Mpi. +func (m *Mpi) GetDistributionConfiguration() *DistributionConfiguration { + return &DistributionConfiguration{ + DistributionType: m.DistributionType, + } +} + +// NodeStateCounts - Counts of various compute node states on the amlCompute. +type NodeStateCounts struct { + // READ-ONLY; Number of compute nodes in idle state. + IdleNodeCount *int32 `json:"idleNodeCount,omitempty" azure:"ro"` + + // READ-ONLY; Number of compute nodes which are leaving the amlCompute. + LeavingNodeCount *int32 `json:"leavingNodeCount,omitempty" azure:"ro"` + + // READ-ONLY; Number of compute nodes which are in preempted state. + PreemptedNodeCount *int32 `json:"preemptedNodeCount,omitempty" azure:"ro"` + + // READ-ONLY; Number of compute nodes which are being prepared. + PreparingNodeCount *int32 `json:"preparingNodeCount,omitempty" azure:"ro"` + + // READ-ONLY; Number of compute nodes which are running jobs. + RunningNodeCount *int32 `json:"runningNodeCount,omitempty" azure:"ro"` + + // READ-ONLY; Number of compute nodes which are in unusable state. + UnusableNodeCount *int32 `json:"unusableNodeCount,omitempty" azure:"ro"` +} + +type NoneAuthTypeWorkspaceConnectionProperties struct { + // REQUIRED; Authentication type of the connection target + AuthType *ConnectionAuthType `json:"authType,omitempty"` + + // Category of the connection + Category *ConnectionCategory `json:"category,omitempty"` + Target *string `json:"target,omitempty"` + + // Value details of the workspace connection. + Value *string `json:"value,omitempty"` + + // format for the workspace connection value + ValueFormat *ValueFormat `json:"valueFormat,omitempty"` +} + +// GetWorkspaceConnectionPropertiesV2 implements the WorkspaceConnectionPropertiesV2Classification interface for type NoneAuthTypeWorkspaceConnectionProperties. +func (n *NoneAuthTypeWorkspaceConnectionProperties) GetWorkspaceConnectionPropertiesV2() *WorkspaceConnectionPropertiesV2 { + return &WorkspaceConnectionPropertiesV2{ + AuthType: n.AuthType, + Category: n.Category, + Target: n.Target, + Value: n.Value, + ValueFormat: n.ValueFormat, + } +} + +// NoneDatastoreCredentials - Empty/none datastore credentials. +type NoneDatastoreCredentials struct { + // REQUIRED; [Required] Credential type used to authentication with storage. + CredentialsType *CredentialsType `json:"credentialsType,omitempty"` +} + +// GetDatastoreCredentials implements the DatastoreCredentialsClassification interface for type NoneDatastoreCredentials. +func (n *NoneDatastoreCredentials) GetDatastoreCredentials() *DatastoreCredentials { + return &DatastoreCredentials{ + CredentialsType: n.CredentialsType, + } +} + +type NotebookAccessTokenResult struct { + // READ-ONLY + AccessToken *string `json:"accessToken,omitempty" azure:"ro"` + + // READ-ONLY + ExpiresIn *int32 `json:"expiresIn,omitempty" azure:"ro"` + + // READ-ONLY + HostName *string `json:"hostName,omitempty" azure:"ro"` + + // READ-ONLY + NotebookResourceID *string `json:"notebookResourceId,omitempty" azure:"ro"` + + // READ-ONLY + PublicDNS *string `json:"publicDns,omitempty" azure:"ro"` + + // READ-ONLY + RefreshToken *string `json:"refreshToken,omitempty" azure:"ro"` + + // READ-ONLY + Scope *string `json:"scope,omitempty" azure:"ro"` + + // READ-ONLY + TokenType *string `json:"tokenType,omitempty" azure:"ro"` +} + +type NotebookPreparationError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + StatusCode *int32 `json:"statusCode,omitempty"` +} + +type NotebookResourceInfo struct { + Fqdn *string `json:"fqdn,omitempty"` + + // The error that occurs when preparing notebook. + NotebookPreparationError *NotebookPreparationError `json:"notebookPreparationError,omitempty"` + + // the data plane resourceId that used to initialize notebook component + ResourceID *string `json:"resourceId,omitempty"` +} + +// Objective - Optimization objective. +type Objective struct { + // REQUIRED; [Required] Defines supported metric goals for hyperparameter tuning + Goal *Goal `json:"goal,omitempty"` + + // REQUIRED; [Required] Name of the metric to optimize. + PrimaryMetric *string `json:"primaryMetric,omitempty"` +} + +type OnlineDeployment struct { + // REQUIRED; The geo-location where the resource lives + Location *string `json:"location,omitempty"` + + // REQUIRED; [Required] Additional attributes of the entity. + Properties OnlineDeploymentPropertiesClassification `json:"properties,omitempty"` + + // Managed service identity (system assigned and/or user assigned identities) + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + + // Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. + Kind *string `json:"kind,omitempty"` + + // Sku details required for ARM contract for Autoscaling. + SKU *SKU `json:"sku,omitempty"` + + // Resource tags. + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +// OnlineDeploymentPropertiesClassification provides polymorphic access to related types. +// Call the interface's GetOnlineDeploymentProperties() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *KubernetesOnlineDeployment, *ManagedOnlineDeployment, *OnlineDeploymentProperties +type OnlineDeploymentPropertiesClassification interface { + // GetOnlineDeploymentProperties returns the OnlineDeploymentProperties content of the underlying type. + GetOnlineDeploymentProperties() *OnlineDeploymentProperties +} + +type OnlineDeploymentProperties struct { + // REQUIRED; [Required] The compute type of the endpoint. + EndpointComputeType *EndpointComputeType `json:"endpointComputeType,omitempty"` + + // If true, enables Application Insights logging. + AppInsightsEnabled *bool `json:"appInsightsEnabled,omitempty"` + + // Code configuration for the endpoint deployment. + CodeConfiguration *CodeConfiguration `json:"codeConfiguration,omitempty"` + + // Description of the endpoint deployment. + Description *string `json:"description,omitempty"` + + // ARM resource ID or AssetId of the environment specification for the endpoint deployment. + EnvironmentID *string `json:"environmentId,omitempty"` + + // Environment variables configuration for the deployment. + EnvironmentVariables map[string]*string `json:"environmentVariables,omitempty"` + + // Compute instance type. + InstanceType *string `json:"instanceType,omitempty"` + + // Liveness probe monitors the health of the container regularly. + LivenessProbe *ProbeSettings `json:"livenessProbe,omitempty"` + + // The URI path to the model. + Model *string `json:"model,omitempty"` + + // The path to mount the model in custom container. + ModelMountPath *string `json:"modelMountPath,omitempty"` + + // Property dictionary. Properties can be added, but not removed or altered. + Properties map[string]*string `json:"properties,omitempty"` + + // Readiness probe validates if the container is ready to serve traffic. The properties and defaults are the same as liveness + // probe. + ReadinessProbe *ProbeSettings `json:"readinessProbe,omitempty"` + + // Request settings for the deployment. + RequestSettings *OnlineRequestSettings `json:"requestSettings,omitempty"` + + // Scale settings for the deployment. If it is null or not provided, it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment + // and to DefaultScaleSettings for ManagedOnlineDeployment. + ScaleSettings OnlineScaleSettingsClassification `json:"scaleSettings,omitempty"` + + // READ-ONLY; Provisioning state for the endpoint deployment. + ProvisioningState *DeploymentProvisioningState `json:"provisioningState,omitempty" azure:"ro"` +} + +// GetOnlineDeploymentProperties implements the OnlineDeploymentPropertiesClassification interface for type OnlineDeploymentProperties. +func (o *OnlineDeploymentProperties) GetOnlineDeploymentProperties() *OnlineDeploymentProperties { + return o +} + +// OnlineDeploymentTrackedResourceArmPaginatedResult - A paginated list of OnlineDeployment entities. +type OnlineDeploymentTrackedResourceArmPaginatedResult struct { + // The link to the next page of OnlineDeployment objects. If null, there are no additional pages. + NextLink *string `json:"nextLink,omitempty"` + + // An array of objects of type OnlineDeployment. + Value []*OnlineDeployment `json:"value,omitempty"` +} + +// OnlineDeploymentsClientBeginCreateOrUpdateOptions contains the optional parameters for the OnlineDeploymentsClient.BeginCreateOrUpdate +// method. +type OnlineDeploymentsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// OnlineDeploymentsClientBeginDeleteOptions contains the optional parameters for the OnlineDeploymentsClient.BeginDelete +// method. +type OnlineDeploymentsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// OnlineDeploymentsClientBeginUpdateOptions contains the optional parameters for the OnlineDeploymentsClient.BeginUpdate +// method. +type OnlineDeploymentsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// OnlineDeploymentsClientGetLogsOptions contains the optional parameters for the OnlineDeploymentsClient.GetLogs method. +type OnlineDeploymentsClientGetLogsOptions struct { + // placeholder for future optional parameters +} + +// OnlineDeploymentsClientGetOptions contains the optional parameters for the OnlineDeploymentsClient.Get method. +type OnlineDeploymentsClientGetOptions struct { + // placeholder for future optional parameters +} + +// OnlineDeploymentsClientListOptions contains the optional parameters for the OnlineDeploymentsClient.List method. +type OnlineDeploymentsClientListOptions struct { + // Ordering of list. + OrderBy *string + // Continuation token for pagination. + Skip *string + // Top of list. + Top *int32 +} + +// OnlineDeploymentsClientListSKUsOptions contains the optional parameters for the OnlineDeploymentsClient.ListSKUs method. +type OnlineDeploymentsClientListSKUsOptions struct { + // Number of Skus to be retrieved in a page of results. + Count *int32 + // Continuation token for pagination. + Skip *string +} + +type OnlineEndpoint struct { + // REQUIRED; The geo-location where the resource lives + Location *string `json:"location,omitempty"` + + // REQUIRED; [Required] Additional attributes of the entity. + Properties *OnlineEndpointProperties `json:"properties,omitempty"` + + // Managed service identity (system assigned and/or user assigned identities) + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + + // Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. + Kind *string `json:"kind,omitempty"` + + // Sku details required for ARM contract for Autoscaling. + SKU *SKU `json:"sku,omitempty"` + + // Resource tags. + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +// OnlineEndpointProperties - Online endpoint configuration +type OnlineEndpointProperties struct { + // REQUIRED; [Required] Use 'Key' for key based authentication and 'AMLToken' for Azure Machine Learning token-based authentication. + // 'Key' doesn't expire but 'AMLToken' does. + AuthMode *EndpointAuthMode `json:"authMode,omitempty"` + + // ARM resource ID of the compute if it exists. optional + Compute *string `json:"compute,omitempty"` + + // Description of the inference endpoint. + Description *string `json:"description,omitempty"` + + // EndpointAuthKeys to set initially on an Endpoint. This property will always be returned as null. AuthKey values must be + // retrieved using the ListKeys API. + Keys *EndpointAuthKeys `json:"keys,omitempty"` + + // Property dictionary. Properties can be added, but not removed or altered. + Properties map[string]*string `json:"properties,omitempty"` + + // Percentage of traffic from endpoint to divert to each deployment. Traffic values need to sum to 100. + Traffic map[string]*int32 `json:"traffic,omitempty"` + + // READ-ONLY; Provisioning state for the endpoint. + ProvisioningState *EndpointProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + + // READ-ONLY; Endpoint URI. + ScoringURI *string `json:"scoringUri,omitempty" azure:"ro"` + + // READ-ONLY; Endpoint Swagger URI. + SwaggerURI *string `json:"swaggerUri,omitempty" azure:"ro"` +} + +// OnlineEndpointTrackedResourceArmPaginatedResult - A paginated list of OnlineEndpoint entities. +type OnlineEndpointTrackedResourceArmPaginatedResult struct { + // The link to the next page of OnlineEndpoint objects. If null, there are no additional pages. + NextLink *string `json:"nextLink,omitempty"` + + // An array of objects of type OnlineEndpoint. + Value []*OnlineEndpoint `json:"value,omitempty"` +} + +// OnlineEndpointsClientBeginCreateOrUpdateOptions contains the optional parameters for the OnlineEndpointsClient.BeginCreateOrUpdate +// method. +type OnlineEndpointsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// OnlineEndpointsClientBeginDeleteOptions contains the optional parameters for the OnlineEndpointsClient.BeginDelete method. +type OnlineEndpointsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// OnlineEndpointsClientBeginRegenerateKeysOptions contains the optional parameters for the OnlineEndpointsClient.BeginRegenerateKeys +// method. +type OnlineEndpointsClientBeginRegenerateKeysOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// OnlineEndpointsClientBeginUpdateOptions contains the optional parameters for the OnlineEndpointsClient.BeginUpdate method. +type OnlineEndpointsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// OnlineEndpointsClientGetOptions contains the optional parameters for the OnlineEndpointsClient.Get method. +type OnlineEndpointsClientGetOptions struct { + // placeholder for future optional parameters +} + +// OnlineEndpointsClientGetTokenOptions contains the optional parameters for the OnlineEndpointsClient.GetToken method. +type OnlineEndpointsClientGetTokenOptions struct { + // placeholder for future optional parameters +} + +// OnlineEndpointsClientListKeysOptions contains the optional parameters for the OnlineEndpointsClient.ListKeys method. +type OnlineEndpointsClientListKeysOptions struct { + // placeholder for future optional parameters +} + +// OnlineEndpointsClientListOptions contains the optional parameters for the OnlineEndpointsClient.List method. +type OnlineEndpointsClientListOptions struct { + // EndpointComputeType to be filtered by. + ComputeType *EndpointComputeType + // Number of endpoints to be retrieved in a page of results. + Count *int32 + // Name of the endpoint. + Name *string + // The option to order the response. + OrderBy *OrderString + // A set of properties with which to filter the returned models. It is a comma separated string of properties key and/or properties + // key=value Example: propKey1,propKey2,propKey3=value3 . + Properties *string + // Continuation token for pagination. + Skip *string + // A set of tags with which to filter the returned models. It is a comma separated string of tags key or tags key=value. Example: + // tagKey1,tagKey2,tagKey3=value3 . + Tags *string +} + +// OnlineRequestSettings - Online deployment scoring requests configuration. +type OnlineRequestSettings struct { + // The number of maximum concurrent requests per node allowed per deployment. Defaults to 1. + MaxConcurrentRequestsPerInstance *int32 `json:"maxConcurrentRequestsPerInstance,omitempty"` + + // The maximum amount of time a request will stay in the queue in ISO 8601 format. Defaults to 500ms. + MaxQueueWait *string `json:"maxQueueWait,omitempty"` + + // The scoring timeout in ISO 8601 format. Defaults to 5000ms. + RequestTimeout *string `json:"requestTimeout,omitempty"` +} + +// OnlineScaleSettingsClassification provides polymorphic access to related types. +// Call the interface's GetOnlineScaleSettings() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *DefaultScaleSettings, *OnlineScaleSettings, *TargetUtilizationScaleSettings +type OnlineScaleSettingsClassification interface { + // GetOnlineScaleSettings returns the OnlineScaleSettings content of the underlying type. + GetOnlineScaleSettings() *OnlineScaleSettings +} + +// OnlineScaleSettings - Online deployment scaling configuration. +type OnlineScaleSettings struct { + // REQUIRED; [Required] Type of deployment scaling algorithm + ScaleType *ScaleType `json:"scaleType,omitempty"` +} + +// GetOnlineScaleSettings implements the OnlineScaleSettingsClassification interface for type OnlineScaleSettings. +func (o *OnlineScaleSettings) GetOnlineScaleSettings() *OnlineScaleSettings { return o } + +// OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +type OperationsClientListOptions struct { + // placeholder for future optional parameters +} + +// OutputPathAssetReference - Reference to an asset via its path in a job output. +type OutputPathAssetReference struct { + // REQUIRED; [Required] Specifies the type of asset reference. + ReferenceType *ReferenceType `json:"referenceType,omitempty"` + + // ARM resource ID of the job. + JobID *string `json:"jobId,omitempty"` + + // The path of the file/directory in the job output. + Path *string `json:"path,omitempty"` +} + +// GetAssetReferenceBase implements the AssetReferenceBaseClassification interface for type OutputPathAssetReference. +func (o *OutputPathAssetReference) GetAssetReferenceBase() *AssetReferenceBase { + return &AssetReferenceBase{ + ReferenceType: o.ReferenceType, + } +} + +type PATAuthTypeWorkspaceConnectionProperties struct { + // REQUIRED; Authentication type of the connection target + AuthType *ConnectionAuthType `json:"authType,omitempty"` + + // Category of the connection + Category *ConnectionCategory `json:"category,omitempty"` + Credentials *WorkspaceConnectionPersonalAccessToken `json:"credentials,omitempty"` + Target *string `json:"target,omitempty"` + + // Value details of the workspace connection. + Value *string `json:"value,omitempty"` + + // format for the workspace connection value + ValueFormat *ValueFormat `json:"valueFormat,omitempty"` +} + +// GetWorkspaceConnectionPropertiesV2 implements the WorkspaceConnectionPropertiesV2Classification interface for type PATAuthTypeWorkspaceConnectionProperties. +func (p *PATAuthTypeWorkspaceConnectionProperties) GetWorkspaceConnectionPropertiesV2() *WorkspaceConnectionPropertiesV2 { + return &WorkspaceConnectionPropertiesV2{ + AuthType: p.AuthType, + Category: p.Category, + Target: p.Target, + Value: p.Value, + ValueFormat: p.ValueFormat, + } +} + +// PaginatedComputeResourcesList - Paginated list of Machine Learning compute objects wrapped in ARM resource envelope. +type PaginatedComputeResourcesList struct { + // A continuation link (absolute URI) to the next page of results in the list. + NextLink *string `json:"nextLink,omitempty"` + + // An array of Machine Learning compute objects wrapped in ARM resource envelope. + Value []*ComputeResource `json:"value,omitempty"` +} + +// PartialBatchDeployment - Mutable batch inference settings per deployment. +type PartialBatchDeployment struct { + // Description of the endpoint deployment. + Description *string `json:"description,omitempty"` +} + +// PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties - Strictly used in update requests. +type PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties struct { + // Additional attributes of the entity. + Properties *PartialBatchDeployment `json:"properties,omitempty"` + + // Resource tags. + Tags map[string]*string `json:"tags,omitempty"` +} + +// PartialManagedServiceIdentity - Managed service identity (system assigned and/or user assigned identities) +type PartialManagedServiceIdentity struct { + // Managed service identity (system assigned and/or user assigned identities) + Type *ManagedServiceIdentityType `json:"type,omitempty"` + + // The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM + // resource ids in the form: + // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + // The dictionary values can be empty objects ({}) in + // requests. + UserAssignedIdentities map[string]interface{} `json:"userAssignedIdentities,omitempty"` +} + +// PartialMinimalTrackedResource - Strictly used in update requests. +type PartialMinimalTrackedResource struct { + // Resource tags. + Tags map[string]*string `json:"tags,omitempty"` +} + +// PartialMinimalTrackedResourceWithIdentity - Strictly used in update requests. +type PartialMinimalTrackedResourceWithIdentity struct { + // Managed service identity (system assigned and/or user assigned identities) + Identity *PartialManagedServiceIdentity `json:"identity,omitempty"` + + // Resource tags. + Tags map[string]*string `json:"tags,omitempty"` +} + +// PartialMinimalTrackedResourceWithSKU - Strictly used in update requests. +type PartialMinimalTrackedResourceWithSKU struct { + // Sku details required for ARM contract for Autoscaling. + SKU *PartialSKU `json:"sku,omitempty"` + + // Resource tags. + Tags map[string]*string `json:"tags,omitempty"` +} + +// PartialSKU - Common SKU definition. +type PartialSKU struct { + // 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 `json:"capacity,omitempty"` + + // If the service has different generations of hardware, for the same SKU, then that can be captured here. + Family *string `json:"family,omitempty"` + + // The name of the SKU. Ex - P3. It is typically a letter+number code. + Name *string `json:"name,omitempty"` + + // The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. + Size *string `json:"size,omitempty"` + + // 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 `json:"tier,omitempty"` +} + +type Password struct { + // READ-ONLY + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY + Value *string `json:"value,omitempty" azure:"ro"` +} + +// PersonalComputeInstanceSettings - Settings for a personal compute instance. +type PersonalComputeInstanceSettings struct { + // A user explicitly assigned to a personal compute instance. + AssignedUser *AssignedUser `json:"assignedUser,omitempty"` +} + +// PipelineJob - Pipeline Job definition: defines generic to MFE attributes. +type PipelineJob struct { + // REQUIRED; [Required] Specifies the type of job. + JobType *JobType `json:"jobType,omitempty"` + + // ARM resource ID of the compute resource. + ComputeID *string `json:"computeId,omitempty"` + + // The asset description text. + Description *string `json:"description,omitempty"` + + // Display name of job. + DisplayName *string `json:"displayName,omitempty"` + + // The name of the experiment the job belongs to. If not set, the job is placed in the "Default" experiment. + ExperimentName *string `json:"experimentName,omitempty"` + + // Identity configuration. If set, this should be one of AmlToken, ManagedIdentity, UserIdentity or null. Defaults to AmlToken + // if null. + Identity IdentityConfigurationClassification `json:"identity,omitempty"` + + // Inputs for the pipeline job. + Inputs map[string]JobInputClassification `json:"inputs,omitempty"` + + // Is the asset archived? + IsArchived *bool `json:"isArchived,omitempty"` + + // Jobs construct the Pipeline Job. + Jobs map[string]interface{} `json:"jobs,omitempty"` + + // Outputs for the pipeline job + Outputs map[string]JobOutputClassification `json:"outputs,omitempty"` + + // The asset property dictionary. + Properties map[string]*string `json:"properties,omitempty"` + + // List of JobEndpoints. For local jobs, a job endpoint will have an endpoint value of FileStreamObject. + Services map[string]*JobService `json:"services,omitempty"` + + // Pipeline settings, for things like ContinueRunOnStepFailure etc. + Settings interface{} `json:"settings,omitempty"` + + // Tag dictionary. Tags can be added, removed, and updated. + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; Status of the job. + Status *JobStatus `json:"status,omitempty" azure:"ro"` +} + +// GetJobBaseProperties implements the JobBasePropertiesClassification interface for type PipelineJob. +func (p *PipelineJob) GetJobBaseProperties() *JobBaseProperties { + return &JobBaseProperties{ + ComputeID: p.ComputeID, + DisplayName: p.DisplayName, + ExperimentName: p.ExperimentName, + Identity: p.Identity, + IsArchived: p.IsArchived, + JobType: p.JobType, + Services: p.Services, + Status: p.Status, + Description: p.Description, + Properties: p.Properties, + Tags: p.Tags, + } +} + +// PrivateEndpoint - The Private Endpoint resource. +type PrivateEndpoint struct { + // READ-ONLY; The ARM identifier for Private Endpoint + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The ARM identifier for Subnet resource that private endpoint links to + SubnetArmID *string `json:"subnetArmId,omitempty" azure:"ro"` +} + +// PrivateEndpointConnection - The Private Endpoint Connection resource. +type PrivateEndpointConnection struct { + // The identity of the resource. + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + + // Specifies the location of the resource. + Location *string `json:"location,omitempty"` + + // Resource properties. + Properties *PrivateEndpointConnectionProperties `json:"properties,omitempty"` + + // The sku of the workspace. + SKU *SKU `json:"sku,omitempty"` + + // Contains resource tags defined as key/value pairs. + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +// PrivateEndpointConnectionListResult - List of private endpoint connection associated with the specified workspace +type PrivateEndpointConnectionListResult struct { + // Array of private endpoint connections + Value []*PrivateEndpointConnection `json:"value,omitempty"` +} + +// 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 `json:"privateLinkServiceConnectionState,omitempty"` + + // The resource of private end point. + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + + // READ-ONLY; The provisioning state of the private endpoint connection resource. + ProvisioningState *PrivateEndpointConnectionProvisioningState `json:"provisioningState,omitempty" azure:"ro"` +} + +// PrivateEndpointConnectionsClientCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.CreateOrUpdate +// method. +type PrivateEndpointConnectionsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// PrivateEndpointConnectionsClientDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Delete +// method. +type PrivateEndpointConnectionsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// 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 +} + +// PrivateLinkResource - A private link resource +type PrivateLinkResource struct { + // The identity of the resource. + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + + // Specifies the location of the resource. + Location *string `json:"location,omitempty"` + + // Resource properties. + Properties *PrivateLinkResourceProperties `json:"properties,omitempty"` + + // The sku of the workspace. + SKU *SKU `json:"sku,omitempty"` + + // Contains resource tags defined as key/value pairs. + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +// PrivateLinkResourceListResult - A list of private link resources +type PrivateLinkResourceListResult struct { + // Array of private link resources + Value []*PrivateLinkResource `json:"value,omitempty"` +} + +// PrivateLinkResourceProperties - Properties of a private link resource. +type PrivateLinkResourceProperties struct { + // The private link resource Private link DNS zone name. + RequiredZoneNames []*string `json:"requiredZoneNames,omitempty"` + + // READ-ONLY; The private link resource group id. + GroupID *string `json:"groupId,omitempty" azure:"ro"` + + // READ-ONLY; The private link resource required member names. + RequiredMembers []*string `json:"requiredMembers,omitempty" azure:"ro"` +} + +// PrivateLinkResourcesClientListOptions contains the optional parameters for the PrivateLinkResourcesClient.List method. +type PrivateLinkResourcesClientListOptions struct { + // placeholder for future optional parameters +} + +// 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 `json:"actionsRequired,omitempty"` + + // The reason for approval/rejection of the connection. + Description *string `json:"description,omitempty"` + + // Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + Status *PrivateEndpointServiceConnectionStatus `json:"status,omitempty"` +} + +// ProbeSettings - Deployment container liveness/readiness probe configuration. +type ProbeSettings struct { + // The number of failures to allow before returning an unhealthy status. + FailureThreshold *int32 `json:"failureThreshold,omitempty"` + + // The delay before the first probe in ISO 8601 format. + InitialDelay *string `json:"initialDelay,omitempty"` + + // The length of time between probes in ISO 8601 format. + Period *string `json:"period,omitempty"` + + // The number of successful probes before returning a healthy status. + SuccessThreshold *int32 `json:"successThreshold,omitempty"` + + // The probe timeout in ISO 8601 format. + Timeout *string `json:"timeout,omitempty"` +} + +// PyTorch distribution configuration. +type PyTorch struct { + // REQUIRED; [Required] Specifies the type of distribution framework. + DistributionType *DistributionType `json:"distributionType,omitempty"` + + // Number of processes per node. + ProcessCountPerInstance *int32 `json:"processCountPerInstance,omitempty"` +} + +// GetDistributionConfiguration implements the DistributionConfigurationClassification interface for type PyTorch. +func (p *PyTorch) GetDistributionConfiguration() *DistributionConfiguration { + return &DistributionConfiguration{ + DistributionType: p.DistributionType, + } +} + +// QuotaBaseProperties - The properties for Quota update or retrieval. +type QuotaBaseProperties struct { + // Specifies the resource ID. + ID *string `json:"id,omitempty"` + + // The maximum permitted quota of the resource. + Limit *int64 `json:"limit,omitempty"` + + // Specifies the resource type. + Type *string `json:"type,omitempty"` + + // An enum describing the unit of quota measurement. + Unit *QuotaUnit `json:"unit,omitempty"` +} + +// QuotaUpdateParameters - Quota update parameters. +type QuotaUpdateParameters struct { + // Region of workspace quota to be updated. + Location *string `json:"location,omitempty"` + + // The list for update quota. + Value []*QuotaBaseProperties `json:"value,omitempty"` +} + +// QuotasClientListOptions contains the optional parameters for the QuotasClient.List method. +type QuotasClientListOptions struct { + // placeholder for future optional parameters +} + +// QuotasClientUpdateOptions contains the optional parameters for the QuotasClient.Update method. +type QuotasClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// RandomSamplingAlgorithm - Defines a Sampling Algorithm that generates values randomly +type RandomSamplingAlgorithm struct { + // REQUIRED; [Required] The algorithm used for generating hyperparameter values, along with configuration properties + SamplingAlgorithmType *SamplingAlgorithmType `json:"samplingAlgorithmType,omitempty"` + + // The specific type of random algorithm + Rule *RandomSamplingAlgorithmRule `json:"rule,omitempty"` + + // An optional integer to use as the seed for random number generation + Seed *int32 `json:"seed,omitempty"` +} + +// GetSamplingAlgorithm implements the SamplingAlgorithmClassification interface for type RandomSamplingAlgorithm. +func (r *RandomSamplingAlgorithm) GetSamplingAlgorithm() *SamplingAlgorithm { + return &SamplingAlgorithm{ + SamplingAlgorithmType: r.SamplingAlgorithmType, + } +} + +type RegenerateEndpointKeysRequest struct { + // REQUIRED; [Required] Specification for which type of key to generate. Primary or Secondary. + KeyType *KeyType `json:"keyType,omitempty"` + + // The value the key is set to. + KeyValue *string `json:"keyValue,omitempty"` +} + +type RegistryListCredentialsResult struct { + Passwords []*Password `json:"passwords,omitempty"` + + // READ-ONLY + Location *string `json:"location,omitempty" azure:"ro"` + + // READ-ONLY + Username *string `json:"username,omitempty" azure:"ro"` +} + +// 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 `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +type ResourceBase struct { + // The asset description text. + Description *string `json:"description,omitempty"` + + // The asset property dictionary. + Properties map[string]*string `json:"properties,omitempty"` + + // Tag dictionary. Tags can be added, removed, and updated. + Tags map[string]*string `json:"tags,omitempty"` +} + +type ResourceConfiguration struct { + // Optional number of instances or nodes used by the compute target. + InstanceCount *int32 `json:"instanceCount,omitempty"` + + // Optional type of VM used as supported by the compute target. + InstanceType *string `json:"instanceType,omitempty"` + + // Additional properties bag. + Properties map[string]interface{} `json:"properties,omitempty"` +} + +// ResourceID - Represents a resource ID. For example, for a subnet, it is the resource URL for the subnet. +type ResourceID struct { + // REQUIRED; The ID of the resource + ID *string `json:"id,omitempty"` +} + +// ResourceName - The Resource Name. +type ResourceName struct { + // READ-ONLY; The localized name of the resource. + LocalizedValue *string `json:"localizedValue,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource. + Value *string `json:"value,omitempty" azure:"ro"` +} + +// ResourceQuota - The quota assigned to a resource. +type ResourceQuota struct { + // READ-ONLY; Region of the AML workspace in the id. + AmlWorkspaceLocation *string `json:"amlWorkspaceLocation,omitempty" azure:"ro"` + + // READ-ONLY; Specifies the resource ID. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The maximum permitted quota of the resource. + Limit *int64 `json:"limit,omitempty" azure:"ro"` + + // READ-ONLY; Name of the resource. + Name *ResourceName `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Specifies the resource type. + Type *string `json:"type,omitempty" azure:"ro"` + + // READ-ONLY; An enum describing the unit of quota measurement. + Unit *QuotaUnit `json:"unit,omitempty" azure:"ro"` +} + +type Route struct { + // REQUIRED; [Required] The path for the route. + Path *string `json:"path,omitempty"` + + // REQUIRED; [Required] The port for the route. + Port *int32 `json:"port,omitempty"` +} + +type SASAuthTypeWorkspaceConnectionProperties struct { + // REQUIRED; Authentication type of the connection target + AuthType *ConnectionAuthType `json:"authType,omitempty"` + + // Category of the connection + Category *ConnectionCategory `json:"category,omitempty"` + Credentials *WorkspaceConnectionSharedAccessSignature `json:"credentials,omitempty"` + Target *string `json:"target,omitempty"` + + // Value details of the workspace connection. + Value *string `json:"value,omitempty"` + + // format for the workspace connection value + ValueFormat *ValueFormat `json:"valueFormat,omitempty"` +} + +// GetWorkspaceConnectionPropertiesV2 implements the WorkspaceConnectionPropertiesV2Classification interface for type SASAuthTypeWorkspaceConnectionProperties. +func (s *SASAuthTypeWorkspaceConnectionProperties) GetWorkspaceConnectionPropertiesV2() *WorkspaceConnectionPropertiesV2 { + return &WorkspaceConnectionPropertiesV2{ + AuthType: s.AuthType, + Category: s.Category, + Target: s.Target, + Value: s.Value, + ValueFormat: s.ValueFormat, + } +} + +// 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 `json:"name,omitempty"` + + // 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 `json:"capacity,omitempty"` + + // If the service has different generations of hardware, for the same SKU, then that can be captured here. + Family *string `json:"family,omitempty"` + + // The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. + Size *string `json:"size,omitempty"` + + // 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 `json:"tier,omitempty"` +} + +// SKUCapacity - SKU capacity information +type SKUCapacity struct { + // Gets or sets the default capacity. + Default *int32 `json:"default,omitempty"` + + // Gets or sets the maximum. + Maximum *int32 `json:"maximum,omitempty"` + + // Gets or sets the minimum. + Minimum *int32 `json:"minimum,omitempty"` + + // Gets or sets the type of the scale. + ScaleType *SKUScaleType `json:"scaleType,omitempty"` +} + +// SKUResource - Fulfills ARM Contract requirement to list all available SKUS for a resource. +type SKUResource struct { + // Gets or sets the Sku Capacity. + Capacity *SKUCapacity `json:"capacity,omitempty"` + + // Gets or sets the Sku. + SKU *SKUSetting `json:"sku,omitempty"` + + // READ-ONLY; The resource type name. + ResourceType *string `json:"resourceType,omitempty" azure:"ro"` +} + +// SKUResourceArmPaginatedResult - A paginated list of SkuResource entities. +type SKUResourceArmPaginatedResult struct { + // The link to the next page of SkuResource objects. If null, there are no additional pages. + NextLink *string `json:"nextLink,omitempty"` + + // An array of objects of type SkuResource. + Value []*SKUResource `json:"value,omitempty"` +} + +// SKUSetting - SkuSetting fulfills the need for stripped down SKU info in ARM contract. +type SKUSetting struct { + // REQUIRED; [Required] The name of the SKU. Ex - P3. It is typically a letter+number code. + Name *string `json:"name,omitempty"` + + // 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 `json:"tier,omitempty"` +} + +// SSLConfiguration - The ssl configuration for scoring +type SSLConfiguration struct { + // Cert data + Cert *string `json:"cert,omitempty"` + + // CNAME of the cert + Cname *string `json:"cname,omitempty"` + + // Key data + Key *string `json:"key,omitempty"` + + // Leaf domain label of public endpoint + LeafDomainLabel *string `json:"leafDomainLabel,omitempty"` + + // Indicates whether to overwrite existing domain label. + OverwriteExistingDomain *bool `json:"overwriteExistingDomain,omitempty"` + + // Enable or disable ssl for scoring + Status *SSLConfigStatus `json:"status,omitempty"` +} + +// SamplingAlgorithmClassification provides polymorphic access to related types. +// Call the interface's GetSamplingAlgorithm() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *BayesianSamplingAlgorithm, *GridSamplingAlgorithm, *RandomSamplingAlgorithm, *SamplingAlgorithm +type SamplingAlgorithmClassification interface { + // GetSamplingAlgorithm returns the SamplingAlgorithm content of the underlying type. + GetSamplingAlgorithm() *SamplingAlgorithm +} + +// SamplingAlgorithm - The Sampling Algorithm used to generate hyperparameter values, along with properties to configure the +// algorithm +type SamplingAlgorithm struct { + // REQUIRED; [Required] The algorithm used for generating hyperparameter values, along with configuration properties + SamplingAlgorithmType *SamplingAlgorithmType `json:"samplingAlgorithmType,omitempty"` +} + +// GetSamplingAlgorithm implements the SamplingAlgorithmClassification interface for type SamplingAlgorithm. +func (s *SamplingAlgorithm) GetSamplingAlgorithm() *SamplingAlgorithm { return s } + +// SasDatastoreCredentials - SAS datastore credentials configuration. +type SasDatastoreCredentials struct { + // REQUIRED; [Required] Credential type used to authentication with storage. + CredentialsType *CredentialsType `json:"credentialsType,omitempty"` + + // REQUIRED; [Required] Storage container secrets. + Secrets *SasDatastoreSecrets `json:"secrets,omitempty"` +} + +// GetDatastoreCredentials implements the DatastoreCredentialsClassification interface for type SasDatastoreCredentials. +func (s *SasDatastoreCredentials) GetDatastoreCredentials() *DatastoreCredentials { + return &DatastoreCredentials{ + CredentialsType: s.CredentialsType, + } +} + +// SasDatastoreSecrets - Datastore SAS secrets. +type SasDatastoreSecrets struct { + // REQUIRED; [Required] Credential type used to authentication with storage. + SecretsType *SecretsType `json:"secretsType,omitempty"` + + // Storage container SAS token. + SasToken *string `json:"sasToken,omitempty"` +} + +// GetDatastoreSecrets implements the DatastoreSecretsClassification interface for type SasDatastoreSecrets. +func (s *SasDatastoreSecrets) GetDatastoreSecrets() *DatastoreSecrets { + return &DatastoreSecrets{ + SecretsType: s.SecretsType, + } +} + +// ScaleSettings - scale settings for AML Compute +type ScaleSettings struct { + // REQUIRED; Max number of nodes to use + MaxNodeCount *int32 `json:"maxNodeCount,omitempty"` + + // Min number of nodes to use + MinNodeCount *int32 `json:"minNodeCount,omitempty"` + + // Node Idle Time before scaling down amlCompute. This string needs to be in the RFC Format. + NodeIdleTimeBeforeScaleDown *string `json:"nodeIdleTimeBeforeScaleDown,omitempty"` +} + +// ScaleSettingsInformation - Desired scale settings for the amlCompute. +type ScaleSettingsInformation struct { + // scale settings for AML Compute + ScaleSettings *ScaleSettings `json:"scaleSettings,omitempty"` +} + +type ScheduleBase struct { + ID *string `json:"id,omitempty"` + ProvisioningStatus *ScheduleProvisioningState `json:"provisioningStatus,omitempty"` + Status *ScheduleStatus `json:"status,omitempty"` +} + +// ScriptReference - Script reference +type ScriptReference struct { + // Optional command line arguments passed to the script to run. + ScriptArguments *string `json:"scriptArguments,omitempty"` + + // The location of scripts in the mounted volume. + ScriptData *string `json:"scriptData,omitempty"` + + // The storage source of the script: inline, workspace. + ScriptSource *string `json:"scriptSource,omitempty"` + + // Optional time period passed to timeout command. + Timeout *string `json:"timeout,omitempty"` +} + +// ScriptsToExecute - Customized setup scripts +type ScriptsToExecute struct { + // Script that's run only once during provision of the compute. + CreationScript *ScriptReference `json:"creationScript,omitempty"` + + // Script that's run every time the machine starts. + StartupScript *ScriptReference `json:"startupScript,omitempty"` +} + +type ServiceManagedResourcesSettings struct { + // The settings for the service managed cosmosdb account. + CosmosDb *CosmosDbSettings `json:"cosmosDb,omitempty"` +} + +// ServicePrincipalDatastoreCredentials - Service Principal datastore credentials configuration. +type ServicePrincipalDatastoreCredentials struct { + // REQUIRED; [Required] Service principal client ID. + ClientID *string `json:"clientId,omitempty"` + + // REQUIRED; [Required] Credential type used to authentication with storage. + CredentialsType *CredentialsType `json:"credentialsType,omitempty"` + + // REQUIRED; [Required] Service principal secrets. + Secrets *ServicePrincipalDatastoreSecrets `json:"secrets,omitempty"` + + // REQUIRED; [Required] ID of the tenant to which the service principal belongs. + TenantID *string `json:"tenantId,omitempty"` + + // Authority URL used for authentication. + AuthorityURL *string `json:"authorityUrl,omitempty"` + + // Resource the service principal has access to. + ResourceURL *string `json:"resourceUrl,omitempty"` +} + +// GetDatastoreCredentials implements the DatastoreCredentialsClassification interface for type ServicePrincipalDatastoreCredentials. +func (s *ServicePrincipalDatastoreCredentials) GetDatastoreCredentials() *DatastoreCredentials { + return &DatastoreCredentials{ + CredentialsType: s.CredentialsType, + } +} + +// ServicePrincipalDatastoreSecrets - Datastore Service Principal secrets. +type ServicePrincipalDatastoreSecrets struct { + // REQUIRED; [Required] Credential type used to authentication with storage. + SecretsType *SecretsType `json:"secretsType,omitempty"` + + // Service principal secret. + ClientSecret *string `json:"clientSecret,omitempty"` +} + +// GetDatastoreSecrets implements the DatastoreSecretsClassification interface for type ServicePrincipalDatastoreSecrets. +func (s *ServicePrincipalDatastoreSecrets) GetDatastoreSecrets() *DatastoreSecrets { + return &DatastoreSecrets{ + SecretsType: s.SecretsType, + } +} + +// SetupScripts - Details of customized scripts to execute for setting up the cluster. +type SetupScripts struct { + // Customized setup scripts + Scripts *ScriptsToExecute `json:"scripts,omitempty"` +} + +type SharedPrivateLinkResource struct { + // Unique name of the private link. + Name *string `json:"name,omitempty"` + + // Resource properties. + Properties *SharedPrivateLinkResourceProperty `json:"properties,omitempty"` +} + +// SharedPrivateLinkResourceProperty - Properties of a shared private link resource. +type SharedPrivateLinkResourceProperty struct { + // The private link resource group id. + GroupID *string `json:"groupId,omitempty"` + + // The resource id that private link links to. + PrivateLinkResourceID *string `json:"privateLinkResourceId,omitempty"` + + // Request message. + RequestMessage *string `json:"requestMessage,omitempty"` + + // Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + Status *PrivateEndpointServiceConnectionStatus `json:"status,omitempty"` +} + +// SweepJob - Sweep job definition. +type SweepJob struct { + // REQUIRED; [Required] Specifies the type of job. + JobType *JobType `json:"jobType,omitempty"` + + // REQUIRED; [Required] Optimization objective. + Objective *Objective `json:"objective,omitempty"` + + // REQUIRED; [Required] The hyperparameter sampling algorithm + SamplingAlgorithm SamplingAlgorithmClassification `json:"samplingAlgorithm,omitempty"` + + // REQUIRED; [Required] A dictionary containing each parameter and its distribution. The dictionary key is the name of the + // parameter + SearchSpace interface{} `json:"searchSpace,omitempty"` + + // REQUIRED; [Required] Trial component definition. + Trial *TrialComponent `json:"trial,omitempty"` + + // ARM resource ID of the compute resource. + ComputeID *string `json:"computeId,omitempty"` + + // The asset description text. + Description *string `json:"description,omitempty"` + + // Display name of job. + DisplayName *string `json:"displayName,omitempty"` + + // Early termination policies enable canceling poor-performing runs before they complete + EarlyTermination EarlyTerminationPolicyClassification `json:"earlyTermination,omitempty"` + + // The name of the experiment the job belongs to. If not set, the job is placed in the "Default" experiment. + ExperimentName *string `json:"experimentName,omitempty"` + + // Identity configuration. If set, this should be one of AmlToken, ManagedIdentity, UserIdentity or null. Defaults to AmlToken + // if null. + Identity IdentityConfigurationClassification `json:"identity,omitempty"` + + // Mapping of input data bindings used in the job. + Inputs map[string]JobInputClassification `json:"inputs,omitempty"` + + // Is the asset archived? + IsArchived *bool `json:"isArchived,omitempty"` + + // Sweep Job limit. + Limits *SweepJobLimits `json:"limits,omitempty"` + + // Mapping of output data bindings used in the job. + Outputs map[string]JobOutputClassification `json:"outputs,omitempty"` + + // The asset property dictionary. + Properties map[string]*string `json:"properties,omitempty"` + + // List of JobEndpoints. For local jobs, a job endpoint will have an endpoint value of FileStreamObject. + Services map[string]*JobService `json:"services,omitempty"` + + // Tag dictionary. Tags can be added, removed, and updated. + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; Status of the job. + Status *JobStatus `json:"status,omitempty" azure:"ro"` +} + +// GetJobBaseProperties implements the JobBasePropertiesClassification interface for type SweepJob. +func (s *SweepJob) GetJobBaseProperties() *JobBaseProperties { + return &JobBaseProperties{ + ComputeID: s.ComputeID, + DisplayName: s.DisplayName, + ExperimentName: s.ExperimentName, + Identity: s.Identity, + IsArchived: s.IsArchived, + JobType: s.JobType, + Services: s.Services, + Status: s.Status, + Description: s.Description, + Properties: s.Properties, + Tags: s.Tags, + } +} + +// SweepJobLimits - Sweep Job limit class. +type SweepJobLimits struct { + // REQUIRED; [Required] JobLimit type. + JobLimitsType *JobLimitsType `json:"jobLimitsType,omitempty"` + + // Sweep Job max concurrent trials. + MaxConcurrentTrials *int32 `json:"maxConcurrentTrials,omitempty"` + + // Sweep Job max total trials. + MaxTotalTrials *int32 `json:"maxTotalTrials,omitempty"` + + // The max run duration in ISO 8601 format, after which the job will be cancelled. Only supports duration with precision as + // low as Seconds. + Timeout *string `json:"timeout,omitempty"` + + // Sweep Job Trial timeout value. + TrialTimeout *string `json:"trialTimeout,omitempty"` +} + +// GetJobLimits implements the JobLimitsClassification interface for type SweepJobLimits. +func (s *SweepJobLimits) GetJobLimits() *JobLimits { + return &JobLimits{ + JobLimitsType: s.JobLimitsType, + Timeout: s.Timeout, + } +} + +// SynapseSpark - A SynapseSpark compute. +type SynapseSpark struct { + // REQUIRED; The type of compute + ComputeType *ComputeType `json:"computeType,omitempty"` + + // The description of the Machine Learning compute. + Description *string `json:"description,omitempty"` + + // Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for authentication. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + Properties *SynapseSparkProperties `json:"properties,omitempty"` + + // ARM resource id of the underlying compute + ResourceID *string `json:"resourceId,omitempty"` + + // READ-ONLY; Location for the underlying compute + ComputeLocation *string `json:"computeLocation,omitempty" azure:"ro"` + + // READ-ONLY; The time at which the compute was created. + CreatedOn *time.Time `json:"createdOn,omitempty" azure:"ro"` + + // READ-ONLY; Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning + // service provisioned it if false. + IsAttachedCompute *bool `json:"isAttachedCompute,omitempty" azure:"ro"` + + // READ-ONLY; The time at which the compute was last modified. + ModifiedOn *time.Time `json:"modifiedOn,omitempty" azure:"ro"` + + // READ-ONLY; Errors during provisioning + ProvisioningErrors []*ErrorResponse `json:"provisioningErrors,omitempty" azure:"ro"` + + // READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` +} + +// GetCompute implements the ComputeClassification interface for type SynapseSpark. +func (s *SynapseSpark) GetCompute() *Compute { + return &Compute{ + ComputeType: s.ComputeType, + ComputeLocation: s.ComputeLocation, + ProvisioningState: s.ProvisioningState, + Description: s.Description, + CreatedOn: s.CreatedOn, + ModifiedOn: s.ModifiedOn, + ResourceID: s.ResourceID, + ProvisioningErrors: s.ProvisioningErrors, + IsAttachedCompute: s.IsAttachedCompute, + DisableLocalAuth: s.DisableLocalAuth, + } +} + +type SynapseSparkProperties struct { + // Auto pause properties. + AutoPauseProperties *AutoPauseProperties `json:"autoPauseProperties,omitempty"` + + // Auto scale properties. + AutoScaleProperties *AutoScaleProperties `json:"autoScaleProperties,omitempty"` + + // The number of compute nodes currently assigned to the compute. + NodeCount *int32 `json:"nodeCount,omitempty"` + + // Node size. + NodeSize *string `json:"nodeSize,omitempty"` + + // Node size family. + NodeSizeFamily *string `json:"nodeSizeFamily,omitempty"` + + // Pool name. + PoolName *string `json:"poolName,omitempty"` + + // Name of the resource group in which workspace is located. + ResourceGroup *string `json:"resourceGroup,omitempty"` + + // Spark version. + SparkVersion *string `json:"sparkVersion,omitempty"` + + // Azure subscription identifier. + SubscriptionID *string `json:"subscriptionId,omitempty"` + + // Name of Azure Machine Learning workspace. + WorkspaceName *string `json:"workspaceName,omitempty"` +} + +// SystemData - Metadata pertaining to creation and last modification of the resource. +type SystemData struct { + // The timestamp of resource creation (UTC). + CreatedAt *time.Time `json:"createdAt,omitempty"` + + // The identity that created the resource. + CreatedBy *string `json:"createdBy,omitempty"` + + // The type of identity that created the resource. + CreatedByType *CreatedByType `json:"createdByType,omitempty"` + + // The timestamp of resource last modification (UTC) + LastModifiedAt *time.Time `json:"lastModifiedAt,omitempty"` + + // The identity that last modified the resource. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + + // The type of identity that last modified the resource. + LastModifiedByType *CreatedByType `json:"lastModifiedByType,omitempty"` +} + +// SystemService - A system service running on a compute. +type SystemService struct { + // READ-ONLY; Public IP address + PublicIPAddress *string `json:"publicIpAddress,omitempty" azure:"ro"` + + // READ-ONLY; The type of this system service. + SystemServiceType *string `json:"systemServiceType,omitempty" azure:"ro"` + + // READ-ONLY; The version for this type. + Version *string `json:"version,omitempty" azure:"ro"` +} + +type TargetUtilizationScaleSettings struct { + // REQUIRED; [Required] Type of deployment scaling algorithm + ScaleType *ScaleType `json:"scaleType,omitempty"` + + // The maximum number of instances that the deployment can scale to. The quota will be reserved for max_instances. + MaxInstances *int32 `json:"maxInstances,omitempty"` + + // The minimum number of instances to always be present. + MinInstances *int32 `json:"minInstances,omitempty"` + + // The polling interval in ISO 8691 format. Only supports duration with precision as low as Seconds. + PollingInterval *string `json:"pollingInterval,omitempty"` + + // Target CPU usage for the autoscaler. + TargetUtilizationPercentage *int32 `json:"targetUtilizationPercentage,omitempty"` +} + +// GetOnlineScaleSettings implements the OnlineScaleSettingsClassification interface for type TargetUtilizationScaleSettings. +func (t *TargetUtilizationScaleSettings) GetOnlineScaleSettings() *OnlineScaleSettings { + return &OnlineScaleSettings{ + ScaleType: t.ScaleType, + } +} + +// TensorFlow distribution configuration. +type TensorFlow struct { + // REQUIRED; [Required] Specifies the type of distribution framework. + DistributionType *DistributionType `json:"distributionType,omitempty"` + + // Number of parameter server tasks. + ParameterServerCount *int32 `json:"parameterServerCount,omitempty"` + + // Number of workers. If not specified, will default to the instance count. + WorkerCount *int32 `json:"workerCount,omitempty"` +} + +// GetDistributionConfiguration implements the DistributionConfigurationClassification interface for type TensorFlow. +func (t *TensorFlow) GetDistributionConfiguration() *DistributionConfiguration { + return &DistributionConfiguration{ + DistributionType: t.DistributionType, + } +} + +// TrackedResource - The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' +// and a 'location' +type TrackedResource struct { + // REQUIRED; The geo-location where the resource lives + Location *string `json:"location,omitempty"` + + // Resource tags. + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +// TrialComponent - Trial component definition. +type TrialComponent struct { + // REQUIRED; [Required] The command to execute on startup of the job. eg. "python train.py" + Command *string `json:"command,omitempty"` + + // REQUIRED; [Required] The ARM resource ID of the Environment specification for the job. + EnvironmentID *string `json:"environmentId,omitempty"` + + // ARM resource ID of the code asset. + CodeID *string `json:"codeId,omitempty"` + + // Distribution configuration of the job. If set, this should be one of Mpi, Tensorflow, PyTorch, or null. + Distribution DistributionConfigurationClassification `json:"distribution,omitempty"` + + // Environment variables included in the job. + EnvironmentVariables map[string]*string `json:"environmentVariables,omitempty"` + + // Compute Resource configuration for the job. + Resources *ResourceConfiguration `json:"resources,omitempty"` +} + +type TritonModelJobInput struct { + // REQUIRED; [Required] Specifies the type of job. + JobInputType *JobInputType `json:"jobInputType,omitempty"` + + // REQUIRED; [Required] Input Asset URI. + URI *string `json:"uri,omitempty"` + + // Description for the input. + Description *string `json:"description,omitempty"` + + // Input Asset Delivery Mode. + Mode *InputDeliveryMode `json:"mode,omitempty"` +} + +// GetJobInput implements the JobInputClassification interface for type TritonModelJobInput. +func (t *TritonModelJobInput) GetJobInput() *JobInput { + return &JobInput{ + Description: t.Description, + JobInputType: t.JobInputType, + } +} + +type TritonModelJobOutput struct { + // REQUIRED; [Required] Specifies the type of job. + JobOutputType *JobOutputType `json:"jobOutputType,omitempty"` + + // Description for the output. + Description *string `json:"description,omitempty"` + + // Output Asset Delivery Mode. + Mode *OutputDeliveryMode `json:"mode,omitempty"` + + // Output Asset URI. + URI *string `json:"uri,omitempty"` +} + +// GetJobOutput implements the JobOutputClassification interface for type TritonModelJobOutput. +func (t *TritonModelJobOutput) GetJobOutput() *JobOutput { + return &JobOutput{ + Description: t.Description, + JobOutputType: t.JobOutputType, + } +} + +// TruncationSelectionPolicy - Defines an early termination policy that cancels a given percentage of runs at each evaluation +// interval. +type TruncationSelectionPolicy struct { + // REQUIRED; [Required] Name of policy configuration + PolicyType *EarlyTerminationPolicyType `json:"policyType,omitempty"` + + // Number of intervals by which to delay the first evaluation. + DelayEvaluation *int32 `json:"delayEvaluation,omitempty"` + + // Interval (number of runs) between policy evaluations. + EvaluationInterval *int32 `json:"evaluationInterval,omitempty"` + + // The percentage of runs to cancel at each evaluation interval. + TruncationPercentage *int32 `json:"truncationPercentage,omitempty"` +} + +// GetEarlyTerminationPolicy implements the EarlyTerminationPolicyClassification interface for type TruncationSelectionPolicy. +func (t *TruncationSelectionPolicy) GetEarlyTerminationPolicy() *EarlyTerminationPolicy { + return &EarlyTerminationPolicy{ + DelayEvaluation: t.DelayEvaluation, + EvaluationInterval: t.EvaluationInterval, + PolicyType: t.PolicyType, + } +} + +// URIFileDataVersion - uri-file data version entity +type URIFileDataVersion struct { + // REQUIRED; [Required] Specifies the type of data. + DataType *DataType `json:"dataType,omitempty"` + + // REQUIRED; [Required] Uri of the data. Usage/meaning depends on Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20220501.Assets.DataVersionBase.DataType + DataURI *string `json:"dataUri,omitempty"` + + // The asset description text. + Description *string `json:"description,omitempty"` + + // If the name version are system generated (anonymous registration). + IsAnonymous *bool `json:"isAnonymous,omitempty"` + + // Is the asset archived? + IsArchived *bool `json:"isArchived,omitempty"` + + // The asset property dictionary. + Properties map[string]*string `json:"properties,omitempty"` + + // Tag dictionary. Tags can be added, removed, and updated. + Tags map[string]*string `json:"tags,omitempty"` +} + +// GetDataVersionBaseProperties implements the DataVersionBasePropertiesClassification interface for type URIFileDataVersion. +func (u *URIFileDataVersion) GetDataVersionBaseProperties() *DataVersionBaseProperties { + return &DataVersionBaseProperties{ + DataType: u.DataType, + DataURI: u.DataURI, + IsAnonymous: u.IsAnonymous, + IsArchived: u.IsArchived, + Description: u.Description, + Properties: u.Properties, + Tags: u.Tags, + } +} + +type URIFileJobInput struct { + // REQUIRED; [Required] Specifies the type of job. + JobInputType *JobInputType `json:"jobInputType,omitempty"` + + // REQUIRED; [Required] Input Asset URI. + URI *string `json:"uri,omitempty"` + + // Description for the input. + Description *string `json:"description,omitempty"` + + // Input Asset Delivery Mode. + Mode *InputDeliveryMode `json:"mode,omitempty"` +} + +// GetJobInput implements the JobInputClassification interface for type URIFileJobInput. +func (u *URIFileJobInput) GetJobInput() *JobInput { + return &JobInput{ + Description: u.Description, + JobInputType: u.JobInputType, + } +} + +type URIFileJobOutput struct { + // REQUIRED; [Required] Specifies the type of job. + JobOutputType *JobOutputType `json:"jobOutputType,omitempty"` + + // Description for the output. + Description *string `json:"description,omitempty"` + + // Output Asset Delivery Mode. + Mode *OutputDeliveryMode `json:"mode,omitempty"` + + // Output Asset URI. + URI *string `json:"uri,omitempty"` +} + +// GetJobOutput implements the JobOutputClassification interface for type URIFileJobOutput. +func (u *URIFileJobOutput) GetJobOutput() *JobOutput { + return &JobOutput{ + Description: u.Description, + JobOutputType: u.JobOutputType, + } +} + +// URIFolderDataVersion - uri-folder data version entity +type URIFolderDataVersion struct { + // REQUIRED; [Required] Specifies the type of data. + DataType *DataType `json:"dataType,omitempty"` + + // REQUIRED; [Required] Uri of the data. Usage/meaning depends on Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20220501.Assets.DataVersionBase.DataType + DataURI *string `json:"dataUri,omitempty"` + + // The asset description text. + Description *string `json:"description,omitempty"` + + // If the name version are system generated (anonymous registration). + IsAnonymous *bool `json:"isAnonymous,omitempty"` + + // Is the asset archived? + IsArchived *bool `json:"isArchived,omitempty"` + + // The asset property dictionary. + Properties map[string]*string `json:"properties,omitempty"` + + // Tag dictionary. Tags can be added, removed, and updated. + Tags map[string]*string `json:"tags,omitempty"` +} + +// GetDataVersionBaseProperties implements the DataVersionBasePropertiesClassification interface for type URIFolderDataVersion. +func (u *URIFolderDataVersion) GetDataVersionBaseProperties() *DataVersionBaseProperties { + return &DataVersionBaseProperties{ + DataType: u.DataType, + DataURI: u.DataURI, + IsAnonymous: u.IsAnonymous, + IsArchived: u.IsArchived, + Description: u.Description, + Properties: u.Properties, + Tags: u.Tags, + } +} + +type URIFolderJobInput struct { + // REQUIRED; [Required] Specifies the type of job. + JobInputType *JobInputType `json:"jobInputType,omitempty"` + + // REQUIRED; [Required] Input Asset URI. + URI *string `json:"uri,omitempty"` + + // Description for the input. + Description *string `json:"description,omitempty"` + + // Input Asset Delivery Mode. + Mode *InputDeliveryMode `json:"mode,omitempty"` +} + +// GetJobInput implements the JobInputClassification interface for type URIFolderJobInput. +func (u *URIFolderJobInput) GetJobInput() *JobInput { + return &JobInput{ + Description: u.Description, + JobInputType: u.JobInputType, + } +} + +type URIFolderJobOutput struct { + // REQUIRED; [Required] Specifies the type of job. + JobOutputType *JobOutputType `json:"jobOutputType,omitempty"` + + // Description for the output. + Description *string `json:"description,omitempty"` + + // Output Asset Delivery Mode. + Mode *OutputDeliveryMode `json:"mode,omitempty"` + + // Output Asset URI. + URI *string `json:"uri,omitempty"` +} + +// GetJobOutput implements the JobOutputClassification interface for type URIFolderJobOutput. +func (u *URIFolderJobOutput) GetJobOutput() *JobOutput { + return &JobOutput{ + Description: u.Description, + JobOutputType: u.JobOutputType, + } +} + +// UpdateWorkspaceQuotas - The properties for update Quota response. +type UpdateWorkspaceQuotas struct { + // The maximum permitted quota of the resource. + Limit *int64 `json:"limit,omitempty"` + + // Status of update workspace quota. + Status *Status `json:"status,omitempty"` + + // READ-ONLY; Specifies the resource ID. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; Specifies the resource type. + Type *string `json:"type,omitempty" azure:"ro"` + + // READ-ONLY; An enum describing the unit of quota measurement. + Unit *QuotaUnit `json:"unit,omitempty" azure:"ro"` +} + +// UpdateWorkspaceQuotasResult - The result of update workspace quota. +type UpdateWorkspaceQuotasResult struct { + // READ-ONLY; The URI to fetch the next page of workspace quota update result. Call ListNext() with this to fetch the next + // page of Workspace Quota update result. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` + + // READ-ONLY; The list of workspace quota update result. + Value []*UpdateWorkspaceQuotas `json:"value,omitempty" azure:"ro"` +} + +// Usage - Describes AML Resource Usage. +type Usage struct { + // READ-ONLY; Region of the AML workspace in the id. + AmlWorkspaceLocation *string `json:"amlWorkspaceLocation,omitempty" azure:"ro"` + + // READ-ONLY; The current usage of the resource. + CurrentValue *int64 `json:"currentValue,omitempty" azure:"ro"` + + // READ-ONLY; Specifies the resource ID. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The maximum permitted usage of the resource. + Limit *int64 `json:"limit,omitempty" azure:"ro"` + + // READ-ONLY; The name of the type of usage. + Name *UsageName `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Specifies the resource type. + Type *string `json:"type,omitempty" azure:"ro"` + + // READ-ONLY; An enum describing the unit of usage measurement. + Unit *UsageUnit `json:"unit,omitempty" azure:"ro"` +} + +// UsageName - The Usage Names. +type UsageName struct { + // READ-ONLY; The localized name of the resource. + LocalizedValue *string `json:"localizedValue,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource. + Value *string `json:"value,omitempty" azure:"ro"` +} + +// UsagesClientListOptions contains the optional parameters for the UsagesClient.List method. +type UsagesClientListOptions struct { + // placeholder for future optional parameters +} + +// UserAccountCredentials - Settings for user account that gets created on each on the nodes of a compute. +type UserAccountCredentials struct { + // REQUIRED; Name of the administrator user account which can be used to SSH to nodes. + AdminUserName *string `json:"adminUserName,omitempty"` + + // Password of the administrator user account. + AdminUserPassword *string `json:"adminUserPassword,omitempty"` + + // SSH public key of the administrator user account. + AdminUserSSHPublicKey *string `json:"adminUserSshPublicKey,omitempty"` +} + +// UserAssignedIdentity - User assigned identity properties +type UserAssignedIdentity struct { + // READ-ONLY; The client ID of the assigned identity. + ClientID *string `json:"clientId,omitempty" azure:"ro"` + + // READ-ONLY; The principal ID of the assigned identity. + PrincipalID *string `json:"principalId,omitempty" azure:"ro"` +} + +// UserIdentity - User identity configuration. +type UserIdentity struct { + // REQUIRED; [Required] Specifies the type of identity framework. + IdentityType *IdentityConfigurationType `json:"identityType,omitempty"` +} + +// GetIdentityConfiguration implements the IdentityConfigurationClassification interface for type UserIdentity. +func (u *UserIdentity) GetIdentityConfiguration() *IdentityConfiguration { + return &IdentityConfiguration{ + IdentityType: u.IdentityType, + } +} + +type UsernamePasswordAuthTypeWorkspaceConnectionProperties struct { + // REQUIRED; Authentication type of the connection target + AuthType *ConnectionAuthType `json:"authType,omitempty"` + + // Category of the connection + Category *ConnectionCategory `json:"category,omitempty"` + Credentials *WorkspaceConnectionUsernamePassword `json:"credentials,omitempty"` + Target *string `json:"target,omitempty"` + + // Value details of the workspace connection. + Value *string `json:"value,omitempty"` + + // format for the workspace connection value + ValueFormat *ValueFormat `json:"valueFormat,omitempty"` +} + +// GetWorkspaceConnectionPropertiesV2 implements the WorkspaceConnectionPropertiesV2Classification interface for type UsernamePasswordAuthTypeWorkspaceConnectionProperties. +func (u *UsernamePasswordAuthTypeWorkspaceConnectionProperties) GetWorkspaceConnectionPropertiesV2() *WorkspaceConnectionPropertiesV2 { + return &WorkspaceConnectionPropertiesV2{ + AuthType: u.AuthType, + Category: u.Category, + Target: u.Target, + Value: u.Value, + ValueFormat: u.ValueFormat, + } +} + +// VirtualMachine - A Machine Learning compute based on Azure Virtual Machines. +type VirtualMachine struct { + // REQUIRED; The type of compute + ComputeType *ComputeType `json:"computeType,omitempty"` + + // The description of the Machine Learning compute. + Description *string `json:"description,omitempty"` + + // Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for authentication. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + Properties *VirtualMachineSchemaProperties `json:"properties,omitempty"` + + // ARM resource id of the underlying compute + ResourceID *string `json:"resourceId,omitempty"` + + // READ-ONLY; Location for the underlying compute + ComputeLocation *string `json:"computeLocation,omitempty" azure:"ro"` + + // READ-ONLY; The time at which the compute was created. + CreatedOn *time.Time `json:"createdOn,omitempty" azure:"ro"` + + // READ-ONLY; Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning + // service provisioned it if false. + IsAttachedCompute *bool `json:"isAttachedCompute,omitempty" azure:"ro"` + + // READ-ONLY; The time at which the compute was last modified. + ModifiedOn *time.Time `json:"modifiedOn,omitempty" azure:"ro"` + + // READ-ONLY; Errors during provisioning + ProvisioningErrors []*ErrorResponse `json:"provisioningErrors,omitempty" azure:"ro"` + + // READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` +} + +// GetCompute implements the ComputeClassification interface for type VirtualMachine. +func (v *VirtualMachine) GetCompute() *Compute { + return &Compute{ + ComputeType: v.ComputeType, + ComputeLocation: v.ComputeLocation, + ProvisioningState: v.ProvisioningState, + Description: v.Description, + CreatedOn: v.CreatedOn, + ModifiedOn: v.ModifiedOn, + ResourceID: v.ResourceID, + ProvisioningErrors: v.ProvisioningErrors, + IsAttachedCompute: v.IsAttachedCompute, + DisableLocalAuth: v.DisableLocalAuth, + } +} + +// VirtualMachineImage - Virtual Machine image for Windows AML Compute +type VirtualMachineImage struct { + // REQUIRED; Virtual Machine image path + ID *string `json:"id,omitempty"` +} + +// VirtualMachineSSHCredentials - Admin credentials for virtual machine +type VirtualMachineSSHCredentials struct { + // Password of admin account + Password *string `json:"password,omitempty"` + + // Private key data + PrivateKeyData *string `json:"privateKeyData,omitempty"` + + // Public key data + PublicKeyData *string `json:"publicKeyData,omitempty"` + + // Username of admin account + Username *string `json:"username,omitempty"` +} + +type VirtualMachineSchema struct { + Properties *VirtualMachineSchemaProperties `json:"properties,omitempty"` +} + +type VirtualMachineSchemaProperties struct { + // Public IP address of the virtual machine. + Address *string `json:"address,omitempty"` + + // Admin credentials for virtual machine + AdministratorAccount *VirtualMachineSSHCredentials `json:"administratorAccount,omitempty"` + + // Indicates whether this compute will be used for running notebooks. + IsNotebookInstanceCompute *bool `json:"isNotebookInstanceCompute,omitempty"` + + // Notebook server port open for ssh connections. + NotebookServerPort *int32 `json:"notebookServerPort,omitempty"` + + // Port open for ssh connections. + SSHPort *int32 `json:"sshPort,omitempty"` + + // Virtual Machine size + VirtualMachineSize *string `json:"virtualMachineSize,omitempty"` +} + +// VirtualMachineSecrets - Secrets related to a Machine Learning compute based on AKS. +type VirtualMachineSecrets struct { + // REQUIRED; The type of compute + ComputeType *ComputeType `json:"computeType,omitempty"` + + // Admin credentials for virtual machine. + AdministratorAccount *VirtualMachineSSHCredentials `json:"administratorAccount,omitempty"` +} + +// GetComputeSecrets implements the ComputeSecretsClassification interface for type VirtualMachineSecrets. +func (v *VirtualMachineSecrets) GetComputeSecrets() *ComputeSecrets { + return &ComputeSecrets{ + ComputeType: v.ComputeType, + } +} + +type VirtualMachineSecretsSchema struct { + // Admin credentials for virtual machine. + AdministratorAccount *VirtualMachineSSHCredentials `json:"administratorAccount,omitempty"` +} + +// VirtualMachineSize - Describes the properties of a VM size. +type VirtualMachineSize struct { + // The estimated price information for using a VM. + EstimatedVMPrices *EstimatedVMPrices `json:"estimatedVMPrices,omitempty"` + + // Specifies the compute types supported by the virtual machine size. + SupportedComputeTypes []*string `json:"supportedComputeTypes,omitempty"` + + // READ-ONLY; The family name of the virtual machine size. + Family *string `json:"family,omitempty" azure:"ro"` + + // READ-ONLY; The number of gPUs supported by the virtual machine size. + Gpus *int32 `json:"gpus,omitempty" azure:"ro"` + + // READ-ONLY; Specifies if the virtual machine size supports low priority VMs. + LowPriorityCapable *bool `json:"lowPriorityCapable,omitempty" azure:"ro"` + + // READ-ONLY; The resource volume size, in MB, allowed by the virtual machine size. + MaxResourceVolumeMB *int32 `json:"maxResourceVolumeMB,omitempty" azure:"ro"` + + // READ-ONLY; The amount of memory, in GB, supported by the virtual machine size. + MemoryGB *float64 `json:"memoryGB,omitempty" azure:"ro"` + + // READ-ONLY; The name of the virtual machine size. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The OS VHD disk size, in MB, allowed by the virtual machine size. + OSVhdSizeMB *int32 `json:"osVhdSizeMB,omitempty" azure:"ro"` + + // READ-ONLY; Specifies if the virtual machine size supports premium IO. + PremiumIO *bool `json:"premiumIO,omitempty" azure:"ro"` + + // READ-ONLY; The number of vCPUs supported by the virtual machine size. + VCPUs *int32 `json:"vCPUs,omitempty" azure:"ro"` +} + +// VirtualMachineSizeListResult - The List Virtual Machine size operation response. +type VirtualMachineSizeListResult struct { + // The list of virtual machine sizes supported by AmlCompute. + Value []*VirtualMachineSize `json:"value,omitempty"` +} + +// VirtualMachineSizesClientListOptions contains the optional parameters for the VirtualMachineSizesClient.List method. +type VirtualMachineSizesClientListOptions struct { + // placeholder for future optional parameters +} + +// Workspace - An object that represents a machine learning workspace. +type Workspace struct { + // The identity of the resource. + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + + // Specifies the location of the resource. + Location *string `json:"location,omitempty"` + + // The properties of the machine learning workspace. + Properties *WorkspaceProperties `json:"properties,omitempty"` + + // The sku of the workspace. + SKU *SKU `json:"sku,omitempty"` + + // Contains resource tags defined as key/value pairs. + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +type WorkspaceConnectionManagedIdentity struct { + ClientID *string `json:"clientId,omitempty"` + ResourceID *string `json:"resourceId,omitempty"` +} + +type WorkspaceConnectionPersonalAccessToken struct { + Pat *string `json:"pat,omitempty"` +} + +// WorkspaceConnectionPropertiesV2Classification provides polymorphic access to related types. +// Call the interface's GetWorkspaceConnectionPropertiesV2() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *ManagedIdentityAuthTypeWorkspaceConnectionProperties, *NoneAuthTypeWorkspaceConnectionProperties, *PATAuthTypeWorkspaceConnectionProperties, +// - *SASAuthTypeWorkspaceConnectionProperties, *UsernamePasswordAuthTypeWorkspaceConnectionProperties, *WorkspaceConnectionPropertiesV2 +type WorkspaceConnectionPropertiesV2Classification interface { + // GetWorkspaceConnectionPropertiesV2 returns the WorkspaceConnectionPropertiesV2 content of the underlying type. + GetWorkspaceConnectionPropertiesV2() *WorkspaceConnectionPropertiesV2 +} + +type WorkspaceConnectionPropertiesV2 struct { + // REQUIRED; Authentication type of the connection target + AuthType *ConnectionAuthType `json:"authType,omitempty"` + + // Category of the connection + Category *ConnectionCategory `json:"category,omitempty"` + Target *string `json:"target,omitempty"` + + // Value details of the workspace connection. + Value *string `json:"value,omitempty"` + + // format for the workspace connection value + ValueFormat *ValueFormat `json:"valueFormat,omitempty"` +} + +// GetWorkspaceConnectionPropertiesV2 implements the WorkspaceConnectionPropertiesV2Classification interface for type WorkspaceConnectionPropertiesV2. +func (w *WorkspaceConnectionPropertiesV2) GetWorkspaceConnectionPropertiesV2() *WorkspaceConnectionPropertiesV2 { + return w +} + +type WorkspaceConnectionPropertiesV2BasicResource struct { + // REQUIRED + Properties WorkspaceConnectionPropertiesV2Classification `json:"properties,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +type WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult struct { + Value []*WorkspaceConnectionPropertiesV2BasicResource `json:"value,omitempty"` + + // READ-ONLY + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +type WorkspaceConnectionSharedAccessSignature struct { + Sas *string `json:"sas,omitempty"` +} + +type WorkspaceConnectionUsernamePassword struct { + Password *string `json:"password,omitempty"` + Username *string `json:"username,omitempty"` +} + +// WorkspaceConnectionsClientCreateOptions contains the optional parameters for the WorkspaceConnectionsClient.Create method. +type WorkspaceConnectionsClientCreateOptions struct { + // placeholder for future optional parameters +} + +// WorkspaceConnectionsClientDeleteOptions contains the optional parameters for the WorkspaceConnectionsClient.Delete method. +type WorkspaceConnectionsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// WorkspaceConnectionsClientGetOptions contains the optional parameters for the WorkspaceConnectionsClient.Get method. +type WorkspaceConnectionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// WorkspaceConnectionsClientListOptions contains the optional parameters for the WorkspaceConnectionsClient.List method. +type WorkspaceConnectionsClientListOptions struct { + // Category of the workspace connection. + Category *string + // Target of the workspace connection. + Target *string +} + +// WorkspaceFeaturesClientListOptions contains the optional parameters for the WorkspaceFeaturesClient.List method. +type WorkspaceFeaturesClientListOptions struct { + // placeholder for future optional parameters +} + +// WorkspaceListResult - The result of a request to list machine learning workspaces. +type WorkspaceListResult struct { + // The URI that can be used to request the next list of machine learning workspaces. + NextLink *string `json:"nextLink,omitempty"` + + // The list of machine learning workspaces. Since this list may be incomplete, the nextLink field should be used to request + // the next list of machine learning workspaces. + Value []*Workspace `json:"value,omitempty"` +} + +// WorkspaceProperties - The properties of a machine learning workspace. +type WorkspaceProperties struct { + // The flag to indicate whether to allow public access when behind VNet. + AllowPublicAccessWhenBehindVnet *bool `json:"allowPublicAccessWhenBehindVnet,omitempty"` + + // ARM id of the application insights associated with this workspace. + ApplicationInsights *string `json:"applicationInsights,omitempty"` + + // ARM id of the container registry associated with this workspace. + ContainerRegistry *string `json:"containerRegistry,omitempty"` + + // The description of this workspace. + Description *string `json:"description,omitempty"` + + // Url for the discovery service to identify regional endpoints for machine learning experimentation services + DiscoveryURL *string `json:"discoveryUrl,omitempty"` + + // The encryption settings of Azure ML workspace. + Encryption *EncryptionProperty `json:"encryption,omitempty"` + + // The friendly name for this workspace. This name in mutable + FriendlyName *string `json:"friendlyName,omitempty"` + + // The flag to signal HBI data in the workspace and reduce diagnostic data collected by the service + HbiWorkspace *bool `json:"hbiWorkspace,omitempty"` + + // The compute name for image build + ImageBuildCompute *string `json:"imageBuildCompute,omitempty"` + + // ARM id of the key vault associated with this workspace. This cannot be changed once the workspace has been created + KeyVault *string `json:"keyVault,omitempty"` + + // The user assigned identity resource id that represents the workspace identity. + PrimaryUserAssignedIdentity *string `json:"primaryUserAssignedIdentity,omitempty"` + + // Whether requests from Public Network are allowed. + PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` + + // The service managed resource settings. + ServiceManagedResourcesSettings *ServiceManagedResourcesSettings `json:"serviceManagedResourcesSettings,omitempty"` + + // The list of shared private link resources in this workspace. + SharedPrivateLinkResources []*SharedPrivateLinkResource `json:"sharedPrivateLinkResources,omitempty"` + + // ARM id of the storage account associated with this workspace. This cannot be changed once the workspace has been created + StorageAccount *string `json:"storageAccount,omitempty"` + + // Enabling v1legacymode may prevent you from using features provided by the v2 API. + V1LegacyMode *bool `json:"v1LegacyMode,omitempty"` + + // READ-ONLY; The URI associated with this workspace that machine learning flow must point at to set up tracking. + MlFlowTrackingURI *string `json:"mlFlowTrackingUri,omitempty" azure:"ro"` + + // READ-ONLY; The notebook info of Azure ML workspace. + NotebookInfo *NotebookResourceInfo `json:"notebookInfo,omitempty" azure:"ro"` + + // READ-ONLY; The list of private endpoint connections in the workspace. + PrivateEndpointConnections []*PrivateEndpointConnection `json:"privateEndpointConnections,omitempty" azure:"ro"` + + // READ-ONLY; Count of private connections in the workspace + PrivateLinkCount *int32 `json:"privateLinkCount,omitempty" azure:"ro"` + + // READ-ONLY; The current deployment state of workspace resource. The provisioningState is to indicate states for resource + // provisioning. + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + + // READ-ONLY; The name of the managed resource group created by workspace RP in customer subscription if the workspace is + // CMK workspace + ServiceProvisionedResourceGroup *string `json:"serviceProvisionedResourceGroup,omitempty" azure:"ro"` + + // READ-ONLY; If the storage associated with the workspace has hierarchical namespace(HNS) enabled. + StorageHnsEnabled *bool `json:"storageHnsEnabled,omitempty" azure:"ro"` + + // READ-ONLY; The tenant id associated with this workspace. + TenantID *string `json:"tenantId,omitempty" azure:"ro"` + + // READ-ONLY; The immutable id associated with this workspace. + WorkspaceID *string `json:"workspaceId,omitempty" azure:"ro"` +} + +// WorkspacePropertiesUpdateParameters - The parameters for updating the properties of a machine learning workspace. +type WorkspacePropertiesUpdateParameters struct { + // ARM id of the application insights associated with this workspace. + ApplicationInsights *string `json:"applicationInsights,omitempty"` + + // ARM id of the container registry associated with this workspace. + ContainerRegistry *string `json:"containerRegistry,omitempty"` + + // The description of this workspace. + Description *string `json:"description,omitempty"` + + // The friendly name for this workspace. + FriendlyName *string `json:"friendlyName,omitempty"` + + // The compute name for image build + ImageBuildCompute *string `json:"imageBuildCompute,omitempty"` + + // The user assigned identity resource id that represents the workspace identity. + PrimaryUserAssignedIdentity *string `json:"primaryUserAssignedIdentity,omitempty"` + + // Whether requests from Public Network are allowed. + PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` + + // The service managed resource settings. + ServiceManagedResourcesSettings *ServiceManagedResourcesSettings `json:"serviceManagedResourcesSettings,omitempty"` +} + +// WorkspaceUpdateParameters - The parameters for updating a machine learning workspace. +type WorkspaceUpdateParameters struct { + // The identity of the resource. + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + + // The properties that the machine learning workspace will be updated with. + Properties *WorkspacePropertiesUpdateParameters `json:"properties,omitempty"` + + // The sku of the workspace. + SKU *SKU `json:"sku,omitempty"` + + // The resource tags for the machine learning workspace. + Tags map[string]*string `json:"tags,omitempty"` +} + +// WorkspacesClientBeginCreateOrUpdateOptions contains the optional parameters for the WorkspacesClient.BeginCreateOrUpdate +// method. +type WorkspacesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// WorkspacesClientBeginDeleteOptions contains the optional parameters for the WorkspacesClient.BeginDelete method. +type WorkspacesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// WorkspacesClientBeginDiagnoseOptions contains the optional parameters for the WorkspacesClient.BeginDiagnose method. +type WorkspacesClientBeginDiagnoseOptions struct { + // The parameter of diagnosing workspace health + Parameters *DiagnoseWorkspaceParameters + // Resumes the LRO from the provided token. + ResumeToken string +} + +// WorkspacesClientBeginPrepareNotebookOptions contains the optional parameters for the WorkspacesClient.BeginPrepareNotebook +// method. +type WorkspacesClientBeginPrepareNotebookOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// WorkspacesClientBeginResyncKeysOptions contains the optional parameters for the WorkspacesClient.BeginResyncKeys method. +type WorkspacesClientBeginResyncKeysOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// WorkspacesClientBeginUpdateOptions contains the optional parameters for the WorkspacesClient.BeginUpdate method. +type WorkspacesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// WorkspacesClientGetOptions contains the optional parameters for the WorkspacesClient.Get method. +type WorkspacesClientGetOptions struct { + // placeholder for future optional parameters +} + +// WorkspacesClientListByResourceGroupOptions contains the optional parameters for the WorkspacesClient.ListByResourceGroup +// method. +type WorkspacesClientListByResourceGroupOptions struct { + // Continuation token for pagination. + Skip *string +} + +// WorkspacesClientListBySubscriptionOptions contains the optional parameters for the WorkspacesClient.ListBySubscription +// method. +type WorkspacesClientListBySubscriptionOptions struct { + // Continuation token for pagination. + Skip *string +} + +// WorkspacesClientListKeysOptions contains the optional parameters for the WorkspacesClient.ListKeys method. +type WorkspacesClientListKeysOptions struct { + // placeholder for future optional parameters +} + +// WorkspacesClientListNotebookAccessTokenOptions contains the optional parameters for the WorkspacesClient.ListNotebookAccessToken +// method. +type WorkspacesClientListNotebookAccessTokenOptions struct { + // placeholder for future optional parameters +} + +// WorkspacesClientListNotebookKeysOptions contains the optional parameters for the WorkspacesClient.ListNotebookKeys method. +type WorkspacesClientListNotebookKeysOptions struct { + // placeholder for future optional parameters +} + +// WorkspacesClientListOutboundNetworkDependenciesEndpointsOptions contains the optional parameters for the WorkspacesClient.ListOutboundNetworkDependenciesEndpoints +// method. +type WorkspacesClientListOutboundNetworkDependenciesEndpointsOptions struct { + // placeholder for future optional parameters +} + +// WorkspacesClientListStorageAccountKeysOptions contains the optional parameters for the WorkspacesClient.ListStorageAccountKeys +// method. +type WorkspacesClientListStorageAccountKeysOptions struct { + // placeholder for future optional parameters +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_models_serde.go b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_models_serde.go new file mode 100644 index 000000000000..13c4f0fa98d7 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_models_serde.go @@ -0,0 +1,4862 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" +) + +// MarshalJSON implements the json.Marshaller interface for type AKS. +func (a AKS) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "computeLocation", a.ComputeLocation) + objectMap["computeType"] = ComputeTypeAKS + populateTimeRFC3339(objectMap, "createdOn", a.CreatedOn) + populate(objectMap, "description", a.Description) + populate(objectMap, "disableLocalAuth", a.DisableLocalAuth) + populate(objectMap, "isAttachedCompute", a.IsAttachedCompute) + populateTimeRFC3339(objectMap, "modifiedOn", a.ModifiedOn) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "provisioningErrors", a.ProvisioningErrors) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "resourceId", a.ResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AKS. +func (a *AKS) 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 "computeLocation": + err = unpopulate(val, "ComputeLocation", &a.ComputeLocation) + delete(rawMsg, key) + case "computeType": + err = unpopulate(val, "ComputeType", &a.ComputeType) + delete(rawMsg, key) + case "createdOn": + err = unpopulateTimeRFC3339(val, "CreatedOn", &a.CreatedOn) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "disableLocalAuth": + err = unpopulate(val, "DisableLocalAuth", &a.DisableLocalAuth) + delete(rawMsg, key) + case "isAttachedCompute": + err = unpopulate(val, "IsAttachedCompute", &a.IsAttachedCompute) + delete(rawMsg, key) + case "modifiedOn": + err = unpopulateTimeRFC3339(val, "ModifiedOn", &a.ModifiedOn) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "provisioningErrors": + err = unpopulate(val, "ProvisioningErrors", &a.ProvisioningErrors) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &a.ResourceID) + 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 AKSSchemaProperties. +func (a AKSSchemaProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "agentCount", a.AgentCount) + populate(objectMap, "agentVmSize", a.AgentVMSize) + populate(objectMap, "aksNetworkingConfiguration", a.AksNetworkingConfiguration) + populate(objectMap, "clusterFqdn", a.ClusterFqdn) + populate(objectMap, "clusterPurpose", a.ClusterPurpose) + populate(objectMap, "loadBalancerSubnet", a.LoadBalancerSubnet) + populate(objectMap, "loadBalancerType", a.LoadBalancerType) + populate(objectMap, "sslConfiguration", a.SSLConfiguration) + populate(objectMap, "systemServices", a.SystemServices) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type AccountKeyDatastoreCredentials. +func (a AccountKeyDatastoreCredentials) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["credentialsType"] = CredentialsTypeAccountKey + populate(objectMap, "secrets", a.Secrets) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccountKeyDatastoreCredentials. +func (a *AccountKeyDatastoreCredentials) 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 "credentialsType": + err = unpopulate(val, "CredentialsType", &a.CredentialsType) + delete(rawMsg, key) + case "secrets": + err = unpopulate(val, "Secrets", &a.Secrets) + 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 AccountKeyDatastoreSecrets. +func (a AccountKeyDatastoreSecrets) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "key", a.Key) + objectMap["secretsType"] = SecretsTypeAccountKey + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccountKeyDatastoreSecrets. +func (a *AccountKeyDatastoreSecrets) 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 "key": + err = unpopulate(val, "Key", &a.Key) + delete(rawMsg, key) + case "secretsType": + err = unpopulate(val, "SecretsType", &a.SecretsType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AksComputeSecrets. +func (a *AksComputeSecrets) 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 "adminKubeConfig": + err = unpopulate(val, "AdminKubeConfig", &a.AdminKubeConfig) + delete(rawMsg, key) + case "computeType": + err = unpopulate(val, "ComputeType", &a.ComputeType) + delete(rawMsg, key) + case "imagePullSecretName": + err = unpopulate(val, "ImagePullSecretName", &a.ImagePullSecretName) + delete(rawMsg, key) + case "userKubeConfig": + err = unpopulate(val, "UserKubeConfig", &a.UserKubeConfig) + 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 AmlCompute. +func (a AmlCompute) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "computeLocation", a.ComputeLocation) + objectMap["computeType"] = ComputeTypeAmlCompute + populateTimeRFC3339(objectMap, "createdOn", a.CreatedOn) + populate(objectMap, "description", a.Description) + populate(objectMap, "disableLocalAuth", a.DisableLocalAuth) + populate(objectMap, "isAttachedCompute", a.IsAttachedCompute) + populateTimeRFC3339(objectMap, "modifiedOn", a.ModifiedOn) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "provisioningErrors", a.ProvisioningErrors) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "resourceId", a.ResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AmlCompute. +func (a *AmlCompute) 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 "computeLocation": + err = unpopulate(val, "ComputeLocation", &a.ComputeLocation) + delete(rawMsg, key) + case "computeType": + err = unpopulate(val, "ComputeType", &a.ComputeType) + delete(rawMsg, key) + case "createdOn": + err = unpopulateTimeRFC3339(val, "CreatedOn", &a.CreatedOn) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "disableLocalAuth": + err = unpopulate(val, "DisableLocalAuth", &a.DisableLocalAuth) + delete(rawMsg, key) + case "isAttachedCompute": + err = unpopulate(val, "IsAttachedCompute", &a.IsAttachedCompute) + delete(rawMsg, key) + case "modifiedOn": + err = unpopulateTimeRFC3339(val, "ModifiedOn", &a.ModifiedOn) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "provisioningErrors": + err = unpopulate(val, "ProvisioningErrors", &a.ProvisioningErrors) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &a.ResourceID) + 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 AmlComputeProperties. +func (a AmlComputeProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "allocationState", a.AllocationState) + populateTimeRFC3339(objectMap, "allocationStateTransitionTime", a.AllocationStateTransitionTime) + populate(objectMap, "currentNodeCount", a.CurrentNodeCount) + populate(objectMap, "enableNodePublicIp", a.EnableNodePublicIP) + populate(objectMap, "errors", a.Errors) + populate(objectMap, "isolatedNetwork", a.IsolatedNetwork) + populate(objectMap, "nodeStateCounts", a.NodeStateCounts) + populate(objectMap, "osType", a.OSType) + populate(objectMap, "propertyBag", &a.PropertyBag) + populate(objectMap, "remoteLoginPortPublicAccess", a.RemoteLoginPortPublicAccess) + populate(objectMap, "scaleSettings", a.ScaleSettings) + populate(objectMap, "subnet", a.Subnet) + populate(objectMap, "targetNodeCount", a.TargetNodeCount) + populate(objectMap, "userAccountCredentials", a.UserAccountCredentials) + populate(objectMap, "vmPriority", a.VMPriority) + populate(objectMap, "vmSize", a.VMSize) + populate(objectMap, "virtualMachineImage", a.VirtualMachineImage) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AmlComputeProperties. +func (a *AmlComputeProperties) 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 "allocationState": + err = unpopulate(val, "AllocationState", &a.AllocationState) + delete(rawMsg, key) + case "allocationStateTransitionTime": + err = unpopulateTimeRFC3339(val, "AllocationStateTransitionTime", &a.AllocationStateTransitionTime) + delete(rawMsg, key) + case "currentNodeCount": + err = unpopulate(val, "CurrentNodeCount", &a.CurrentNodeCount) + delete(rawMsg, key) + case "enableNodePublicIp": + err = unpopulate(val, "EnableNodePublicIP", &a.EnableNodePublicIP) + delete(rawMsg, key) + case "errors": + err = unpopulate(val, "Errors", &a.Errors) + delete(rawMsg, key) + case "isolatedNetwork": + err = unpopulate(val, "IsolatedNetwork", &a.IsolatedNetwork) + delete(rawMsg, key) + case "nodeStateCounts": + err = unpopulate(val, "NodeStateCounts", &a.NodeStateCounts) + delete(rawMsg, key) + case "osType": + err = unpopulate(val, "OSType", &a.OSType) + delete(rawMsg, key) + case "propertyBag": + err = unpopulate(val, "PropertyBag", &a.PropertyBag) + delete(rawMsg, key) + case "remoteLoginPortPublicAccess": + err = unpopulate(val, "RemoteLoginPortPublicAccess", &a.RemoteLoginPortPublicAccess) + delete(rawMsg, key) + case "scaleSettings": + err = unpopulate(val, "ScaleSettings", &a.ScaleSettings) + delete(rawMsg, key) + case "subnet": + err = unpopulate(val, "Subnet", &a.Subnet) + delete(rawMsg, key) + case "targetNodeCount": + err = unpopulate(val, "TargetNodeCount", &a.TargetNodeCount) + delete(rawMsg, key) + case "userAccountCredentials": + err = unpopulate(val, "UserAccountCredentials", &a.UserAccountCredentials) + delete(rawMsg, key) + case "vmPriority": + err = unpopulate(val, "VMPriority", &a.VMPriority) + delete(rawMsg, key) + case "vmSize": + err = unpopulate(val, "VMSize", &a.VMSize) + delete(rawMsg, key) + case "virtualMachineImage": + err = unpopulate(val, "VirtualMachineImage", &a.VirtualMachineImage) + 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 AmlToken. +func (a AmlToken) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["identityType"] = IdentityConfigurationTypeAMLToken + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AmlToken. +func (a *AmlToken) 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 "identityType": + err = unpopulate(val, "IdentityType", &a.IdentityType) + 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 AssetBase. +func (a AssetBase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", a.Description) + populate(objectMap, "isAnonymous", a.IsAnonymous) + populate(objectMap, "isArchived", a.IsArchived) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "tags", a.Tags) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type AssetContainer. +func (a AssetContainer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", a.Description) + populate(objectMap, "isArchived", a.IsArchived) + populate(objectMap, "latestVersion", a.LatestVersion) + populate(objectMap, "nextVersion", a.NextVersion) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "tags", a.Tags) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type AzureBlobDatastore. +func (a AzureBlobDatastore) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "accountName", a.AccountName) + populate(objectMap, "containerName", a.ContainerName) + populate(objectMap, "credentials", a.Credentials) + objectMap["datastoreType"] = DatastoreTypeAzureBlob + populate(objectMap, "description", a.Description) + populate(objectMap, "endpoint", a.Endpoint) + populate(objectMap, "isDefault", a.IsDefault) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "protocol", a.Protocol) + populate(objectMap, "serviceDataAccessAuthIdentity", a.ServiceDataAccessAuthIdentity) + populate(objectMap, "tags", a.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureBlobDatastore. +func (a *AzureBlobDatastore) 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 "accountName": + err = unpopulate(val, "AccountName", &a.AccountName) + delete(rawMsg, key) + case "containerName": + err = unpopulate(val, "ContainerName", &a.ContainerName) + delete(rawMsg, key) + case "credentials": + a.Credentials, err = unmarshalDatastoreCredentialsClassification(val) + delete(rawMsg, key) + case "datastoreType": + err = unpopulate(val, "DatastoreType", &a.DatastoreType) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "endpoint": + err = unpopulate(val, "Endpoint", &a.Endpoint) + delete(rawMsg, key) + case "isDefault": + err = unpopulate(val, "IsDefault", &a.IsDefault) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "protocol": + err = unpopulate(val, "Protocol", &a.Protocol) + delete(rawMsg, key) + case "serviceDataAccessAuthIdentity": + err = unpopulate(val, "ServiceDataAccessAuthIdentity", &a.ServiceDataAccessAuthIdentity) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &a.Tags) + 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 AzureDataLakeGen1Datastore. +func (a AzureDataLakeGen1Datastore) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "credentials", a.Credentials) + objectMap["datastoreType"] = DatastoreTypeAzureDataLakeGen1 + populate(objectMap, "description", a.Description) + populate(objectMap, "isDefault", a.IsDefault) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "serviceDataAccessAuthIdentity", a.ServiceDataAccessAuthIdentity) + populate(objectMap, "storeName", a.StoreName) + populate(objectMap, "tags", a.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureDataLakeGen1Datastore. +func (a *AzureDataLakeGen1Datastore) 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 "credentials": + a.Credentials, err = unmarshalDatastoreCredentialsClassification(val) + delete(rawMsg, key) + case "datastoreType": + err = unpopulate(val, "DatastoreType", &a.DatastoreType) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "isDefault": + err = unpopulate(val, "IsDefault", &a.IsDefault) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "serviceDataAccessAuthIdentity": + err = unpopulate(val, "ServiceDataAccessAuthIdentity", &a.ServiceDataAccessAuthIdentity) + delete(rawMsg, key) + case "storeName": + err = unpopulate(val, "StoreName", &a.StoreName) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &a.Tags) + 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 AzureDataLakeGen2Datastore. +func (a AzureDataLakeGen2Datastore) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "accountName", a.AccountName) + populate(objectMap, "credentials", a.Credentials) + objectMap["datastoreType"] = DatastoreTypeAzureDataLakeGen2 + populate(objectMap, "description", a.Description) + populate(objectMap, "endpoint", a.Endpoint) + populate(objectMap, "filesystem", a.Filesystem) + populate(objectMap, "isDefault", a.IsDefault) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "protocol", a.Protocol) + populate(objectMap, "serviceDataAccessAuthIdentity", a.ServiceDataAccessAuthIdentity) + populate(objectMap, "tags", a.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureDataLakeGen2Datastore. +func (a *AzureDataLakeGen2Datastore) 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 "accountName": + err = unpopulate(val, "AccountName", &a.AccountName) + delete(rawMsg, key) + case "credentials": + a.Credentials, err = unmarshalDatastoreCredentialsClassification(val) + delete(rawMsg, key) + case "datastoreType": + err = unpopulate(val, "DatastoreType", &a.DatastoreType) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "endpoint": + err = unpopulate(val, "Endpoint", &a.Endpoint) + delete(rawMsg, key) + case "filesystem": + err = unpopulate(val, "Filesystem", &a.Filesystem) + delete(rawMsg, key) + case "isDefault": + err = unpopulate(val, "IsDefault", &a.IsDefault) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "protocol": + err = unpopulate(val, "Protocol", &a.Protocol) + delete(rawMsg, key) + case "serviceDataAccessAuthIdentity": + err = unpopulate(val, "ServiceDataAccessAuthIdentity", &a.ServiceDataAccessAuthIdentity) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &a.Tags) + 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 AzureFileDatastore. +func (a AzureFileDatastore) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "accountName", a.AccountName) + populate(objectMap, "credentials", a.Credentials) + objectMap["datastoreType"] = DatastoreTypeAzureFile + populate(objectMap, "description", a.Description) + populate(objectMap, "endpoint", a.Endpoint) + populate(objectMap, "fileShareName", a.FileShareName) + populate(objectMap, "isDefault", a.IsDefault) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "protocol", a.Protocol) + populate(objectMap, "serviceDataAccessAuthIdentity", a.ServiceDataAccessAuthIdentity) + populate(objectMap, "tags", a.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFileDatastore. +func (a *AzureFileDatastore) 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 "accountName": + err = unpopulate(val, "AccountName", &a.AccountName) + delete(rawMsg, key) + case "credentials": + a.Credentials, err = unmarshalDatastoreCredentialsClassification(val) + delete(rawMsg, key) + case "datastoreType": + err = unpopulate(val, "DatastoreType", &a.DatastoreType) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "endpoint": + err = unpopulate(val, "Endpoint", &a.Endpoint) + delete(rawMsg, key) + case "fileShareName": + err = unpopulate(val, "FileShareName", &a.FileShareName) + delete(rawMsg, key) + case "isDefault": + err = unpopulate(val, "IsDefault", &a.IsDefault) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "protocol": + err = unpopulate(val, "Protocol", &a.Protocol) + delete(rawMsg, key) + case "serviceDataAccessAuthIdentity": + err = unpopulate(val, "ServiceDataAccessAuthIdentity", &a.ServiceDataAccessAuthIdentity) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &a.Tags) + 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 BanditPolicy. +func (b BanditPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "delayEvaluation", b.DelayEvaluation) + populate(objectMap, "evaluationInterval", b.EvaluationInterval) + objectMap["policyType"] = EarlyTerminationPolicyTypeBandit + populate(objectMap, "slackAmount", b.SlackAmount) + populate(objectMap, "slackFactor", b.SlackFactor) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BanditPolicy. +func (b *BanditPolicy) 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", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "delayEvaluation": + err = unpopulate(val, "DelayEvaluation", &b.DelayEvaluation) + delete(rawMsg, key) + case "evaluationInterval": + err = unpopulate(val, "EvaluationInterval", &b.EvaluationInterval) + delete(rawMsg, key) + case "policyType": + err = unpopulate(val, "PolicyType", &b.PolicyType) + delete(rawMsg, key) + case "slackAmount": + err = unpopulate(val, "SlackAmount", &b.SlackAmount) + delete(rawMsg, key) + case "slackFactor": + err = unpopulate(val, "SlackFactor", &b.SlackFactor) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BatchDeployment. +func (b BatchDeployment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", b.ID) + populate(objectMap, "identity", b.Identity) + populate(objectMap, "kind", b.Kind) + populate(objectMap, "location", b.Location) + populate(objectMap, "name", b.Name) + populate(objectMap, "properties", b.Properties) + populate(objectMap, "sku", b.SKU) + populate(objectMap, "systemData", b.SystemData) + populate(objectMap, "tags", b.Tags) + populate(objectMap, "type", b.Type) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type BatchDeploymentProperties. +func (b BatchDeploymentProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "codeConfiguration", b.CodeConfiguration) + populate(objectMap, "compute", b.Compute) + populate(objectMap, "description", b.Description) + populate(objectMap, "environmentId", b.EnvironmentID) + populate(objectMap, "environmentVariables", b.EnvironmentVariables) + populate(objectMap, "errorThreshold", b.ErrorThreshold) + populate(objectMap, "loggingLevel", b.LoggingLevel) + populate(objectMap, "maxConcurrencyPerInstance", b.MaxConcurrencyPerInstance) + populate(objectMap, "miniBatchSize", b.MiniBatchSize) + populate(objectMap, "model", b.Model) + populate(objectMap, "outputAction", b.OutputAction) + populate(objectMap, "outputFileName", b.OutputFileName) + populate(objectMap, "properties", b.Properties) + populate(objectMap, "provisioningState", b.ProvisioningState) + populate(objectMap, "resources", b.Resources) + populate(objectMap, "retrySettings", b.RetrySettings) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BatchDeploymentProperties. +func (b *BatchDeploymentProperties) 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", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "codeConfiguration": + err = unpopulate(val, "CodeConfiguration", &b.CodeConfiguration) + delete(rawMsg, key) + case "compute": + err = unpopulate(val, "Compute", &b.Compute) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &b.Description) + delete(rawMsg, key) + case "environmentId": + err = unpopulate(val, "EnvironmentID", &b.EnvironmentID) + delete(rawMsg, key) + case "environmentVariables": + err = unpopulate(val, "EnvironmentVariables", &b.EnvironmentVariables) + delete(rawMsg, key) + case "errorThreshold": + err = unpopulate(val, "ErrorThreshold", &b.ErrorThreshold) + delete(rawMsg, key) + case "loggingLevel": + err = unpopulate(val, "LoggingLevel", &b.LoggingLevel) + delete(rawMsg, key) + case "maxConcurrencyPerInstance": + err = unpopulate(val, "MaxConcurrencyPerInstance", &b.MaxConcurrencyPerInstance) + delete(rawMsg, key) + case "miniBatchSize": + err = unpopulate(val, "MiniBatchSize", &b.MiniBatchSize) + delete(rawMsg, key) + case "model": + b.Model, err = unmarshalAssetReferenceBaseClassification(val) + delete(rawMsg, key) + case "outputAction": + err = unpopulate(val, "OutputAction", &b.OutputAction) + delete(rawMsg, key) + case "outputFileName": + err = unpopulate(val, "OutputFileName", &b.OutputFileName) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &b.Properties) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &b.ProvisioningState) + delete(rawMsg, key) + case "resources": + err = unpopulate(val, "Resources", &b.Resources) + delete(rawMsg, key) + case "retrySettings": + err = unpopulate(val, "RetrySettings", &b.RetrySettings) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BatchEndpoint. +func (b BatchEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", b.ID) + populate(objectMap, "identity", b.Identity) + populate(objectMap, "kind", b.Kind) + populate(objectMap, "location", b.Location) + populate(objectMap, "name", b.Name) + populate(objectMap, "properties", b.Properties) + populate(objectMap, "sku", b.SKU) + populate(objectMap, "systemData", b.SystemData) + populate(objectMap, "tags", b.Tags) + populate(objectMap, "type", b.Type) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type BatchEndpointProperties. +func (b BatchEndpointProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "authMode", b.AuthMode) + populate(objectMap, "defaults", b.Defaults) + populate(objectMap, "description", b.Description) + populate(objectMap, "keys", b.Keys) + populate(objectMap, "properties", b.Properties) + populate(objectMap, "provisioningState", b.ProvisioningState) + populate(objectMap, "scoringUri", b.ScoringURI) + populate(objectMap, "swaggerUri", b.SwaggerURI) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type BayesianSamplingAlgorithm. +func (b BayesianSamplingAlgorithm) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["samplingAlgorithmType"] = SamplingAlgorithmTypeBayesian + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BayesianSamplingAlgorithm. +func (b *BayesianSamplingAlgorithm) 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", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "samplingAlgorithmType": + err = unpopulate(val, "SamplingAlgorithmType", &b.SamplingAlgorithmType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CertificateDatastoreCredentials. +func (c CertificateDatastoreCredentials) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "authorityUrl", c.AuthorityURL) + populate(objectMap, "clientId", c.ClientID) + objectMap["credentialsType"] = CredentialsTypeCertificate + populate(objectMap, "resourceUrl", c.ResourceURL) + populate(objectMap, "secrets", c.Secrets) + populate(objectMap, "tenantId", c.TenantID) + populate(objectMap, "thumbprint", c.Thumbprint) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateDatastoreCredentials. +func (c *CertificateDatastoreCredentials) 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 "authorityUrl": + err = unpopulate(val, "AuthorityURL", &c.AuthorityURL) + delete(rawMsg, key) + case "clientId": + err = unpopulate(val, "ClientID", &c.ClientID) + delete(rawMsg, key) + case "credentialsType": + err = unpopulate(val, "CredentialsType", &c.CredentialsType) + delete(rawMsg, key) + case "resourceUrl": + err = unpopulate(val, "ResourceURL", &c.ResourceURL) + delete(rawMsg, key) + case "secrets": + err = unpopulate(val, "Secrets", &c.Secrets) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &c.TenantID) + delete(rawMsg, key) + case "thumbprint": + err = unpopulate(val, "Thumbprint", &c.Thumbprint) + 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 CertificateDatastoreSecrets. +func (c CertificateDatastoreSecrets) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "certificate", c.Certificate) + objectMap["secretsType"] = SecretsTypeCertificate + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateDatastoreSecrets. +func (c *CertificateDatastoreSecrets) 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 "certificate": + err = unpopulate(val, "Certificate", &c.Certificate) + delete(rawMsg, key) + case "secretsType": + err = unpopulate(val, "SecretsType", &c.SecretsType) + 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 ClusterUpdateParameters. +func (c ClusterUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", c.Properties) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type CodeContainerProperties. +func (c CodeContainerProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", c.Description) + populate(objectMap, "isArchived", c.IsArchived) + populate(objectMap, "latestVersion", c.LatestVersion) + populate(objectMap, "nextVersion", c.NextVersion) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "tags", c.Tags) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type CodeVersionProperties. +func (c CodeVersionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "codeUri", c.CodeURI) + populate(objectMap, "description", c.Description) + populate(objectMap, "isAnonymous", c.IsAnonymous) + populate(objectMap, "isArchived", c.IsArchived) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "tags", c.Tags) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type CommandJob. +func (c CommandJob) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "codeId", c.CodeID) + populate(objectMap, "command", c.Command) + populate(objectMap, "computeId", c.ComputeID) + populate(objectMap, "description", c.Description) + populate(objectMap, "displayName", c.DisplayName) + populate(objectMap, "distribution", c.Distribution) + populate(objectMap, "environmentId", c.EnvironmentID) + populate(objectMap, "environmentVariables", c.EnvironmentVariables) + populate(objectMap, "experimentName", c.ExperimentName) + populate(objectMap, "identity", c.Identity) + populate(objectMap, "inputs", c.Inputs) + populate(objectMap, "isArchived", c.IsArchived) + objectMap["jobType"] = JobTypeCommand + populate(objectMap, "limits", c.Limits) + populate(objectMap, "outputs", c.Outputs) + populate(objectMap, "parameters", &c.Parameters) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "resources", c.Resources) + populate(objectMap, "services", c.Services) + populate(objectMap, "status", c.Status) + populate(objectMap, "tags", c.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CommandJob. +func (c *CommandJob) 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 "codeId": + err = unpopulate(val, "CodeID", &c.CodeID) + delete(rawMsg, key) + case "command": + err = unpopulate(val, "Command", &c.Command) + delete(rawMsg, key) + case "computeId": + err = unpopulate(val, "ComputeID", &c.ComputeID) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &c.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &c.DisplayName) + delete(rawMsg, key) + case "distribution": + c.Distribution, err = unmarshalDistributionConfigurationClassification(val) + delete(rawMsg, key) + case "environmentId": + err = unpopulate(val, "EnvironmentID", &c.EnvironmentID) + delete(rawMsg, key) + case "environmentVariables": + err = unpopulate(val, "EnvironmentVariables", &c.EnvironmentVariables) + delete(rawMsg, key) + case "experimentName": + err = unpopulate(val, "ExperimentName", &c.ExperimentName) + delete(rawMsg, key) + case "identity": + c.Identity, err = unmarshalIdentityConfigurationClassification(val) + delete(rawMsg, key) + case "inputs": + c.Inputs, err = unmarshalJobInputClassificationMap(val) + delete(rawMsg, key) + case "isArchived": + err = unpopulate(val, "IsArchived", &c.IsArchived) + delete(rawMsg, key) + case "jobType": + err = unpopulate(val, "JobType", &c.JobType) + delete(rawMsg, key) + case "limits": + err = unpopulate(val, "Limits", &c.Limits) + delete(rawMsg, key) + case "outputs": + c.Outputs, err = unmarshalJobOutputClassificationMap(val) + delete(rawMsg, key) + case "parameters": + err = unpopulate(val, "Parameters", &c.Parameters) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "resources": + err = unpopulate(val, "Resources", &c.Resources) + delete(rawMsg, key) + case "services": + err = unpopulate(val, "Services", &c.Services) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &c.Status) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &c.Tags) + 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 CommandJobLimits. +func (c CommandJobLimits) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["jobLimitsType"] = JobLimitsTypeCommand + populate(objectMap, "timeout", c.Timeout) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CommandJobLimits. +func (c *CommandJobLimits) 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 "jobLimitsType": + err = unpopulate(val, "JobLimitsType", &c.JobLimitsType) + delete(rawMsg, key) + case "timeout": + err = unpopulate(val, "Timeout", &c.Timeout) + 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 ComponentContainerProperties. +func (c ComponentContainerProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", c.Description) + populate(objectMap, "isArchived", c.IsArchived) + populate(objectMap, "latestVersion", c.LatestVersion) + populate(objectMap, "nextVersion", c.NextVersion) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "tags", c.Tags) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ComponentVersionProperties. +func (c ComponentVersionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "componentSpec", &c.ComponentSpec) + populate(objectMap, "description", c.Description) + populate(objectMap, "isAnonymous", c.IsAnonymous) + populate(objectMap, "isArchived", c.IsArchived) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "tags", c.Tags) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type Compute. +func (c Compute) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "computeLocation", c.ComputeLocation) + objectMap["computeType"] = c.ComputeType + populateTimeRFC3339(objectMap, "createdOn", c.CreatedOn) + populate(objectMap, "description", c.Description) + populate(objectMap, "disableLocalAuth", c.DisableLocalAuth) + populate(objectMap, "isAttachedCompute", c.IsAttachedCompute) + populateTimeRFC3339(objectMap, "modifiedOn", c.ModifiedOn) + populate(objectMap, "provisioningErrors", c.ProvisioningErrors) + populate(objectMap, "provisioningState", c.ProvisioningState) + populate(objectMap, "resourceId", c.ResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Compute. +func (c *Compute) 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 "computeLocation": + err = unpopulate(val, "ComputeLocation", &c.ComputeLocation) + delete(rawMsg, key) + case "computeType": + err = unpopulate(val, "ComputeType", &c.ComputeType) + delete(rawMsg, key) + case "createdOn": + err = unpopulateTimeRFC3339(val, "CreatedOn", &c.CreatedOn) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &c.Description) + delete(rawMsg, key) + case "disableLocalAuth": + err = unpopulate(val, "DisableLocalAuth", &c.DisableLocalAuth) + delete(rawMsg, key) + case "isAttachedCompute": + err = unpopulate(val, "IsAttachedCompute", &c.IsAttachedCompute) + delete(rawMsg, key) + case "modifiedOn": + err = unpopulateTimeRFC3339(val, "ModifiedOn", &c.ModifiedOn) + delete(rawMsg, key) + case "provisioningErrors": + err = unpopulate(val, "ProvisioningErrors", &c.ProvisioningErrors) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &c.ResourceID) + 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 ComputeInstance. +func (c ComputeInstance) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "computeLocation", c.ComputeLocation) + objectMap["computeType"] = ComputeTypeComputeInstance + populateTimeRFC3339(objectMap, "createdOn", c.CreatedOn) + populate(objectMap, "description", c.Description) + populate(objectMap, "disableLocalAuth", c.DisableLocalAuth) + populate(objectMap, "isAttachedCompute", c.IsAttachedCompute) + populateTimeRFC3339(objectMap, "modifiedOn", c.ModifiedOn) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "provisioningErrors", c.ProvisioningErrors) + populate(objectMap, "provisioningState", c.ProvisioningState) + populate(objectMap, "resourceId", c.ResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeInstance. +func (c *ComputeInstance) 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 "computeLocation": + err = unpopulate(val, "ComputeLocation", &c.ComputeLocation) + delete(rawMsg, key) + case "computeType": + err = unpopulate(val, "ComputeType", &c.ComputeType) + delete(rawMsg, key) + case "createdOn": + err = unpopulateTimeRFC3339(val, "CreatedOn", &c.CreatedOn) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &c.Description) + delete(rawMsg, key) + case "disableLocalAuth": + err = unpopulate(val, "DisableLocalAuth", &c.DisableLocalAuth) + delete(rawMsg, key) + case "isAttachedCompute": + err = unpopulate(val, "IsAttachedCompute", &c.IsAttachedCompute) + delete(rawMsg, key) + case "modifiedOn": + err = unpopulateTimeRFC3339(val, "ModifiedOn", &c.ModifiedOn) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "provisioningErrors": + err = unpopulate(val, "ProvisioningErrors", &c.ProvisioningErrors) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &c.ResourceID) + 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 ComputeInstanceContainer. +func (c ComputeInstanceContainer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "autosave", c.Autosave) + populate(objectMap, "environment", c.Environment) + populate(objectMap, "gpu", c.Gpu) + populate(objectMap, "name", c.Name) + populate(objectMap, "network", c.Network) + populate(objectMap, "services", c.Services) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ComputeInstanceDataMount. +func (c ComputeInstanceDataMount) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "createdBy", c.CreatedBy) + populate(objectMap, "error", c.Error) + populate(objectMap, "mountAction", c.MountAction) + populate(objectMap, "mountName", c.MountName) + populate(objectMap, "mountPath", c.MountPath) + populate(objectMap, "mountState", c.MountState) + populateTimeRFC3339(objectMap, "mountedOn", c.MountedOn) + populate(objectMap, "source", c.Source) + populate(objectMap, "sourceType", c.SourceType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeInstanceDataMount. +func (c *ComputeInstanceDataMount) 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 "createdBy": + err = unpopulate(val, "CreatedBy", &c.CreatedBy) + delete(rawMsg, key) + case "error": + err = unpopulate(val, "Error", &c.Error) + delete(rawMsg, key) + case "mountAction": + err = unpopulate(val, "MountAction", &c.MountAction) + delete(rawMsg, key) + case "mountName": + err = unpopulate(val, "MountName", &c.MountName) + delete(rawMsg, key) + case "mountPath": + err = unpopulate(val, "MountPath", &c.MountPath) + delete(rawMsg, key) + case "mountState": + err = unpopulate(val, "MountState", &c.MountState) + delete(rawMsg, key) + case "mountedOn": + err = unpopulateTimeRFC3339(val, "MountedOn", &c.MountedOn) + delete(rawMsg, key) + case "source": + err = unpopulate(val, "Source", &c.Source) + delete(rawMsg, key) + case "sourceType": + err = unpopulate(val, "SourceType", &c.SourceType) + 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 ComputeInstanceLastOperation. +func (c ComputeInstanceLastOperation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "operationName", c.OperationName) + populate(objectMap, "operationStatus", c.OperationStatus) + populateTimeRFC3339(objectMap, "operationTime", c.OperationTime) + populate(objectMap, "operationTrigger", c.OperationTrigger) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeInstanceLastOperation. +func (c *ComputeInstanceLastOperation) 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 "operationName": + err = unpopulate(val, "OperationName", &c.OperationName) + delete(rawMsg, key) + case "operationStatus": + err = unpopulate(val, "OperationStatus", &c.OperationStatus) + delete(rawMsg, key) + case "operationTime": + err = unpopulateTimeRFC3339(val, "OperationTime", &c.OperationTime) + delete(rawMsg, key) + case "operationTrigger": + err = unpopulate(val, "OperationTrigger", &c.OperationTrigger) + 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 ComputeInstanceProperties. +func (c ComputeInstanceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "applicationSharingPolicy", c.ApplicationSharingPolicy) + populate(objectMap, "applications", c.Applications) + populate(objectMap, "computeInstanceAuthorizationType", c.ComputeInstanceAuthorizationType) + populate(objectMap, "connectivityEndpoints", c.ConnectivityEndpoints) + populate(objectMap, "containers", c.Containers) + populate(objectMap, "createdBy", c.CreatedBy) + populate(objectMap, "dataDisks", c.DataDisks) + populate(objectMap, "dataMounts", c.DataMounts) + populate(objectMap, "enableNodePublicIp", c.EnableNodePublicIP) + populate(objectMap, "errors", c.Errors) + populate(objectMap, "lastOperation", c.LastOperation) + populate(objectMap, "personalComputeInstanceSettings", c.PersonalComputeInstanceSettings) + populate(objectMap, "sshSettings", c.SSHSettings) + populate(objectMap, "schedules", c.Schedules) + populate(objectMap, "setupScripts", c.SetupScripts) + populate(objectMap, "state", c.State) + populate(objectMap, "subnet", c.Subnet) + populate(objectMap, "vmSize", c.VMSize) + populate(objectMap, "versions", c.Versions) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ComputeResource. +func (c ComputeResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", c.ID) + populate(objectMap, "identity", c.Identity) + 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 ComputeResource. +func (c *ComputeResource) 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 "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &c.Identity) + 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": + c.Properties, err = unmarshalComputeClassification(val) + 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 ComputeResourceSchema. +func (c ComputeResourceSchema) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", c.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeResourceSchema. +func (c *ComputeResourceSchema) 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 "properties": + c.Properties, err = unmarshalComputeClassification(val) + 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 ComputeSchedules. +func (c ComputeSchedules) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "computeStartStop", c.ComputeStartStop) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type CustomModelJobInput. +func (c CustomModelJobInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", c.Description) + objectMap["jobInputType"] = JobInputTypeCustomModel + populate(objectMap, "mode", c.Mode) + populate(objectMap, "uri", c.URI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomModelJobInput. +func (c *CustomModelJobInput) 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 "description": + err = unpopulate(val, "Description", &c.Description) + delete(rawMsg, key) + case "jobInputType": + err = unpopulate(val, "JobInputType", &c.JobInputType) + delete(rawMsg, key) + case "mode": + err = unpopulate(val, "Mode", &c.Mode) + delete(rawMsg, key) + case "uri": + err = unpopulate(val, "URI", &c.URI) + 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 CustomModelJobOutput. +func (c CustomModelJobOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", c.Description) + objectMap["jobOutputType"] = JobOutputTypeCustomModel + populate(objectMap, "mode", c.Mode) + populate(objectMap, "uri", c.URI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomModelJobOutput. +func (c *CustomModelJobOutput) 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 "description": + err = unpopulate(val, "Description", &c.Description) + delete(rawMsg, key) + case "jobOutputType": + err = unpopulate(val, "JobOutputType", &c.JobOutputType) + delete(rawMsg, key) + case "mode": + err = unpopulate(val, "Mode", &c.Mode) + delete(rawMsg, key) + case "uri": + err = unpopulate(val, "URI", &c.URI) + 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 DataContainerProperties. +func (d DataContainerProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "dataType", d.DataType) + populate(objectMap, "description", d.Description) + populate(objectMap, "isArchived", d.IsArchived) + populate(objectMap, "latestVersion", d.LatestVersion) + populate(objectMap, "nextVersion", d.NextVersion) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "tags", d.Tags) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type DataFactory. +func (d DataFactory) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "computeLocation", d.ComputeLocation) + objectMap["computeType"] = ComputeTypeDataFactory + populateTimeRFC3339(objectMap, "createdOn", d.CreatedOn) + populate(objectMap, "description", d.Description) + populate(objectMap, "disableLocalAuth", d.DisableLocalAuth) + populate(objectMap, "isAttachedCompute", d.IsAttachedCompute) + populateTimeRFC3339(objectMap, "modifiedOn", d.ModifiedOn) + populate(objectMap, "provisioningErrors", d.ProvisioningErrors) + populate(objectMap, "provisioningState", d.ProvisioningState) + populate(objectMap, "resourceId", d.ResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataFactory. +func (d *DataFactory) 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 "computeLocation": + err = unpopulate(val, "ComputeLocation", &d.ComputeLocation) + delete(rawMsg, key) + case "computeType": + err = unpopulate(val, "ComputeType", &d.ComputeType) + delete(rawMsg, key) + case "createdOn": + err = unpopulateTimeRFC3339(val, "CreatedOn", &d.CreatedOn) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &d.Description) + delete(rawMsg, key) + case "disableLocalAuth": + err = unpopulate(val, "DisableLocalAuth", &d.DisableLocalAuth) + delete(rawMsg, key) + case "isAttachedCompute": + err = unpopulate(val, "IsAttachedCompute", &d.IsAttachedCompute) + delete(rawMsg, key) + case "modifiedOn": + err = unpopulateTimeRFC3339(val, "ModifiedOn", &d.ModifiedOn) + delete(rawMsg, key) + case "provisioningErrors": + err = unpopulate(val, "ProvisioningErrors", &d.ProvisioningErrors) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &d.ResourceID) + 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 DataLakeAnalytics. +func (d DataLakeAnalytics) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "computeLocation", d.ComputeLocation) + objectMap["computeType"] = ComputeTypeDataLakeAnalytics + populateTimeRFC3339(objectMap, "createdOn", d.CreatedOn) + populate(objectMap, "description", d.Description) + populate(objectMap, "disableLocalAuth", d.DisableLocalAuth) + populate(objectMap, "isAttachedCompute", d.IsAttachedCompute) + populateTimeRFC3339(objectMap, "modifiedOn", d.ModifiedOn) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "provisioningErrors", d.ProvisioningErrors) + populate(objectMap, "provisioningState", d.ProvisioningState) + populate(objectMap, "resourceId", d.ResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataLakeAnalytics. +func (d *DataLakeAnalytics) 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 "computeLocation": + err = unpopulate(val, "ComputeLocation", &d.ComputeLocation) + delete(rawMsg, key) + case "computeType": + err = unpopulate(val, "ComputeType", &d.ComputeType) + delete(rawMsg, key) + case "createdOn": + err = unpopulateTimeRFC3339(val, "CreatedOn", &d.CreatedOn) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &d.Description) + delete(rawMsg, key) + case "disableLocalAuth": + err = unpopulate(val, "DisableLocalAuth", &d.DisableLocalAuth) + delete(rawMsg, key) + case "isAttachedCompute": + err = unpopulate(val, "IsAttachedCompute", &d.IsAttachedCompute) + delete(rawMsg, key) + case "modifiedOn": + err = unpopulateTimeRFC3339(val, "ModifiedOn", &d.ModifiedOn) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "provisioningErrors": + err = unpopulate(val, "ProvisioningErrors", &d.ProvisioningErrors) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &d.ResourceID) + 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 DataPathAssetReference. +func (d DataPathAssetReference) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "datastoreId", d.DatastoreID) + populate(objectMap, "path", d.Path) + objectMap["referenceType"] = ReferenceTypeDataPath + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataPathAssetReference. +func (d *DataPathAssetReference) 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 "datastoreId": + err = unpopulate(val, "DatastoreID", &d.DatastoreID) + delete(rawMsg, key) + case "path": + err = unpopulate(val, "Path", &d.Path) + delete(rawMsg, key) + case "referenceType": + err = unpopulate(val, "ReferenceType", &d.ReferenceType) + 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 DataVersionBase. +func (d DataVersionBase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataVersionBase. +func (d *DataVersionBase) 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 "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + d.Properties, err = unmarshalDataVersionBasePropertiesClassification(val) + 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 DataVersionBaseProperties. +func (d DataVersionBaseProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["dataType"] = d.DataType + populate(objectMap, "dataUri", d.DataURI) + populate(objectMap, "description", d.Description) + populate(objectMap, "isAnonymous", d.IsAnonymous) + populate(objectMap, "isArchived", d.IsArchived) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "tags", d.Tags) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type Databricks. +func (d Databricks) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "computeLocation", d.ComputeLocation) + objectMap["computeType"] = ComputeTypeDatabricks + populateTimeRFC3339(objectMap, "createdOn", d.CreatedOn) + populate(objectMap, "description", d.Description) + populate(objectMap, "disableLocalAuth", d.DisableLocalAuth) + populate(objectMap, "isAttachedCompute", d.IsAttachedCompute) + populateTimeRFC3339(objectMap, "modifiedOn", d.ModifiedOn) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "provisioningErrors", d.ProvisioningErrors) + populate(objectMap, "provisioningState", d.ProvisioningState) + populate(objectMap, "resourceId", d.ResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Databricks. +func (d *Databricks) 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 "computeLocation": + err = unpopulate(val, "ComputeLocation", &d.ComputeLocation) + delete(rawMsg, key) + case "computeType": + err = unpopulate(val, "ComputeType", &d.ComputeType) + delete(rawMsg, key) + case "createdOn": + err = unpopulateTimeRFC3339(val, "CreatedOn", &d.CreatedOn) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &d.Description) + delete(rawMsg, key) + case "disableLocalAuth": + err = unpopulate(val, "DisableLocalAuth", &d.DisableLocalAuth) + delete(rawMsg, key) + case "isAttachedCompute": + err = unpopulate(val, "IsAttachedCompute", &d.IsAttachedCompute) + delete(rawMsg, key) + case "modifiedOn": + err = unpopulateTimeRFC3339(val, "ModifiedOn", &d.ModifiedOn) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "provisioningErrors": + err = unpopulate(val, "ProvisioningErrors", &d.ProvisioningErrors) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &d.ResourceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabricksComputeSecrets. +func (d *DatabricksComputeSecrets) 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 "computeType": + err = unpopulate(val, "ComputeType", &d.ComputeType) + delete(rawMsg, key) + case "databricksAccessToken": + err = unpopulate(val, "DatabricksAccessToken", &d.DatabricksAccessToken) + 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 Datastore. +func (d Datastore) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Datastore. +func (d *Datastore) 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 "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + d.Properties, err = unmarshalDatastorePropertiesClassification(val) + 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 DatastoreProperties. +func (d DatastoreProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "credentials", d.Credentials) + objectMap["datastoreType"] = d.DatastoreType + populate(objectMap, "description", d.Description) + populate(objectMap, "isDefault", d.IsDefault) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "tags", d.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatastoreProperties. +func (d *DatastoreProperties) 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 "credentials": + d.Credentials, err = unmarshalDatastoreCredentialsClassification(val) + delete(rawMsg, key) + case "datastoreType": + err = unpopulate(val, "DatastoreType", &d.DatastoreType) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &d.Description) + delete(rawMsg, key) + case "isDefault": + err = unpopulate(val, "IsDefault", &d.IsDefault) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &d.Tags) + 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 DefaultScaleSettings. +func (d DefaultScaleSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["scaleType"] = ScaleTypeDefault + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DefaultScaleSettings. +func (d *DefaultScaleSettings) 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 "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 DiagnoseRequestProperties. +func (d DiagnoseRequestProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "applicationInsights", d.ApplicationInsights) + populate(objectMap, "containerRegistry", d.ContainerRegistry) + populate(objectMap, "dnsResolution", d.DNSResolution) + populate(objectMap, "keyVault", d.KeyVault) + populate(objectMap, "nsg", d.Nsg) + populate(objectMap, "others", d.Others) + populate(objectMap, "resourceLock", d.ResourceLock) + populate(objectMap, "storageAccount", d.StorageAccount) + populate(objectMap, "udr", d.Udr) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type EndpointDeploymentPropertiesBase. +func (e EndpointDeploymentPropertiesBase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "codeConfiguration", e.CodeConfiguration) + populate(objectMap, "description", e.Description) + populate(objectMap, "environmentId", e.EnvironmentID) + populate(objectMap, "environmentVariables", e.EnvironmentVariables) + populate(objectMap, "properties", e.Properties) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type EndpointPropertiesBase. +func (e EndpointPropertiesBase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "authMode", e.AuthMode) + populate(objectMap, "description", e.Description) + populate(objectMap, "keys", e.Keys) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "scoringUri", e.ScoringURI) + populate(objectMap, "swaggerUri", e.SwaggerURI) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type EnvironmentContainerProperties. +func (e EnvironmentContainerProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", e.Description) + populate(objectMap, "isArchived", e.IsArchived) + populate(objectMap, "latestVersion", e.LatestVersion) + populate(objectMap, "nextVersion", e.NextVersion) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "tags", e.Tags) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type EnvironmentVersionProperties. +func (e EnvironmentVersionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "build", e.Build) + populate(objectMap, "condaFile", e.CondaFile) + populate(objectMap, "description", e.Description) + populate(objectMap, "environmentType", e.EnvironmentType) + populate(objectMap, "image", e.Image) + populate(objectMap, "inferenceConfig", e.InferenceConfig) + populate(objectMap, "isAnonymous", e.IsAnonymous) + populate(objectMap, "isArchived", e.IsArchived) + populate(objectMap, "osType", e.OSType) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "tags", e.Tags) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorDetail. +func (e ErrorDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + 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) +} + +// MarshalJSON implements the json.Marshaller interface for type FlavorData. +func (f FlavorData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "data", f.Data) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type GridSamplingAlgorithm. +func (g GridSamplingAlgorithm) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["samplingAlgorithmType"] = SamplingAlgorithmTypeGrid + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GridSamplingAlgorithm. +func (g *GridSamplingAlgorithm) 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", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "samplingAlgorithmType": + err = unpopulate(val, "SamplingAlgorithmType", &g.SamplingAlgorithmType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HDInsight. +func (h HDInsight) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "computeLocation", h.ComputeLocation) + objectMap["computeType"] = ComputeTypeHDInsight + populateTimeRFC3339(objectMap, "createdOn", h.CreatedOn) + populate(objectMap, "description", h.Description) + populate(objectMap, "disableLocalAuth", h.DisableLocalAuth) + populate(objectMap, "isAttachedCompute", h.IsAttachedCompute) + populateTimeRFC3339(objectMap, "modifiedOn", h.ModifiedOn) + populate(objectMap, "properties", h.Properties) + populate(objectMap, "provisioningErrors", h.ProvisioningErrors) + populate(objectMap, "provisioningState", h.ProvisioningState) + populate(objectMap, "resourceId", h.ResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HDInsight. +func (h *HDInsight) 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", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "computeLocation": + err = unpopulate(val, "ComputeLocation", &h.ComputeLocation) + delete(rawMsg, key) + case "computeType": + err = unpopulate(val, "ComputeType", &h.ComputeType) + delete(rawMsg, key) + case "createdOn": + err = unpopulateTimeRFC3339(val, "CreatedOn", &h.CreatedOn) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &h.Description) + delete(rawMsg, key) + case "disableLocalAuth": + err = unpopulate(val, "DisableLocalAuth", &h.DisableLocalAuth) + delete(rawMsg, key) + case "isAttachedCompute": + err = unpopulate(val, "IsAttachedCompute", &h.IsAttachedCompute) + delete(rawMsg, key) + case "modifiedOn": + err = unpopulateTimeRFC3339(val, "ModifiedOn", &h.ModifiedOn) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &h.Properties) + delete(rawMsg, key) + case "provisioningErrors": + err = unpopulate(val, "ProvisioningErrors", &h.ProvisioningErrors) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &h.ProvisioningState) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &h.ResourceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IDAssetReference. +func (i IDAssetReference) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "assetId", i.AssetID) + objectMap["referenceType"] = ReferenceTypeID + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IDAssetReference. +func (i *IDAssetReference) 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 "assetId": + err = unpopulate(val, "AssetID", &i.AssetID) + delete(rawMsg, key) + case "referenceType": + err = unpopulate(val, "ReferenceType", &i.ReferenceType) + 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 InstanceTypeSchema. +func (i InstanceTypeSchema) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nodeSelector", i.NodeSelector) + populate(objectMap, "resources", i.Resources) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type InstanceTypeSchemaResources. +func (i InstanceTypeSchemaResources) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "limits", i.Limits) + populate(objectMap, "requests", i.Requests) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type JobBase. +func (j JobBase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", j.ID) + populate(objectMap, "name", j.Name) + populate(objectMap, "properties", j.Properties) + populate(objectMap, "systemData", j.SystemData) + populate(objectMap, "type", j.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobBase. +func (j *JobBase) 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", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &j.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &j.Name) + delete(rawMsg, key) + case "properties": + j.Properties, err = unmarshalJobBasePropertiesClassification(val) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &j.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &j.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobBaseProperties. +func (j JobBaseProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "computeId", j.ComputeID) + populate(objectMap, "description", j.Description) + populate(objectMap, "displayName", j.DisplayName) + populate(objectMap, "experimentName", j.ExperimentName) + populate(objectMap, "identity", j.Identity) + populate(objectMap, "isArchived", j.IsArchived) + objectMap["jobType"] = j.JobType + populate(objectMap, "properties", j.Properties) + populate(objectMap, "services", j.Services) + populate(objectMap, "status", j.Status) + populate(objectMap, "tags", j.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobBaseProperties. +func (j *JobBaseProperties) 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", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "computeId": + err = unpopulate(val, "ComputeID", &j.ComputeID) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &j.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &j.DisplayName) + delete(rawMsg, key) + case "experimentName": + err = unpopulate(val, "ExperimentName", &j.ExperimentName) + delete(rawMsg, key) + case "identity": + j.Identity, err = unmarshalIdentityConfigurationClassification(val) + delete(rawMsg, key) + case "isArchived": + err = unpopulate(val, "IsArchived", &j.IsArchived) + delete(rawMsg, key) + case "jobType": + err = unpopulate(val, "JobType", &j.JobType) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &j.Properties) + delete(rawMsg, key) + case "services": + err = unpopulate(val, "Services", &j.Services) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &j.Status) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &j.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobService. +func (j JobService) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "endpoint", j.Endpoint) + populate(objectMap, "errorMessage", j.ErrorMessage) + populate(objectMap, "jobServiceType", j.JobServiceType) + populate(objectMap, "port", j.Port) + populate(objectMap, "properties", j.Properties) + populate(objectMap, "status", j.Status) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type Kubernetes. +func (k Kubernetes) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "computeLocation", k.ComputeLocation) + objectMap["computeType"] = ComputeTypeKubernetes + populateTimeRFC3339(objectMap, "createdOn", k.CreatedOn) + populate(objectMap, "description", k.Description) + populate(objectMap, "disableLocalAuth", k.DisableLocalAuth) + populate(objectMap, "isAttachedCompute", k.IsAttachedCompute) + populateTimeRFC3339(objectMap, "modifiedOn", k.ModifiedOn) + populate(objectMap, "properties", k.Properties) + populate(objectMap, "provisioningErrors", k.ProvisioningErrors) + populate(objectMap, "provisioningState", k.ProvisioningState) + populate(objectMap, "resourceId", k.ResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Kubernetes. +func (k *Kubernetes) 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 "computeLocation": + err = unpopulate(val, "ComputeLocation", &k.ComputeLocation) + delete(rawMsg, key) + case "computeType": + err = unpopulate(val, "ComputeType", &k.ComputeType) + delete(rawMsg, key) + case "createdOn": + err = unpopulateTimeRFC3339(val, "CreatedOn", &k.CreatedOn) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &k.Description) + delete(rawMsg, key) + case "disableLocalAuth": + err = unpopulate(val, "DisableLocalAuth", &k.DisableLocalAuth) + delete(rawMsg, key) + case "isAttachedCompute": + err = unpopulate(val, "IsAttachedCompute", &k.IsAttachedCompute) + delete(rawMsg, key) + case "modifiedOn": + err = unpopulateTimeRFC3339(val, "ModifiedOn", &k.ModifiedOn) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &k.Properties) + delete(rawMsg, key) + case "provisioningErrors": + err = unpopulate(val, "ProvisioningErrors", &k.ProvisioningErrors) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &k.ProvisioningState) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &k.ResourceID) + 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 KubernetesOnlineDeployment. +func (k KubernetesOnlineDeployment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "appInsightsEnabled", k.AppInsightsEnabled) + populate(objectMap, "codeConfiguration", k.CodeConfiguration) + populate(objectMap, "containerResourceRequirements", k.ContainerResourceRequirements) + populate(objectMap, "description", k.Description) + objectMap["endpointComputeType"] = EndpointComputeTypeKubernetes + populate(objectMap, "environmentId", k.EnvironmentID) + populate(objectMap, "environmentVariables", k.EnvironmentVariables) + populate(objectMap, "instanceType", k.InstanceType) + populate(objectMap, "livenessProbe", k.LivenessProbe) + populate(objectMap, "model", k.Model) + populate(objectMap, "modelMountPath", k.ModelMountPath) + populate(objectMap, "properties", k.Properties) + populate(objectMap, "provisioningState", k.ProvisioningState) + populate(objectMap, "readinessProbe", k.ReadinessProbe) + populate(objectMap, "requestSettings", k.RequestSettings) + populate(objectMap, "scaleSettings", k.ScaleSettings) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KubernetesOnlineDeployment. +func (k *KubernetesOnlineDeployment) 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 "appInsightsEnabled": + err = unpopulate(val, "AppInsightsEnabled", &k.AppInsightsEnabled) + delete(rawMsg, key) + case "codeConfiguration": + err = unpopulate(val, "CodeConfiguration", &k.CodeConfiguration) + delete(rawMsg, key) + case "containerResourceRequirements": + err = unpopulate(val, "ContainerResourceRequirements", &k.ContainerResourceRequirements) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &k.Description) + delete(rawMsg, key) + case "endpointComputeType": + err = unpopulate(val, "EndpointComputeType", &k.EndpointComputeType) + delete(rawMsg, key) + case "environmentId": + err = unpopulate(val, "EnvironmentID", &k.EnvironmentID) + delete(rawMsg, key) + case "environmentVariables": + err = unpopulate(val, "EnvironmentVariables", &k.EnvironmentVariables) + delete(rawMsg, key) + case "instanceType": + err = unpopulate(val, "InstanceType", &k.InstanceType) + delete(rawMsg, key) + case "livenessProbe": + err = unpopulate(val, "LivenessProbe", &k.LivenessProbe) + delete(rawMsg, key) + case "model": + err = unpopulate(val, "Model", &k.Model) + delete(rawMsg, key) + case "modelMountPath": + err = unpopulate(val, "ModelMountPath", &k.ModelMountPath) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &k.Properties) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &k.ProvisioningState) + delete(rawMsg, key) + case "readinessProbe": + err = unpopulate(val, "ReadinessProbe", &k.ReadinessProbe) + delete(rawMsg, key) + case "requestSettings": + err = unpopulate(val, "RequestSettings", &k.RequestSettings) + delete(rawMsg, key) + case "scaleSettings": + k.ScaleSettings, err = unmarshalOnlineScaleSettingsClassification(val) + 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 KubernetesProperties. +func (k KubernetesProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "defaultInstanceType", k.DefaultInstanceType) + populate(objectMap, "extensionInstanceReleaseTrain", k.ExtensionInstanceReleaseTrain) + populate(objectMap, "extensionPrincipalId", k.ExtensionPrincipalID) + populate(objectMap, "instanceTypes", k.InstanceTypes) + populate(objectMap, "namespace", k.Namespace) + populate(objectMap, "relayConnectionString", k.RelayConnectionString) + populate(objectMap, "serviceBusConnectionString", k.ServiceBusConnectionString) + populate(objectMap, "vcName", k.VcName) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type LiteralJobInput. +func (l LiteralJobInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", l.Description) + objectMap["jobInputType"] = JobInputTypeLiteral + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LiteralJobInput. +func (l *LiteralJobInput) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &l.Description) + delete(rawMsg, key) + case "jobInputType": + err = unpopulate(val, "JobInputType", &l.JobInputType) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &l.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MLFlowModelJobInput. +func (m MLFlowModelJobInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", m.Description) + objectMap["jobInputType"] = JobInputTypeMlflowModel + populate(objectMap, "mode", m.Mode) + populate(objectMap, "uri", m.URI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MLFlowModelJobInput. +func (m *MLFlowModelJobInput) 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 "description": + err = unpopulate(val, "Description", &m.Description) + delete(rawMsg, key) + case "jobInputType": + err = unpopulate(val, "JobInputType", &m.JobInputType) + delete(rawMsg, key) + case "mode": + err = unpopulate(val, "Mode", &m.Mode) + delete(rawMsg, key) + case "uri": + err = unpopulate(val, "URI", &m.URI) + 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 MLFlowModelJobOutput. +func (m MLFlowModelJobOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", m.Description) + objectMap["jobOutputType"] = JobOutputTypeMlflowModel + populate(objectMap, "mode", m.Mode) + populate(objectMap, "uri", m.URI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MLFlowModelJobOutput. +func (m *MLFlowModelJobOutput) 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 "description": + err = unpopulate(val, "Description", &m.Description) + delete(rawMsg, key) + case "jobOutputType": + err = unpopulate(val, "JobOutputType", &m.JobOutputType) + delete(rawMsg, key) + case "mode": + err = unpopulate(val, "Mode", &m.Mode) + delete(rawMsg, key) + case "uri": + err = unpopulate(val, "URI", &m.URI) + 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 MLTableData. +func (m MLTableData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["dataType"] = DataTypeMltable + populate(objectMap, "dataUri", m.DataURI) + populate(objectMap, "description", m.Description) + populate(objectMap, "isAnonymous", m.IsAnonymous) + populate(objectMap, "isArchived", m.IsArchived) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "referencedUris", m.ReferencedUris) + populate(objectMap, "tags", m.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MLTableData. +func (m *MLTableData) 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 "dataType": + err = unpopulate(val, "DataType", &m.DataType) + delete(rawMsg, key) + case "dataUri": + err = unpopulate(val, "DataURI", &m.DataURI) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &m.Description) + delete(rawMsg, key) + case "isAnonymous": + err = unpopulate(val, "IsAnonymous", &m.IsAnonymous) + delete(rawMsg, key) + case "isArchived": + err = unpopulate(val, "IsArchived", &m.IsArchived) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "referencedUris": + err = unpopulate(val, "ReferencedUris", &m.ReferencedUris) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &m.Tags) + 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 MLTableJobInput. +func (m MLTableJobInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", m.Description) + objectMap["jobInputType"] = JobInputTypeMltable + populate(objectMap, "mode", m.Mode) + populate(objectMap, "uri", m.URI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MLTableJobInput. +func (m *MLTableJobInput) 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 "description": + err = unpopulate(val, "Description", &m.Description) + delete(rawMsg, key) + case "jobInputType": + err = unpopulate(val, "JobInputType", &m.JobInputType) + delete(rawMsg, key) + case "mode": + err = unpopulate(val, "Mode", &m.Mode) + delete(rawMsg, key) + case "uri": + err = unpopulate(val, "URI", &m.URI) + 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 MLTableJobOutput. +func (m MLTableJobOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", m.Description) + objectMap["jobOutputType"] = JobOutputTypeMltable + populate(objectMap, "mode", m.Mode) + populate(objectMap, "uri", m.URI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MLTableJobOutput. +func (m *MLTableJobOutput) 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 "description": + err = unpopulate(val, "Description", &m.Description) + delete(rawMsg, key) + case "jobOutputType": + err = unpopulate(val, "JobOutputType", &m.JobOutputType) + delete(rawMsg, key) + case "mode": + err = unpopulate(val, "Mode", &m.Mode) + delete(rawMsg, key) + case "uri": + err = unpopulate(val, "URI", &m.URI) + 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 ManagedIdentity. +func (m ManagedIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "clientId", m.ClientID) + objectMap["identityType"] = IdentityConfigurationTypeManaged + populate(objectMap, "objectId", m.ObjectID) + populate(objectMap, "resourceId", m.ResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedIdentity. +func (m *ManagedIdentity) 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 "clientId": + err = unpopulate(val, "ClientID", &m.ClientID) + delete(rawMsg, key) + case "identityType": + err = unpopulate(val, "IdentityType", &m.IdentityType) + delete(rawMsg, key) + case "objectId": + err = unpopulate(val, "ObjectID", &m.ObjectID) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &m.ResourceID) + 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 ManagedIdentityAuthTypeWorkspaceConnectionProperties. +func (m ManagedIdentityAuthTypeWorkspaceConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["authType"] = ConnectionAuthTypeManagedIdentity + populate(objectMap, "category", m.Category) + populate(objectMap, "credentials", m.Credentials) + populate(objectMap, "target", m.Target) + populate(objectMap, "value", m.Value) + populate(objectMap, "valueFormat", m.ValueFormat) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedIdentityAuthTypeWorkspaceConnectionProperties. +func (m *ManagedIdentityAuthTypeWorkspaceConnectionProperties) 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 "authType": + err = unpopulate(val, "AuthType", &m.AuthType) + delete(rawMsg, key) + case "category": + err = unpopulate(val, "Category", &m.Category) + delete(rawMsg, key) + case "credentials": + err = unpopulate(val, "Credentials", &m.Credentials) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &m.Target) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + case "valueFormat": + err = unpopulate(val, "ValueFormat", &m.ValueFormat) + 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 ManagedOnlineDeployment. +func (m ManagedOnlineDeployment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "appInsightsEnabled", m.AppInsightsEnabled) + populate(objectMap, "codeConfiguration", m.CodeConfiguration) + populate(objectMap, "description", m.Description) + objectMap["endpointComputeType"] = EndpointComputeTypeManaged + populate(objectMap, "environmentId", m.EnvironmentID) + populate(objectMap, "environmentVariables", m.EnvironmentVariables) + populate(objectMap, "instanceType", m.InstanceType) + populate(objectMap, "livenessProbe", m.LivenessProbe) + populate(objectMap, "model", m.Model) + populate(objectMap, "modelMountPath", m.ModelMountPath) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "provisioningState", m.ProvisioningState) + populate(objectMap, "readinessProbe", m.ReadinessProbe) + populate(objectMap, "requestSettings", m.RequestSettings) + populate(objectMap, "scaleSettings", m.ScaleSettings) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedOnlineDeployment. +func (m *ManagedOnlineDeployment) 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 "appInsightsEnabled": + err = unpopulate(val, "AppInsightsEnabled", &m.AppInsightsEnabled) + delete(rawMsg, key) + case "codeConfiguration": + err = unpopulate(val, "CodeConfiguration", &m.CodeConfiguration) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &m.Description) + delete(rawMsg, key) + case "endpointComputeType": + err = unpopulate(val, "EndpointComputeType", &m.EndpointComputeType) + delete(rawMsg, key) + case "environmentId": + err = unpopulate(val, "EnvironmentID", &m.EnvironmentID) + delete(rawMsg, key) + case "environmentVariables": + err = unpopulate(val, "EnvironmentVariables", &m.EnvironmentVariables) + delete(rawMsg, key) + case "instanceType": + err = unpopulate(val, "InstanceType", &m.InstanceType) + delete(rawMsg, key) + case "livenessProbe": + err = unpopulate(val, "LivenessProbe", &m.LivenessProbe) + delete(rawMsg, key) + case "model": + err = unpopulate(val, "Model", &m.Model) + delete(rawMsg, key) + case "modelMountPath": + err = unpopulate(val, "ModelMountPath", &m.ModelMountPath) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &m.ProvisioningState) + delete(rawMsg, key) + case "readinessProbe": + err = unpopulate(val, "ReadinessProbe", &m.ReadinessProbe) + delete(rawMsg, key) + case "requestSettings": + err = unpopulate(val, "RequestSettings", &m.RequestSettings) + delete(rawMsg, key) + case "scaleSettings": + m.ScaleSettings, err = unmarshalOnlineScaleSettingsClassification(val) + 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 ManagedServiceIdentity. +func (m ManagedServiceIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "principalId", m.PrincipalID) + populate(objectMap, "tenantId", m.TenantID) + populate(objectMap, "type", m.Type) + populate(objectMap, "userAssignedIdentities", m.UserAssignedIdentities) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type MedianStoppingPolicy. +func (m MedianStoppingPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "delayEvaluation", m.DelayEvaluation) + populate(objectMap, "evaluationInterval", m.EvaluationInterval) + objectMap["policyType"] = EarlyTerminationPolicyTypeMedianStopping + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MedianStoppingPolicy. +func (m *MedianStoppingPolicy) 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 "delayEvaluation": + err = unpopulate(val, "DelayEvaluation", &m.DelayEvaluation) + delete(rawMsg, key) + case "evaluationInterval": + err = unpopulate(val, "EvaluationInterval", &m.EvaluationInterval) + delete(rawMsg, key) + case "policyType": + err = unpopulate(val, "PolicyType", &m.PolicyType) + 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 ModelContainerProperties. +func (m ModelContainerProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", m.Description) + populate(objectMap, "isArchived", m.IsArchived) + populate(objectMap, "latestVersion", m.LatestVersion) + populate(objectMap, "nextVersion", m.NextVersion) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "tags", m.Tags) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ModelVersionProperties. +func (m ModelVersionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", m.Description) + populate(objectMap, "flavors", m.Flavors) + populate(objectMap, "isAnonymous", m.IsAnonymous) + populate(objectMap, "isArchived", m.IsArchived) + populate(objectMap, "jobName", m.JobName) + populate(objectMap, "modelType", m.ModelType) + populate(objectMap, "modelUri", m.ModelURI) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "tags", m.Tags) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type Mpi. +func (m Mpi) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["distributionType"] = DistributionTypeMpi + populate(objectMap, "processCountPerInstance", m.ProcessCountPerInstance) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Mpi. +func (m *Mpi) 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 "distributionType": + err = unpopulate(val, "DistributionType", &m.DistributionType) + delete(rawMsg, key) + case "processCountPerInstance": + err = unpopulate(val, "ProcessCountPerInstance", &m.ProcessCountPerInstance) + 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 NoneAuthTypeWorkspaceConnectionProperties. +func (n NoneAuthTypeWorkspaceConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["authType"] = ConnectionAuthTypeNone + populate(objectMap, "category", n.Category) + populate(objectMap, "target", n.Target) + populate(objectMap, "value", n.Value) + populate(objectMap, "valueFormat", n.ValueFormat) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NoneAuthTypeWorkspaceConnectionProperties. +func (n *NoneAuthTypeWorkspaceConnectionProperties) 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 "authType": + err = unpopulate(val, "AuthType", &n.AuthType) + delete(rawMsg, key) + case "category": + err = unpopulate(val, "Category", &n.Category) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &n.Target) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &n.Value) + delete(rawMsg, key) + case "valueFormat": + err = unpopulate(val, "ValueFormat", &n.ValueFormat) + 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 NoneDatastoreCredentials. +func (n NoneDatastoreCredentials) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["credentialsType"] = CredentialsTypeNone + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NoneDatastoreCredentials. +func (n *NoneDatastoreCredentials) 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 "credentialsType": + err = unpopulate(val, "CredentialsType", &n.CredentialsType) + 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 OnlineDeployment. +func (o OnlineDeployment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", o.ID) + populate(objectMap, "identity", o.Identity) + populate(objectMap, "kind", o.Kind) + populate(objectMap, "location", o.Location) + populate(objectMap, "name", o.Name) + populate(objectMap, "properties", o.Properties) + populate(objectMap, "sku", o.SKU) + populate(objectMap, "systemData", o.SystemData) + populate(objectMap, "tags", o.Tags) + populate(objectMap, "type", o.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OnlineDeployment. +func (o *OnlineDeployment) 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 "id": + err = unpopulate(val, "ID", &o.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &o.Identity) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &o.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &o.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "properties": + o.Properties, err = unmarshalOnlineDeploymentPropertiesClassification(val) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &o.SKU) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &o.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &o.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &o.Type) + 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 OnlineDeploymentProperties. +func (o OnlineDeploymentProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "appInsightsEnabled", o.AppInsightsEnabled) + populate(objectMap, "codeConfiguration", o.CodeConfiguration) + populate(objectMap, "description", o.Description) + objectMap["endpointComputeType"] = o.EndpointComputeType + populate(objectMap, "environmentId", o.EnvironmentID) + populate(objectMap, "environmentVariables", o.EnvironmentVariables) + populate(objectMap, "instanceType", o.InstanceType) + populate(objectMap, "livenessProbe", o.LivenessProbe) + populate(objectMap, "model", o.Model) + populate(objectMap, "modelMountPath", o.ModelMountPath) + populate(objectMap, "properties", o.Properties) + populate(objectMap, "provisioningState", o.ProvisioningState) + populate(objectMap, "readinessProbe", o.ReadinessProbe) + populate(objectMap, "requestSettings", o.RequestSettings) + populate(objectMap, "scaleSettings", o.ScaleSettings) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OnlineDeploymentProperties. +func (o *OnlineDeploymentProperties) 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 "appInsightsEnabled": + err = unpopulate(val, "AppInsightsEnabled", &o.AppInsightsEnabled) + delete(rawMsg, key) + case "codeConfiguration": + err = unpopulate(val, "CodeConfiguration", &o.CodeConfiguration) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &o.Description) + delete(rawMsg, key) + case "endpointComputeType": + err = unpopulate(val, "EndpointComputeType", &o.EndpointComputeType) + delete(rawMsg, key) + case "environmentId": + err = unpopulate(val, "EnvironmentID", &o.EnvironmentID) + delete(rawMsg, key) + case "environmentVariables": + err = unpopulate(val, "EnvironmentVariables", &o.EnvironmentVariables) + delete(rawMsg, key) + case "instanceType": + err = unpopulate(val, "InstanceType", &o.InstanceType) + delete(rawMsg, key) + case "livenessProbe": + err = unpopulate(val, "LivenessProbe", &o.LivenessProbe) + delete(rawMsg, key) + case "model": + err = unpopulate(val, "Model", &o.Model) + delete(rawMsg, key) + case "modelMountPath": + err = unpopulate(val, "ModelMountPath", &o.ModelMountPath) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &o.ProvisioningState) + delete(rawMsg, key) + case "readinessProbe": + err = unpopulate(val, "ReadinessProbe", &o.ReadinessProbe) + delete(rawMsg, key) + case "requestSettings": + err = unpopulate(val, "RequestSettings", &o.RequestSettings) + delete(rawMsg, key) + case "scaleSettings": + o.ScaleSettings, err = unmarshalOnlineScaleSettingsClassification(val) + 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 OnlineEndpoint. +func (o OnlineEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", o.ID) + populate(objectMap, "identity", o.Identity) + populate(objectMap, "kind", o.Kind) + populate(objectMap, "location", o.Location) + populate(objectMap, "name", o.Name) + populate(objectMap, "properties", o.Properties) + populate(objectMap, "sku", o.SKU) + populate(objectMap, "systemData", o.SystemData) + populate(objectMap, "tags", o.Tags) + populate(objectMap, "type", o.Type) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type OnlineEndpointProperties. +func (o OnlineEndpointProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "authMode", o.AuthMode) + populate(objectMap, "compute", o.Compute) + populate(objectMap, "description", o.Description) + populate(objectMap, "keys", o.Keys) + populate(objectMap, "properties", o.Properties) + populate(objectMap, "provisioningState", o.ProvisioningState) + populate(objectMap, "scoringUri", o.ScoringURI) + populate(objectMap, "swaggerUri", o.SwaggerURI) + populate(objectMap, "traffic", o.Traffic) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type OutputPathAssetReference. +func (o OutputPathAssetReference) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "jobId", o.JobID) + populate(objectMap, "path", o.Path) + objectMap["referenceType"] = ReferenceTypeOutputPath + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OutputPathAssetReference. +func (o *OutputPathAssetReference) 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 "jobId": + err = unpopulate(val, "JobID", &o.JobID) + delete(rawMsg, key) + case "path": + err = unpopulate(val, "Path", &o.Path) + delete(rawMsg, key) + case "referenceType": + err = unpopulate(val, "ReferenceType", &o.ReferenceType) + 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 PATAuthTypeWorkspaceConnectionProperties. +func (p PATAuthTypeWorkspaceConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["authType"] = ConnectionAuthTypePAT + populate(objectMap, "category", p.Category) + populate(objectMap, "credentials", p.Credentials) + populate(objectMap, "target", p.Target) + populate(objectMap, "value", p.Value) + populate(objectMap, "valueFormat", p.ValueFormat) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PATAuthTypeWorkspaceConnectionProperties. +func (p *PATAuthTypeWorkspaceConnectionProperties) 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 "authType": + err = unpopulate(val, "AuthType", &p.AuthType) + delete(rawMsg, key) + case "category": + err = unpopulate(val, "Category", &p.Category) + delete(rawMsg, key) + case "credentials": + err = unpopulate(val, "Credentials", &p.Credentials) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &p.Target) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &p.Value) + delete(rawMsg, key) + case "valueFormat": + err = unpopulate(val, "ValueFormat", &p.ValueFormat) + 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 PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties. +func (p PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "tags", p.Tags) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type PartialManagedServiceIdentity. +func (p PartialManagedServiceIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "type", p.Type) + populate(objectMap, "userAssignedIdentities", p.UserAssignedIdentities) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type PartialMinimalTrackedResource. +func (p PartialMinimalTrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "tags", p.Tags) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type PartialMinimalTrackedResourceWithIdentity. +func (p PartialMinimalTrackedResourceWithIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "identity", p.Identity) + populate(objectMap, "tags", p.Tags) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type PartialMinimalTrackedResourceWithSKU. +func (p PartialMinimalTrackedResourceWithSKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "sku", p.SKU) + populate(objectMap, "tags", p.Tags) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type PipelineJob. +func (p PipelineJob) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "computeId", p.ComputeID) + populate(objectMap, "description", p.Description) + populate(objectMap, "displayName", p.DisplayName) + populate(objectMap, "experimentName", p.ExperimentName) + populate(objectMap, "identity", p.Identity) + populate(objectMap, "inputs", p.Inputs) + populate(objectMap, "isArchived", p.IsArchived) + objectMap["jobType"] = JobTypePipeline + populate(objectMap, "jobs", p.Jobs) + populate(objectMap, "outputs", p.Outputs) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "services", p.Services) + populate(objectMap, "settings", &p.Settings) + populate(objectMap, "status", p.Status) + populate(objectMap, "tags", p.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PipelineJob. +func (p *PipelineJob) 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 "computeId": + err = unpopulate(val, "ComputeID", &p.ComputeID) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &p.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &p.DisplayName) + delete(rawMsg, key) + case "experimentName": + err = unpopulate(val, "ExperimentName", &p.ExperimentName) + delete(rawMsg, key) + case "identity": + p.Identity, err = unmarshalIdentityConfigurationClassification(val) + delete(rawMsg, key) + case "inputs": + p.Inputs, err = unmarshalJobInputClassificationMap(val) + delete(rawMsg, key) + case "isArchived": + err = unpopulate(val, "IsArchived", &p.IsArchived) + delete(rawMsg, key) + case "jobType": + err = unpopulate(val, "JobType", &p.JobType) + delete(rawMsg, key) + case "jobs": + err = unpopulate(val, "Jobs", &p.Jobs) + delete(rawMsg, key) + case "outputs": + p.Outputs, err = unmarshalJobOutputClassificationMap(val) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "services": + err = unpopulate(val, "Services", &p.Services) + delete(rawMsg, key) + case "settings": + err = unpopulate(val, "Settings", &p.Settings) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &p.Status) + 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 PrivateEndpointConnection. +func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + populate(objectMap, "identity", p.Identity) + populate(objectMap, "location", p.Location) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "sku", p.SKU) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "tags", p.Tags) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource. +func (p PrivateLinkResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + populate(objectMap, "identity", p.Identity) + populate(objectMap, "location", p.Location) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "sku", p.SKU) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "tags", p.Tags) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties. +func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "groupId", p.GroupID) + populate(objectMap, "requiredMembers", p.RequiredMembers) + populate(objectMap, "requiredZoneNames", p.RequiredZoneNames) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type PyTorch. +func (p PyTorch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["distributionType"] = DistributionTypePyTorch + populate(objectMap, "processCountPerInstance", p.ProcessCountPerInstance) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PyTorch. +func (p *PyTorch) 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 "distributionType": + err = unpopulate(val, "DistributionType", &p.DistributionType) + delete(rawMsg, key) + case "processCountPerInstance": + err = unpopulate(val, "ProcessCountPerInstance", &p.ProcessCountPerInstance) + 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 QuotaUpdateParameters. +func (q QuotaUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "location", q.Location) + populate(objectMap, "value", q.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type RandomSamplingAlgorithm. +func (r RandomSamplingAlgorithm) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "rule", r.Rule) + objectMap["samplingAlgorithmType"] = SamplingAlgorithmTypeRandom + populate(objectMap, "seed", r.Seed) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RandomSamplingAlgorithm. +func (r *RandomSamplingAlgorithm) 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 "rule": + err = unpopulate(val, "Rule", &r.Rule) + delete(rawMsg, key) + case "samplingAlgorithmType": + err = unpopulate(val, "SamplingAlgorithmType", &r.SamplingAlgorithmType) + delete(rawMsg, key) + case "seed": + err = unpopulate(val, "Seed", &r.Seed) + 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 ResourceBase. +func (r ResourceBase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", r.Description) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "tags", r.Tags) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceConfiguration. +func (r ResourceConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "instanceCount", r.InstanceCount) + populate(objectMap, "instanceType", r.InstanceType) + populate(objectMap, "properties", r.Properties) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type SASAuthTypeWorkspaceConnectionProperties. +func (s SASAuthTypeWorkspaceConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["authType"] = ConnectionAuthTypeSAS + populate(objectMap, "category", s.Category) + populate(objectMap, "credentials", s.Credentials) + populate(objectMap, "target", s.Target) + populate(objectMap, "value", s.Value) + populate(objectMap, "valueFormat", s.ValueFormat) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SASAuthTypeWorkspaceConnectionProperties. +func (s *SASAuthTypeWorkspaceConnectionProperties) 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 "authType": + err = unpopulate(val, "AuthType", &s.AuthType) + delete(rawMsg, key) + case "category": + err = unpopulate(val, "Category", &s.Category) + delete(rawMsg, key) + case "credentials": + err = unpopulate(val, "Credentials", &s.Credentials) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &s.Target) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + case "valueFormat": + err = unpopulate(val, "ValueFormat", &s.ValueFormat) + 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 SasDatastoreCredentials. +func (s SasDatastoreCredentials) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["credentialsType"] = CredentialsTypeSas + populate(objectMap, "secrets", s.Secrets) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SasDatastoreCredentials. +func (s *SasDatastoreCredentials) 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 "credentialsType": + err = unpopulate(val, "CredentialsType", &s.CredentialsType) + delete(rawMsg, key) + case "secrets": + err = unpopulate(val, "Secrets", &s.Secrets) + 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 SasDatastoreSecrets. +func (s SasDatastoreSecrets) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "sasToken", s.SasToken) + objectMap["secretsType"] = SecretsTypeSas + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SasDatastoreSecrets. +func (s *SasDatastoreSecrets) 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 "sasToken": + err = unpopulate(val, "SasToken", &s.SasToken) + delete(rawMsg, key) + case "secretsType": + err = unpopulate(val, "SecretsType", &s.SecretsType) + 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 ServicePrincipalDatastoreCredentials. +func (s ServicePrincipalDatastoreCredentials) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "authorityUrl", s.AuthorityURL) + populate(objectMap, "clientId", s.ClientID) + objectMap["credentialsType"] = CredentialsTypeServicePrincipal + populate(objectMap, "resourceUrl", s.ResourceURL) + populate(objectMap, "secrets", s.Secrets) + populate(objectMap, "tenantId", s.TenantID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServicePrincipalDatastoreCredentials. +func (s *ServicePrincipalDatastoreCredentials) 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 "authorityUrl": + err = unpopulate(val, "AuthorityURL", &s.AuthorityURL) + delete(rawMsg, key) + case "clientId": + err = unpopulate(val, "ClientID", &s.ClientID) + delete(rawMsg, key) + case "credentialsType": + err = unpopulate(val, "CredentialsType", &s.CredentialsType) + delete(rawMsg, key) + case "resourceUrl": + err = unpopulate(val, "ResourceURL", &s.ResourceURL) + delete(rawMsg, key) + case "secrets": + err = unpopulate(val, "Secrets", &s.Secrets) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &s.TenantID) + 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 ServicePrincipalDatastoreSecrets. +func (s ServicePrincipalDatastoreSecrets) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "clientSecret", s.ClientSecret) + objectMap["secretsType"] = SecretsTypeServicePrincipal + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServicePrincipalDatastoreSecrets. +func (s *ServicePrincipalDatastoreSecrets) 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 "clientSecret": + err = unpopulate(val, "ClientSecret", &s.ClientSecret) + delete(rawMsg, key) + case "secretsType": + err = unpopulate(val, "SecretsType", &s.SecretsType) + 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 SweepJob. +func (s SweepJob) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "computeId", s.ComputeID) + populate(objectMap, "description", s.Description) + populate(objectMap, "displayName", s.DisplayName) + populate(objectMap, "earlyTermination", s.EarlyTermination) + populate(objectMap, "experimentName", s.ExperimentName) + populate(objectMap, "identity", s.Identity) + populate(objectMap, "inputs", s.Inputs) + populate(objectMap, "isArchived", s.IsArchived) + objectMap["jobType"] = JobTypeSweep + populate(objectMap, "limits", s.Limits) + populate(objectMap, "objective", s.Objective) + populate(objectMap, "outputs", s.Outputs) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "samplingAlgorithm", s.SamplingAlgorithm) + populate(objectMap, "searchSpace", &s.SearchSpace) + populate(objectMap, "services", s.Services) + populate(objectMap, "status", s.Status) + populate(objectMap, "tags", s.Tags) + populate(objectMap, "trial", s.Trial) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SweepJob. +func (s *SweepJob) 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 "computeId": + err = unpopulate(val, "ComputeID", &s.ComputeID) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &s.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &s.DisplayName) + delete(rawMsg, key) + case "earlyTermination": + s.EarlyTermination, err = unmarshalEarlyTerminationPolicyClassification(val) + delete(rawMsg, key) + case "experimentName": + err = unpopulate(val, "ExperimentName", &s.ExperimentName) + delete(rawMsg, key) + case "identity": + s.Identity, err = unmarshalIdentityConfigurationClassification(val) + delete(rawMsg, key) + case "inputs": + s.Inputs, err = unmarshalJobInputClassificationMap(val) + delete(rawMsg, key) + case "isArchived": + err = unpopulate(val, "IsArchived", &s.IsArchived) + delete(rawMsg, key) + case "jobType": + err = unpopulate(val, "JobType", &s.JobType) + delete(rawMsg, key) + case "limits": + err = unpopulate(val, "Limits", &s.Limits) + delete(rawMsg, key) + case "objective": + err = unpopulate(val, "Objective", &s.Objective) + delete(rawMsg, key) + case "outputs": + s.Outputs, err = unmarshalJobOutputClassificationMap(val) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "samplingAlgorithm": + s.SamplingAlgorithm, err = unmarshalSamplingAlgorithmClassification(val) + delete(rawMsg, key) + case "searchSpace": + err = unpopulate(val, "SearchSpace", &s.SearchSpace) + delete(rawMsg, key) + case "services": + err = unpopulate(val, "Services", &s.Services) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &s.Status) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &s.Tags) + delete(rawMsg, key) + case "trial": + err = unpopulate(val, "Trial", &s.Trial) + 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 SweepJobLimits. +func (s SweepJobLimits) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["jobLimitsType"] = JobLimitsTypeSweep + populate(objectMap, "maxConcurrentTrials", s.MaxConcurrentTrials) + populate(objectMap, "maxTotalTrials", s.MaxTotalTrials) + populate(objectMap, "timeout", s.Timeout) + populate(objectMap, "trialTimeout", s.TrialTimeout) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SweepJobLimits. +func (s *SweepJobLimits) 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 "jobLimitsType": + err = unpopulate(val, "JobLimitsType", &s.JobLimitsType) + delete(rawMsg, key) + case "maxConcurrentTrials": + err = unpopulate(val, "MaxConcurrentTrials", &s.MaxConcurrentTrials) + delete(rawMsg, key) + case "maxTotalTrials": + err = unpopulate(val, "MaxTotalTrials", &s.MaxTotalTrials) + delete(rawMsg, key) + case "timeout": + err = unpopulate(val, "Timeout", &s.Timeout) + delete(rawMsg, key) + case "trialTimeout": + err = unpopulate(val, "TrialTimeout", &s.TrialTimeout) + 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 SynapseSpark. +func (s SynapseSpark) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "computeLocation", s.ComputeLocation) + objectMap["computeType"] = ComputeTypeSynapseSpark + populateTimeRFC3339(objectMap, "createdOn", s.CreatedOn) + populate(objectMap, "description", s.Description) + populate(objectMap, "disableLocalAuth", s.DisableLocalAuth) + populate(objectMap, "isAttachedCompute", s.IsAttachedCompute) + populateTimeRFC3339(objectMap, "modifiedOn", s.ModifiedOn) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "provisioningErrors", s.ProvisioningErrors) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "resourceId", s.ResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SynapseSpark. +func (s *SynapseSpark) 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 "computeLocation": + err = unpopulate(val, "ComputeLocation", &s.ComputeLocation) + delete(rawMsg, key) + case "computeType": + err = unpopulate(val, "ComputeType", &s.ComputeType) + delete(rawMsg, key) + case "createdOn": + err = unpopulateTimeRFC3339(val, "CreatedOn", &s.CreatedOn) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &s.Description) + delete(rawMsg, key) + case "disableLocalAuth": + err = unpopulate(val, "DisableLocalAuth", &s.DisableLocalAuth) + delete(rawMsg, key) + case "isAttachedCompute": + err = unpopulate(val, "IsAttachedCompute", &s.IsAttachedCompute) + delete(rawMsg, key) + case "modifiedOn": + err = unpopulateTimeRFC3339(val, "ModifiedOn", &s.ModifiedOn) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "provisioningErrors": + err = unpopulate(val, "ProvisioningErrors", &s.ProvisioningErrors) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &s.ResourceID) + 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]interface{}) + populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populate(objectMap, "createdBy", s.CreatedBy) + populate(objectMap, "createdByType", s.CreatedByType) + populateTimeRFC3339(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 = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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 TargetUtilizationScaleSettings. +func (t TargetUtilizationScaleSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "maxInstances", t.MaxInstances) + populate(objectMap, "minInstances", t.MinInstances) + populate(objectMap, "pollingInterval", t.PollingInterval) + objectMap["scaleType"] = ScaleTypeTargetUtilization + populate(objectMap, "targetUtilizationPercentage", t.TargetUtilizationPercentage) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TargetUtilizationScaleSettings. +func (t *TargetUtilizationScaleSettings) 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 "maxInstances": + err = unpopulate(val, "MaxInstances", &t.MaxInstances) + delete(rawMsg, key) + case "minInstances": + err = unpopulate(val, "MinInstances", &t.MinInstances) + delete(rawMsg, key) + case "pollingInterval": + err = unpopulate(val, "PollingInterval", &t.PollingInterval) + delete(rawMsg, key) + case "scaleType": + err = unpopulate(val, "ScaleType", &t.ScaleType) + delete(rawMsg, key) + case "targetUtilizationPercentage": + err = unpopulate(val, "TargetUtilizationPercentage", &t.TargetUtilizationPercentage) + 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 TensorFlow. +func (t TensorFlow) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["distributionType"] = DistributionTypeTensorFlow + populate(objectMap, "parameterServerCount", t.ParameterServerCount) + populate(objectMap, "workerCount", t.WorkerCount) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TensorFlow. +func (t *TensorFlow) 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 "distributionType": + err = unpopulate(val, "DistributionType", &t.DistributionType) + delete(rawMsg, key) + case "parameterServerCount": + err = unpopulate(val, "ParameterServerCount", &t.ParameterServerCount) + delete(rawMsg, key) + case "workerCount": + err = unpopulate(val, "WorkerCount", &t.WorkerCount) + 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 TrackedResource. +func (t TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", t.ID) + populate(objectMap, "location", t.Location) + populate(objectMap, "name", t.Name) + populate(objectMap, "systemData", t.SystemData) + populate(objectMap, "tags", t.Tags) + populate(objectMap, "type", t.Type) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type TrialComponent. +func (t TrialComponent) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "codeId", t.CodeID) + populate(objectMap, "command", t.Command) + populate(objectMap, "distribution", t.Distribution) + populate(objectMap, "environmentId", t.EnvironmentID) + populate(objectMap, "environmentVariables", t.EnvironmentVariables) + populate(objectMap, "resources", t.Resources) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TrialComponent. +func (t *TrialComponent) 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 "codeId": + err = unpopulate(val, "CodeID", &t.CodeID) + delete(rawMsg, key) + case "command": + err = unpopulate(val, "Command", &t.Command) + delete(rawMsg, key) + case "distribution": + t.Distribution, err = unmarshalDistributionConfigurationClassification(val) + delete(rawMsg, key) + case "environmentId": + err = unpopulate(val, "EnvironmentID", &t.EnvironmentID) + delete(rawMsg, key) + case "environmentVariables": + err = unpopulate(val, "EnvironmentVariables", &t.EnvironmentVariables) + delete(rawMsg, key) + case "resources": + err = unpopulate(val, "Resources", &t.Resources) + 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 TritonModelJobInput. +func (t TritonModelJobInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", t.Description) + objectMap["jobInputType"] = JobInputTypeTritonModel + populate(objectMap, "mode", t.Mode) + populate(objectMap, "uri", t.URI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TritonModelJobInput. +func (t *TritonModelJobInput) 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 "description": + err = unpopulate(val, "Description", &t.Description) + delete(rawMsg, key) + case "jobInputType": + err = unpopulate(val, "JobInputType", &t.JobInputType) + delete(rawMsg, key) + case "mode": + err = unpopulate(val, "Mode", &t.Mode) + delete(rawMsg, key) + case "uri": + err = unpopulate(val, "URI", &t.URI) + 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 TritonModelJobOutput. +func (t TritonModelJobOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", t.Description) + objectMap["jobOutputType"] = JobOutputTypeTritonModel + populate(objectMap, "mode", t.Mode) + populate(objectMap, "uri", t.URI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TritonModelJobOutput. +func (t *TritonModelJobOutput) 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 "description": + err = unpopulate(val, "Description", &t.Description) + delete(rawMsg, key) + case "jobOutputType": + err = unpopulate(val, "JobOutputType", &t.JobOutputType) + delete(rawMsg, key) + case "mode": + err = unpopulate(val, "Mode", &t.Mode) + delete(rawMsg, key) + case "uri": + err = unpopulate(val, "URI", &t.URI) + 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 TruncationSelectionPolicy. +func (t TruncationSelectionPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "delayEvaluation", t.DelayEvaluation) + populate(objectMap, "evaluationInterval", t.EvaluationInterval) + objectMap["policyType"] = EarlyTerminationPolicyTypeTruncationSelection + populate(objectMap, "truncationPercentage", t.TruncationPercentage) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TruncationSelectionPolicy. +func (t *TruncationSelectionPolicy) 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 "delayEvaluation": + err = unpopulate(val, "DelayEvaluation", &t.DelayEvaluation) + delete(rawMsg, key) + case "evaluationInterval": + err = unpopulate(val, "EvaluationInterval", &t.EvaluationInterval) + delete(rawMsg, key) + case "policyType": + err = unpopulate(val, "PolicyType", &t.PolicyType) + delete(rawMsg, key) + case "truncationPercentage": + err = unpopulate(val, "TruncationPercentage", &t.TruncationPercentage) + 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 URIFileDataVersion. +func (u URIFileDataVersion) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["dataType"] = DataTypeURIFile + populate(objectMap, "dataUri", u.DataURI) + populate(objectMap, "description", u.Description) + populate(objectMap, "isAnonymous", u.IsAnonymous) + populate(objectMap, "isArchived", u.IsArchived) + populate(objectMap, "properties", u.Properties) + populate(objectMap, "tags", u.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type URIFileDataVersion. +func (u *URIFileDataVersion) 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 "dataType": + err = unpopulate(val, "DataType", &u.DataType) + delete(rawMsg, key) + case "dataUri": + err = unpopulate(val, "DataURI", &u.DataURI) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &u.Description) + delete(rawMsg, key) + case "isAnonymous": + err = unpopulate(val, "IsAnonymous", &u.IsAnonymous) + delete(rawMsg, key) + case "isArchived": + err = unpopulate(val, "IsArchived", &u.IsArchived) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &u.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &u.Tags) + 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 URIFileJobInput. +func (u URIFileJobInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", u.Description) + objectMap["jobInputType"] = JobInputTypeURIFile + populate(objectMap, "mode", u.Mode) + populate(objectMap, "uri", u.URI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type URIFileJobInput. +func (u *URIFileJobInput) 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 "description": + err = unpopulate(val, "Description", &u.Description) + delete(rawMsg, key) + case "jobInputType": + err = unpopulate(val, "JobInputType", &u.JobInputType) + delete(rawMsg, key) + case "mode": + err = unpopulate(val, "Mode", &u.Mode) + delete(rawMsg, key) + case "uri": + err = unpopulate(val, "URI", &u.URI) + 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 URIFileJobOutput. +func (u URIFileJobOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", u.Description) + objectMap["jobOutputType"] = JobOutputTypeURIFile + populate(objectMap, "mode", u.Mode) + populate(objectMap, "uri", u.URI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type URIFileJobOutput. +func (u *URIFileJobOutput) 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 "description": + err = unpopulate(val, "Description", &u.Description) + delete(rawMsg, key) + case "jobOutputType": + err = unpopulate(val, "JobOutputType", &u.JobOutputType) + delete(rawMsg, key) + case "mode": + err = unpopulate(val, "Mode", &u.Mode) + delete(rawMsg, key) + case "uri": + err = unpopulate(val, "URI", &u.URI) + 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 URIFolderDataVersion. +func (u URIFolderDataVersion) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["dataType"] = DataTypeURIFolder + populate(objectMap, "dataUri", u.DataURI) + populate(objectMap, "description", u.Description) + populate(objectMap, "isAnonymous", u.IsAnonymous) + populate(objectMap, "isArchived", u.IsArchived) + populate(objectMap, "properties", u.Properties) + populate(objectMap, "tags", u.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type URIFolderDataVersion. +func (u *URIFolderDataVersion) 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 "dataType": + err = unpopulate(val, "DataType", &u.DataType) + delete(rawMsg, key) + case "dataUri": + err = unpopulate(val, "DataURI", &u.DataURI) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &u.Description) + delete(rawMsg, key) + case "isAnonymous": + err = unpopulate(val, "IsAnonymous", &u.IsAnonymous) + delete(rawMsg, key) + case "isArchived": + err = unpopulate(val, "IsArchived", &u.IsArchived) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &u.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &u.Tags) + 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 URIFolderJobInput. +func (u URIFolderJobInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", u.Description) + objectMap["jobInputType"] = JobInputTypeURIFolder + populate(objectMap, "mode", u.Mode) + populate(objectMap, "uri", u.URI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type URIFolderJobInput. +func (u *URIFolderJobInput) 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 "description": + err = unpopulate(val, "Description", &u.Description) + delete(rawMsg, key) + case "jobInputType": + err = unpopulate(val, "JobInputType", &u.JobInputType) + delete(rawMsg, key) + case "mode": + err = unpopulate(val, "Mode", &u.Mode) + delete(rawMsg, key) + case "uri": + err = unpopulate(val, "URI", &u.URI) + 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 URIFolderJobOutput. +func (u URIFolderJobOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", u.Description) + objectMap["jobOutputType"] = JobOutputTypeURIFolder + populate(objectMap, "mode", u.Mode) + populate(objectMap, "uri", u.URI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type URIFolderJobOutput. +func (u *URIFolderJobOutput) 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 "description": + err = unpopulate(val, "Description", &u.Description) + delete(rawMsg, key) + case "jobOutputType": + err = unpopulate(val, "JobOutputType", &u.JobOutputType) + delete(rawMsg, key) + case "mode": + err = unpopulate(val, "Mode", &u.Mode) + delete(rawMsg, key) + case "uri": + err = unpopulate(val, "URI", &u.URI) + 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 UserIdentity. +func (u UserIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["identityType"] = IdentityConfigurationTypeUserIdentity + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserIdentity. +func (u *UserIdentity) 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 "identityType": + err = unpopulate(val, "IdentityType", &u.IdentityType) + 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 UsernamePasswordAuthTypeWorkspaceConnectionProperties. +func (u UsernamePasswordAuthTypeWorkspaceConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["authType"] = ConnectionAuthTypeUsernamePassword + populate(objectMap, "category", u.Category) + populate(objectMap, "credentials", u.Credentials) + populate(objectMap, "target", u.Target) + populate(objectMap, "value", u.Value) + populate(objectMap, "valueFormat", u.ValueFormat) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UsernamePasswordAuthTypeWorkspaceConnectionProperties. +func (u *UsernamePasswordAuthTypeWorkspaceConnectionProperties) 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 "authType": + err = unpopulate(val, "AuthType", &u.AuthType) + delete(rawMsg, key) + case "category": + err = unpopulate(val, "Category", &u.Category) + delete(rawMsg, key) + case "credentials": + err = unpopulate(val, "Credentials", &u.Credentials) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &u.Target) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &u.Value) + delete(rawMsg, key) + case "valueFormat": + err = unpopulate(val, "ValueFormat", &u.ValueFormat) + 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 VirtualMachine. +func (v VirtualMachine) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "computeLocation", v.ComputeLocation) + objectMap["computeType"] = ComputeTypeVirtualMachine + populateTimeRFC3339(objectMap, "createdOn", v.CreatedOn) + populate(objectMap, "description", v.Description) + populate(objectMap, "disableLocalAuth", v.DisableLocalAuth) + populate(objectMap, "isAttachedCompute", v.IsAttachedCompute) + populateTimeRFC3339(objectMap, "modifiedOn", v.ModifiedOn) + populate(objectMap, "properties", v.Properties) + populate(objectMap, "provisioningErrors", v.ProvisioningErrors) + populate(objectMap, "provisioningState", v.ProvisioningState) + populate(objectMap, "resourceId", v.ResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachine. +func (v *VirtualMachine) 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 "computeLocation": + err = unpopulate(val, "ComputeLocation", &v.ComputeLocation) + delete(rawMsg, key) + case "computeType": + err = unpopulate(val, "ComputeType", &v.ComputeType) + delete(rawMsg, key) + case "createdOn": + err = unpopulateTimeRFC3339(val, "CreatedOn", &v.CreatedOn) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &v.Description) + delete(rawMsg, key) + case "disableLocalAuth": + err = unpopulate(val, "DisableLocalAuth", &v.DisableLocalAuth) + delete(rawMsg, key) + case "isAttachedCompute": + err = unpopulate(val, "IsAttachedCompute", &v.IsAttachedCompute) + delete(rawMsg, key) + case "modifiedOn": + err = unpopulateTimeRFC3339(val, "ModifiedOn", &v.ModifiedOn) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + case "provisioningErrors": + err = unpopulate(val, "ProvisioningErrors", &v.ProvisioningErrors) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &v.ResourceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineSecrets. +func (v *VirtualMachineSecrets) 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 "administratorAccount": + err = unpopulate(val, "AdministratorAccount", &v.AdministratorAccount) + delete(rawMsg, key) + case "computeType": + err = unpopulate(val, "ComputeType", &v.ComputeType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Workspace. +func (w Workspace) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", w.ID) + populate(objectMap, "identity", w.Identity) + populate(objectMap, "location", w.Location) + populate(objectMap, "name", w.Name) + populate(objectMap, "properties", w.Properties) + populate(objectMap, "sku", w.SKU) + populate(objectMap, "systemData", w.SystemData) + populate(objectMap, "tags", w.Tags) + populate(objectMap, "type", w.Type) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type WorkspaceConnectionPropertiesV2BasicResource. +func (w WorkspaceConnectionPropertiesV2BasicResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", w.ID) + populate(objectMap, "name", w.Name) + populate(objectMap, "properties", w.Properties) + populate(objectMap, "systemData", w.SystemData) + populate(objectMap, "type", w.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkspaceConnectionPropertiesV2BasicResource. +func (w *WorkspaceConnectionPropertiesV2BasicResource) 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", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &w.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &w.Name) + delete(rawMsg, key) + case "properties": + w.Properties, err = unmarshalWorkspaceConnectionPropertiesV2Classification(val) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &w.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &w.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WorkspaceProperties. +func (w WorkspaceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "allowPublicAccessWhenBehindVnet", w.AllowPublicAccessWhenBehindVnet) + populate(objectMap, "applicationInsights", w.ApplicationInsights) + populate(objectMap, "containerRegistry", w.ContainerRegistry) + populate(objectMap, "description", w.Description) + populate(objectMap, "discoveryUrl", w.DiscoveryURL) + populate(objectMap, "encryption", w.Encryption) + populate(objectMap, "friendlyName", w.FriendlyName) + populate(objectMap, "hbiWorkspace", w.HbiWorkspace) + populate(objectMap, "imageBuildCompute", w.ImageBuildCompute) + populate(objectMap, "keyVault", w.KeyVault) + populate(objectMap, "mlFlowTrackingUri", w.MlFlowTrackingURI) + populate(objectMap, "notebookInfo", w.NotebookInfo) + populate(objectMap, "primaryUserAssignedIdentity", w.PrimaryUserAssignedIdentity) + populate(objectMap, "privateEndpointConnections", w.PrivateEndpointConnections) + populate(objectMap, "privateLinkCount", w.PrivateLinkCount) + populate(objectMap, "provisioningState", w.ProvisioningState) + populate(objectMap, "publicNetworkAccess", w.PublicNetworkAccess) + populate(objectMap, "serviceManagedResourcesSettings", w.ServiceManagedResourcesSettings) + populate(objectMap, "serviceProvisionedResourceGroup", w.ServiceProvisionedResourceGroup) + populate(objectMap, "sharedPrivateLinkResources", w.SharedPrivateLinkResources) + populate(objectMap, "storageAccount", w.StorageAccount) + populate(objectMap, "storageHnsEnabled", w.StorageHnsEnabled) + populate(objectMap, "tenantId", w.TenantID) + populate(objectMap, "v1LegacyMode", w.V1LegacyMode) + populate(objectMap, "workspaceId", w.WorkspaceID) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type WorkspaceUpdateParameters. +func (w WorkspaceUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "identity", w.Identity) + populate(objectMap, "properties", w.Properties) + populate(objectMap, "sku", w.SKU) + populate(objectMap, "tags", w.Tags) + return json.Marshal(objectMap) +} + +func populate(m map[string]interface{}, k string, v interface{}) { + if v == nil { + return + } else if azcore.IsNullValue(v) { + m[k] = nil + } else if !reflect.ValueOf(v).IsNil() { + m[k] = v + } +} + +func unpopulate(data json.RawMessage, fn string, v interface{}) 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/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_modelversions_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_modelversions_client.go new file mode 100644 index 000000000000..d06c5498e698 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_modelversions_client.go @@ -0,0 +1,351 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// ModelVersionsClient contains the methods for the ModelVersions group. +// Don't use this type directly, use NewModelVersionsClient() instead. +type ModelVersionsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewModelVersionsClient creates a new instance of ModelVersionsClient 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 NewModelVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ModelVersionsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &ModelVersionsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// CreateOrUpdate - Create or update version. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// name - Container name. This is case-sensitive. +// version - Version identifier. This is case-sensitive. +// body - Version entity to create or update. +// options - ModelVersionsClientCreateOrUpdateOptions contains the optional parameters for the ModelVersionsClient.CreateOrUpdate +// method. +func (client *ModelVersionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body ModelVersion, options *ModelVersionsClientCreateOrUpdateOptions) (ModelVersionsClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, name, version, body, options) + if err != nil { + return ModelVersionsClientCreateOrUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ModelVersionsClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return ModelVersionsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ModelVersionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body ModelVersion, options *ModelVersionsClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, body) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *ModelVersionsClient) createOrUpdateHandleResponse(resp *http.Response) (ModelVersionsClientCreateOrUpdateResponse, error) { + result := ModelVersionsClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ModelVersion); err != nil { + return ModelVersionsClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Delete version. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// name - Container name. This is case-sensitive. +// version - Version identifier. This is case-sensitive. +// options - ModelVersionsClientDeleteOptions contains the optional parameters for the ModelVersionsClient.Delete method. +func (client *ModelVersionsClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *ModelVersionsClientDeleteOptions) (ModelVersionsClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, name, version, options) + if err != nil { + return ModelVersionsClientDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ModelVersionsClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return ModelVersionsClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return ModelVersionsClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ModelVersionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *ModelVersionsClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get version. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// name - Container name. This is case-sensitive. +// version - Version identifier. This is case-sensitive. +// options - ModelVersionsClientGetOptions contains the optional parameters for the ModelVersionsClient.Get method. +func (client *ModelVersionsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *ModelVersionsClientGetOptions) (ModelVersionsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, name, version, options) + if err != nil { + return ModelVersionsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ModelVersionsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ModelVersionsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ModelVersionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *ModelVersionsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-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 *ModelVersionsClient) getHandleResponse(resp *http.Response) (ModelVersionsClientGetResponse, error) { + result := ModelVersionsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ModelVersion); err != nil { + return ModelVersionsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List model versions. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// name - Model name. This is case-sensitive. +// options - ModelVersionsClientListOptions contains the optional parameters for the ModelVersionsClient.List method. +func (client *ModelVersionsClient) NewListPager(resourceGroupName string, workspaceName string, name string, options *ModelVersionsClientListOptions) *runtime.Pager[ModelVersionsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ModelVersionsClientListResponse]{ + More: func(page ModelVersionsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ModelVersionsClientListResponse) (ModelVersionsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, name, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ModelVersionsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ModelVersionsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ModelVersionsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *ModelVersionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *ModelVersionsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + if options != nil && options.OrderBy != nil { + reqQP.Set("$orderBy", *options.OrderBy) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.Version != nil { + reqQP.Set("version", *options.Version) + } + if options != nil && options.Description != nil { + reqQP.Set("description", *options.Description) + } + if options != nil && options.Offset != nil { + reqQP.Set("offset", strconv.FormatInt(int64(*options.Offset), 10)) + } + if options != nil && options.Tags != nil { + reqQP.Set("tags", *options.Tags) + } + if options != nil && options.Properties != nil { + reqQP.Set("properties", *options.Properties) + } + if options != nil && options.Feed != nil { + reqQP.Set("feed", *options.Feed) + } + if options != nil && options.ListViewType != nil { + reqQP.Set("listViewType", string(*options.ListViewType)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ModelVersionsClient) listHandleResponse(resp *http.Response) (ModelVersionsClientListResponse, error) { + result := ModelVersionsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ModelVersionResourceArmPaginatedResult); err != nil { + return ModelVersionsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_onlinedeployments_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_onlinedeployments_client.go new file mode 100644 index 000000000000..537c723ce0ed --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_onlinedeployments_client.go @@ -0,0 +1,580 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// OnlineDeploymentsClient contains the methods for the OnlineDeployments group. +// Don't use this type directly, use NewOnlineDeploymentsClient() instead. +type OnlineDeploymentsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewOnlineDeploymentsClient creates a new instance of OnlineDeploymentsClient 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 NewOnlineDeploymentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*OnlineDeploymentsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &OnlineDeploymentsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create or update Inference Endpoint Deployment (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// endpointName - Inference endpoint name. +// deploymentName - Inference Endpoint Deployment name. +// body - Inference Endpoint entity to apply during operation. +// options - OnlineDeploymentsClientBeginCreateOrUpdateOptions contains the optional parameters for the OnlineDeploymentsClient.BeginCreateOrUpdate +// method. +func (client *OnlineDeploymentsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, deploymentName string, body OnlineDeployment, options *OnlineDeploymentsClientBeginCreateOrUpdateOptions) (*runtime.Poller[OnlineDeploymentsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, workspaceName, endpointName, deploymentName, body, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[OnlineDeploymentsClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[OnlineDeploymentsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateOrUpdate - Create or update Inference Endpoint Deployment (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +func (client *OnlineDeploymentsClient) createOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, deploymentName string, body OnlineDeployment, options *OnlineDeploymentsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, deploymentName, body, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *OnlineDeploymentsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, deploymentName string, body OnlineDeployment, options *OnlineDeploymentsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if endpointName == "" { + return nil, errors.New("parameter endpointName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{endpointName}", url.PathEscape(endpointName)) + 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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, body) +} + +// BeginDelete - Delete Inference Endpoint Deployment (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// endpointName - Inference endpoint name. +// deploymentName - Inference Endpoint Deployment name. +// options - OnlineDeploymentsClientBeginDeleteOptions contains the optional parameters for the OnlineDeploymentsClient.BeginDelete +// method. +func (client *OnlineDeploymentsClient) BeginDelete(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, deploymentName string, options *OnlineDeploymentsClientBeginDeleteOptions) (*runtime.Poller[OnlineDeploymentsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, workspaceName, endpointName, deploymentName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[OnlineDeploymentsClientDeleteResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[OnlineDeploymentsClientDeleteResponse](options.ResumeToken, client.pl, nil) + } +} + +// Delete - Delete Inference Endpoint Deployment (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +func (client *OnlineDeploymentsClient) deleteOperation(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, deploymentName string, options *OnlineDeploymentsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, deploymentName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *OnlineDeploymentsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, deploymentName string, options *OnlineDeploymentsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if endpointName == "" { + return nil, errors.New("parameter endpointName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{endpointName}", url.PathEscape(endpointName)) + 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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get Inference Deployment Deployment. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// endpointName - Inference endpoint name. +// deploymentName - Inference Endpoint Deployment name. +// options - OnlineDeploymentsClientGetOptions contains the optional parameters for the OnlineDeploymentsClient.Get method. +func (client *OnlineDeploymentsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, deploymentName string, options *OnlineDeploymentsClientGetOptions) (OnlineDeploymentsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, deploymentName, options) + if err != nil { + return OnlineDeploymentsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return OnlineDeploymentsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return OnlineDeploymentsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *OnlineDeploymentsClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, deploymentName string, options *OnlineDeploymentsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if endpointName == "" { + return nil, errors.New("parameter endpointName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{endpointName}", url.PathEscape(endpointName)) + 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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-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 *OnlineDeploymentsClient) getHandleResponse(resp *http.Response) (OnlineDeploymentsClientGetResponse, error) { + result := OnlineDeploymentsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.OnlineDeployment); err != nil { + return OnlineDeploymentsClientGetResponse{}, err + } + return result, nil +} + +// GetLogs - Polls an Endpoint operation. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// endpointName - Inference endpoint name. +// deploymentName - The name and identifier for the endpoint. +// body - The request containing parameters for retrieving logs. +// options - OnlineDeploymentsClientGetLogsOptions contains the optional parameters for the OnlineDeploymentsClient.GetLogs +// method. +func (client *OnlineDeploymentsClient) GetLogs(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, deploymentName string, body DeploymentLogsRequest, options *OnlineDeploymentsClientGetLogsOptions) (OnlineDeploymentsClientGetLogsResponse, error) { + req, err := client.getLogsCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, deploymentName, body, options) + if err != nil { + return OnlineDeploymentsClientGetLogsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return OnlineDeploymentsClientGetLogsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return OnlineDeploymentsClientGetLogsResponse{}, runtime.NewResponseError(resp) + } + return client.getLogsHandleResponse(resp) +} + +// getLogsCreateRequest creates the GetLogs request. +func (client *OnlineDeploymentsClient) getLogsCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, deploymentName string, body DeploymentLogsRequest, options *OnlineDeploymentsClientGetLogsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if endpointName == "" { + return nil, errors.New("parameter endpointName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{endpointName}", url.PathEscape(endpointName)) + 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.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, body) +} + +// getLogsHandleResponse handles the GetLogs response. +func (client *OnlineDeploymentsClient) getLogsHandleResponse(resp *http.Response) (OnlineDeploymentsClientGetLogsResponse, error) { + result := OnlineDeploymentsClientGetLogsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DeploymentLogs); err != nil { + return OnlineDeploymentsClientGetLogsResponse{}, err + } + return result, nil +} + +// NewListPager - List Inference Endpoint Deployments. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// endpointName - Inference endpoint name. +// options - OnlineDeploymentsClientListOptions contains the optional parameters for the OnlineDeploymentsClient.List method. +func (client *OnlineDeploymentsClient) NewListPager(resourceGroupName string, workspaceName string, endpointName string, options *OnlineDeploymentsClientListOptions) *runtime.Pager[OnlineDeploymentsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[OnlineDeploymentsClientListResponse]{ + More: func(page OnlineDeploymentsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *OnlineDeploymentsClientListResponse) (OnlineDeploymentsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return OnlineDeploymentsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return OnlineDeploymentsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return OnlineDeploymentsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *OnlineDeploymentsClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, options *OnlineDeploymentsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if endpointName == "" { + return nil, errors.New("parameter endpointName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{endpointName}", url.PathEscape(endpointName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + if options != nil && options.OrderBy != nil { + reqQP.Set("$orderBy", *options.OrderBy) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *OnlineDeploymentsClient) listHandleResponse(resp *http.Response) (OnlineDeploymentsClientListResponse, error) { + result := OnlineDeploymentsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.OnlineDeploymentTrackedResourceArmPaginatedResult); err != nil { + return OnlineDeploymentsClientListResponse{}, err + } + return result, nil +} + +// NewListSKUsPager - List Inference Endpoint Deployment Skus. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// endpointName - Inference endpoint name. +// deploymentName - Inference Endpoint Deployment name. +// options - OnlineDeploymentsClientListSKUsOptions contains the optional parameters for the OnlineDeploymentsClient.ListSKUs +// method. +func (client *OnlineDeploymentsClient) NewListSKUsPager(resourceGroupName string, workspaceName string, endpointName string, deploymentName string, options *OnlineDeploymentsClientListSKUsOptions) *runtime.Pager[OnlineDeploymentsClientListSKUsResponse] { + return runtime.NewPager(runtime.PagingHandler[OnlineDeploymentsClientListSKUsResponse]{ + More: func(page OnlineDeploymentsClientListSKUsResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *OnlineDeploymentsClientListSKUsResponse) (OnlineDeploymentsClientListSKUsResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listSKUsCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, deploymentName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return OnlineDeploymentsClientListSKUsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return OnlineDeploymentsClientListSKUsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return OnlineDeploymentsClientListSKUsResponse{}, runtime.NewResponseError(resp) + } + return client.listSKUsHandleResponse(resp) + }, + }) +} + +// listSKUsCreateRequest creates the ListSKUs request. +func (client *OnlineDeploymentsClient) listSKUsCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, deploymentName string, options *OnlineDeploymentsClientListSKUsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if endpointName == "" { + return nil, errors.New("parameter endpointName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{endpointName}", url.PathEscape(endpointName)) + 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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + if options != nil && options.Count != nil { + reqQP.Set("count", strconv.FormatInt(int64(*options.Count), 10)) + } + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listSKUsHandleResponse handles the ListSKUs response. +func (client *OnlineDeploymentsClient) listSKUsHandleResponse(resp *http.Response) (OnlineDeploymentsClientListSKUsResponse, error) { + result := OnlineDeploymentsClientListSKUsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SKUResourceArmPaginatedResult); err != nil { + return OnlineDeploymentsClientListSKUsResponse{}, err + } + return result, nil +} + +// BeginUpdate - Update Online Deployment (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// endpointName - Online Endpoint name. +// deploymentName - Inference Endpoint Deployment name. +// body - Online Endpoint entity to apply during operation. +// options - OnlineDeploymentsClientBeginUpdateOptions contains the optional parameters for the OnlineDeploymentsClient.BeginUpdate +// method. +func (client *OnlineDeploymentsClient) BeginUpdate(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, deploymentName string, body PartialMinimalTrackedResourceWithSKU, options *OnlineDeploymentsClientBeginUpdateOptions) (*runtime.Poller[OnlineDeploymentsClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, workspaceName, endpointName, deploymentName, body, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[OnlineDeploymentsClientUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[OnlineDeploymentsClientUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// Update - Update Online Deployment (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +func (client *OnlineDeploymentsClient) update(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, deploymentName string, body PartialMinimalTrackedResourceWithSKU, options *OnlineDeploymentsClientBeginUpdateOptions) (*http.Response, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, deploymentName, body, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateCreateRequest creates the Update request. +func (client *OnlineDeploymentsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, deploymentName string, body PartialMinimalTrackedResourceWithSKU, options *OnlineDeploymentsClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if endpointName == "" { + return nil, errors.New("parameter endpointName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{endpointName}", url.PathEscape(endpointName)) + 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.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, body) +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_onlineendpoints_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_onlineendpoints_client.go new file mode 100644 index 000000000000..32218a40ed44 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_onlineendpoints_client.go @@ -0,0 +1,608 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// OnlineEndpointsClient contains the methods for the OnlineEndpoints group. +// Don't use this type directly, use NewOnlineEndpointsClient() instead. +type OnlineEndpointsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewOnlineEndpointsClient creates a new instance of OnlineEndpointsClient 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 NewOnlineEndpointsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*OnlineEndpointsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &OnlineEndpointsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create or update Online Endpoint (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// endpointName - Online Endpoint name. +// body - Online Endpoint entity to apply during operation. +// options - OnlineEndpointsClientBeginCreateOrUpdateOptions contains the optional parameters for the OnlineEndpointsClient.BeginCreateOrUpdate +// method. +func (client *OnlineEndpointsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, body OnlineEndpoint, options *OnlineEndpointsClientBeginCreateOrUpdateOptions) (*runtime.Poller[OnlineEndpointsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, workspaceName, endpointName, body, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[OnlineEndpointsClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[OnlineEndpointsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateOrUpdate - Create or update Online Endpoint (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +func (client *OnlineEndpointsClient) createOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, body OnlineEndpoint, options *OnlineEndpointsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, body, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *OnlineEndpointsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, body OnlineEndpoint, options *OnlineEndpointsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if endpointName == "" { + return nil, errors.New("parameter endpointName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{endpointName}", url.PathEscape(endpointName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, body) +} + +// BeginDelete - Delete Online Endpoint (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// endpointName - Online Endpoint name. +// options - OnlineEndpointsClientBeginDeleteOptions contains the optional parameters for the OnlineEndpointsClient.BeginDelete +// method. +func (client *OnlineEndpointsClient) BeginDelete(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, options *OnlineEndpointsClientBeginDeleteOptions) (*runtime.Poller[OnlineEndpointsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, workspaceName, endpointName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[OnlineEndpointsClientDeleteResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[OnlineEndpointsClientDeleteResponse](options.ResumeToken, client.pl, nil) + } +} + +// Delete - Delete Online Endpoint (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +func (client *OnlineEndpointsClient) deleteOperation(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, options *OnlineEndpointsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *OnlineEndpointsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, options *OnlineEndpointsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if endpointName == "" { + return nil, errors.New("parameter endpointName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{endpointName}", url.PathEscape(endpointName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get Online Endpoint. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// endpointName - Online Endpoint name. +// options - OnlineEndpointsClientGetOptions contains the optional parameters for the OnlineEndpointsClient.Get method. +func (client *OnlineEndpointsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, options *OnlineEndpointsClientGetOptions) (OnlineEndpointsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, options) + if err != nil { + return OnlineEndpointsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return OnlineEndpointsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return OnlineEndpointsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *OnlineEndpointsClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, options *OnlineEndpointsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if endpointName == "" { + return nil, errors.New("parameter endpointName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{endpointName}", url.PathEscape(endpointName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-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 *OnlineEndpointsClient) getHandleResponse(resp *http.Response) (OnlineEndpointsClientGetResponse, error) { + result := OnlineEndpointsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.OnlineEndpoint); err != nil { + return OnlineEndpointsClientGetResponse{}, err + } + return result, nil +} + +// GetToken - Retrieve a valid AAD token for an Endpoint using AMLToken-based authentication. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// endpointName - Online Endpoint name. +// options - OnlineEndpointsClientGetTokenOptions contains the optional parameters for the OnlineEndpointsClient.GetToken +// method. +func (client *OnlineEndpointsClient) GetToken(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, options *OnlineEndpointsClientGetTokenOptions) (OnlineEndpointsClientGetTokenResponse, error) { + req, err := client.getTokenCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, options) + if err != nil { + return OnlineEndpointsClientGetTokenResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return OnlineEndpointsClientGetTokenResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return OnlineEndpointsClientGetTokenResponse{}, runtime.NewResponseError(resp) + } + return client.getTokenHandleResponse(resp) +} + +// getTokenCreateRequest creates the GetToken request. +func (client *OnlineEndpointsClient) getTokenCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, options *OnlineEndpointsClientGetTokenOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if endpointName == "" { + return nil, errors.New("parameter endpointName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{endpointName}", url.PathEscape(endpointName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getTokenHandleResponse handles the GetToken response. +func (client *OnlineEndpointsClient) getTokenHandleResponse(resp *http.Response) (OnlineEndpointsClientGetTokenResponse, error) { + result := OnlineEndpointsClientGetTokenResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.EndpointAuthToken); err != nil { + return OnlineEndpointsClientGetTokenResponse{}, err + } + return result, nil +} + +// NewListPager - List Online Endpoints. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// options - OnlineEndpointsClientListOptions contains the optional parameters for the OnlineEndpointsClient.List method. +func (client *OnlineEndpointsClient) NewListPager(resourceGroupName string, workspaceName string, options *OnlineEndpointsClientListOptions) *runtime.Pager[OnlineEndpointsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[OnlineEndpointsClientListResponse]{ + More: func(page OnlineEndpointsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *OnlineEndpointsClientListResponse) (OnlineEndpointsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return OnlineEndpointsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return OnlineEndpointsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return OnlineEndpointsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *OnlineEndpointsClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *OnlineEndpointsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + if options != nil && options.Name != nil { + reqQP.Set("name", *options.Name) + } + if options != nil && options.Count != nil { + reqQP.Set("count", strconv.FormatInt(int64(*options.Count), 10)) + } + if options != nil && options.ComputeType != nil { + reqQP.Set("computeType", string(*options.ComputeType)) + } + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + if options != nil && options.Tags != nil { + reqQP.Set("tags", *options.Tags) + } + if options != nil && options.Properties != nil { + reqQP.Set("properties", *options.Properties) + } + if options != nil && options.OrderBy != nil { + reqQP.Set("orderBy", string(*options.OrderBy)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *OnlineEndpointsClient) listHandleResponse(resp *http.Response) (OnlineEndpointsClientListResponse, error) { + result := OnlineEndpointsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.OnlineEndpointTrackedResourceArmPaginatedResult); err != nil { + return OnlineEndpointsClientListResponse{}, err + } + return result, nil +} + +// ListKeys - List EndpointAuthKeys for an Endpoint using Key-based authentication. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// endpointName - Online Endpoint name. +// options - OnlineEndpointsClientListKeysOptions contains the optional parameters for the OnlineEndpointsClient.ListKeys +// method. +func (client *OnlineEndpointsClient) ListKeys(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, options *OnlineEndpointsClientListKeysOptions) (OnlineEndpointsClientListKeysResponse, error) { + req, err := client.listKeysCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, options) + if err != nil { + return OnlineEndpointsClientListKeysResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return OnlineEndpointsClientListKeysResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return OnlineEndpointsClientListKeysResponse{}, runtime.NewResponseError(resp) + } + return client.listKeysHandleResponse(resp) +} + +// listKeysCreateRequest creates the ListKeys request. +func (client *OnlineEndpointsClient) listKeysCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, options *OnlineEndpointsClientListKeysOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if endpointName == "" { + return nil, errors.New("parameter endpointName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{endpointName}", url.PathEscape(endpointName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-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 *OnlineEndpointsClient) listKeysHandleResponse(resp *http.Response) (OnlineEndpointsClientListKeysResponse, error) { + result := OnlineEndpointsClientListKeysResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.EndpointAuthKeys); err != nil { + return OnlineEndpointsClientListKeysResponse{}, err + } + return result, nil +} + +// BeginRegenerateKeys - Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// endpointName - Online Endpoint name. +// body - RegenerateKeys request . +// options - OnlineEndpointsClientBeginRegenerateKeysOptions contains the optional parameters for the OnlineEndpointsClient.BeginRegenerateKeys +// method. +func (client *OnlineEndpointsClient) BeginRegenerateKeys(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, body RegenerateEndpointKeysRequest, options *OnlineEndpointsClientBeginRegenerateKeysOptions) (*runtime.Poller[OnlineEndpointsClientRegenerateKeysResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.regenerateKeys(ctx, resourceGroupName, workspaceName, endpointName, body, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[OnlineEndpointsClientRegenerateKeysResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[OnlineEndpointsClientRegenerateKeysResponse](options.ResumeToken, client.pl, nil) + } +} + +// RegenerateKeys - Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +func (client *OnlineEndpointsClient) regenerateKeys(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, body RegenerateEndpointKeysRequest, options *OnlineEndpointsClientBeginRegenerateKeysOptions) (*http.Response, error) { + req, err := client.regenerateKeysCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, body, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// regenerateKeysCreateRequest creates the RegenerateKeys request. +func (client *OnlineEndpointsClient) regenerateKeysCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, body RegenerateEndpointKeysRequest, options *OnlineEndpointsClientBeginRegenerateKeysOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if endpointName == "" { + return nil, errors.New("parameter endpointName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{endpointName}", url.PathEscape(endpointName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, body) +} + +// BeginUpdate - Update Online Endpoint (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// endpointName - Online Endpoint name. +// body - Online Endpoint entity to apply during operation. +// options - OnlineEndpointsClientBeginUpdateOptions contains the optional parameters for the OnlineEndpointsClient.BeginUpdate +// method. +func (client *OnlineEndpointsClient) BeginUpdate(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, body PartialMinimalTrackedResourceWithIdentity, options *OnlineEndpointsClientBeginUpdateOptions) (*runtime.Poller[OnlineEndpointsClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, workspaceName, endpointName, body, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[OnlineEndpointsClientUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[OnlineEndpointsClientUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// Update - Update Online Endpoint (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +func (client *OnlineEndpointsClient) update(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, body PartialMinimalTrackedResourceWithIdentity, options *OnlineEndpointsClientBeginUpdateOptions) (*http.Response, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, body, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateCreateRequest creates the Update request. +func (client *OnlineEndpointsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, body PartialMinimalTrackedResourceWithIdentity, options *OnlineEndpointsClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if endpointName == "" { + return nil, errors.New("parameter endpointName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{endpointName}", url.PathEscape(endpointName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, body) +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_operations_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_operations_client.go new file mode 100644 index 000000000000..8aa1578e7695 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_operations_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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "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 { + host string + pl runtime.Pipeline +} + +// 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) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &OperationsClient{ + host: ep, + pl: pl, + } + return client, nil +} + +// NewListPager - Lists all of the available Azure Machine Learning Workspaces REST API operations. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ + More: func(page OperationsClientListResponse) bool { + return false + }, + Fetcher: func(ctx context.Context, page *OperationsClientListResponse) (OperationsClientListResponse, error) { + req, err := client.listCreateRequest(ctx, options) + if err != nil { + return OperationsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return OperationsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return OperationsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *OperationsClient) listCreateRequest(ctx context.Context, options *OperationsClientListOptions) (*policy.Request, error) { + urlPath := "/providers/Microsoft.MachineLearningServices/operations" + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-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.AmlOperationListResult); err != nil { + return OperationsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_polymorphic_helpers.go b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_polymorphic_helpers.go new file mode 100644 index 000000000000..aef187b22026 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_polymorphic_helpers.go @@ -0,0 +1,459 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import "encoding/json" + +func unmarshalAssetReferenceBaseClassification(rawMsg json.RawMessage) (AssetReferenceBaseClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]interface{} + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b AssetReferenceBaseClassification + switch m["referenceType"] { + case string(ReferenceTypeDataPath): + b = &DataPathAssetReference{} + case string(ReferenceTypeID): + b = &IDAssetReference{} + case string(ReferenceTypeOutputPath): + b = &OutputPathAssetReference{} + default: + b = &AssetReferenceBase{} + } + return b, json.Unmarshal(rawMsg, b) +} + +func unmarshalComputeClassification(rawMsg json.RawMessage) (ComputeClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]interface{} + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b ComputeClassification + switch m["computeType"] { + case string(ComputeTypeAKS): + b = &AKS{} + case string(ComputeTypeAmlCompute): + b = &AmlCompute{} + case string(ComputeTypeComputeInstance): + b = &ComputeInstance{} + case string(ComputeTypeDataFactory): + b = &DataFactory{} + case string(ComputeTypeDataLakeAnalytics): + b = &DataLakeAnalytics{} + case string(ComputeTypeDatabricks): + b = &Databricks{} + case string(ComputeTypeHDInsight): + b = &HDInsight{} + case string(ComputeTypeKubernetes): + b = &Kubernetes{} + case string(ComputeTypeSynapseSpark): + b = &SynapseSpark{} + case string(ComputeTypeVirtualMachine): + b = &VirtualMachine{} + default: + b = &Compute{} + } + return b, json.Unmarshal(rawMsg, b) +} + +func unmarshalComputeSecretsClassification(rawMsg json.RawMessage) (ComputeSecretsClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]interface{} + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b ComputeSecretsClassification + switch m["computeType"] { + case string(ComputeTypeAKS): + b = &AksComputeSecrets{} + case string(ComputeTypeDatabricks): + b = &DatabricksComputeSecrets{} + case string(ComputeTypeVirtualMachine): + b = &VirtualMachineSecrets{} + default: + b = &ComputeSecrets{} + } + return b, json.Unmarshal(rawMsg, b) +} + +func unmarshalDataVersionBasePropertiesClassification(rawMsg json.RawMessage) (DataVersionBasePropertiesClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]interface{} + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b DataVersionBasePropertiesClassification + switch m["dataType"] { + case string(DataTypeMltable): + b = &MLTableData{} + case string(DataTypeURIFile): + b = &URIFileDataVersion{} + case string(DataTypeURIFolder): + b = &URIFolderDataVersion{} + default: + b = &DataVersionBaseProperties{} + } + return b, json.Unmarshal(rawMsg, b) +} + +func unmarshalDatastoreCredentialsClassification(rawMsg json.RawMessage) (DatastoreCredentialsClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]interface{} + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b DatastoreCredentialsClassification + switch m["credentialsType"] { + case string(CredentialsTypeAccountKey): + b = &AccountKeyDatastoreCredentials{} + case string(CredentialsTypeCertificate): + b = &CertificateDatastoreCredentials{} + case string(CredentialsTypeNone): + b = &NoneDatastoreCredentials{} + case string(CredentialsTypeSas): + b = &SasDatastoreCredentials{} + case string(CredentialsTypeServicePrincipal): + b = &ServicePrincipalDatastoreCredentials{} + default: + b = &DatastoreCredentials{} + } + return b, json.Unmarshal(rawMsg, b) +} + +func unmarshalDatastorePropertiesClassification(rawMsg json.RawMessage) (DatastorePropertiesClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]interface{} + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b DatastorePropertiesClassification + switch m["datastoreType"] { + case string(DatastoreTypeAzureBlob): + b = &AzureBlobDatastore{} + case string(DatastoreTypeAzureDataLakeGen1): + b = &AzureDataLakeGen1Datastore{} + case string(DatastoreTypeAzureDataLakeGen2): + b = &AzureDataLakeGen2Datastore{} + case string(DatastoreTypeAzureFile): + b = &AzureFileDatastore{} + default: + b = &DatastoreProperties{} + } + return b, json.Unmarshal(rawMsg, b) +} + +func unmarshalDatastoreSecretsClassification(rawMsg json.RawMessage) (DatastoreSecretsClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]interface{} + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b DatastoreSecretsClassification + switch m["secretsType"] { + case string(SecretsTypeAccountKey): + b = &AccountKeyDatastoreSecrets{} + case string(SecretsTypeCertificate): + b = &CertificateDatastoreSecrets{} + case string(SecretsTypeSas): + b = &SasDatastoreSecrets{} + case string(SecretsTypeServicePrincipal): + b = &ServicePrincipalDatastoreSecrets{} + default: + b = &DatastoreSecrets{} + } + return b, json.Unmarshal(rawMsg, b) +} + +func unmarshalDistributionConfigurationClassification(rawMsg json.RawMessage) (DistributionConfigurationClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]interface{} + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b DistributionConfigurationClassification + switch m["distributionType"] { + case string(DistributionTypeMpi): + b = &Mpi{} + case string(DistributionTypePyTorch): + b = &PyTorch{} + case string(DistributionTypeTensorFlow): + b = &TensorFlow{} + default: + b = &DistributionConfiguration{} + } + return b, json.Unmarshal(rawMsg, b) +} + +func unmarshalEarlyTerminationPolicyClassification(rawMsg json.RawMessage) (EarlyTerminationPolicyClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]interface{} + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b EarlyTerminationPolicyClassification + switch m["policyType"] { + case string(EarlyTerminationPolicyTypeBandit): + b = &BanditPolicy{} + case string(EarlyTerminationPolicyTypeMedianStopping): + b = &MedianStoppingPolicy{} + case string(EarlyTerminationPolicyTypeTruncationSelection): + b = &TruncationSelectionPolicy{} + default: + b = &EarlyTerminationPolicy{} + } + return b, json.Unmarshal(rawMsg, b) +} + +func unmarshalIdentityConfigurationClassification(rawMsg json.RawMessage) (IdentityConfigurationClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]interface{} + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b IdentityConfigurationClassification + switch m["identityType"] { + case string(IdentityConfigurationTypeAMLToken): + b = &AmlToken{} + case string(IdentityConfigurationTypeManaged): + b = &ManagedIdentity{} + case string(IdentityConfigurationTypeUserIdentity): + b = &UserIdentity{} + default: + b = &IdentityConfiguration{} + } + return b, json.Unmarshal(rawMsg, b) +} + +func unmarshalJobBasePropertiesClassification(rawMsg json.RawMessage) (JobBasePropertiesClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]interface{} + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b JobBasePropertiesClassification + switch m["jobType"] { + case string(JobTypeCommand): + b = &CommandJob{} + case string(JobTypePipeline): + b = &PipelineJob{} + case string(JobTypeSweep): + b = &SweepJob{} + default: + b = &JobBaseProperties{} + } + return b, json.Unmarshal(rawMsg, b) +} + +func unmarshalJobInputClassification(rawMsg json.RawMessage) (JobInputClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]interface{} + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b JobInputClassification + switch m["jobInputType"] { + case string(JobInputTypeCustomModel): + b = &CustomModelJobInput{} + case string(JobInputTypeLiteral): + b = &LiteralJobInput{} + case string(JobInputTypeMlflowModel): + b = &MLFlowModelJobInput{} + case string(JobInputTypeMltable): + b = &MLTableJobInput{} + case string(JobInputTypeTritonModel): + b = &TritonModelJobInput{} + case string(JobInputTypeURIFile): + b = &URIFileJobInput{} + case string(JobInputTypeURIFolder): + b = &URIFolderJobInput{} + default: + b = &JobInput{} + } + return b, json.Unmarshal(rawMsg, b) +} + +func unmarshalJobInputClassificationMap(rawMsg json.RawMessage) (map[string]JobInputClassification, error) { + if rawMsg == nil { + return nil, nil + } + var rawMessages map[string]json.RawMessage + if err := json.Unmarshal(rawMsg, &rawMessages); err != nil { + return nil, err + } + fMap := make(map[string]JobInputClassification, len(rawMessages)) + for key, rawMessage := range rawMessages { + f, err := unmarshalJobInputClassification(rawMessage) + if err != nil { + return nil, err + } + fMap[key] = f + } + return fMap, nil +} + +func unmarshalJobOutputClassification(rawMsg json.RawMessage) (JobOutputClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]interface{} + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b JobOutputClassification + switch m["jobOutputType"] { + case string(JobOutputTypeCustomModel): + b = &CustomModelJobOutput{} + case string(JobOutputTypeMlflowModel): + b = &MLFlowModelJobOutput{} + case string(JobOutputTypeMltable): + b = &MLTableJobOutput{} + case string(JobOutputTypeTritonModel): + b = &TritonModelJobOutput{} + case string(JobOutputTypeURIFile): + b = &URIFileJobOutput{} + case string(JobOutputTypeURIFolder): + b = &URIFolderJobOutput{} + default: + b = &JobOutput{} + } + return b, json.Unmarshal(rawMsg, b) +} + +func unmarshalJobOutputClassificationMap(rawMsg json.RawMessage) (map[string]JobOutputClassification, error) { + if rawMsg == nil { + return nil, nil + } + var rawMessages map[string]json.RawMessage + if err := json.Unmarshal(rawMsg, &rawMessages); err != nil { + return nil, err + } + fMap := make(map[string]JobOutputClassification, len(rawMessages)) + for key, rawMessage := range rawMessages { + f, err := unmarshalJobOutputClassification(rawMessage) + if err != nil { + return nil, err + } + fMap[key] = f + } + return fMap, nil +} + +func unmarshalOnlineDeploymentPropertiesClassification(rawMsg json.RawMessage) (OnlineDeploymentPropertiesClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]interface{} + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b OnlineDeploymentPropertiesClassification + switch m["endpointComputeType"] { + case string(EndpointComputeTypeKubernetes): + b = &KubernetesOnlineDeployment{} + case string(EndpointComputeTypeManaged): + b = &ManagedOnlineDeployment{} + default: + b = &OnlineDeploymentProperties{} + } + return b, json.Unmarshal(rawMsg, b) +} + +func unmarshalOnlineScaleSettingsClassification(rawMsg json.RawMessage) (OnlineScaleSettingsClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]interface{} + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b OnlineScaleSettingsClassification + switch m["scaleType"] { + case string(ScaleTypeDefault): + b = &DefaultScaleSettings{} + case string(ScaleTypeTargetUtilization): + b = &TargetUtilizationScaleSettings{} + default: + b = &OnlineScaleSettings{} + } + return b, json.Unmarshal(rawMsg, b) +} + +func unmarshalSamplingAlgorithmClassification(rawMsg json.RawMessage) (SamplingAlgorithmClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]interface{} + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b SamplingAlgorithmClassification + switch m["samplingAlgorithmType"] { + case string(SamplingAlgorithmTypeBayesian): + b = &BayesianSamplingAlgorithm{} + case string(SamplingAlgorithmTypeGrid): + b = &GridSamplingAlgorithm{} + case string(SamplingAlgorithmTypeRandom): + b = &RandomSamplingAlgorithm{} + default: + b = &SamplingAlgorithm{} + } + return b, json.Unmarshal(rawMsg, b) +} + +func unmarshalWorkspaceConnectionPropertiesV2Classification(rawMsg json.RawMessage) (WorkspaceConnectionPropertiesV2Classification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]interface{} + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b WorkspaceConnectionPropertiesV2Classification + switch m["authType"] { + case string(ConnectionAuthTypeManagedIdentity): + b = &ManagedIdentityAuthTypeWorkspaceConnectionProperties{} + case string(ConnectionAuthTypeNone): + b = &NoneAuthTypeWorkspaceConnectionProperties{} + case string(ConnectionAuthTypePAT): + b = &PATAuthTypeWorkspaceConnectionProperties{} + case string(ConnectionAuthTypeSAS): + b = &SASAuthTypeWorkspaceConnectionProperties{} + case string(ConnectionAuthTypeUsernamePassword): + b = &UsernamePasswordAuthTypeWorkspaceConnectionProperties{} + default: + b = &WorkspaceConnectionPropertiesV2{} + } + return b, json.Unmarshal(rawMsg, b) +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_privateendpointconnections_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_privateendpointconnections_client.go new file mode 100644 index 000000000000..a9bafbaca3fb --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_privateendpointconnections_client.go @@ -0,0 +1,297 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "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 { + host string + subscriptionID string + pl runtime.Pipeline +} + +// 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) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &PrivateEndpointConnectionsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// CreateOrUpdate - Update the state of specified private endpoint connection associated with the workspace. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// privateEndpointConnectionName - The name of the private endpoint connection associated with the workspace +// properties - The private endpoint connection properties. +// options - PrivateEndpointConnectionsClientCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.CreateOrUpdate +// method. +func (client *PrivateEndpointConnectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, properties PrivateEndpointConnection, options *PrivateEndpointConnectionsClientCreateOrUpdateOptions) (PrivateEndpointConnectionsClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, privateEndpointConnectionName, properties, options) + if err != nil { + return PrivateEndpointConnectionsClientCreateOrUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PrivateEndpointConnectionsClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrivateEndpointConnectionsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, properties PrivateEndpointConnection, options *PrivateEndpointConnectionsClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + 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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, properties) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *PrivateEndpointConnectionsClient) createOrUpdateHandleResponse(resp *http.Response) (PrivateEndpointConnectionsClientCreateOrUpdateResponse, error) { + result := PrivateEndpointConnectionsClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnection); err != nil { + return PrivateEndpointConnectionsClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Deletes the specified private endpoint connection associated with the workspace. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// privateEndpointConnectionName - The name of the private endpoint connection associated with the workspace +// options - PrivateEndpointConnectionsClientDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Delete +// method. +func (client *PrivateEndpointConnectionsClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientDeleteOptions) (PrivateEndpointConnectionsClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, privateEndpointConnectionName, options) + if err != nil { + return PrivateEndpointConnectionsClientDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PrivateEndpointConnectionsClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return PrivateEndpointConnectionsClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return PrivateEndpointConnectionsClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + 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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-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 workspace. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// privateEndpointConnectionName - The name of the private endpoint connection associated with the workspace +// options - PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get +// method. +func (client *PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetOptions) (PrivateEndpointConnectionsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, privateEndpointConnectionName, options) + if err != nil { + return PrivateEndpointConnectionsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PrivateEndpointConnectionsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrivateEndpointConnectionsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + 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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-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 +} + +// NewListPager - List all the private endpoint connections associated with the workspace. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// options - PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.List +// method. +func (client *PrivateEndpointConnectionsClient) NewListPager(resourceGroupName string, workspaceName string, options *PrivateEndpointConnectionsClientListOptions) *runtime.Pager[PrivateEndpointConnectionsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[PrivateEndpointConnectionsClientListResponse]{ + More: func(page PrivateEndpointConnectionsClientListResponse) bool { + return false + }, + Fetcher: func(ctx context.Context, page *PrivateEndpointConnectionsClientListResponse) (PrivateEndpointConnectionsClientListResponse, error) { + req, err := client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) + if err != nil { + return PrivateEndpointConnectionsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PrivateEndpointConnectionsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrivateEndpointConnectionsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *PrivateEndpointConnectionsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + 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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-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/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_privatelinkresources_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_privatelinkresources_client.go new file mode 100644 index 000000000000..5294a59e2527 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_privatelinkresources_client.go @@ -0,0 +1,112 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "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 { + host string + subscriptionID string + pl runtime.Pipeline +} + +// 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) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &PrivateLinkResourcesClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// List - Gets the private link resources that need to be created for a workspace. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// options - PrivateLinkResourcesClientListOptions contains the optional parameters for the PrivateLinkResourcesClient.List +// method. +func (client *PrivateLinkResourcesClient) List(ctx context.Context, resourceGroupName string, workspaceName string, options *PrivateLinkResourcesClientListOptions) (PrivateLinkResourcesClientListResponse, error) { + req, err := client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) + if err != nil { + return PrivateLinkResourcesClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PrivateLinkResourcesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrivateLinkResourcesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) +} + +// listCreateRequest creates the List request. +func (client *PrivateLinkResourcesClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *PrivateLinkResourcesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-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/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_quotas_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_quotas_client.go new file mode 100644 index 000000000000..1d8e8d928da7 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_quotas_client.go @@ -0,0 +1,171 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "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" +) + +// QuotasClient contains the methods for the Quotas group. +// Don't use this type directly, use NewQuotasClient() instead. +type QuotasClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewQuotasClient creates a new instance of QuotasClient 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 NewQuotasClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*QuotasClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &QuotasClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// NewListPager - Gets the currently assigned Workspace Quotas based on VMFamily. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// location - The location for which resource usage is queried. +// options - QuotasClientListOptions contains the optional parameters for the QuotasClient.List method. +func (client *QuotasClient) NewListPager(location string, options *QuotasClientListOptions) *runtime.Pager[QuotasClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[QuotasClientListResponse]{ + More: func(page QuotasClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *QuotasClientListResponse) (QuotasClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, location, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return QuotasClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return QuotasClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return QuotasClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *QuotasClient) listCreateRequest(ctx context.Context, location string, options *QuotasClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas" + 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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-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 *QuotasClient) listHandleResponse(resp *http.Response) (QuotasClientListResponse, error) { + result := QuotasClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ListWorkspaceQuotas); err != nil { + return QuotasClientListResponse{}, err + } + return result, nil +} + +// Update - Update quota for each VM family in workspace. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// location - The location for update quota is queried. +// parameters - Quota update parameters. +// options - QuotasClientUpdateOptions contains the optional parameters for the QuotasClient.Update method. +func (client *QuotasClient) Update(ctx context.Context, location string, parameters QuotaUpdateParameters, options *QuotasClientUpdateOptions) (QuotasClientUpdateResponse, error) { + req, err := client.updateCreateRequest(ctx, location, parameters, options) + if err != nil { + return QuotasClientUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return QuotasClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return QuotasClientUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.updateHandleResponse(resp) +} + +// updateCreateRequest creates the Update request. +func (client *QuotasClient) updateCreateRequest(ctx context.Context, location string, parameters QuotaUpdateParameters, options *QuotasClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas" + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + 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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// updateHandleResponse handles the Update response. +func (client *QuotasClient) updateHandleResponse(resp *http.Response) (QuotasClientUpdateResponse, error) { + result := QuotasClientUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.UpdateWorkspaceQuotasResult); err != nil { + return QuotasClientUpdateResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_response_types.go b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_response_types.go new file mode 100644 index 000000000000..160588373737 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_response_types.go @@ -0,0 +1,604 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +// BatchDeploymentsClientCreateOrUpdateResponse contains the response from method BatchDeploymentsClient.CreateOrUpdate. +type BatchDeploymentsClientCreateOrUpdateResponse struct { + BatchDeployment +} + +// BatchDeploymentsClientDeleteResponse contains the response from method BatchDeploymentsClient.Delete. +type BatchDeploymentsClientDeleteResponse struct { + // placeholder for future response values +} + +// BatchDeploymentsClientGetResponse contains the response from method BatchDeploymentsClient.Get. +type BatchDeploymentsClientGetResponse struct { + BatchDeployment +} + +// BatchDeploymentsClientListResponse contains the response from method BatchDeploymentsClient.List. +type BatchDeploymentsClientListResponse struct { + BatchDeploymentTrackedResourceArmPaginatedResult +} + +// BatchDeploymentsClientUpdateResponse contains the response from method BatchDeploymentsClient.Update. +type BatchDeploymentsClientUpdateResponse struct { + BatchDeployment +} + +// BatchEndpointsClientCreateOrUpdateResponse contains the response from method BatchEndpointsClient.CreateOrUpdate. +type BatchEndpointsClientCreateOrUpdateResponse struct { + BatchEndpoint +} + +// BatchEndpointsClientDeleteResponse contains the response from method BatchEndpointsClient.Delete. +type BatchEndpointsClientDeleteResponse struct { + // placeholder for future response values +} + +// BatchEndpointsClientGetResponse contains the response from method BatchEndpointsClient.Get. +type BatchEndpointsClientGetResponse struct { + BatchEndpoint +} + +// BatchEndpointsClientListKeysResponse contains the response from method BatchEndpointsClient.ListKeys. +type BatchEndpointsClientListKeysResponse struct { + EndpointAuthKeys +} + +// BatchEndpointsClientListResponse contains the response from method BatchEndpointsClient.List. +type BatchEndpointsClientListResponse struct { + BatchEndpointTrackedResourceArmPaginatedResult +} + +// BatchEndpointsClientUpdateResponse contains the response from method BatchEndpointsClient.Update. +type BatchEndpointsClientUpdateResponse struct { + BatchEndpoint +} + +// CodeContainersClientCreateOrUpdateResponse contains the response from method CodeContainersClient.CreateOrUpdate. +type CodeContainersClientCreateOrUpdateResponse struct { + CodeContainer +} + +// CodeContainersClientDeleteResponse contains the response from method CodeContainersClient.Delete. +type CodeContainersClientDeleteResponse struct { + // placeholder for future response values +} + +// CodeContainersClientGetResponse contains the response from method CodeContainersClient.Get. +type CodeContainersClientGetResponse struct { + CodeContainer +} + +// CodeContainersClientListResponse contains the response from method CodeContainersClient.List. +type CodeContainersClientListResponse struct { + CodeContainerResourceArmPaginatedResult +} + +// CodeVersionsClientCreateOrUpdateResponse contains the response from method CodeVersionsClient.CreateOrUpdate. +type CodeVersionsClientCreateOrUpdateResponse struct { + CodeVersion +} + +// CodeVersionsClientDeleteResponse contains the response from method CodeVersionsClient.Delete. +type CodeVersionsClientDeleteResponse struct { + // placeholder for future response values +} + +// CodeVersionsClientGetResponse contains the response from method CodeVersionsClient.Get. +type CodeVersionsClientGetResponse struct { + CodeVersion +} + +// CodeVersionsClientListResponse contains the response from method CodeVersionsClient.List. +type CodeVersionsClientListResponse struct { + CodeVersionResourceArmPaginatedResult +} + +// ComponentContainersClientCreateOrUpdateResponse contains the response from method ComponentContainersClient.CreateOrUpdate. +type ComponentContainersClientCreateOrUpdateResponse struct { + ComponentContainer +} + +// ComponentContainersClientDeleteResponse contains the response from method ComponentContainersClient.Delete. +type ComponentContainersClientDeleteResponse struct { + // placeholder for future response values +} + +// ComponentContainersClientGetResponse contains the response from method ComponentContainersClient.Get. +type ComponentContainersClientGetResponse struct { + ComponentContainer +} + +// ComponentContainersClientListResponse contains the response from method ComponentContainersClient.List. +type ComponentContainersClientListResponse struct { + ComponentContainerResourceArmPaginatedResult +} + +// ComponentVersionsClientCreateOrUpdateResponse contains the response from method ComponentVersionsClient.CreateOrUpdate. +type ComponentVersionsClientCreateOrUpdateResponse struct { + ComponentVersion +} + +// ComponentVersionsClientDeleteResponse contains the response from method ComponentVersionsClient.Delete. +type ComponentVersionsClientDeleteResponse struct { + // placeholder for future response values +} + +// ComponentVersionsClientGetResponse contains the response from method ComponentVersionsClient.Get. +type ComponentVersionsClientGetResponse struct { + ComponentVersion +} + +// ComponentVersionsClientListResponse contains the response from method ComponentVersionsClient.List. +type ComponentVersionsClientListResponse struct { + ComponentVersionResourceArmPaginatedResult +} + +// ComputeClientCreateOrUpdateResponse contains the response from method ComputeClient.CreateOrUpdate. +type ComputeClientCreateOrUpdateResponse struct { + ComputeResource +} + +// ComputeClientDeleteResponse contains the response from method ComputeClient.Delete. +type ComputeClientDeleteResponse struct { + // placeholder for future response values +} + +// ComputeClientGetResponse contains the response from method ComputeClient.Get. +type ComputeClientGetResponse struct { + ComputeResource +} + +// ComputeClientListKeysResponse contains the response from method ComputeClient.ListKeys. +type ComputeClientListKeysResponse struct { + ComputeSecretsClassification +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeClientListKeysResponse. +func (c *ComputeClientListKeysResponse) UnmarshalJSON(data []byte) error { + res, err := unmarshalComputeSecretsClassification(data) + if err != nil { + return err + } + c.ComputeSecretsClassification = res + return nil +} + +// ComputeClientListNodesResponse contains the response from method ComputeClient.ListNodes. +type ComputeClientListNodesResponse struct { + AmlComputeNodesInformation +} + +// ComputeClientListResponse contains the response from method ComputeClient.List. +type ComputeClientListResponse struct { + PaginatedComputeResourcesList +} + +// ComputeClientRestartResponse contains the response from method ComputeClient.Restart. +type ComputeClientRestartResponse struct { + // placeholder for future response values +} + +// ComputeClientStartResponse contains the response from method ComputeClient.Start. +type ComputeClientStartResponse struct { + // placeholder for future response values +} + +// ComputeClientStopResponse contains the response from method ComputeClient.Stop. +type ComputeClientStopResponse struct { + // placeholder for future response values +} + +// ComputeClientUpdateResponse contains the response from method ComputeClient.Update. +type ComputeClientUpdateResponse struct { + ComputeResource +} + +// DataContainersClientCreateOrUpdateResponse contains the response from method DataContainersClient.CreateOrUpdate. +type DataContainersClientCreateOrUpdateResponse struct { + DataContainer +} + +// DataContainersClientDeleteResponse contains the response from method DataContainersClient.Delete. +type DataContainersClientDeleteResponse struct { + // placeholder for future response values +} + +// DataContainersClientGetResponse contains the response from method DataContainersClient.Get. +type DataContainersClientGetResponse struct { + DataContainer +} + +// DataContainersClientListResponse contains the response from method DataContainersClient.List. +type DataContainersClientListResponse struct { + DataContainerResourceArmPaginatedResult +} + +// DataVersionsClientCreateOrUpdateResponse contains the response from method DataVersionsClient.CreateOrUpdate. +type DataVersionsClientCreateOrUpdateResponse struct { + DataVersionBase +} + +// DataVersionsClientDeleteResponse contains the response from method DataVersionsClient.Delete. +type DataVersionsClientDeleteResponse struct { + // placeholder for future response values +} + +// DataVersionsClientGetResponse contains the response from method DataVersionsClient.Get. +type DataVersionsClientGetResponse struct { + DataVersionBase +} + +// DataVersionsClientListResponse contains the response from method DataVersionsClient.List. +type DataVersionsClientListResponse struct { + DataVersionBaseResourceArmPaginatedResult +} + +// DatastoresClientCreateOrUpdateResponse contains the response from method DatastoresClient.CreateOrUpdate. +type DatastoresClientCreateOrUpdateResponse struct { + Datastore +} + +// DatastoresClientDeleteResponse contains the response from method DatastoresClient.Delete. +type DatastoresClientDeleteResponse struct { + // placeholder for future response values +} + +// DatastoresClientGetResponse contains the response from method DatastoresClient.Get. +type DatastoresClientGetResponse struct { + Datastore +} + +// DatastoresClientListResponse contains the response from method DatastoresClient.List. +type DatastoresClientListResponse struct { + DatastoreResourceArmPaginatedResult +} + +// DatastoresClientListSecretsResponse contains the response from method DatastoresClient.ListSecrets. +type DatastoresClientListSecretsResponse struct { + DatastoreSecretsClassification +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatastoresClientListSecretsResponse. +func (d *DatastoresClientListSecretsResponse) UnmarshalJSON(data []byte) error { + res, err := unmarshalDatastoreSecretsClassification(data) + if err != nil { + return err + } + d.DatastoreSecretsClassification = res + return nil +} + +// EnvironmentContainersClientCreateOrUpdateResponse contains the response from method EnvironmentContainersClient.CreateOrUpdate. +type EnvironmentContainersClientCreateOrUpdateResponse struct { + EnvironmentContainer +} + +// EnvironmentContainersClientDeleteResponse contains the response from method EnvironmentContainersClient.Delete. +type EnvironmentContainersClientDeleteResponse struct { + // placeholder for future response values +} + +// EnvironmentContainersClientGetResponse contains the response from method EnvironmentContainersClient.Get. +type EnvironmentContainersClientGetResponse struct { + EnvironmentContainer +} + +// EnvironmentContainersClientListResponse contains the response from method EnvironmentContainersClient.List. +type EnvironmentContainersClientListResponse struct { + EnvironmentContainerResourceArmPaginatedResult +} + +// EnvironmentVersionsClientCreateOrUpdateResponse contains the response from method EnvironmentVersionsClient.CreateOrUpdate. +type EnvironmentVersionsClientCreateOrUpdateResponse struct { + EnvironmentVersion +} + +// EnvironmentVersionsClientDeleteResponse contains the response from method EnvironmentVersionsClient.Delete. +type EnvironmentVersionsClientDeleteResponse struct { + // placeholder for future response values +} + +// EnvironmentVersionsClientGetResponse contains the response from method EnvironmentVersionsClient.Get. +type EnvironmentVersionsClientGetResponse struct { + EnvironmentVersion +} + +// EnvironmentVersionsClientListResponse contains the response from method EnvironmentVersionsClient.List. +type EnvironmentVersionsClientListResponse struct { + EnvironmentVersionResourceArmPaginatedResult +} + +// JobsClientCancelResponse contains the response from method JobsClient.Cancel. +type JobsClientCancelResponse struct { + // placeholder for future response values +} + +// JobsClientCreateOrUpdateResponse contains the response from method JobsClient.CreateOrUpdate. +type JobsClientCreateOrUpdateResponse struct { + JobBase +} + +// JobsClientDeleteResponse contains the response from method JobsClient.Delete. +type JobsClientDeleteResponse struct { + // placeholder for future response values +} + +// JobsClientGetResponse contains the response from method JobsClient.Get. +type JobsClientGetResponse struct { + JobBase +} + +// JobsClientListResponse contains the response from method JobsClient.List. +type JobsClientListResponse struct { + JobBaseResourceArmPaginatedResult +} + +// ModelContainersClientCreateOrUpdateResponse contains the response from method ModelContainersClient.CreateOrUpdate. +type ModelContainersClientCreateOrUpdateResponse struct { + ModelContainer +} + +// ModelContainersClientDeleteResponse contains the response from method ModelContainersClient.Delete. +type ModelContainersClientDeleteResponse struct { + // placeholder for future response values +} + +// ModelContainersClientGetResponse contains the response from method ModelContainersClient.Get. +type ModelContainersClientGetResponse struct { + ModelContainer +} + +// ModelContainersClientListResponse contains the response from method ModelContainersClient.List. +type ModelContainersClientListResponse struct { + ModelContainerResourceArmPaginatedResult +} + +// ModelVersionsClientCreateOrUpdateResponse contains the response from method ModelVersionsClient.CreateOrUpdate. +type ModelVersionsClientCreateOrUpdateResponse struct { + ModelVersion +} + +// ModelVersionsClientDeleteResponse contains the response from method ModelVersionsClient.Delete. +type ModelVersionsClientDeleteResponse struct { + // placeholder for future response values +} + +// ModelVersionsClientGetResponse contains the response from method ModelVersionsClient.Get. +type ModelVersionsClientGetResponse struct { + ModelVersion +} + +// ModelVersionsClientListResponse contains the response from method ModelVersionsClient.List. +type ModelVersionsClientListResponse struct { + ModelVersionResourceArmPaginatedResult +} + +// OnlineDeploymentsClientCreateOrUpdateResponse contains the response from method OnlineDeploymentsClient.CreateOrUpdate. +type OnlineDeploymentsClientCreateOrUpdateResponse struct { + OnlineDeployment +} + +// OnlineDeploymentsClientDeleteResponse contains the response from method OnlineDeploymentsClient.Delete. +type OnlineDeploymentsClientDeleteResponse struct { + // placeholder for future response values +} + +// OnlineDeploymentsClientGetLogsResponse contains the response from method OnlineDeploymentsClient.GetLogs. +type OnlineDeploymentsClientGetLogsResponse struct { + DeploymentLogs +} + +// OnlineDeploymentsClientGetResponse contains the response from method OnlineDeploymentsClient.Get. +type OnlineDeploymentsClientGetResponse struct { + OnlineDeployment +} + +// OnlineDeploymentsClientListResponse contains the response from method OnlineDeploymentsClient.List. +type OnlineDeploymentsClientListResponse struct { + OnlineDeploymentTrackedResourceArmPaginatedResult +} + +// OnlineDeploymentsClientListSKUsResponse contains the response from method OnlineDeploymentsClient.ListSKUs. +type OnlineDeploymentsClientListSKUsResponse struct { + SKUResourceArmPaginatedResult +} + +// OnlineDeploymentsClientUpdateResponse contains the response from method OnlineDeploymentsClient.Update. +type OnlineDeploymentsClientUpdateResponse struct { + OnlineDeployment +} + +// OnlineEndpointsClientCreateOrUpdateResponse contains the response from method OnlineEndpointsClient.CreateOrUpdate. +type OnlineEndpointsClientCreateOrUpdateResponse struct { + OnlineEndpoint +} + +// OnlineEndpointsClientDeleteResponse contains the response from method OnlineEndpointsClient.Delete. +type OnlineEndpointsClientDeleteResponse struct { + // placeholder for future response values +} + +// OnlineEndpointsClientGetResponse contains the response from method OnlineEndpointsClient.Get. +type OnlineEndpointsClientGetResponse struct { + OnlineEndpoint +} + +// OnlineEndpointsClientGetTokenResponse contains the response from method OnlineEndpointsClient.GetToken. +type OnlineEndpointsClientGetTokenResponse struct { + EndpointAuthToken +} + +// OnlineEndpointsClientListKeysResponse contains the response from method OnlineEndpointsClient.ListKeys. +type OnlineEndpointsClientListKeysResponse struct { + EndpointAuthKeys +} + +// OnlineEndpointsClientListResponse contains the response from method OnlineEndpointsClient.List. +type OnlineEndpointsClientListResponse struct { + OnlineEndpointTrackedResourceArmPaginatedResult +} + +// OnlineEndpointsClientRegenerateKeysResponse contains the response from method OnlineEndpointsClient.RegenerateKeys. +type OnlineEndpointsClientRegenerateKeysResponse struct { + // placeholder for future response values +} + +// OnlineEndpointsClientUpdateResponse contains the response from method OnlineEndpointsClient.Update. +type OnlineEndpointsClientUpdateResponse struct { + OnlineEndpoint +} + +// OperationsClientListResponse contains the response from method OperationsClient.List. +type OperationsClientListResponse struct { + AmlOperationListResult +} + +// PrivateEndpointConnectionsClientCreateOrUpdateResponse contains the response from method PrivateEndpointConnectionsClient.CreateOrUpdate. +type PrivateEndpointConnectionsClientCreateOrUpdateResponse struct { + PrivateEndpointConnection +} + +// PrivateEndpointConnectionsClientDeleteResponse contains the response from method PrivateEndpointConnectionsClient.Delete. +type PrivateEndpointConnectionsClientDeleteResponse struct { + // placeholder for future response values +} + +// PrivateEndpointConnectionsClientGetResponse contains the response from method PrivateEndpointConnectionsClient.Get. +type PrivateEndpointConnectionsClientGetResponse struct { + PrivateEndpointConnection +} + +// PrivateEndpointConnectionsClientListResponse contains the response from method PrivateEndpointConnectionsClient.List. +type PrivateEndpointConnectionsClientListResponse struct { + PrivateEndpointConnectionListResult +} + +// PrivateLinkResourcesClientListResponse contains the response from method PrivateLinkResourcesClient.List. +type PrivateLinkResourcesClientListResponse struct { + PrivateLinkResourceListResult +} + +// QuotasClientListResponse contains the response from method QuotasClient.List. +type QuotasClientListResponse struct { + ListWorkspaceQuotas +} + +// QuotasClientUpdateResponse contains the response from method QuotasClient.Update. +type QuotasClientUpdateResponse struct { + UpdateWorkspaceQuotasResult +} + +// UsagesClientListResponse contains the response from method UsagesClient.List. +type UsagesClientListResponse struct { + ListUsagesResult +} + +// VirtualMachineSizesClientListResponse contains the response from method VirtualMachineSizesClient.List. +type VirtualMachineSizesClientListResponse struct { + VirtualMachineSizeListResult +} + +// WorkspaceConnectionsClientCreateResponse contains the response from method WorkspaceConnectionsClient.Create. +type WorkspaceConnectionsClientCreateResponse struct { + WorkspaceConnectionPropertiesV2BasicResource +} + +// WorkspaceConnectionsClientDeleteResponse contains the response from method WorkspaceConnectionsClient.Delete. +type WorkspaceConnectionsClientDeleteResponse struct { + // placeholder for future response values +} + +// WorkspaceConnectionsClientGetResponse contains the response from method WorkspaceConnectionsClient.Get. +type WorkspaceConnectionsClientGetResponse struct { + WorkspaceConnectionPropertiesV2BasicResource +} + +// WorkspaceConnectionsClientListResponse contains the response from method WorkspaceConnectionsClient.List. +type WorkspaceConnectionsClientListResponse struct { + WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult +} + +// WorkspaceFeaturesClientListResponse contains the response from method WorkspaceFeaturesClient.List. +type WorkspaceFeaturesClientListResponse struct { + ListAmlUserFeatureResult +} + +// WorkspacesClientCreateOrUpdateResponse contains the response from method WorkspacesClient.CreateOrUpdate. +type WorkspacesClientCreateOrUpdateResponse struct { + Workspace +} + +// WorkspacesClientDeleteResponse contains the response from method WorkspacesClient.Delete. +type WorkspacesClientDeleteResponse struct { + // placeholder for future response values +} + +// WorkspacesClientDiagnoseResponse contains the response from method WorkspacesClient.Diagnose. +type WorkspacesClientDiagnoseResponse struct { + DiagnoseResponseResult +} + +// WorkspacesClientGetResponse contains the response from method WorkspacesClient.Get. +type WorkspacesClientGetResponse struct { + Workspace +} + +// WorkspacesClientListByResourceGroupResponse contains the response from method WorkspacesClient.ListByResourceGroup. +type WorkspacesClientListByResourceGroupResponse struct { + WorkspaceListResult +} + +// WorkspacesClientListBySubscriptionResponse contains the response from method WorkspacesClient.ListBySubscription. +type WorkspacesClientListBySubscriptionResponse struct { + WorkspaceListResult +} + +// WorkspacesClientListKeysResponse contains the response from method WorkspacesClient.ListKeys. +type WorkspacesClientListKeysResponse struct { + ListWorkspaceKeysResult +} + +// WorkspacesClientListNotebookAccessTokenResponse contains the response from method WorkspacesClient.ListNotebookAccessToken. +type WorkspacesClientListNotebookAccessTokenResponse struct { + NotebookAccessTokenResult +} + +// WorkspacesClientListNotebookKeysResponse contains the response from method WorkspacesClient.ListNotebookKeys. +type WorkspacesClientListNotebookKeysResponse struct { + ListNotebookKeysResult +} + +// WorkspacesClientListOutboundNetworkDependenciesEndpointsResponse contains the response from method WorkspacesClient.ListOutboundNetworkDependenciesEndpoints. +type WorkspacesClientListOutboundNetworkDependenciesEndpointsResponse struct { + ExternalFQDNResponse +} + +// WorkspacesClientListStorageAccountKeysResponse contains the response from method WorkspacesClient.ListStorageAccountKeys. +type WorkspacesClientListStorageAccountKeysResponse struct { + ListStorageAccountKeysResult +} + +// WorkspacesClientPrepareNotebookResponse contains the response from method WorkspacesClient.PrepareNotebook. +type WorkspacesClientPrepareNotebookResponse struct { + NotebookResourceInfo +} + +// WorkspacesClientResyncKeysResponse contains the response from method WorkspacesClient.ResyncKeys. +type WorkspacesClientResyncKeysResponse struct { + // placeholder for future response values +} + +// WorkspacesClientUpdateResponse contains the response from method WorkspacesClient.Update. +type WorkspacesClientUpdateResponse struct { + Workspace +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_time_rfc3339.go b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_time_rfc3339.go new file mode 100644 index 000000000000..9a83980c92ad --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" + "regexp" + "strings" + "time" +) + +const ( + utcLayoutJSON = `"2006-01-02T15:04:05.999999999"` + utcLayout = "2006-01-02T15:04:05.999999999" + rfc3339JSON = `"` + time.RFC3339Nano + `"` +) + +// 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+)*"*$`) + +type timeRFC3339 time.Time + +func (t timeRFC3339) MarshalJSON() (json []byte, err error) { + tt := time.Time(t) + return tt.MarshalJSON() +} + +func (t timeRFC3339) MarshalText() (text []byte, err error) { + tt := time.Time(t) + return tt.MarshalText() +} + +func (t *timeRFC3339) UnmarshalJSON(data []byte) error { + layout := utcLayoutJSON + if tzOffsetRegex.Match(data) { + layout = rfc3339JSON + } + return t.Parse(layout, string(data)) +} + +func (t *timeRFC3339) UnmarshalText(data []byte) (err error) { + layout := utcLayout + if tzOffsetRegex.Match(data) { + layout = time.RFC3339Nano + } + return t.Parse(layout, string(data)) +} + +func (t *timeRFC3339) Parse(layout, value string) error { + p, err := time.Parse(layout, strings.ToUpper(value)) + *t = timeRFC3339(p) + return err +} + +func populateTimeRFC3339(m map[string]interface{}, 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] = (*timeRFC3339)(t) +} + +func unpopulateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { + if data == nil || strings.EqualFold(string(data), "null") { + return nil + } + var aux timeRFC3339 + 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/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_usages_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_usages_client.go new file mode 100644 index 000000000000..0ab6ba8a3dbf --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_usages_client.go @@ -0,0 +1,119 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "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 { + host string + subscriptionID string + pl runtime.Pipeline +} + +// 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) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &UsagesClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// NewListPager - Gets the current usage information as well as limits for AML resources for given subscription and location. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// location - The location for which resource usage is queried. +// options - UsagesClientListOptions contains the optional parameters for the UsagesClient.List 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) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, location, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return UsagesClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return UsagesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return UsagesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *UsagesClient) listCreateRequest(ctx context.Context, location string, options *UsagesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-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 *UsagesClient) listHandleResponse(resp *http.Response) (UsagesClientListResponse, error) { + result := UsagesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ListUsagesResult); err != nil { + return UsagesClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_virtualmachinesizes_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_virtualmachinesizes_client.go new file mode 100644 index 000000000000..471a4ebc6861 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_virtualmachinesizes_client.go @@ -0,0 +1,107 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "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" +) + +// VirtualMachineSizesClient contains the methods for the VirtualMachineSizes group. +// Don't use this type directly, use NewVirtualMachineSizesClient() instead. +type VirtualMachineSizesClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewVirtualMachineSizesClient creates a new instance of VirtualMachineSizesClient 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 NewVirtualMachineSizesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineSizesClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &VirtualMachineSizesClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// List - Returns supported VM Sizes in a location +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// location - The location upon which virtual-machine-sizes is queried. +// options - VirtualMachineSizesClientListOptions contains the optional parameters for the VirtualMachineSizesClient.List +// method. +func (client *VirtualMachineSizesClient) List(ctx context.Context, location string, options *VirtualMachineSizesClientListOptions) (VirtualMachineSizesClientListResponse, error) { + req, err := client.listCreateRequest(ctx, location, options) + if err != nil { + return VirtualMachineSizesClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return VirtualMachineSizesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualMachineSizesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) +} + +// listCreateRequest creates the List request. +func (client *VirtualMachineSizesClient) listCreateRequest(ctx context.Context, location string, options *VirtualMachineSizesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes" + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + 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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-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 *VirtualMachineSizesClient) listHandleResponse(resp *http.Response) (VirtualMachineSizesClientListResponse, error) { + result := VirtualMachineSizesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineSizeListResult); err != nil { + return VirtualMachineSizesClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_workspaceconnections_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_workspaceconnections_client.go new file mode 100644 index 000000000000..df08c10b779d --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_workspaceconnections_client.go @@ -0,0 +1,309 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "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" +) + +// WorkspaceConnectionsClient contains the methods for the WorkspaceConnections group. +// Don't use this type directly, use NewWorkspaceConnectionsClient() instead. +type WorkspaceConnectionsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewWorkspaceConnectionsClient creates a new instance of WorkspaceConnectionsClient 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 NewWorkspaceConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*WorkspaceConnectionsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &WorkspaceConnectionsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// Create - +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// connectionName - Friendly name of the workspace connection +// parameters - The object for creating or updating a new workspace connection +// options - WorkspaceConnectionsClientCreateOptions contains the optional parameters for the WorkspaceConnectionsClient.Create +// method. +func (client *WorkspaceConnectionsClient) Create(ctx context.Context, resourceGroupName string, workspaceName string, connectionName string, parameters WorkspaceConnectionPropertiesV2BasicResource, options *WorkspaceConnectionsClientCreateOptions) (WorkspaceConnectionsClientCreateResponse, error) { + req, err := client.createCreateRequest(ctx, resourceGroupName, workspaceName, connectionName, parameters, options) + if err != nil { + return WorkspaceConnectionsClientCreateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WorkspaceConnectionsClientCreateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WorkspaceConnectionsClientCreateResponse{}, runtime.NewResponseError(resp) + } + return client.createHandleResponse(resp) +} + +// createCreateRequest creates the Create request. +func (client *WorkspaceConnectionsClient) createCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, connectionName string, parameters WorkspaceConnectionPropertiesV2BasicResource, options *WorkspaceConnectionsClientCreateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if connectionName == "" { + return nil, errors.New("parameter connectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// createHandleResponse handles the Create response. +func (client *WorkspaceConnectionsClient) createHandleResponse(resp *http.Response) (WorkspaceConnectionsClientCreateResponse, error) { + result := WorkspaceConnectionsClientCreateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.WorkspaceConnectionPropertiesV2BasicResource); err != nil { + return WorkspaceConnectionsClientCreateResponse{}, err + } + return result, nil +} + +// Delete - +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// connectionName - Friendly name of the workspace connection +// options - WorkspaceConnectionsClientDeleteOptions contains the optional parameters for the WorkspaceConnectionsClient.Delete +// method. +func (client *WorkspaceConnectionsClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, connectionName string, options *WorkspaceConnectionsClientDeleteOptions) (WorkspaceConnectionsClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, connectionName, options) + if err != nil { + return WorkspaceConnectionsClientDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WorkspaceConnectionsClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return WorkspaceConnectionsClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return WorkspaceConnectionsClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *WorkspaceConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, connectionName string, options *WorkspaceConnectionsClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if connectionName == "" { + return nil, errors.New("parameter connectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// connectionName - Friendly name of the workspace connection +// options - WorkspaceConnectionsClientGetOptions contains the optional parameters for the WorkspaceConnectionsClient.Get +// method. +func (client *WorkspaceConnectionsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, connectionName string, options *WorkspaceConnectionsClientGetOptions) (WorkspaceConnectionsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, connectionName, options) + if err != nil { + return WorkspaceConnectionsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WorkspaceConnectionsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WorkspaceConnectionsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *WorkspaceConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, connectionName string, options *WorkspaceConnectionsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if connectionName == "" { + return nil, errors.New("parameter connectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-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 *WorkspaceConnectionsClient) getHandleResponse(resp *http.Response) (WorkspaceConnectionsClientGetResponse, error) { + result := WorkspaceConnectionsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.WorkspaceConnectionPropertiesV2BasicResource); err != nil { + return WorkspaceConnectionsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// options - WorkspaceConnectionsClientListOptions contains the optional parameters for the WorkspaceConnectionsClient.List +// method. +func (client *WorkspaceConnectionsClient) NewListPager(resourceGroupName string, workspaceName string, options *WorkspaceConnectionsClientListOptions) *runtime.Pager[WorkspaceConnectionsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[WorkspaceConnectionsClientListResponse]{ + More: func(page WorkspaceConnectionsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *WorkspaceConnectionsClientListResponse) (WorkspaceConnectionsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return WorkspaceConnectionsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WorkspaceConnectionsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WorkspaceConnectionsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *WorkspaceConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *WorkspaceConnectionsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Target != nil { + reqQP.Set("target", *options.Target) + } + if options != nil && options.Category != nil { + reqQP.Set("category", *options.Category) + } + reqQP.Set("api-version", "2022-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 *WorkspaceConnectionsClient) listHandleResponse(resp *http.Response) (WorkspaceConnectionsClientListResponse, error) { + result := WorkspaceConnectionsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult); err != nil { + return WorkspaceConnectionsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_workspacefeatures_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_workspacefeatures_client.go new file mode 100644 index 000000000000..605cbf349a91 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_workspacefeatures_client.go @@ -0,0 +1,124 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "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" +) + +// WorkspaceFeaturesClient contains the methods for the WorkspaceFeatures group. +// Don't use this type directly, use NewWorkspaceFeaturesClient() instead. +type WorkspaceFeaturesClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewWorkspaceFeaturesClient creates a new instance of WorkspaceFeaturesClient 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 NewWorkspaceFeaturesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*WorkspaceFeaturesClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &WorkspaceFeaturesClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// NewListPager - Lists all enabled features for a workspace +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// options - WorkspaceFeaturesClientListOptions contains the optional parameters for the WorkspaceFeaturesClient.List method. +func (client *WorkspaceFeaturesClient) NewListPager(resourceGroupName string, workspaceName string, options *WorkspaceFeaturesClientListOptions) *runtime.Pager[WorkspaceFeaturesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[WorkspaceFeaturesClientListResponse]{ + More: func(page WorkspaceFeaturesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *WorkspaceFeaturesClientListResponse) (WorkspaceFeaturesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return WorkspaceFeaturesClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WorkspaceFeaturesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WorkspaceFeaturesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *WorkspaceFeaturesClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *WorkspaceFeaturesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-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 *WorkspaceFeaturesClient) listHandleResponse(resp *http.Response) (WorkspaceFeaturesClientListResponse, error) { + result := WorkspaceFeaturesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ListAmlUserFeatureResult); err != nil { + return WorkspaceFeaturesClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_workspaces_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_workspaces_client.go new file mode 100644 index 000000000000..a7148e6c7d6a --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/zz_generated_workspaces_client.go @@ -0,0 +1,915 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "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" +) + +// WorkspacesClient contains the methods for the Workspaces group. +// Don't use this type directly, use NewWorkspacesClient() instead. +type WorkspacesClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewWorkspacesClient creates a new instance of WorkspacesClient 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 NewWorkspacesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*WorkspacesClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &WorkspacesClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates a workspace with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// parameters - The parameters for creating or updating a machine learning workspace. +// options - WorkspacesClientBeginCreateOrUpdateOptions contains the optional parameters for the WorkspacesClient.BeginCreateOrUpdate +// method. +func (client *WorkspacesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, parameters Workspace, options *WorkspacesClientBeginCreateOrUpdateOptions) (*runtime.Poller[WorkspacesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, workspaceName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[WorkspacesClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[WorkspacesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateOrUpdate - Creates or updates a workspace with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +func (client *WorkspacesClient) createOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, parameters Workspace, options *WorkspacesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *WorkspacesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, parameters Workspace, options *WorkspacesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Deletes a machine learning workspace. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// options - WorkspacesClientBeginDeleteOptions contains the optional parameters for the WorkspacesClient.BeginDelete method. +func (client *WorkspacesClient) BeginDelete(ctx context.Context, resourceGroupName string, workspaceName string, options *WorkspacesClientBeginDeleteOptions) (*runtime.Poller[WorkspacesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, workspaceName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[WorkspacesClientDeleteResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[WorkspacesClientDeleteResponse](options.ResumeToken, client.pl, nil) + } +} + +// Delete - Deletes a machine learning workspace. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +func (client *WorkspacesClient) deleteOperation(ctx context.Context, resourceGroupName string, workspaceName string, options *WorkspacesClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *WorkspacesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *WorkspacesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginDiagnose - Diagnose workspace setup issue. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// options - WorkspacesClientBeginDiagnoseOptions contains the optional parameters for the WorkspacesClient.BeginDiagnose +// method. +func (client *WorkspacesClient) BeginDiagnose(ctx context.Context, resourceGroupName string, workspaceName string, options *WorkspacesClientBeginDiagnoseOptions) (*runtime.Poller[WorkspacesClientDiagnoseResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.diagnose(ctx, resourceGroupName, workspaceName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[WorkspacesClientDiagnoseResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[WorkspacesClientDiagnoseResponse](options.ResumeToken, client.pl, nil) + } +} + +// Diagnose - Diagnose workspace setup issue. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +func (client *WorkspacesClient) diagnose(ctx context.Context, resourceGroupName string, workspaceName string, options *WorkspacesClientBeginDiagnoseOptions) (*http.Response, error) { + req, err := client.diagnoseCreateRequest(ctx, resourceGroupName, workspaceName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// diagnoseCreateRequest creates the Diagnose request. +func (client *WorkspacesClient) diagnoseCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *WorkspacesClientBeginDiagnoseOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.Parameters != nil { + return req, runtime.MarshalAsJSON(req, *options.Parameters) + } + return req, nil +} + +// Get - Gets the properties of the specified machine learning workspace. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// options - WorkspacesClientGetOptions contains the optional parameters for the WorkspacesClient.Get method. +func (client *WorkspacesClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, options *WorkspacesClientGetOptions) (WorkspacesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, options) + if err != nil { + return WorkspacesClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WorkspacesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WorkspacesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *WorkspacesClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *WorkspacesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-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 *WorkspacesClient) getHandleResponse(resp *http.Response) (WorkspacesClientGetResponse, error) { + result := WorkspacesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Workspace); err != nil { + return WorkspacesClientGetResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - Lists all the available machine learning workspaces under the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// options - WorkspacesClientListByResourceGroupOptions contains the optional parameters for the WorkspacesClient.ListByResourceGroup +// method. +func (client *WorkspacesClient) NewListByResourceGroupPager(resourceGroupName string, options *WorkspacesClientListByResourceGroupOptions) *runtime.Pager[WorkspacesClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[WorkspacesClientListByResourceGroupResponse]{ + More: func(page WorkspacesClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *WorkspacesClientListByResourceGroupResponse) (WorkspacesClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return WorkspacesClientListByResourceGroupResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WorkspacesClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WorkspacesClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *WorkspacesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *WorkspacesClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *WorkspacesClient) listByResourceGroupHandleResponse(resp *http.Response) (WorkspacesClientListByResourceGroupResponse, error) { + result := WorkspacesClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.WorkspaceListResult); err != nil { + return WorkspacesClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// NewListBySubscriptionPager - Lists all the available machine learning workspaces under the specified subscription. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// options - WorkspacesClientListBySubscriptionOptions contains the optional parameters for the WorkspacesClient.ListBySubscription +// method. +func (client *WorkspacesClient) NewListBySubscriptionPager(options *WorkspacesClientListBySubscriptionOptions) *runtime.Pager[WorkspacesClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PagingHandler[WorkspacesClientListBySubscriptionResponse]{ + More: func(page WorkspacesClientListBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *WorkspacesClientListBySubscriptionResponse) (WorkspacesClientListBySubscriptionResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listBySubscriptionCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return WorkspacesClientListBySubscriptionResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WorkspacesClientListBySubscriptionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WorkspacesClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) + } + return client.listBySubscriptionHandleResponse(resp) + }, + }) +} + +// listBySubscriptionCreateRequest creates the ListBySubscription request. +func (client *WorkspacesClient) listBySubscriptionCreateRequest(ctx context.Context, options *WorkspacesClientListBySubscriptionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces" + 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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listBySubscriptionHandleResponse handles the ListBySubscription response. +func (client *WorkspacesClient) listBySubscriptionHandleResponse(resp *http.Response) (WorkspacesClientListBySubscriptionResponse, error) { + result := WorkspacesClientListBySubscriptionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.WorkspaceListResult); err != nil { + return WorkspacesClientListBySubscriptionResponse{}, err + } + return result, nil +} + +// ListKeys - Lists all the keys associated with this workspace. This includes keys for the storage account, app insights +// and password for container registry +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// options - WorkspacesClientListKeysOptions contains the optional parameters for the WorkspacesClient.ListKeys method. +func (client *WorkspacesClient) ListKeys(ctx context.Context, resourceGroupName string, workspaceName string, options *WorkspacesClientListKeysOptions) (WorkspacesClientListKeysResponse, error) { + req, err := client.listKeysCreateRequest(ctx, resourceGroupName, workspaceName, options) + if err != nil { + return WorkspacesClientListKeysResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WorkspacesClientListKeysResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WorkspacesClientListKeysResponse{}, runtime.NewResponseError(resp) + } + return client.listKeysHandleResponse(resp) +} + +// listKeysCreateRequest creates the ListKeys request. +func (client *WorkspacesClient) listKeysCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *WorkspacesClientListKeysOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-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 *WorkspacesClient) listKeysHandleResponse(resp *http.Response) (WorkspacesClientListKeysResponse, error) { + result := WorkspacesClientListKeysResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ListWorkspaceKeysResult); err != nil { + return WorkspacesClientListKeysResponse{}, err + } + return result, nil +} + +// ListNotebookAccessToken - return notebook access token and refresh token +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// options - WorkspacesClientListNotebookAccessTokenOptions contains the optional parameters for the WorkspacesClient.ListNotebookAccessToken +// method. +func (client *WorkspacesClient) ListNotebookAccessToken(ctx context.Context, resourceGroupName string, workspaceName string, options *WorkspacesClientListNotebookAccessTokenOptions) (WorkspacesClientListNotebookAccessTokenResponse, error) { + req, err := client.listNotebookAccessTokenCreateRequest(ctx, resourceGroupName, workspaceName, options) + if err != nil { + return WorkspacesClientListNotebookAccessTokenResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WorkspacesClientListNotebookAccessTokenResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WorkspacesClientListNotebookAccessTokenResponse{}, runtime.NewResponseError(resp) + } + return client.listNotebookAccessTokenHandleResponse(resp) +} + +// listNotebookAccessTokenCreateRequest creates the ListNotebookAccessToken request. +func (client *WorkspacesClient) listNotebookAccessTokenCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *WorkspacesClientListNotebookAccessTokenOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listNotebookAccessTokenHandleResponse handles the ListNotebookAccessToken response. +func (client *WorkspacesClient) listNotebookAccessTokenHandleResponse(resp *http.Response) (WorkspacesClientListNotebookAccessTokenResponse, error) { + result := WorkspacesClientListNotebookAccessTokenResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NotebookAccessTokenResult); err != nil { + return WorkspacesClientListNotebookAccessTokenResponse{}, err + } + return result, nil +} + +// ListNotebookKeys - List keys of a notebook. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// options - WorkspacesClientListNotebookKeysOptions contains the optional parameters for the WorkspacesClient.ListNotebookKeys +// method. +func (client *WorkspacesClient) ListNotebookKeys(ctx context.Context, resourceGroupName string, workspaceName string, options *WorkspacesClientListNotebookKeysOptions) (WorkspacesClientListNotebookKeysResponse, error) { + req, err := client.listNotebookKeysCreateRequest(ctx, resourceGroupName, workspaceName, options) + if err != nil { + return WorkspacesClientListNotebookKeysResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WorkspacesClientListNotebookKeysResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WorkspacesClientListNotebookKeysResponse{}, runtime.NewResponseError(resp) + } + return client.listNotebookKeysHandleResponse(resp) +} + +// listNotebookKeysCreateRequest creates the ListNotebookKeys request. +func (client *WorkspacesClient) listNotebookKeysCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *WorkspacesClientListNotebookKeysOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listNotebookKeysHandleResponse handles the ListNotebookKeys response. +func (client *WorkspacesClient) listNotebookKeysHandleResponse(resp *http.Response) (WorkspacesClientListNotebookKeysResponse, error) { + result := WorkspacesClientListNotebookKeysResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ListNotebookKeysResult); err != nil { + return WorkspacesClientListNotebookKeysResponse{}, err + } + return result, nil +} + +// ListOutboundNetworkDependenciesEndpoints - Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies +// (FQDNs) programmatically. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// options - WorkspacesClientListOutboundNetworkDependenciesEndpointsOptions contains the optional parameters for the WorkspacesClient.ListOutboundNetworkDependenciesEndpoints +// method. +func (client *WorkspacesClient) ListOutboundNetworkDependenciesEndpoints(ctx context.Context, resourceGroupName string, workspaceName string, options *WorkspacesClientListOutboundNetworkDependenciesEndpointsOptions) (WorkspacesClientListOutboundNetworkDependenciesEndpointsResponse, error) { + req, err := client.listOutboundNetworkDependenciesEndpointsCreateRequest(ctx, resourceGroupName, workspaceName, options) + if err != nil { + return WorkspacesClientListOutboundNetworkDependenciesEndpointsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WorkspacesClientListOutboundNetworkDependenciesEndpointsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WorkspacesClientListOutboundNetworkDependenciesEndpointsResponse{}, runtime.NewResponseError(resp) + } + return client.listOutboundNetworkDependenciesEndpointsHandleResponse(resp) +} + +// listOutboundNetworkDependenciesEndpointsCreateRequest creates the ListOutboundNetworkDependenciesEndpoints request. +func (client *WorkspacesClient) listOutboundNetworkDependenciesEndpointsCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *WorkspacesClientListOutboundNetworkDependenciesEndpointsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listOutboundNetworkDependenciesEndpointsHandleResponse handles the ListOutboundNetworkDependenciesEndpoints response. +func (client *WorkspacesClient) listOutboundNetworkDependenciesEndpointsHandleResponse(resp *http.Response) (WorkspacesClientListOutboundNetworkDependenciesEndpointsResponse, error) { + result := WorkspacesClientListOutboundNetworkDependenciesEndpointsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExternalFQDNResponse); err != nil { + return WorkspacesClientListOutboundNetworkDependenciesEndpointsResponse{}, err + } + return result, nil +} + +// ListStorageAccountKeys - List storage account keys of a workspace. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// options - WorkspacesClientListStorageAccountKeysOptions contains the optional parameters for the WorkspacesClient.ListStorageAccountKeys +// method. +func (client *WorkspacesClient) ListStorageAccountKeys(ctx context.Context, resourceGroupName string, workspaceName string, options *WorkspacesClientListStorageAccountKeysOptions) (WorkspacesClientListStorageAccountKeysResponse, error) { + req, err := client.listStorageAccountKeysCreateRequest(ctx, resourceGroupName, workspaceName, options) + if err != nil { + return WorkspacesClientListStorageAccountKeysResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WorkspacesClientListStorageAccountKeysResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WorkspacesClientListStorageAccountKeysResponse{}, runtime.NewResponseError(resp) + } + return client.listStorageAccountKeysHandleResponse(resp) +} + +// listStorageAccountKeysCreateRequest creates the ListStorageAccountKeys request. +func (client *WorkspacesClient) listStorageAccountKeysCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *WorkspacesClientListStorageAccountKeysOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listStorageAccountKeysHandleResponse handles the ListStorageAccountKeys response. +func (client *WorkspacesClient) listStorageAccountKeysHandleResponse(resp *http.Response) (WorkspacesClientListStorageAccountKeysResponse, error) { + result := WorkspacesClientListStorageAccountKeysResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ListStorageAccountKeysResult); err != nil { + return WorkspacesClientListStorageAccountKeysResponse{}, err + } + return result, nil +} + +// BeginPrepareNotebook - Prepare a notebook. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// options - WorkspacesClientBeginPrepareNotebookOptions contains the optional parameters for the WorkspacesClient.BeginPrepareNotebook +// method. +func (client *WorkspacesClient) BeginPrepareNotebook(ctx context.Context, resourceGroupName string, workspaceName string, options *WorkspacesClientBeginPrepareNotebookOptions) (*runtime.Poller[WorkspacesClientPrepareNotebookResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.prepareNotebook(ctx, resourceGroupName, workspaceName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[WorkspacesClientPrepareNotebookResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[WorkspacesClientPrepareNotebookResponse](options.ResumeToken, client.pl, nil) + } +} + +// PrepareNotebook - Prepare a notebook. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +func (client *WorkspacesClient) prepareNotebook(ctx context.Context, resourceGroupName string, workspaceName string, options *WorkspacesClientBeginPrepareNotebookOptions) (*http.Response, error) { + req, err := client.prepareNotebookCreateRequest(ctx, resourceGroupName, workspaceName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// prepareNotebookCreateRequest creates the PrepareNotebook request. +func (client *WorkspacesClient) prepareNotebookCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *WorkspacesClientBeginPrepareNotebookOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginResyncKeys - Resync all the keys associated with this workspace. This includes keys for the storage account, app insights +// and password for container registry +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// options - WorkspacesClientBeginResyncKeysOptions contains the optional parameters for the WorkspacesClient.BeginResyncKeys +// method. +func (client *WorkspacesClient) BeginResyncKeys(ctx context.Context, resourceGroupName string, workspaceName string, options *WorkspacesClientBeginResyncKeysOptions) (*runtime.Poller[WorkspacesClientResyncKeysResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.resyncKeys(ctx, resourceGroupName, workspaceName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[WorkspacesClientResyncKeysResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[WorkspacesClientResyncKeysResponse](options.ResumeToken, client.pl, nil) + } +} + +// ResyncKeys - Resync all the keys associated with this workspace. This includes keys for the storage account, app insights +// and password for container registry +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +func (client *WorkspacesClient) resyncKeys(ctx context.Context, resourceGroupName string, workspaceName string, options *WorkspacesClientBeginResyncKeysOptions) (*http.Response, error) { + req, err := client.resyncKeysCreateRequest(ctx, resourceGroupName, workspaceName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// resyncKeysCreateRequest creates the ResyncKeys request. +func (client *WorkspacesClient) resyncKeysCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *WorkspacesClientBeginResyncKeysOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginUpdate - Updates a machine learning workspace with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - Name of Azure Machine Learning workspace. +// parameters - The parameters for updating a machine learning workspace. +// options - WorkspacesClientBeginUpdateOptions contains the optional parameters for the WorkspacesClient.BeginUpdate method. +func (client *WorkspacesClient) BeginUpdate(ctx context.Context, resourceGroupName string, workspaceName string, parameters WorkspaceUpdateParameters, options *WorkspacesClientBeginUpdateOptions) (*runtime.Poller[WorkspacesClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, workspaceName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[WorkspacesClientUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[WorkspacesClientUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// Update - Updates a machine learning workspace with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01 +func (client *WorkspacesClient) update(ctx context.Context, resourceGroupName string, workspaceName string, parameters WorkspaceUpdateParameters, options *WorkspacesClientBeginUpdateOptions) (*http.Response, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, workspaceName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateCreateRequest creates the Update request. +func (client *WorkspacesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, parameters WorkspaceUpdateParameters, options *WorkspacesClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +}