diff --git a/services/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/CHANGELOG.md b/services/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/CHANGELOG.md new file mode 100644 index 000000000000..f451633a319d --- /dev/null +++ b/services/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/CHANGELOG.md @@ -0,0 +1,9 @@ +Generated from https://github.com/Azure/azure-rest-api-specs/tree/3c764635e7d442b3e74caf593029fcd440b3ef82 + +Code generator @microsoft.azure/autorest.go@~2.1.161 + +## Breaking Changes + +- Function `NewDescriptionListResultPage` parameter(s) have been changed from `(func(context.Context, DescriptionListResult) (DescriptionListResult, error))` to `(DescriptionListResult, func(context.Context, DescriptionListResult) (DescriptionListResult, error))` +- Function `NewEndpointResourceListResultPage` parameter(s) have been changed from `(func(context.Context, EndpointResourceListResult) (EndpointResourceListResult, error))` to `(EndpointResourceListResult, func(context.Context, EndpointResourceListResult) (EndpointResourceListResult, error))` +- Function `NewOperationListResultPage` parameter(s) have been changed from `(func(context.Context, OperationListResult) (OperationListResult, error))` to `(OperationListResult, func(context.Context, OperationListResult) (OperationListResult, error))` 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 e285fa1481e4..1340dd13302c 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 @@ -83,6 +83,7 @@ func (client Client) CheckNameAvailability(ctx context.Context, location string, result, err = client.CheckNameAvailabilityResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "digitaltwins.Client", "CheckNameAvailability", resp, "Failure responding to request") + return } return @@ -344,6 +345,7 @@ func (client Client) Get(ctx context.Context, resourceGroupName string, resource result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "digitaltwins.Client", "Get", resp, "Failure responding to request") + return } return @@ -417,9 +419,11 @@ func (client Client) List(ctx context.Context) (result DescriptionListResultPage result.dlr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "digitaltwins.Client", "List", resp, "Failure responding to request") + return } if result.dlr.hasNextLink() && result.dlr.IsEmpty() { err = result.NextWithContext(ctx) + return } return @@ -537,9 +541,11 @@ func (client Client) ListByResourceGroup(ctx context.Context, resourceGroupName result.dlr, err = client.ListByResourceGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "digitaltwins.Client", "ListByResourceGroup", resp, "Failure responding to request") + return } if result.dlr.hasNextLink() && result.dlr.IsEmpty() { err = result.NextWithContext(ctx) + return } return 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 290a09ec6817..e1cc6dfe947d 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 @@ -273,6 +273,7 @@ func (client EndpointClient) Get(ctx context.Context, resourceGroupName string, result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "digitaltwins.EndpointClient", "Get", resp, "Failure responding to request") + return } return @@ -360,9 +361,11 @@ func (client EndpointClient) List(ctx context.Context, resourceGroupName string, result.erlr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "digitaltwins.EndpointClient", "List", resp, "Failure responding to request") + return } if result.erlr.hasNextLink() && result.erlr.IsEmpty() { err = result.NextWithContext(ctx) + return } 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 b948b2166298..ab2825553ff0 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 @@ -52,7 +52,8 @@ type CheckNameResult struct { Reason Reason `json:"reason,omitempty"` } -// CreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// CreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type CreateOrUpdateFuture struct { azure.Future } @@ -375,8 +376,11 @@ func (page DescriptionListResultPage) Values() []Description { } // Creates a new instance of the DescriptionListResultPage type. -func NewDescriptionListResultPage(getNextPage func(context.Context, DescriptionListResult) (DescriptionListResult, error)) DescriptionListResultPage { - return DescriptionListResultPage{fn: getNextPage} +func NewDescriptionListResultPage(cur DescriptionListResult, getNextPage func(context.Context, DescriptionListResult) (DescriptionListResult, error)) DescriptionListResultPage { + return DescriptionListResultPage{ + fn: getNextPage, + dlr: cur, + } } // EndpointCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running @@ -408,7 +412,8 @@ func (future *EndpointCreateOrUpdateFuture) Result(client EndpointClient) (er En return } -// EndpointDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// EndpointDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type EndpointDeleteFuture struct { azure.Future } @@ -658,8 +663,11 @@ func (page EndpointResourceListResultPage) Values() []EndpointResource { } // Creates a new instance of the EndpointResourceListResultPage type. -func NewEndpointResourceListResultPage(getNextPage func(context.Context, EndpointResourceListResult) (EndpointResourceListResult, error)) EndpointResourceListResultPage { - return EndpointResourceListResultPage{fn: getNextPage} +func NewEndpointResourceListResultPage(cur EndpointResourceListResult, getNextPage func(context.Context, EndpointResourceListResult) (EndpointResourceListResult, error)) EndpointResourceListResultPage { + return EndpointResourceListResultPage{ + fn: getNextPage, + erlr: cur, + } } // BasicEndpointResourceProperties properties related to Digital Twins Endpoint @@ -945,8 +953,8 @@ type OperationDisplay struct { Description *string `json:"description,omitempty"` } -// OperationListResult a list of DigitalTwins service operations. It contains a list of operations and a URL -// link to get the next set of results. +// OperationListResult a list of DigitalTwins service operations. It contains a list of operations and a +// URL link to get the next set of results. type OperationListResult struct { autorest.Response `json:"-"` // NextLink - The link used to get the next page of DigitalTwins description objects. @@ -1107,8 +1115,11 @@ func (page OperationListResultPage) Values() []Operation { } // Creates a new instance of the OperationListResultPage type. -func NewOperationListResultPage(getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { - return OperationListResultPage{fn: getNextPage} +func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { + return OperationListResultPage{ + fn: getNextPage, + olr: cur, + } } // PatchDescription the description of the DigitalTwins service. 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 61a7127c1c76..a522aacdade9 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 @@ -70,9 +70,11 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListRe result.olr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "digitaltwins.OperationsClient", "List", resp, "Failure responding to request") + return } if result.olr.hasNextLink() && result.olr.IsEmpty() { err = result.NextWithContext(ctx) + return } return