From 2f19da50a8313cb078e822e1f94545a68bfeaaae Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 15 Dec 2020 07:44:08 +0000 Subject: [PATCH] CodeGen from PR 11970 in Azure/azure-rest-api-specs add hybridcompute track2 config (#11970) --- .../2019-12-12/hybridcompute/CHANGELOG.md | 8 +++ .../hybridcompute/machineextensions.go | 3 + .../mgmt/2019-12-12/hybridcompute/machines.go | 9 +++ .../mgmt/2019-12-12/hybridcompute/models.go | 63 +++++++++++-------- .../2019-12-12/hybridcompute/operations.go | 1 + 5 files changed, 57 insertions(+), 27 deletions(-) create mode 100644 services/hybridcompute/mgmt/2019-12-12/hybridcompute/CHANGELOG.md diff --git a/services/hybridcompute/mgmt/2019-12-12/hybridcompute/CHANGELOG.md b/services/hybridcompute/mgmt/2019-12-12/hybridcompute/CHANGELOG.md new file mode 100644 index 000000000000..3ad5a0642725 --- /dev/null +++ b/services/hybridcompute/mgmt/2019-12-12/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/2019-12-12/hybridcompute/machineextensions.go b/services/hybridcompute/mgmt/2019-12-12/hybridcompute/machineextensions.go index 4f501875bece..f817f0c7e28c 100644 --- a/services/hybridcompute/mgmt/2019-12-12/hybridcompute/machineextensions.go +++ b/services/hybridcompute/mgmt/2019-12-12/hybridcompute/machineextensions.go @@ -249,6 +249,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 @@ -333,9 +334,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 diff --git a/services/hybridcompute/mgmt/2019-12-12/hybridcompute/machines.go b/services/hybridcompute/mgmt/2019-12-12/hybridcompute/machines.go index dbb5634e035c..7d54a360f9b7 100644 --- a/services/hybridcompute/mgmt/2019-12-12/hybridcompute/machines.go +++ b/services/hybridcompute/mgmt/2019-12-12/hybridcompute/machines.go @@ -80,6 +80,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 @@ -163,6 +164,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 @@ -244,6 +246,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 @@ -329,9 +332,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 @@ -448,9 +453,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 @@ -568,6 +575,7 @@ func (client MachinesClient) Reconnect(ctx context.Context, resourceGroupName st result, err = client.ReconnectResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "hybridcompute.MachinesClient", "Reconnect", resp, "Failure responding to request") + return } return @@ -652,6 +660,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/2019-12-12/hybridcompute/models.go b/services/hybridcompute/mgmt/2019-12-12/hybridcompute/models.go index 40291c7c9060..837027e0d5f3 100644 --- a/services/hybridcompute/mgmt/2019-12-12/hybridcompute/models.go +++ b/services/hybridcompute/mgmt/2019-12-12/hybridcompute/models.go @@ -29,17 +29,17 @@ import ( ) // The package's fully qualified name. -const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/hybridcompute/mgmt/2019-12-12/hybridcompute" +const fqdn = "github.com/Azure/azure-sdk-for-go/services/hybridcompute/mgmt/2019-12-12/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"` } @@ -63,7 +63,8 @@ type ErrorDetail struct { Details *[]ErrorDetail `json:"details,omitempty"` } -// ErrorResponse the resource management error response. +// ErrorResponse common error response for all Azure Resource Manager APIs to return error details for +// failed operations. (This also follows the OData error response format.) type ErrorResponse struct { // Code - READ-ONLY; The error code. Code *string `json:"code,omitempty"` @@ -118,11 +119,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"` } @@ -231,11 +232,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"` } @@ -669,8 +670,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 @@ -962,8 +966,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. @@ -1339,39 +1346,40 @@ type Plan struct { Version *string `json:"version,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"` } // ResourceModelWithAllowedPropertySet the resource model definition containing the full set of allowed -// properties for a resource. Except properties bag, there cannot be a top level property outside of this set. +// properties for a resource. Except properties bag, there cannot be a top level property outside of this +// set. type ResourceModelWithAllowedPropertySet 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"` // Location - The geo-location where the resource lives Location *string `json:"location,omitempty"` - // ManagedBy - The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another azure resource. If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource. + // ManagedBy - The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another Azure resource. If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource. ManagedBy *string `json:"managedBy,omitempty"` // Kind - Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value. Kind *string `json:"kind,omitempty"` @@ -1472,17 +1480,18 @@ type Sku struct { Capacity *int32 `json:"capacity,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/2019-12-12/hybridcompute/operations.go b/services/hybridcompute/mgmt/2019-12-12/hybridcompute/operations.go index 06c97acb5a5a..d466ed85631a 100644 --- a/services/hybridcompute/mgmt/2019-12-12/hybridcompute/operations.go +++ b/services/hybridcompute/mgmt/2019-12-12/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