From 0a55a36dc5c136ee7b2509f5225955fdb9d45e0a Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 19 Nov 2020 05:11:53 +0000 Subject: [PATCH] CodeGen from PR 11405 in Azure/azure-rest-api-specs Swagger Correctness for Cognitive Services (#11405) * Swagger Correctness * Undo changes in 2016-02-01-preview * Move location of field * change enum type to string for Sku.tier --- .../2017-04-18/cognitiveservices/enums.go | 4 +- .../2017-04-18/cognitiveservices/models.go | 60 +++++++++++-------- 2 files changed, 39 insertions(+), 25 deletions(-) diff --git a/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/enums.go b/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/enums.go index 73bd80fd28c2..909ae919aa1e 100644 --- a/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/enums.go +++ b/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/enums.go @@ -189,6 +189,8 @@ func PossibleResourceSkuRestrictionsTypeValues() []ResourceSkuRestrictionsType { type SkuTier string const ( + // Enterprise ... + Enterprise SkuTier = "Enterprise" // Free ... Free SkuTier = "Free" // Premium ... @@ -199,7 +201,7 @@ const ( // PossibleSkuTierValues returns an array of possible values for the SkuTier const type. func PossibleSkuTierValues() []SkuTier { - return []SkuTier{Free, Premium, Standard} + return []SkuTier{Enterprise, Free, Premium, Standard} } // UnitType enumerates the values for unit type. diff --git a/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/models.go b/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/models.go index 0cdd82d6b0e1..9c21c5c70a4e 100644 --- a/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/models.go +++ b/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/models.go @@ -276,8 +276,11 @@ func (page AccountListResultPage) Values() []Account { } // Creates a new instance of the AccountListResultPage type. -func NewAccountListResultPage(getNextPage func(context.Context, AccountListResult) (AccountListResult, error)) AccountListResultPage { - return AccountListResultPage{fn: getNextPage} +func NewAccountListResultPage(cur AccountListResult, getNextPage func(context.Context, AccountListResult) (AccountListResult, error)) AccountListResultPage { + return AccountListResultPage{ + fn: getNextPage, + alr: cur, + } } // AccountProperties properties of Cognitive Services account. @@ -304,6 +307,8 @@ type AccountProperties struct { PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` // APIProperties - The api properties for special APIs. APIProperties *AccountAPIProperties `json:"apiProperties,omitempty"` + // DateCreated - READ-ONLY; Gets the date of cognitive services account creation. + DateCreated *string `json:"dateCreated,omitempty"` } // MarshalJSON is the custom marshaler for AccountProperties. @@ -333,15 +338,15 @@ func (ap AccountProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// 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"` } @@ -655,8 +660,11 @@ func (page OperationEntityListResultPage) Values() []OperationEntity { } // Creates a new instance of the OperationEntityListResultPage type. -func NewOperationEntityListResultPage(getNextPage func(context.Context, OperationEntityListResult) (OperationEntityListResult, error)) OperationEntityListResultPage { - return OperationEntityListResultPage{fn: getNextPage} +func NewOperationEntityListResultPage(cur OperationEntityListResult, getNextPage func(context.Context, OperationEntityListResult) (OperationEntityListResult, error)) OperationEntityListResultPage { + return OperationEntityListResultPage{ + fn: getNextPage, + oelr: cur, + } } // PrivateEndpoint the Private Endpoint resource. @@ -670,11 +678,11 @@ type PrivateEndpointConnection struct { autorest.Response `json:"-"` // Properties - Resource properties. Properties *PrivateEndpointConnectionProperties `json:"properties,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"` } @@ -708,11 +716,11 @@ type PrivateEndpointConnectionProperties struct { type PrivateLinkResource struct { // Properties - Resource properties. Properties *PrivateLinkResourceProperties `json:"properties,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"` } @@ -764,14 +772,14 @@ type PrivateLinkServiceConnectionState struct { ActionRequired *string `json:"actionRequired,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"` } @@ -781,13 +789,13 @@ type RegenerateKeyParameters struct { KeyName KeyName `json:"keyName,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"` } @@ -987,15 +995,18 @@ func (page ResourceSkusResultPage) Values() []ResourceSku { } // Creates a new instance of the ResourceSkusResultPage type. -func NewResourceSkusResultPage(getNextPage func(context.Context, ResourceSkusResult) (ResourceSkusResult, error)) ResourceSkusResultPage { - return ResourceSkusResultPage{fn: getNextPage} +func NewResourceSkusResultPage(cur ResourceSkusResult, getNextPage func(context.Context, ResourceSkusResult) (ResourceSkusResult, error)) ResourceSkusResultPage { + return ResourceSkusResultPage{ + fn: getNextPage, + rsr: cur, + } } // Sku the SKU of the cognitive services account. type Sku struct { // Name - Gets or sets the sku name. Required for account creation, optional for update. Name *string `json:"name,omitempty"` - // Tier - READ-ONLY; Gets the sku tier. This is based on the SKU name. Possible values include: 'Free', 'Standard', 'Premium' + // Tier - READ-ONLY; Gets the sku tier. This is based on the SKU name. Possible values include: 'Free', 'Standard', 'Premium', 'Enterprise' Tier SkuTier `json:"tier,omitempty"` } @@ -1016,17 +1027,18 @@ type SkuCapability struct { Value *string `json:"value,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"` }