From 4bf2455fbce45c1e8df8d52d1f17380f9437d35a Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 15 Dec 2020 07:43:37 +0000 Subject: [PATCH] CodeGen from PR 11970 in Azure/azure-rest-api-specs add hybridcompute track2 config (#11970) --- .../2020-08-02/hybridcompute/CHANGELOG.md | 8 +++ .../hybridcompute/machineextensions.go | 5 +- .../mgmt/2020-08-02/hybridcompute/machines.go | 14 ++++-- .../mgmt/2020-08-02/hybridcompute/models.go | 49 +++++++++++-------- .../2020-08-02/hybridcompute/operations.go | 1 + 5 files changed, 51 insertions(+), 26 deletions(-) create mode 100644 services/hybridcompute/mgmt/2020-08-02/hybridcompute/CHANGELOG.md diff --git a/services/hybridcompute/mgmt/2020-08-02/hybridcompute/CHANGELOG.md b/services/hybridcompute/mgmt/2020-08-02/hybridcompute/CHANGELOG.md new file mode 100644 index 000000000000..3ad5a0642725 --- /dev/null +++ b/services/hybridcompute/mgmt/2020-08-02/hybridcompute/CHANGELOG.md @@ -0,0 +1,8 @@ +Generated from https://github.com/Azure/azure-rest-api-specs/tree/3c764635e7d442b3e74caf593029fcd440b3ef82 + +Code generator @microsoft.azure/autorest.go@~2.1.161 + +## Breaking Changes + +- Function `NewMachineListResultPage` parameter(s) have been changed from `(func(context.Context, MachineListResult) (MachineListResult, error))` to `(MachineListResult, func(context.Context, MachineListResult) (MachineListResult, error))` +- Function `NewMachineExtensionsListResultPage` parameter(s) have been changed from `(func(context.Context, MachineExtensionsListResult) (MachineExtensionsListResult, error))` to `(MachineExtensionsListResult, func(context.Context, MachineExtensionsListResult) (MachineExtensionsListResult, error))` diff --git a/services/hybridcompute/mgmt/2020-08-02/hybridcompute/machineextensions.go b/services/hybridcompute/mgmt/2020-08-02/hybridcompute/machineextensions.go index f256200d1722..703d1c03a9a5 100644 --- a/services/hybridcompute/mgmt/2020-08-02/hybridcompute/machineextensions.go +++ b/services/hybridcompute/mgmt/2020-08-02/hybridcompute/machineextensions.go @@ -230,6 +230,7 @@ func (client MachineExtensionsClient) Get(ctx context.Context, resourceGroupName result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "hybridcompute.MachineExtensionsClient", "Get", resp, "Failure responding to request") + return } return @@ -308,9 +309,11 @@ func (client MachineExtensionsClient) List(ctx context.Context, resourceGroupNam result.melr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "hybridcompute.MachineExtensionsClient", "List", resp, "Failure responding to request") + return } if result.melr.hasNextLink() && result.melr.IsEmpty() { err = result.NextWithContext(ctx) + return } return @@ -395,7 +398,7 @@ func (client MachineExtensionsClient) ListComplete(ctx context.Context, resource return } -// Update the operation to create or update the extension. +// Update the operation to update the extension. // Parameters: // resourceGroupName - the name of the resource group. // name - the name of the machine where the extension should be created or updated. diff --git a/services/hybridcompute/mgmt/2020-08-02/hybridcompute/machines.go b/services/hybridcompute/mgmt/2020-08-02/hybridcompute/machines.go index 24f625c9510e..a97fb4bee03a 100644 --- a/services/hybridcompute/mgmt/2020-08-02/hybridcompute/machines.go +++ b/services/hybridcompute/mgmt/2020-08-02/hybridcompute/machines.go @@ -73,6 +73,7 @@ func (client MachinesClient) CreateOrUpdate(ctx context.Context, resourceGroupNa result, err = client.CreateOrUpdateResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "hybridcompute.MachinesClient", "CreateOrUpdate", resp, "Failure responding to request") + return } return @@ -150,6 +151,7 @@ func (client MachinesClient) Delete(ctx context.Context, resourceGroupName strin result, err = client.DeleteResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "hybridcompute.MachinesClient", "Delete", resp, "Failure responding to request") + return } return @@ -225,6 +227,7 @@ func (client MachinesClient) Get(ctx context.Context, resourceGroupName string, result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "hybridcompute.MachinesClient", "Get", resp, "Failure responding to request") + return } return @@ -272,8 +275,7 @@ func (client MachinesClient) GetResponder(resp *http.Response) (result Machine, return } -// ListByResourceGroup lists all the hybrid machines in the specified resource group. Use the nextLink property in the -// response to get the next page of hybrid machines. +// ListByResourceGroup lists all the hybrid machines in the specified resource group. // Parameters: // resourceGroupName - the name of the resource group. func (client MachinesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result MachineListResultPage, err error) { @@ -304,9 +306,11 @@ func (client MachinesClient) ListByResourceGroup(ctx context.Context, resourceGr result.mlr, err = client.ListByResourceGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "hybridcompute.MachinesClient", "ListByResourceGroup", resp, "Failure responding to request") + return } if result.mlr.hasNextLink() && result.mlr.IsEmpty() { err = result.NextWithContext(ctx) + return } return @@ -387,8 +391,7 @@ func (client MachinesClient) ListByResourceGroupComplete(ctx context.Context, re return } -// ListBySubscription lists all the hybrid machines in the specified subscription. Use the nextLink property in the -// response to get the next page of hybrid machines. +// ListBySubscription lists all the hybrid machines in the specified subscription. func (client MachinesClient) ListBySubscription(ctx context.Context) (result MachineListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/MachinesClient.ListBySubscription") @@ -417,9 +420,11 @@ func (client MachinesClient) ListBySubscription(ctx context.Context) (result Mac result.mlr, err = client.ListBySubscriptionResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "hybridcompute.MachinesClient", "ListBySubscription", resp, "Failure responding to request") + return } if result.mlr.hasNextLink() && result.mlr.IsEmpty() { err = result.NextWithContext(ctx) + return } return @@ -531,6 +536,7 @@ func (client MachinesClient) Update(ctx context.Context, resourceGroupName strin result, err = client.UpdateResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "hybridcompute.MachinesClient", "Update", resp, "Failure responding to request") + return } return diff --git a/services/hybridcompute/mgmt/2020-08-02/hybridcompute/models.go b/services/hybridcompute/mgmt/2020-08-02/hybridcompute/models.go index 67f2807fcdce..e624a16415f5 100644 --- a/services/hybridcompute/mgmt/2020-08-02/hybridcompute/models.go +++ b/services/hybridcompute/mgmt/2020-08-02/hybridcompute/models.go @@ -31,15 +31,15 @@ import ( // The package's fully qualified name. const fqdn = "github.com/Azure/azure-sdk-for-go/services/hybridcompute/mgmt/2020-08-02/hybridcompute" -// AzureEntityResource the resource model definition for a Azure Resource Manager resource with an etag. +// AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag. type AzureEntityResource struct { // Etag - READ-ONLY; Resource Etag. Etag *string `json:"etag,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -102,11 +102,11 @@ type Machine struct { Tags map[string]*string `json:"tags"` // Location - The geo-location where the resource lives Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -215,11 +215,11 @@ type MachineExtension struct { Tags map[string]*string `json:"tags"` // Location - The geo-location where the resource lives Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -671,8 +671,11 @@ func (page MachineExtensionsListResultPage) Values() []MachineExtension { } // Creates a new instance of the MachineExtensionsListResultPage type. -func NewMachineExtensionsListResultPage(getNextPage func(context.Context, MachineExtensionsListResult) (MachineExtensionsListResult, error)) MachineExtensionsListResultPage { - return MachineExtensionsListResultPage{fn: getNextPage} +func NewMachineExtensionsListResultPage(cur MachineExtensionsListResult, getNextPage func(context.Context, MachineExtensionsListResult) (MachineExtensionsListResult, error)) MachineExtensionsListResultPage { + return MachineExtensionsListResultPage{ + fn: getNextPage, + melr: cur, + } } // MachineExtensionsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running @@ -964,8 +967,11 @@ func (page MachineListResultPage) Values() []Machine { } // Creates a new instance of the MachineListResultPage type. -func NewMachineListResultPage(getNextPage func(context.Context, MachineListResult) (MachineListResult, error)) MachineListResultPage { - return MachineListResultPage{fn: getNextPage} +func NewMachineListResultPage(cur MachineListResult, getNextPage func(context.Context, MachineListResult) (MachineListResult, error)) MachineListResultPage { + return MachineListResultPage{ + fn: getNextPage, + mlr: cur, + } } // MachineProperties describes the properties of a hybrid machine. @@ -1286,38 +1292,39 @@ type OSProfile struct { ComputerName *string `json:"computerName,omitempty"` } -// ProxyResource the resource model definition for a ARM proxy resource. It will have everything other than -// required location and tags +// ProxyResource the resource model definition for a Azure Resource Manager proxy resource. It will not +// have tags and a location type ProxyResource struct { - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } -// Resource ... +// Resource common fields that are returned in the response for all Azure Resource Manager resources type Resource struct { - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } -// TrackedResource the resource model definition for a ARM tracked top level resource +// TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource +// which has 'tags' and a 'location' type TrackedResource struct { // Tags - Resource tags. Tags map[string]*string `json:"tags"` // Location - The geo-location where the resource lives Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } diff --git a/services/hybridcompute/mgmt/2020-08-02/hybridcompute/operations.go b/services/hybridcompute/mgmt/2020-08-02/hybridcompute/operations.go index 1812cd476e6d..3d6cb46fbd80 100644 --- a/services/hybridcompute/mgmt/2020-08-02/hybridcompute/operations.go +++ b/services/hybridcompute/mgmt/2020-08-02/hybridcompute/operations.go @@ -69,6 +69,7 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListRe result, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "hybridcompute.OperationsClient", "List", resp, "Failure responding to request") + return } return