diff --git a/profiles/preview/preview/healthcareapis/mgmt/healthcareapis/healthcareapisapi/models.go b/profiles/preview/preview/healthcareapis/mgmt/healthcareapis/healthcareapisapi/models.go index 9a896de44e9f..b9470eb0791c 100644 --- a/profiles/preview/preview/healthcareapis/mgmt/healthcareapis/healthcareapisapi/models.go +++ b/profiles/preview/preview/healthcareapis/mgmt/healthcareapis/healthcareapisapi/models.go @@ -21,7 +21,6 @@ package healthcareapisapi import original "github.com/Azure/azure-sdk-for-go/services/preview/healthcareapis/mgmt/2018-08-20-preview/healthcareapis/healthcareapisapi" -type MoveResourcesStatusClientAPI = original.MoveResourcesStatusClientAPI type OperationResultsClientAPI = original.OperationResultsClientAPI type OperationsClientAPI = original.OperationsClientAPI type ServicesClientAPI = original.ServicesClientAPI diff --git a/profiles/preview/preview/healthcareapis/mgmt/healthcareapis/models.go b/profiles/preview/preview/healthcareapis/mgmt/healthcareapis/models.go index d0a871895a8e..40e3bc255a2f 100644 --- a/profiles/preview/preview/healthcareapis/mgmt/healthcareapis/models.go +++ b/profiles/preview/preview/healthcareapis/mgmt/healthcareapis/models.go @@ -23,7 +23,6 @@ import ( "context" original "github.com/Azure/azure-sdk-for-go/services/preview/healthcareapis/mgmt/2018-08-20-preview/healthcareapis" - uuid "github.com/satori/go.uuid" ) const ( @@ -65,8 +64,6 @@ type BaseClient = original.BaseClient type CheckNameAvailabilityParameters = original.CheckNameAvailabilityParameters type ErrorDetails = original.ErrorDetails type ErrorDetailsInternal = original.ErrorDetailsInternal -type MoveResourcesParameters = original.MoveResourcesParameters -type MoveResourcesStatusClient = original.MoveResourcesStatusClient type Operation = original.Operation type OperationDisplay = original.OperationDisplay type OperationListResult = original.OperationListResult @@ -77,6 +74,8 @@ type OperationResultsDescription = original.OperationResultsDescription type OperationsClient = original.OperationsClient type Resource = original.Resource type ServiceAccessPolicyEntry = original.ServiceAccessPolicyEntry +type ServiceAuthenticationConfigurationInfo = original.ServiceAuthenticationConfigurationInfo +type ServiceCorsConfigurationInfo = original.ServiceCorsConfigurationInfo type ServiceCosmosDbConfigurationInfo = original.ServiceCosmosDbConfigurationInfo type ServicesClient = original.ServicesClient type ServicesCreateOrUpdateFuture = original.ServicesCreateOrUpdateFuture @@ -91,37 +90,31 @@ type ServicesProperties = original.ServicesProperties type ServicesUpdateFuture = original.ServicesUpdateFuture type SetObject = original.SetObject -func New(subscriptionID uuid.UUID) BaseClient { +func New(subscriptionID string) BaseClient { return original.New(subscriptionID) } -func NewMoveResourcesStatusClient(subscriptionID uuid.UUID) MoveResourcesStatusClient { - return original.NewMoveResourcesStatusClient(subscriptionID) -} -func NewMoveResourcesStatusClientWithBaseURI(baseURI string, subscriptionID uuid.UUID) MoveResourcesStatusClient { - return original.NewMoveResourcesStatusClientWithBaseURI(baseURI, subscriptionID) -} func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { return original.NewOperationListResultIterator(page) } func NewOperationListResultPage(getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { return original.NewOperationListResultPage(getNextPage) } -func NewOperationResultsClient(subscriptionID uuid.UUID) OperationResultsClient { +func NewOperationResultsClient(subscriptionID string) OperationResultsClient { return original.NewOperationResultsClient(subscriptionID) } -func NewOperationResultsClientWithBaseURI(baseURI string, subscriptionID uuid.UUID) OperationResultsClient { +func NewOperationResultsClientWithBaseURI(baseURI string, subscriptionID string) OperationResultsClient { return original.NewOperationResultsClientWithBaseURI(baseURI, subscriptionID) } -func NewOperationsClient(subscriptionID uuid.UUID) OperationsClient { +func NewOperationsClient(subscriptionID string) OperationsClient { return original.NewOperationsClient(subscriptionID) } -func NewOperationsClientWithBaseURI(baseURI string, subscriptionID uuid.UUID) OperationsClient { +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) } -func NewServicesClient(subscriptionID uuid.UUID) ServicesClient { +func NewServicesClient(subscriptionID string) ServicesClient { return original.NewServicesClient(subscriptionID) } -func NewServicesClientWithBaseURI(baseURI string, subscriptionID uuid.UUID) ServicesClient { +func NewServicesClientWithBaseURI(baseURI string, subscriptionID string) ServicesClient { return original.NewServicesClientWithBaseURI(baseURI, subscriptionID) } func NewServicesDescriptionListResultIterator(page ServicesDescriptionListResultPage) ServicesDescriptionListResultIterator { @@ -130,7 +123,7 @@ func NewServicesDescriptionListResultIterator(page ServicesDescriptionListResult func NewServicesDescriptionListResultPage(getNextPage func(context.Context, ServicesDescriptionListResult) (ServicesDescriptionListResult, error)) ServicesDescriptionListResultPage { return original.NewServicesDescriptionListResultPage(getNextPage) } -func NewWithBaseURI(baseURI string, subscriptionID uuid.UUID) BaseClient { +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { return original.NewWithBaseURI(baseURI, subscriptionID) } func PossibleOperationResultStatusValues() []OperationResultStatus { diff --git a/services/preview/healthcareapis/mgmt/2018-08-20-preview/healthcareapis/client.go b/services/preview/healthcareapis/mgmt/2018-08-20-preview/healthcareapis/client.go index 76479cb1280e..93457d7f2c43 100644 --- a/services/preview/healthcareapis/mgmt/2018-08-20-preview/healthcareapis/client.go +++ b/services/preview/healthcareapis/mgmt/2018-08-20-preview/healthcareapis/client.go @@ -22,7 +22,6 @@ package healthcareapis import ( "github.com/Azure/go-autorest/autorest" - "github.com/satori/go.uuid" ) const ( @@ -34,16 +33,16 @@ const ( type BaseClient struct { autorest.Client BaseURI string - SubscriptionID uuid.UUID + SubscriptionID string } // New creates an instance of the BaseClient client. -func New(subscriptionID uuid.UUID) BaseClient { +func New(subscriptionID string) BaseClient { return NewWithBaseURI(DefaultBaseURI, subscriptionID) } // NewWithBaseURI creates an instance of the BaseClient client. -func NewWithBaseURI(baseURI string, subscriptionID uuid.UUID) BaseClient { +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { return BaseClient{ Client: autorest.NewClientWithUserAgent(UserAgent()), BaseURI: baseURI, diff --git a/services/preview/healthcareapis/mgmt/2018-08-20-preview/healthcareapis/healthcareapisapi/interfaces.go b/services/preview/healthcareapis/mgmt/2018-08-20-preview/healthcareapis/healthcareapisapi/interfaces.go index 8dd1ae2d1249..c601f369754c 100644 --- a/services/preview/healthcareapis/mgmt/2018-08-20-preview/healthcareapis/healthcareapisapi/interfaces.go +++ b/services/preview/healthcareapis/mgmt/2018-08-20-preview/healthcareapis/healthcareapisapi/interfaces.go @@ -20,7 +20,6 @@ package healthcareapisapi import ( "context" "github.com/Azure/azure-sdk-for-go/services/preview/healthcareapis/mgmt/2018-08-20-preview/healthcareapis" - "github.com/Azure/go-autorest/autorest" ) // ServicesClientAPI contains the set of methods on the ServicesClient type. @@ -31,7 +30,6 @@ type ServicesClientAPI interface { Get(ctx context.Context, resourceGroupName string, resourceName string) (result healthcareapis.ServicesDescription, err error) List(ctx context.Context) (result healthcareapis.ServicesDescriptionListResultPage, err error) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result healthcareapis.ServicesDescriptionListResultPage, err error) - MoveResources(ctx context.Context, resourceGroupName string, moveResourcesInputs healthcareapis.MoveResourcesParameters) (result autorest.Response, err error) Update(ctx context.Context, resourceGroupName string, resourceName string, servicePatchDescription healthcareapis.ServicesPatchDescription) (result healthcareapis.ServicesUpdateFuture, err error) } @@ -50,10 +48,3 @@ type OperationResultsClientAPI interface { } var _ OperationResultsClientAPI = (*healthcareapis.OperationResultsClient)(nil) - -// MoveResourcesStatusClientAPI contains the set of methods on the MoveResourcesStatusClient type. -type MoveResourcesStatusClientAPI interface { - Get(ctx context.Context, locationName string, operationResultID string) (result healthcareapis.SetObject, err error) -} - -var _ MoveResourcesStatusClientAPI = (*healthcareapis.MoveResourcesStatusClient)(nil) diff --git a/services/preview/healthcareapis/mgmt/2018-08-20-preview/healthcareapis/models.go b/services/preview/healthcareapis/mgmt/2018-08-20-preview/healthcareapis/models.go index ceb84d7df997..e5eb52d1bcbf 100644 --- a/services/preview/healthcareapis/mgmt/2018-08-20-preview/healthcareapis/models.go +++ b/services/preview/healthcareapis/mgmt/2018-08-20-preview/healthcareapis/models.go @@ -119,16 +119,6 @@ type ErrorDetailsInternal struct { Target *string `json:"target,omitempty"` } -// MoveResourcesParameters input values. -type MoveResourcesParameters struct { - // TargetSubscriptionID - The target subscription to move resources to. - TargetSubscriptionID *string `json:"targetSubscriptionId,omitempty"` - // TargetResourceGroupName - The target resource group to move resources to. - TargetResourceGroupName *string `json:"targetResourceGroupName,omitempty"` - // ResourceIdsToMove - The list of resources to move. - ResourceIdsToMove *[]string `json:"resourceIdsToMove,omitempty"` -} - // Operation service REST API operation. type Operation struct { // Name - READ-ONLY; Operation name: {provider}/{resource}/{read | write | action | delete} @@ -354,6 +344,30 @@ type ServiceAccessPolicyEntry struct { ObjectID *string `json:"objectId,omitempty"` } +// ServiceAuthenticationConfigurationInfo authentication configuration information +type ServiceAuthenticationConfigurationInfo struct { + // Authority - The authority url for the service + Authority *string `json:"authority,omitempty"` + // Audience - The audience url for the service + Audience *string `json:"audience,omitempty"` + // SmartProxyEnabled - If the SMART on FHIR proxy is enabled + SmartProxyEnabled *bool `json:"smartProxyEnabled,omitempty"` +} + +// ServiceCorsConfigurationInfo the settings for the CORS configuration of the service instance. +type ServiceCorsConfigurationInfo struct { + // Origins - The origins to be allowed via CORS. + Origins *[]string `json:"origins,omitempty"` + // Headers - The headers to be allowed via CORS. + Headers *[]string `json:"headers,omitempty"` + // Methods - The methods to be allowed via CORS. + Methods *[]string `json:"methods,omitempty"` + // MaxAge - The max age to be allowed via CORS. + MaxAge *int32 `json:"maxAge,omitempty"` + // AllowCredentials - If credentials are allowed via CORS. + AllowCredentials *bool `json:"allowCredentials,omitempty"` +} + // ServiceCosmosDbConfigurationInfo the settings for the Cosmos DB database backing the service. type ServiceCosmosDbConfigurationInfo struct { // OfferThroughput - The provisioned throughput for the backing database. @@ -635,6 +649,10 @@ type ServicesProperties struct { AccessPolicies *[]ServiceAccessPolicyEntry `json:"accessPolicies,omitempty"` // CosmosDbConfiguration - The settings for the Cosmos DB database backing the service. CosmosDbConfiguration *ServiceCosmosDbConfigurationInfo `json:"cosmosDbConfiguration,omitempty"` + // AuthenticationConfiguration - The authentication configuration for the service instance. + AuthenticationConfiguration *ServiceAuthenticationConfigurationInfo `json:"authenticationConfiguration,omitempty"` + // CorsConfiguration - The settings for the CORS configuration of the service instance. + CorsConfiguration *ServiceCorsConfigurationInfo `json:"corsConfiguration,omitempty"` } // ServicesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running diff --git a/services/preview/healthcareapis/mgmt/2018-08-20-preview/healthcareapis/moveresourcesstatus.go b/services/preview/healthcareapis/mgmt/2018-08-20-preview/healthcareapis/moveresourcesstatus.go deleted file mode 100644 index 4e289b8262be..000000000000 --- a/services/preview/healthcareapis/mgmt/2018-08-20-preview/healthcareapis/moveresourcesstatus.go +++ /dev/null @@ -1,119 +0,0 @@ -package healthcareapis - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "github.com/satori/go.uuid" - "net/http" -) - -// MoveResourcesStatusClient is the azure Healthcare APIs Client -type MoveResourcesStatusClient struct { - BaseClient -} - -// NewMoveResourcesStatusClient creates an instance of the MoveResourcesStatusClient client. -func NewMoveResourcesStatusClient(subscriptionID uuid.UUID) MoveResourcesStatusClient { - return NewMoveResourcesStatusClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewMoveResourcesStatusClientWithBaseURI creates an instance of the MoveResourcesStatusClient client. -func NewMoveResourcesStatusClientWithBaseURI(baseURI string, subscriptionID uuid.UUID) MoveResourcesStatusClient { - return MoveResourcesStatusClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get get the operation result for a long running move operation. -// Parameters: -// locationName - the location of the operation. -// operationResultID - the ID of the operation result to get. -func (client MoveResourcesStatusClient) Get(ctx context.Context, locationName string, operationResultID string) (result SetObject, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/MoveResourcesStatusClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, locationName, operationResultID) - if err != nil { - err = autorest.NewErrorWithError(err, "healthcareapis.MoveResourcesStatusClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "healthcareapis.MoveResourcesStatusClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "healthcareapis.MoveResourcesStatusClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client MoveResourcesStatusClient) GetPreparer(ctx context.Context, locationName string, operationResultID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "locationName": autorest.Encode("path", locationName), - "operationResultId": autorest.Encode("path", operationResultID), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-08-20-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/locations/{locationName}/moveResourcesStatus/{operationResultId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client MoveResourcesStatusClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client MoveResourcesStatusClient) GetResponder(resp *http.Response) (result SetObject, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/services/preview/healthcareapis/mgmt/2018-08-20-preview/healthcareapis/operationresults.go b/services/preview/healthcareapis/mgmt/2018-08-20-preview/healthcareapis/operationresults.go index 8b34cc78c0c8..39e1032658cb 100644 --- a/services/preview/healthcareapis/mgmt/2018-08-20-preview/healthcareapis/operationresults.go +++ b/services/preview/healthcareapis/mgmt/2018-08-20-preview/healthcareapis/operationresults.go @@ -22,7 +22,6 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/tracing" - "github.com/satori/go.uuid" "net/http" ) @@ -32,12 +31,12 @@ type OperationResultsClient struct { } // NewOperationResultsClient creates an instance of the OperationResultsClient client. -func NewOperationResultsClient(subscriptionID uuid.UUID) OperationResultsClient { +func NewOperationResultsClient(subscriptionID string) OperationResultsClient { return NewOperationResultsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewOperationResultsClientWithBaseURI creates an instance of the OperationResultsClient client. -func NewOperationResultsClientWithBaseURI(baseURI string, subscriptionID uuid.UUID) OperationResultsClient { +func NewOperationResultsClientWithBaseURI(baseURI string, subscriptionID string) OperationResultsClient { return OperationResultsClient{NewWithBaseURI(baseURI, subscriptionID)} } diff --git a/services/preview/healthcareapis/mgmt/2018-08-20-preview/healthcareapis/operations.go b/services/preview/healthcareapis/mgmt/2018-08-20-preview/healthcareapis/operations.go index bee4c4fce6e9..e8a3a557d901 100644 --- a/services/preview/healthcareapis/mgmt/2018-08-20-preview/healthcareapis/operations.go +++ b/services/preview/healthcareapis/mgmt/2018-08-20-preview/healthcareapis/operations.go @@ -22,7 +22,6 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/tracing" - "github.com/satori/go.uuid" "net/http" ) @@ -32,12 +31,12 @@ type OperationsClient struct { } // NewOperationsClient creates an instance of the OperationsClient client. -func NewOperationsClient(subscriptionID uuid.UUID) OperationsClient { +func NewOperationsClient(subscriptionID string) OperationsClient { return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewOperationsClientWithBaseURI creates an instance of the OperationsClient client. -func NewOperationsClientWithBaseURI(baseURI string, subscriptionID uuid.UUID) OperationsClient { +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} } diff --git a/services/preview/healthcareapis/mgmt/2018-08-20-preview/healthcareapis/services.go b/services/preview/healthcareapis/mgmt/2018-08-20-preview/healthcareapis/services.go index d0a6bd18dbe4..09836cb7acda 100644 --- a/services/preview/healthcareapis/mgmt/2018-08-20-preview/healthcareapis/services.go +++ b/services/preview/healthcareapis/mgmt/2018-08-20-preview/healthcareapis/services.go @@ -23,7 +23,6 @@ import ( "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/validation" "github.com/Azure/go-autorest/tracing" - "github.com/satori/go.uuid" "net/http" ) @@ -33,12 +32,12 @@ type ServicesClient struct { } // NewServicesClient creates an instance of the ServicesClient client. -func NewServicesClient(subscriptionID uuid.UUID) ServicesClient { +func NewServicesClient(subscriptionID string) ServicesClient { return NewServicesClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewServicesClientWithBaseURI creates an instance of the ServicesClient client. -func NewServicesClientWithBaseURI(baseURI string, subscriptionID uuid.UUID) ServicesClient { +func NewServicesClientWithBaseURI(baseURI string, subscriptionID string) ServicesClient { return ServicesClient{NewWithBaseURI(baseURI, subscriptionID)} } @@ -152,7 +151,20 @@ func (client ServicesClient) CreateOrUpdate(ctx context.Context, resourceGroupNa {Target: "resourceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, {TargetValue: serviceDescription, Constraints: []validation.Constraint{{Target: "serviceDescription.Properties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "serviceDescription.Properties.AccessPolicies", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + Chain: []validation.Constraint{{Target: "serviceDescription.Properties.AccessPolicies", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "serviceDescription.Properties.CosmosDbConfiguration", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "serviceDescription.Properties.CosmosDbConfiguration.OfferThroughput", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "serviceDescription.Properties.CosmosDbConfiguration.OfferThroughput", Name: validation.InclusiveMaximum, Rule: int64(10000), Chain: nil}, + {Target: "serviceDescription.Properties.CosmosDbConfiguration.OfferThroughput", Name: validation.InclusiveMinimum, Rule: 400, Chain: nil}, + }}, + }}, + {Target: "serviceDescription.Properties.CorsConfiguration", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "serviceDescription.Properties.CorsConfiguration.MaxAge", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "serviceDescription.Properties.CorsConfiguration.MaxAge", Name: validation.InclusiveMaximum, Rule: int64(99999), Chain: nil}, + {Target: "serviceDescription.Properties.CorsConfiguration.MaxAge", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, + }}, + }}, + }}}}}); err != nil { return result, validation.NewError("healthcareapis.ServicesClient", "CreateOrUpdate", err.Error()) } @@ -626,98 +638,6 @@ func (client ServicesClient) ListByResourceGroupComplete(ctx context.Context, re return } -// MoveResources moves resources to another subscription and/or resource group. -// Parameters: -// resourceGroupName - the name of the resource group that contains the service instance. -// moveResourcesInputs - set the move resource structure to the name of the service instance to check. -func (client ServicesClient) MoveResources(ctx context.Context, resourceGroupName string, moveResourcesInputs MoveResourcesParameters) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.MoveResources") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: moveResourcesInputs, - Constraints: []validation.Constraint{{Target: "moveResourcesInputs.TargetSubscriptionID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "moveResourcesInputs.TargetResourceGroupName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "moveResourcesInputs.ResourceIdsToMove", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "moveResourcesInputs.ResourceIdsToMove", Name: validation.MaxItems, Rule: 250, Chain: nil}, - {Target: "moveResourcesInputs.ResourceIdsToMove", Name: validation.MinItems, Rule: 1, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("healthcareapis.ServicesClient", "MoveResources", err.Error()) - } - - req, err := client.MoveResourcesPreparer(ctx, resourceGroupName, moveResourcesInputs) - if err != nil { - err = autorest.NewErrorWithError(err, "healthcareapis.ServicesClient", "MoveResources", nil, "Failure preparing request") - return - } - - resp, err := client.MoveResourcesSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "healthcareapis.ServicesClient", "MoveResources", resp, "Failure sending request") - return - } - - result, err = client.MoveResourcesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "healthcareapis.ServicesClient", "MoveResources", resp, "Failure responding to request") - } - - return -} - -// MoveResourcesPreparer prepares the MoveResources request. -func (client ServicesClient) MoveResourcesPreparer(ctx context.Context, resourceGroupName string, moveResourcesInputs MoveResourcesParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-08-20-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/moveResources", pathParameters), - autorest.WithJSON(moveResourcesInputs), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// MoveResourcesSender sends the MoveResources request. The method will close the -// http.Response Body if it receives an error. -func (client ServicesClient) MoveResourcesSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// MoveResourcesResponder handles the response to the MoveResources request. The method always -// closes the http.Response Body. -func (client ServicesClient) MoveResourcesResponder(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 - return -} - // Update update the metadata of a service instance. // Parameters: // resourceGroupName - the name of the resource group that contains the service instance.