From a901d0b808c803982caf3c56658e3c4f08b2c175 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 1 Sep 2021 10:22:42 +0000 Subject: [PATCH] CodeGen from PR 15864 in Azure/azure-rest-api-specs Merge ddf67ea393a0f0e5d477c8dd27dad504fd6bef23 into 4dc391780cb36a5c8c5632f5baec0cb8f255fa71 --- sdk/signalr/arm-signalr/package.json | 2 +- sdk/signalr/arm-signalr/src/models/index.ts | 103 +++++++++++++++- sdk/signalr/arm-signalr/src/models/mappers.ts | 113 ++++++++++++++++++ .../arm-signalr/src/models/signalRMappers.ts | 3 + .../arm-signalr/src/operations/signalR.ts | 60 ++++++++++ .../src/signalRManagementClientContext.ts | 2 +- 6 files changed, 278 insertions(+), 5 deletions(-) diff --git a/sdk/signalr/arm-signalr/package.json b/sdk/signalr/arm-signalr/package.json index 11f4fda185f6..30cb259172ee 100644 --- a/sdk/signalr/arm-signalr/package.json +++ b/sdk/signalr/arm-signalr/package.json @@ -27,7 +27,7 @@ "rollup-plugin-sourcemaps": "^0.4.2", "uglify-js": "^3.6.0" }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/feature/v4/sdk/signalr/arm-signalr", + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/signalr/arm-signalr", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" diff --git a/sdk/signalr/arm-signalr/src/models/index.ts b/sdk/signalr/arm-signalr/src/models/index.ts index 9e953f655da4..190b838c585d 100644 --- a/sdk/signalr/arm-signalr/src/models/index.ts +++ b/sdk/signalr/arm-signalr/src/models/index.ts @@ -454,7 +454,7 @@ export interface PrivateLinkResource extends ProxyResource { export interface RegenerateKeyParameters { /** * The keyType to regenerate. Must be either 'primary' or 'secondary'(case-insensitive). Possible - * values include: 'Primary', 'Secondary' + * values include: 'Primary', 'Secondary', 'Salt' */ keyType?: KeyType; } @@ -867,6 +867,75 @@ export interface SignalRUsage { unit?: string; } +/** + * Describes scaling information of a sku. + */ +export interface SkuCapacity { + /** + * The lowest permitted capacity for this resource + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly minimum?: number; + /** + * The highest permitted capacity for this resource + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly maximum?: number; + /** + * The default capacity. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly default?: number; + /** + * Allows capacity value list. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly allowedValues?: number[]; + /** + * The scale type applicable to the sku. Possible values include: 'None', 'Manual', 'Automatic' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly scaleType?: ScaleType; +} + +/** + * Describes an available sku." + */ +export interface Sku { + /** + * The resource type that this object applies to + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly resourceType?: string; + /** + * The exact set of keys that define this sku. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly sku?: ResourceSku; + /** + * Specifies the unit of the resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly capacity?: SkuCapacity; +} + +/** + * The list skus operation response + */ +export interface SkuList { + /** + * The list of skus available for the resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly value?: Sku[]; + /** + * The URL the client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + /** * The resource management error additional info. */ @@ -1030,11 +1099,11 @@ export type FeatureFlags = 'ServiceMode' | 'EnableConnectivityLogs' | 'EnableMes /** * Defines values for KeyType. - * Possible values include: 'Primary', 'Secondary' + * Possible values include: 'Primary', 'Secondary', 'Salt' * @readonly * @enum {string} */ -export type KeyType = 'Primary' | 'Secondary'; +export type KeyType = 'Primary' | 'Secondary' | 'Salt'; /** * Defines values for ManagedIdentityType. @@ -1085,6 +1154,14 @@ export type PrivateLinkServiceConnectionStatus = 'Pending' | 'Approved' | 'Rejec */ export type SignalRSkuTier = 'Free' | 'Basic' | 'Standard' | 'Premium'; +/** + * Defines values for ScaleType. + * Possible values include: 'None', 'Manual', 'Automatic' + * @readonly + * @enum {string} + */ +export type ScaleType = 'None' | 'Manual' | 'Automatic'; + /** * Defines values for UpstreamAuthType. * Possible values include: 'None', 'ManagedIdentity' @@ -1309,6 +1386,26 @@ export type SignalRRegenerateKeyResponse = SignalRKeys & { }; }; +/** + * Contains response data for the listSkus operation. + */ +export type SignalRListSkusResponse = SkuList & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SkuList; + }; +}; + /** * Contains response data for the beginCreateOrUpdate operation. */ diff --git a/sdk/signalr/arm-signalr/src/models/mappers.ts b/sdk/signalr/arm-signalr/src/models/mappers.ts index df732de5189d..aa6f8a5dd4d8 100644 --- a/sdk/signalr/arm-signalr/src/models/mappers.ts +++ b/sdk/signalr/arm-signalr/src/models/mappers.ts @@ -1321,6 +1321,119 @@ export const SignalRUsage: msRest.CompositeMapper = { } }; +export const SkuCapacity: msRest.CompositeMapper = { + serializedName: "SkuCapacity", + type: { + name: "Composite", + className: "SkuCapacity", + modelProperties: { + minimum: { + readOnly: true, + serializedName: "minimum", + type: { + name: "Number" + } + }, + maximum: { + readOnly: true, + serializedName: "maximum", + type: { + name: "Number" + } + }, + default: { + readOnly: true, + serializedName: "default", + type: { + name: "Number" + } + }, + allowedValues: { + readOnly: true, + serializedName: "allowedValues", + type: { + name: "Sequence", + element: { + type: { + name: "Number" + } + } + } + }, + scaleType: { + readOnly: true, + serializedName: "scaleType", + type: { + name: "String" + } + } + } + } +}; + +export const Sku: msRest.CompositeMapper = { + serializedName: "Sku", + type: { + name: "Composite", + className: "Sku", + modelProperties: { + resourceType: { + readOnly: true, + serializedName: "resourceType", + type: { + name: "String" + } + }, + sku: { + readOnly: true, + serializedName: "sku", + type: { + name: "Composite", + className: "ResourceSku" + } + }, + capacity: { + readOnly: true, + serializedName: "capacity", + type: { + name: "Composite", + className: "SkuCapacity" + } + } + } + } +}; + +export const SkuList: msRest.CompositeMapper = { + serializedName: "SkuList", + type: { + name: "Composite", + className: "SkuList", + modelProperties: { + value: { + readOnly: true, + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Sku" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + export const ErrorAdditionalInfo: msRest.CompositeMapper = { serializedName: "ErrorAdditionalInfo", type: { diff --git a/sdk/signalr/arm-signalr/src/models/signalRMappers.ts b/sdk/signalr/arm-signalr/src/models/signalRMappers.ts index 7e65f46d8d64..381e091e3158 100644 --- a/sdk/signalr/arm-signalr/src/models/signalRMappers.ts +++ b/sdk/signalr/arm-signalr/src/models/signalRMappers.ts @@ -36,6 +36,9 @@ export { SignalRResource, SignalRResourceList, SignalRTlsSettings, + Sku, + SkuCapacity, + SkuList, SystemData, TrackedResource, UpstreamAuthSettings, diff --git a/sdk/signalr/arm-signalr/src/operations/signalR.ts b/sdk/signalr/arm-signalr/src/operations/signalR.ts index 033f63a676d2..cd429e3a32ad 100644 --- a/sdk/signalr/arm-signalr/src/operations/signalR.ts +++ b/sdk/signalr/arm-signalr/src/operations/signalR.ts @@ -252,6 +252,41 @@ export class SignalR { .then(lroPoller => lroPoller.pollUntilFinished()); } + /** + * List all available skus of the resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can + * obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the resource. + * @param [options] The optional parameters + * @returns Promise + */ + listSkus(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group that contains the resource. You can + * obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the resource. + * @param callback The callback + */ + listSkus(resourceGroupName: string, resourceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group that contains the resource. You can + * obtain this value from the Azure Resource Manager API or the portal. + * @param resourceName The name of the resource. + * @param options The optional parameters + * @param callback The callback + */ + listSkus(resourceGroupName: string, resourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listSkus(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + resourceName, + options + }, + listSkusOperationSpec, + callback) as Promise; + } + /** * Create or update a resource. * @param parameters Parameters for the create or update operation @@ -541,6 +576,31 @@ const listKeysOperationSpec: msRest.OperationSpec = { serializer }; +const listSkusOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/skus", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SkuList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { httpMethod: "PUT", path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}", diff --git a/sdk/signalr/arm-signalr/src/signalRManagementClientContext.ts b/sdk/signalr/arm-signalr/src/signalRManagementClientContext.ts index 02ccc1d28438..680d2f211a12 100644 --- a/sdk/signalr/arm-signalr/src/signalRManagementClientContext.ts +++ b/sdk/signalr/arm-signalr/src/signalRManagementClientContext.ts @@ -50,7 +50,7 @@ export class SignalRManagementClientContext extends msRestAzure.AzureServiceClie super(credentials, options); - this.apiVersion = '2021-06-01-preview'; + this.apiVersion = '2021-09-01-preview'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com";