diff --git a/services/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/client.go b/services/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/client.go index 3eed0373ff72..ada29ca11509 100644 --- a/services/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/client.go +++ b/services/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/client.go @@ -22,7 +22,6 @@ package digitaltwins import ( "github.com/Azure/go-autorest/autorest" - "github.com/satori/go.uuid" ) const ( @@ -34,17 +33,17 @@ 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 using a custom endpoint. Use this when interacting with // an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -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/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/digitaltwins.go b/services/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/digitaltwins.go index a1921ee7d249..29857cc5c446 100644 --- a/services/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/digitaltwins.go +++ b/services/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/digitaltwins.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,13 +32,13 @@ type Client struct { } // NewClient creates an instance of the Client client. -func NewClient(subscriptionID uuid.UUID) Client { +func NewClient(subscriptionID string) Client { return NewClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewClientWithBaseURI creates an instance of the Client client using a custom endpoint. Use this when interacting // with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewClientWithBaseURI(baseURI string, subscriptionID uuid.UUID) Client { +func NewClientWithBaseURI(baseURI string, subscriptionID string) Client { return Client{NewWithBaseURI(baseURI, subscriptionID)} } @@ -122,7 +121,6 @@ func (client Client) CheckNameAvailabilitySender(req *http.Request) (*http.Respo func (client Client) CheckNameAvailabilityResponder(resp *http.Response) (result CheckNameResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -213,7 +211,6 @@ func (client Client) CreateOrUpdateSender(req *http.Request) (future CreateOrUpd func (client Client) CreateOrUpdateResponder(resp *http.Response) (result Description, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -299,7 +296,6 @@ func (client Client) DeleteSender(req *http.Request) (future DeleteFuture, err e func (client Client) DeleteResponder(resp *http.Response) (result Description, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -385,7 +381,6 @@ func (client Client) GetSender(req *http.Request) (*http.Response, error) { func (client Client) GetResponder(resp *http.Response) (result Description, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -457,7 +452,6 @@ func (client Client) ListSender(req *http.Request) (*http.Response, error) { func (client Client) ListResponder(resp *http.Response) (result DescriptionListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -576,7 +570,6 @@ func (client Client) ListByResourceGroupSender(req *http.Request) (*http.Respons func (client Client) ListByResourceGroupResponder(resp *http.Response) (result DescriptionListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -702,7 +695,6 @@ func (client Client) UpdateSender(req *http.Request) (future UpdateFuture, err e func (client Client) UpdateResponder(resp *http.Response) (result Description, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/digitaltwinsapi/interfaces.go b/services/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/digitaltwinsapi/interfaces.go index 6206795991a2..680cbef794e5 100644 --- a/services/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/digitaltwinsapi/interfaces.go +++ b/services/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/digitaltwinsapi/interfaces.go @@ -48,23 +48,6 @@ type EndpointClientAPI interface { var _ EndpointClientAPI = (*digitaltwins.EndpointClient)(nil) -// IoTHubClientAPI contains the set of methods on the IoTHubClient type. -type IoTHubClientAPI interface { - CreateOrUpdate(ctx context.Context, scope string, integrationResourceName string, iotHubDescription digitaltwins.IntegrationResource) (result digitaltwins.IntegrationResource, err error) - Delete(ctx context.Context, scope string, integrationResourceName string) (result digitaltwins.IoTHubDeleteFuture, err error) - Get(ctx context.Context, scope string, integrationResourceName string) (result digitaltwins.IntegrationResource, err error) -} - -var _ IoTHubClientAPI = (*digitaltwins.IoTHubClient)(nil) - -// IoTHubsClientAPI contains the set of methods on the IoTHubsClient type. -type IoTHubsClientAPI interface { - List(ctx context.Context, resourceGroupName string, resourceName string) (result digitaltwins.IntegrationResourceListResultPage, err error) - ListComplete(ctx context.Context, resourceGroupName string, resourceName string) (result digitaltwins.IntegrationResourceListResultIterator, err error) -} - -var _ IoTHubsClientAPI = (*digitaltwins.IoTHubsClient)(nil) - // OperationsClientAPI contains the set of methods on the OperationsClient type. type OperationsClientAPI interface { List(ctx context.Context) (result digitaltwins.OperationListResultPage, err error) diff --git a/services/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/endpoint.go b/services/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/endpoint.go index 966778a90136..03fe788cde3b 100644 --- a/services/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/endpoint.go +++ b/services/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/endpoint.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,13 +32,13 @@ type EndpointClient struct { } // NewEndpointClient creates an instance of the EndpointClient client. -func NewEndpointClient(subscriptionID uuid.UUID) EndpointClient { +func NewEndpointClient(subscriptionID string) EndpointClient { return NewEndpointClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewEndpointClientWithBaseURI creates an instance of the EndpointClient client using a custom endpoint. Use this // when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewEndpointClientWithBaseURI(baseURI string, subscriptionID uuid.UUID) EndpointClient { +func NewEndpointClientWithBaseURI(baseURI string, subscriptionID string) EndpointClient { return EndpointClient{NewWithBaseURI(baseURI, subscriptionID)} } @@ -130,7 +129,6 @@ func (client EndpointClient) CreateOrUpdateSender(req *http.Request) (future End func (client EndpointClient) CreateOrUpdateResponder(resp *http.Response) (result EndpointResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -222,7 +220,6 @@ func (client EndpointClient) DeleteSender(req *http.Request) (future EndpointDel func (client EndpointClient) DeleteResponder(resp *http.Response) (result EndpointResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -314,7 +311,6 @@ func (client EndpointClient) GetSender(req *http.Request) (*http.Response, error func (client EndpointClient) GetResponder(resp *http.Response) (result EndpointResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -401,7 +397,6 @@ func (client EndpointClient) ListSender(req *http.Request) (*http.Response, erro func (client EndpointClient) ListResponder(resp *http.Response) (result EndpointResourceListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/iothub.go b/services/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/iothub.go deleted file mode 100644 index 05e0190ef324..000000000000 --- a/services/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/iothub.go +++ /dev/null @@ -1,278 +0,0 @@ -package digitaltwins - -// 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/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "github.com/satori/go.uuid" - "net/http" -) - -// IoTHubClient is the azure Digital Twins Client for managing DigitalTwinsInstance -type IoTHubClient struct { - BaseClient -} - -// NewIoTHubClient creates an instance of the IoTHubClient client. -func NewIoTHubClient(subscriptionID uuid.UUID) IoTHubClient { - return NewIoTHubClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewIoTHubClientWithBaseURI creates an instance of the IoTHubClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewIoTHubClientWithBaseURI(baseURI string, subscriptionID uuid.UUID) IoTHubClient { - return IoTHubClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or Updates an IoTHub Integration with DigitalTwinsInstances. -// Parameters: -// scope - the scope of the Digital Twins Integration. The scope has to be an IoTHub resource. For example, -// /{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IoTHubs/{resourceName}. -// integrationResourceName - name of IoTHub and DigitalTwinsInstance integration instance. -// iotHubDescription - the IoTHub metadata. -func (client IoTHubClient) CreateOrUpdate(ctx context.Context, scope string, integrationResourceName string, iotHubDescription IntegrationResource) (result IntegrationResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IoTHubClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: integrationResourceName, - Constraints: []validation.Constraint{{Target: "integrationResourceName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "integrationResourceName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("digitaltwins.IoTHubClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, scope, integrationResourceName, iotHubDescription) - if err != nil { - err = autorest.NewErrorWithError(err, "digitaltwins.IoTHubClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "digitaltwins.IoTHubClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "digitaltwins.IoTHubClient", "CreateOrUpdate", resp, "Failure responding to request") - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client IoTHubClient) CreateOrUpdatePreparer(ctx context.Context, scope string, integrationResourceName string, iotHubDescription IntegrationResource) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "integrationResourceName": autorest.Encode("path", integrationResourceName), - "scope": autorest.Encode("path", scope), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/{scope}/providers/Microsoft.DigitalTwins/integrationResources/{integrationResourceName}", pathParameters), - autorest.WithJSON(iotHubDescription)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client IoTHubClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client IoTHubClient) CreateOrUpdateResponder(resp *http.Response) (result IntegrationResource, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a DigitalTwinsInstance link with IoTHub. -// Parameters: -// scope - the scope of the Digital Twins Integration. The scope has to be an IoTHub resource. For example, -// /{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IoTHubs/{resourceName}. -// integrationResourceName - name of IoTHub and DigitalTwinsInstance integration instance. -func (client IoTHubClient) Delete(ctx context.Context, scope string, integrationResourceName string) (result IoTHubDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IoTHubClient.Delete") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: integrationResourceName, - Constraints: []validation.Constraint{{Target: "integrationResourceName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "integrationResourceName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("digitaltwins.IoTHubClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, scope, integrationResourceName) - if err != nil { - err = autorest.NewErrorWithError(err, "digitaltwins.IoTHubClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "digitaltwins.IoTHubClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client IoTHubClient) DeletePreparer(ctx context.Context, scope string, integrationResourceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "integrationResourceName": autorest.Encode("path", integrationResourceName), - "scope": autorest.Encode("path", scope), - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/{scope}/providers/Microsoft.DigitalTwins/integrationResources/{integrationResourceName}", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client IoTHubClient) DeleteSender(req *http.Request) (future IoTHubDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if err != nil { - return - } - future.Future, err = azure.NewFutureFromResponse(resp) - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client IoTHubClient) DeleteResponder(resp *http.Response) (result IntegrationResource, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get gets properties of an IoTHub Integration. -// Parameters: -// scope - the scope of the Digital Twins Integration. The scope has to be an IoTHub resource. For example, -// /{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IoTHubs/{resourceName}. -// integrationResourceName - name of IoTHub and DigitalTwinsInstance integration instance. -func (client IoTHubClient) Get(ctx context.Context, scope string, integrationResourceName string) (result IntegrationResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IoTHubClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: integrationResourceName, - Constraints: []validation.Constraint{{Target: "integrationResourceName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "integrationResourceName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("digitaltwins.IoTHubClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, scope, integrationResourceName) - if err != nil { - err = autorest.NewErrorWithError(err, "digitaltwins.IoTHubClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "digitaltwins.IoTHubClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "digitaltwins.IoTHubClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client IoTHubClient) GetPreparer(ctx context.Context, scope string, integrationResourceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "integrationResourceName": autorest.Encode("path", integrationResourceName), - "scope": autorest.Encode("path", scope), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/{scope}/providers/Microsoft.DigitalTwins/integrationResources/{integrationResourceName}", pathParameters)) - 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 IoTHubClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client IoTHubClient) GetResponder(resp *http.Response) (result IntegrationResource, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/services/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/iothubs.go b/services/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/iothubs.go deleted file mode 100644 index 642de380b822..000000000000 --- a/services/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/iothubs.go +++ /dev/null @@ -1,168 +0,0 @@ -package digitaltwins - -// 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/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "github.com/satori/go.uuid" - "net/http" -) - -// IoTHubsClient is the azure Digital Twins Client for managing DigitalTwinsInstance -type IoTHubsClient struct { - BaseClient -} - -// NewIoTHubsClient creates an instance of the IoTHubsClient client. -func NewIoTHubsClient(subscriptionID uuid.UUID) IoTHubsClient { - return NewIoTHubsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewIoTHubsClientWithBaseURI creates an instance of the IoTHubsClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewIoTHubsClientWithBaseURI(baseURI string, subscriptionID uuid.UUID) IoTHubsClient { - return IoTHubsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List get DigitalTwinsInstance IoTHubs. -// Parameters: -// resourceGroupName - the name of the resource group that contains the DigitalTwinsInstance. -// resourceName - the name of the DigitalTwinsInstance. -func (client IoTHubsClient) List(ctx context.Context, resourceGroupName string, resourceName string) (result IntegrationResourceListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IoTHubsClient.List") - defer func() { - sc := -1 - if result.irlr.Response.Response != nil { - sc = result.irlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceName, - Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("digitaltwins.IoTHubsClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, resourceName) - if err != nil { - err = autorest.NewErrorWithError(err, "digitaltwins.IoTHubsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.irlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "digitaltwins.IoTHubsClient", "List", resp, "Failure sending request") - return - } - - result.irlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "digitaltwins.IoTHubsClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client IoTHubsClient) ListPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "resourceName": autorest.Encode("path", resourceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-03-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances/{resourceName}/integrationResources", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client IoTHubsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client IoTHubsClient) ListResponder(resp *http.Response) (result IntegrationResourceListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client IoTHubsClient) listNextResults(ctx context.Context, lastResults IntegrationResourceListResult) (result IntegrationResourceListResult, err error) { - req, err := lastResults.integrationResourceListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "digitaltwins.IoTHubsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "digitaltwins.IoTHubsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "digitaltwins.IoTHubsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client IoTHubsClient) ListComplete(ctx context.Context, resourceGroupName string, resourceName string) (result IntegrationResourceListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IoTHubsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, resourceName) - return -} diff --git a/services/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/models.go b/services/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/models.go index ae3b11035aa5..c22967727acd 100644 --- a/services/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/models.go +++ b/services/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/models.go @@ -71,27 +71,6 @@ func PossibleEndpointTypeValues() []EndpointType { return []EndpointType{EndpointTypeDigitalTwinsEndpointResourceProperties, EndpointTypeEventGrid, EndpointTypeEventHub, EndpointTypeServiceBus} } -// IntegrationResourceState enumerates the values for integration resource state. -type IntegrationResourceState string - -const ( - // IntegrationResourceStateCanceled ... - IntegrationResourceStateCanceled IntegrationResourceState = "Canceled" - // IntegrationResourceStateDeleting ... - IntegrationResourceStateDeleting IntegrationResourceState = "Deleting" - // IntegrationResourceStateFailed ... - IntegrationResourceStateFailed IntegrationResourceState = "Failed" - // IntegrationResourceStateProvisioning ... - IntegrationResourceStateProvisioning IntegrationResourceState = "Provisioning" - // IntegrationResourceStateSucceeded ... - IntegrationResourceStateSucceeded IntegrationResourceState = "Succeeded" -) - -// PossibleIntegrationResourceStateValues returns an array of possible values for the IntegrationResourceState const type. -func PossibleIntegrationResourceStateValues() []IntegrationResourceState { - return []IntegrationResourceState{IntegrationResourceStateCanceled, IntegrationResourceStateDeleting, IntegrationResourceStateFailed, IntegrationResourceStateProvisioning, IntegrationResourceStateSucceeded} -} - // ProvisioningState enumerates the values for provisioning state. type ProvisioningState string @@ -221,7 +200,7 @@ type Description struct { Location *string `json:"location,omitempty"` // Tags - The resource tags. Tags map[string]*string `json:"tags"` - // Sku - The resource sku. + // Sku - This property is reserved for future use, and will be ignored/omitted Sku *SkuInfo `json:"sku,omitempty"` } @@ -528,8 +507,8 @@ func (future *EndpointDeleteFuture) Result(client EndpointClient) (er EndpointRe // EndpointResource digitalTwinsInstance endpoint resource. type EndpointResource struct { autorest.Response `json:"-"` - // BasicEndpointResourceProperties - DigitalTwinsInstance endpoint resource properties. - BasicEndpointResourceProperties `json:"properties,omitempty"` + // Properties - DigitalTwinsInstance endpoint resource properties. + Properties BasicEndpointResourceProperties `json:"properties,omitempty"` // ID - READ-ONLY; The resource identifier. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Extension resource name. @@ -538,13 +517,6 @@ type EndpointResource struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for EndpointResource. -func (er EndpointResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["properties"] = er.BasicEndpointResourceProperties - return json.Marshal(objectMap) -} - // UnmarshalJSON is the custom unmarshaler for EndpointResource struct. func (er *EndpointResource) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -556,11 +528,11 @@ func (er *EndpointResource) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - basicEndpointResourceProperties, err := unmarshalBasicEndpointResourceProperties(*v) + properties, err := unmarshalBasicEndpointResourceProperties(*v) if err != nil { return err } - er.BasicEndpointResourceProperties = basicEndpointResourceProperties + er.Properties = properties } case "id": if v != nil { @@ -995,350 +967,6 @@ type ExternalResource struct { Type *string `json:"type,omitempty"` } -// IntegrationResource ioTHub integration resource. -type IntegrationResource struct { - autorest.Response `json:"-"` - // IntegrationResourceProperties - IoTHub integration resource properties. - *IntegrationResourceProperties `json:"properties,omitempty"` - // ID - READ-ONLY; The resource identifier. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Extension resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The resource type. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for IntegrationResource. -func (ir IntegrationResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ir.IntegrationResourceProperties != nil { - objectMap["properties"] = ir.IntegrationResourceProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for IntegrationResource struct. -func (ir *IntegrationResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var integrationResourceProperties IntegrationResourceProperties - err = json.Unmarshal(*v, &integrationResourceProperties) - if err != nil { - return err - } - ir.IntegrationResourceProperties = &integrationResourceProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ir.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ir.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ir.Type = &typeVar - } - } - } - - return nil -} - -// IntegrationResourceListResult a list of DigitalTwinsInstance IoTHubs with a next link. -type IntegrationResourceListResult struct { - autorest.Response `json:"-"` - // NextLink - The link used to get the next page of DigitalTwinsInstance IoTHubs. - NextLink *string `json:"nextLink,omitempty"` - // Value - A list of DigitalTwinsInstance IoTHubs. - Value *[]IntegrationResource `json:"value,omitempty"` -} - -// IntegrationResourceListResultIterator provides access to a complete listing of IntegrationResource -// values. -type IntegrationResourceListResultIterator struct { - i int - page IntegrationResourceListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *IntegrationResourceListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationResourceListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *IntegrationResourceListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter IntegrationResourceListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter IntegrationResourceListResultIterator) Response() IntegrationResourceListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter IntegrationResourceListResultIterator) Value() IntegrationResource { - if !iter.page.NotDone() { - return IntegrationResource{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the IntegrationResourceListResultIterator type. -func NewIntegrationResourceListResultIterator(page IntegrationResourceListResultPage) IntegrationResourceListResultIterator { - return IntegrationResourceListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (irlr IntegrationResourceListResult) IsEmpty() bool { - return irlr.Value == nil || len(*irlr.Value) == 0 -} - -// integrationResourceListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (irlr IntegrationResourceListResult) integrationResourceListResultPreparer(ctx context.Context) (*http.Request, error) { - if irlr.NextLink == nil || len(to.String(irlr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(irlr.NextLink))) -} - -// IntegrationResourceListResultPage contains a page of IntegrationResource values. -type IntegrationResourceListResultPage struct { - fn func(context.Context, IntegrationResourceListResult) (IntegrationResourceListResult, error) - irlr IntegrationResourceListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *IntegrationResourceListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationResourceListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - next, err := page.fn(ctx, page.irlr) - if err != nil { - return err - } - page.irlr = next - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *IntegrationResourceListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page IntegrationResourceListResultPage) NotDone() bool { - return !page.irlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page IntegrationResourceListResultPage) Response() IntegrationResourceListResult { - return page.irlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page IntegrationResourceListResultPage) Values() []IntegrationResource { - if page.irlr.IsEmpty() { - return nil - } - return *page.irlr.Value -} - -// Creates a new instance of the IntegrationResourceListResultPage type. -func NewIntegrationResourceListResultPage(getNextPage func(context.Context, IntegrationResourceListResult) (IntegrationResourceListResult, error)) IntegrationResourceListResultPage { - return IntegrationResourceListResultPage{fn: getNextPage} -} - -// IntegrationResourceProperties properties related to the IoTHub DigitalTwinsInstance Integration -// Resource. -type IntegrationResourceProperties struct { - // ResourceID - Fully qualified resource identifier of the DigitalTwins Azure resource. - ResourceID *string `json:"resourceId,omitempty"` - // CreatedTime - READ-ONLY; Time when the IoTHub was added to DigitalTwinsInstance. - CreatedTime *date.Time `json:"createdTime,omitempty"` - // ProvisioningState - READ-ONLY; DigitalTwinsInstance - IoTHub link state. Possible values include: 'IntegrationResourceStateProvisioning', 'IntegrationResourceStateDeleting', 'IntegrationResourceStateSucceeded', 'IntegrationResourceStateFailed', 'IntegrationResourceStateCanceled' - ProvisioningState IntegrationResourceState `json:"provisioningState,omitempty"` -} - -// IntegrationResourceState1 properties related to the IoTHub DigitalTwinsInstance Integration Resource. -type IntegrationResourceState1 struct { - // ProvisioningState - READ-ONLY; DigitalTwinsInstance - IoTHub link state. Possible values include: 'IntegrationResourceStateProvisioning', 'IntegrationResourceStateDeleting', 'IntegrationResourceStateSucceeded', 'IntegrationResourceStateFailed', 'IntegrationResourceStateCanceled' - ProvisioningState IntegrationResourceState `json:"provisioningState,omitempty"` -} - -// IntegrationResourceUpdateInfo ioTHub integration resource. -type IntegrationResourceUpdateInfo struct { - // IntegrationResourceUpdateProperties - IoTHub integration resource properties to be updated. - *IntegrationResourceUpdateProperties `json:"properties,omitempty"` - // ID - READ-ONLY; The resource identifier. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Extension resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The resource type. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for IntegrationResourceUpdateInfo. -func (irui IntegrationResourceUpdateInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if irui.IntegrationResourceUpdateProperties != nil { - objectMap["properties"] = irui.IntegrationResourceUpdateProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for IntegrationResourceUpdateInfo struct. -func (irui *IntegrationResourceUpdateInfo) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var integrationResourceUpdateProperties IntegrationResourceUpdateProperties - err = json.Unmarshal(*v, &integrationResourceUpdateProperties) - if err != nil { - return err - } - irui.IntegrationResourceUpdateProperties = &integrationResourceUpdateProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - irui.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - irui.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - irui.Type = &typeVar - } - } - } - - return nil -} - -// IntegrationResourceUpdateProperties updatable properties related to the IoTHub DigitalTwinsInstance -// Integration Resource. -type IntegrationResourceUpdateProperties struct { - // ProvisioningState - READ-ONLY; DigitalTwinsInstance - IoTHub link state. Possible values include: 'IntegrationResourceStateProvisioning', 'IntegrationResourceStateDeleting', 'IntegrationResourceStateSucceeded', 'IntegrationResourceStateFailed', 'IntegrationResourceStateCanceled' - ProvisioningState IntegrationResourceState `json:"provisioningState,omitempty"` -} - -// IoTHubDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. -type IoTHubDeleteFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *IoTHubDeleteFuture) Result(client IoTHubClient) (ir IntegrationResource, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "digitaltwins.IoTHubDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("digitaltwins.IoTHubDeleteFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ir.Response.Response, err = future.GetResult(sender); err == nil && ir.Response.Response.StatusCode != http.StatusNoContent { - ir, err = client.DeleteResponder(ir.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "digitaltwins.IoTHubDeleteFuture", "Result", ir.Response.Response, "Failure responding to request") - } - } - return -} - // Operation digitalTwins service REST API operation type Operation struct { // Name - READ-ONLY; Operation name: {provider}/{resource}/{read | write | action | delete} @@ -1545,7 +1173,7 @@ type Resource struct { Location *string `json:"location,omitempty"` // Tags - The resource tags. Tags map[string]*string `json:"tags"` - // Sku - The resource sku. + // Sku - This property is reserved for future use, and will be ignored/omitted Sku *SkuInfo `json:"sku,omitempty"` } diff --git a/services/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/operations.go b/services/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/operations.go index 25628880ad6d..3010b593a104 100644 --- a/services/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/operations.go +++ b/services/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/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,13 +31,13 @@ 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 using a custom endpoint. Use this // when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewOperationsClientWithBaseURI(baseURI string, subscriptionID uuid.UUID) OperationsClient { +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} } @@ -102,7 +101,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/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/version.go b/services/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/version.go index ce86d4c221e9..fe3e03dbcadf 100644 --- a/services/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/version.go +++ b/services/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/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 + " digitaltwins/2020-03-01-preview" + return "Azure-SDK-For-Go/" + Version() + " digitaltwins/2020-03-01-preview" } // Version returns the semantic version (see http://semver.org) of the client.