From a2146800d28d83b32bdab3d554b08b8354e63180 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Tue, 14 Jul 2020 06:33:13 +0000 Subject: [PATCH] Generated from 896296e93caa4a97287fb724d01418e86088263d set x-ms-azure-resource --- .../machinelearningservices/client.go | 1 - .../machinelearningcompute.go | 7 ---- .../machinelearningservicesapi/interfaces.go | 2 +- .../machinelearningservices/models.go | 23 ++++++++++++ .../machinelearningservices/operations.go | 1 - .../machinelearningservices/quotas.go | 2 -- .../machinelearningservices/usages.go | 1 - .../machinelearningservices/version.go | 2 +- .../virtualmachinesizes.go | 1 - .../workspacefeatures.go | 1 - .../machinelearningservices/workspaces.go | 36 ++++++++----------- 11 files changed, 39 insertions(+), 38 deletions(-) diff --git a/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/client.go b/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/client.go index 340e934c8e21..9bc865ff76c2 100644 --- a/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/client.go +++ b/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/client.go @@ -119,7 +119,6 @@ func (client BaseClient) ListSkusSender(req *http.Request) (*http.Response, erro func (client BaseClient) ListSkusResponder(resp *http.Response) (result SkuListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/machinelearningcompute.go b/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/machinelearningcompute.go index 16e2b5ae6cff..1c64a8d679d3 100644 --- a/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/machinelearningcompute.go +++ b/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/machinelearningcompute.go @@ -117,7 +117,6 @@ func (client MachineLearningComputeClient) CreateOrUpdateSender(req *http.Reques func (client MachineLearningComputeClient) CreateOrUpdateResponder(resp *http.Response) (result ComputeResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -198,7 +197,6 @@ func (client MachineLearningComputeClient) DeleteSender(req *http.Request) (futu func (client MachineLearningComputeClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -276,7 +274,6 @@ func (client MachineLearningComputeClient) GetSender(req *http.Request) (*http.R func (client MachineLearningComputeClient) GetResponder(resp *http.Response) (result ComputeResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -357,7 +354,6 @@ func (client MachineLearningComputeClient) ListByWorkspaceSender(req *http.Reque func (client MachineLearningComputeClient) ListByWorkspaceResponder(resp *http.Response) (result PaginatedComputeResourcesList, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -472,7 +468,6 @@ func (client MachineLearningComputeClient) ListKeysSender(req *http.Request) (*h func (client MachineLearningComputeClient) ListKeysResponder(resp *http.Response) (result ComputeSecretsModel, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -550,7 +545,6 @@ func (client MachineLearningComputeClient) ListNodesSender(req *http.Request) (* func (client MachineLearningComputeClient) ListNodesResponder(resp *http.Response) (result AmlComputeNodesInformation, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -632,7 +626,6 @@ func (client MachineLearningComputeClient) UpdateSender(req *http.Request) (futu func (client MachineLearningComputeClient) UpdateResponder(resp *http.Response) (result ComputeResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/machinelearningservicesapi/interfaces.go b/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/machinelearningservicesapi/interfaces.go index ebf4fe6ced3e..6c73228799da 100644 --- a/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/machinelearningservicesapi/interfaces.go +++ b/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/machinelearningservicesapi/interfaces.go @@ -41,7 +41,7 @@ var _ OperationsClientAPI = (*machinelearningservices.OperationsClient)(nil) // WorkspacesClientAPI contains the set of methods on the WorkspacesClient type. type WorkspacesClientAPI interface { CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, parameters machinelearningservices.Workspace) (result machinelearningservices.WorkspacesCreateOrUpdateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, workspaceName string) (result autorest.Response, err error) + Delete(ctx context.Context, resourceGroupName string, workspaceName string) (result machinelearningservices.WorkspacesDeleteFuture, err error) Get(ctx context.Context, resourceGroupName string, workspaceName string) (result machinelearningservices.Workspace, err error) ListByResourceGroup(ctx context.Context, resourceGroupName string, skiptoken string) (result machinelearningservices.WorkspaceListResultPage, err error) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, skiptoken string) (result machinelearningservices.WorkspaceListResultIterator, err error) diff --git a/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/models.go b/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/models.go index 8c7b987c9756..fa0b9255bbfc 100644 --- a/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/models.go +++ b/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/models.go @@ -3293,6 +3293,29 @@ func (future *WorkspacesCreateOrUpdateFuture) Result(client WorkspacesClient) (w return } +// WorkspacesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type WorkspacesDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *WorkspacesDeleteFuture) Result(client WorkspacesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("machinelearningservices.WorkspacesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + // WorkspaceSku describes Workspace Sku details and features type WorkspaceSku struct { // Locations - READ-ONLY; The set of locations that the SKU is available. This will be supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). diff --git a/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/operations.go b/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/operations.go index d7267ad77249..2fb092413b5b 100644 --- a/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/operations.go +++ b/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/operations.go @@ -100,7 +100,6 @@ func (client OperationsClient) ListSender(req *http.Request) (*http.Response, er func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/quotas.go b/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/quotas.go index c252e994d53d..a091e9b08eb6 100644 --- a/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/quotas.go +++ b/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/quotas.go @@ -115,7 +115,6 @@ func (client QuotasClient) ListSender(req *http.Request) (*http.Response, error) func (client QuotasClient) ListResponder(resp *http.Response) (result ListWorkspaceQuotas, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -235,7 +234,6 @@ func (client QuotasClient) UpdateSender(req *http.Request) (*http.Response, erro func (client QuotasClient) UpdateResponder(resp *http.Response) (result UpdateWorkspaceQuotasResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/usages.go b/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/usages.go index 700f1bf51562..201195f589e0 100644 --- a/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/usages.go +++ b/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/usages.go @@ -115,7 +115,6 @@ func (client UsagesClient) ListSender(req *http.Request) (*http.Response, error) func (client UsagesClient) ListResponder(resp *http.Response) (result ListUsagesResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/version.go b/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/version.go index ac06eadc9b76..579bbcc0df54 100644 --- a/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/version.go +++ b/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/version.go @@ -21,7 +21,7 @@ import "github.com/Azure/azure-sdk-for-go/version" // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/" + version.Number + " machinelearningservices/2019-11-01" + return "Azure-SDK-For-Go/" + Version() + " machinelearningservices/2019-11-01" } // Version returns the semantic version (see http://semver.org) of the client. diff --git a/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/virtualmachinesizes.go b/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/virtualmachinesizes.go index e3251b2d928b..932be05fa2d1 100644 --- a/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/virtualmachinesizes.go +++ b/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/virtualmachinesizes.go @@ -116,7 +116,6 @@ func (client VirtualMachineSizesClient) ListSender(req *http.Request) (*http.Res func (client VirtualMachineSizesClient) ListResponder(resp *http.Response) (result VirtualMachineSizeListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/workspacefeatures.go b/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/workspacefeatures.go index a23e065ef4c2..0e05c2e40a21 100644 --- a/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/workspacefeatures.go +++ b/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/workspacefeatures.go @@ -111,7 +111,6 @@ func (client WorkspaceFeaturesClient) ListSender(req *http.Request) (*http.Respo func (client WorkspaceFeaturesClient) ListResponder(resp *http.Response) (result ListAmlUserFeatureResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/workspaces.go b/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/workspaces.go index 31818dac6356..22e74bdcd0b9 100644 --- a/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/workspaces.go +++ b/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/workspaces.go @@ -112,7 +112,6 @@ func (client WorkspacesClient) CreateOrUpdateSender(req *http.Request) (future W func (client WorkspacesClient) CreateOrUpdateResponder(resp *http.Response) (result Workspace, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -124,13 +123,13 @@ func (client WorkspacesClient) CreateOrUpdateResponder(resp *http.Response) (res // Parameters: // resourceGroupName - name of the resource group in which workspace is located. // workspaceName - name of Azure Machine Learning workspace. -func (client WorkspacesClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string) (result autorest.Response, err error) { +func (client WorkspacesClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string) (result WorkspacesDeleteFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.Delete") defer func() { sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode + if result.Response() != nil { + sc = result.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -141,18 +140,12 @@ func (client WorkspacesClient) Delete(ctx context.Context, resourceGroupName str return } - resp, err := client.DeleteSender(req) + result, err = client.DeleteSender(req) if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "Delete", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "Delete", result.Response(), "Failure sending request") return } - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "Delete", resp, "Failure responding to request") - } - return } @@ -179,8 +172,14 @@ func (client WorkspacesClient) DeletePreparer(ctx context.Context, resourceGroup // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. -func (client WorkspacesClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +func (client WorkspacesClient) DeleteSender(req *http.Request) (future WorkspacesDeleteFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return } // DeleteResponder handles the response to the Delete request. The method always @@ -188,8 +187,7 @@ func (client WorkspacesClient) DeleteSender(req *http.Request) (*http.Response, func (client WorkspacesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp return @@ -263,7 +261,6 @@ func (client WorkspacesClient) GetSender(req *http.Request) (*http.Response, err func (client WorkspacesClient) GetResponder(resp *http.Response) (result Workspace, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -342,7 +339,6 @@ func (client WorkspacesClient) ListByResourceGroupSender(req *http.Request) (*ht func (client WorkspacesClient) ListByResourceGroupResponder(resp *http.Response) (result WorkspaceListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -456,7 +452,6 @@ func (client WorkspacesClient) ListBySubscriptionSender(req *http.Request) (*htt func (client WorkspacesClient) ListBySubscriptionResponder(resp *http.Response) (result WorkspaceListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -570,7 +565,6 @@ func (client WorkspacesClient) ListKeysSender(req *http.Request) (*http.Response func (client WorkspacesClient) ListKeysResponder(resp *http.Response) (result ListWorkspaceKeysResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -647,7 +641,6 @@ func (client WorkspacesClient) ResyncKeysSender(req *http.Request) (*http.Respon func (client WorkspacesClient) ResyncKeysResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByClosing()) result.Response = resp @@ -725,7 +718,6 @@ func (client WorkspacesClient) UpdateSender(req *http.Request) (*http.Response, func (client WorkspacesClient) UpdateResponder(resp *http.Response) (result Workspace, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing())