diff --git a/sdk/signalr/arm-signalr/LICENSE.txt b/sdk/signalr/arm-signalr/LICENSE.txt index a70e8cf66038..b73b4a1293c3 100644 --- a/sdk/signalr/arm-signalr/LICENSE.txt +++ b/sdk/signalr/arm-signalr/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2018 Microsoft +Copyright (c) 2019 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/sdk/signalr/arm-signalr/README.md b/sdk/signalr/arm-signalr/README.md index 278f0caefac9..32ba5ace0c1a 100644 --- a/sdk/signalr/arm-signalr/README.md +++ b/sdk/signalr/arm-signalr/README.md @@ -9,7 +9,7 @@ This package contains an isomorphic SDK for SignalRManagementClient. ### How to Install -``` +```bash npm install @azure/arm-signalr ``` @@ -19,13 +19,13 @@ npm install @azure/arm-signalr ##### Install @azure/ms-rest-nodeauth -``` +```bash npm install @azure/ms-rest-nodeauth ``` ##### Sample code -```ts +```typescript import * as msRest from "@azure/ms-rest-js"; import * as msRestAzure from "@azure/ms-rest-azure-js"; import * as msRestNodeAuth from "@azure/ms-rest-nodeauth"; @@ -47,7 +47,7 @@ msRestNodeAuth.interactiveLogin().then((creds) => { ##### Install @azure/ms-rest-browserauth -``` +```bash npm install @azure/ms-rest-browserauth ``` @@ -94,6 +94,3 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to ## Related projects - [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) - - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/signalr/arm-signalr/README.png) diff --git a/sdk/signalr/arm-signalr/lib/models/index.ts b/sdk/signalr/arm-signalr/lib/models/index.ts new file mode 100644 index 000000000000..8cb49ef73920 --- /dev/null +++ b/sdk/signalr/arm-signalr/lib/models/index.ts @@ -0,0 +1,1085 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import { BaseResource, CloudError, AzureServiceClientOptions } from "@azure/ms-rest-azure-js"; +import * as msRest from "@azure/ms-rest-js"; + +export { BaseResource, CloudError }; + + +/** + * @interface + * An interface representing OperationDisplay. + * The object that describes a operation. + * + */ +export interface OperationDisplay { + /** + * @member {string} [provider] Friendly name of the resource provider + */ + provider?: string; + /** + * @member {string} [resource] Resource type on which the operation is + * performed. + */ + resource?: string; + /** + * @member {string} [operation] The localized friendly name for the + * operation. + */ + operation?: string; + /** + * @member {string} [description] The localized friendly description for the + * operation + */ + description?: string; +} + +/** + * @interface + * An interface representing Dimension. + * Specifications of the Dimension of metrics. + * + */ +export interface Dimension { + /** + * @member {string} [name] The public facing name of the dimension. + */ + name?: string; + /** + * @member {string} [displayName] Localized friendly display name of the + * dimension. + */ + displayName?: string; + /** + * @member {string} [internalName] Name of the dimension as it appears in + * MDM. + */ + internalName?: string; + /** + * @member {boolean} [toBeExportedForShoebox] A Boolean flag indicating + * whether this dimension should be included for the shoebox export scenario. + */ + toBeExportedForShoebox?: boolean; +} + +/** + * @interface + * An interface representing MetricSpecification. + * Specifications of the Metrics for Azure Monitoring. + * + */ +export interface MetricSpecification { + /** + * @member {string} [name] Name of the metric. + */ + name?: string; + /** + * @member {string} [displayName] Localized friendly display name of the + * metric. + */ + displayName?: string; + /** + * @member {string} [displayDescription] Localized friendly description of + * the metric. + */ + displayDescription?: string; + /** + * @member {string} [unit] The unit that makes sense for the metric. + */ + unit?: string; + /** + * @member {string} [aggregationType] Only provide one value for this field. + * Valid values: Average, Minimum, Maximum, Total, Count. + */ + aggregationType?: string; + /** + * @member {string} [fillGapWithZero] Optional. If set to true, then zero + * will be returned for time duration where no metric is emitted/published. + * Ex. a metric that returns the number of times a particular error code was + * emitted. The error code may not appear + * often, instead of the RP publishing 0, Shoebox can auto fill in 0s for + * time periods where nothing was emitted. + */ + fillGapWithZero?: string; + /** + * @member {string} [category] The name of the metric category that the + * metric belongs to. A metric can only belong to a single category. + */ + category?: string; + /** + * @member {Dimension[]} [dimensions] The dimensions of the metrics. + */ + dimensions?: Dimension[]; +} + +/** + * @interface + * An interface representing ServiceSpecification. + * An object that describes a specification. + * + */ +export interface ServiceSpecification { + /** + * @member {MetricSpecification[]} [metricSpecifications] Specifications of + * the Metrics for Azure Monitoring. + */ + metricSpecifications?: MetricSpecification[]; +} + +/** + * @interface + * An interface representing OperationProperties. + * Extra Operation properties. + * + */ +export interface OperationProperties { + /** + * @member {ServiceSpecification} [serviceSpecification] The service + * specifications. + */ + serviceSpecification?: ServiceSpecification; +} + +/** + * @interface + * An interface representing Operation. + * REST API operation supported by SignalR resource provider. + * + */ +export interface Operation { + /** + * @member {string} [name] Name of the operation with format: + * {provider}/{resource}/{operation} + */ + name?: string; + /** + * @member {OperationDisplay} [display] The object that describes the + * operation. + */ + display?: OperationDisplay; + /** + * @member {string} [origin] Optional. The intended executor of the + * operation; governs the display of the operation in the RBAC UX and the + * audit logs UX. + */ + origin?: string; + /** + * @member {OperationProperties} [properties] Extra properties for the + * operation. + */ + properties?: OperationProperties; +} + +/** + * @interface + * An interface representing NameAvailabilityParameters. + * Data POST-ed to the nameAvailability action + * + */ +export interface NameAvailabilityParameters { + /** + * @member {string} type The resource type. Should be always + * "Microsoft.SignalRService/SignalR". + */ + type: string; + /** + * @member {string} name The SignalR service name to validate. + * e.g."my-signalR-name-here" + */ + name: string; +} + +/** + * @interface + * An interface representing NameAvailability. + * Result of the request to check name availability. It contains a flag and + * possible reason of failure. + * + */ +export interface NameAvailability { + /** + * @member {boolean} [nameAvailable] Indicates whether the name is available + * or not. + */ + nameAvailable?: boolean; + /** + * @member {string} [reason] The reason of the availability. Required if name + * is not available. + */ + reason?: string; + /** + * @member {string} [message] The message of the operation. + */ + message?: string; +} + +/** + * @interface + * An interface representing ResourceSku. + * The billing information of the SignalR resource. + * + */ +export interface ResourceSku { + /** + * @member {string} name The name of the SKU. Required. + * + * Allowed values: Standard_S1, Free_F1 + */ + name: string; + /** + * @member {SignalRSkuTier} [tier] Optional tier of this particular SKU. + * 'Standard' or 'Free'. + * + * `Basic` is deprecated, use `Standard` instead. Possible values include: + * 'Free', 'Basic', 'Standard', 'Premium' + */ + tier?: SignalRSkuTier; + /** + * @member {string} [size] Optional string. For future use. + */ + size?: string; + /** + * @member {string} [family] Optional string. For future use. + */ + family?: string; + /** + * @member {number} [capacity] Optional, integer. The unit count of SignalR + * resource. 1 by default. + * + * If present, following values are allowed: + * Free: 1 + * Standard: 1,2,5,10,20,50,100 + */ + capacity?: number; +} + +/** + * @interface + * An interface representing Resource. + * The core properties of ARM resources. + * + * @extends BaseResource + */ +export interface Resource extends BaseResource { + /** + * @member {string} [id] Fully qualified resource Id for the resource. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [name] The name of the resource. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {string} [type] The type of the service - e.g. + * "Microsoft.SignalRService/SignalR" + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly type?: string; +} + +/** + * @interface + * An interface representing TrackedResource. + * The resource model definition for a ARM tracked top level resource. + * + * @extends Resource + */ +export interface TrackedResource extends Resource { + /** + * @member {string} [location] The GEO location of the SignalR service. e.g. + * West US | East US | North Central US | South Central US. + */ + location?: string; + /** + * @member {{ [propertyName: string]: string }} [tags] Tags of the service + * which is a list of key value pairs that describe the resource. + */ + tags?: { [propertyName: string]: string }; +} + +/** + * @interface + * An interface representing SignalRResource. + * A class represent a SignalR service resource. + * + * @extends TrackedResource + */ +export interface SignalRResource extends TrackedResource { + /** + * @member {ResourceSku} [sku] SKU of the service. + */ + sku?: ResourceSku; + /** + * @member {string} [hostNamePrefix] Prefix for the hostName of the SignalR + * service. Retained for future use. + * The hostname will be of format: + * <hostNamePrefix>.service.signalr.net. + */ + hostNamePrefix?: string; + /** + * @member {SignalRFeature[]} [features] List of SignalR featureFlags. e.g. + * ServiceMode. + * + * When updating featureFlags, if certain featureFlag is not included in + * parameters, SignalR service will remain it unchanged. + * And when you GET a SignalR resource, the response will include only those + * featureFlags explicitly set by you. For other featureFlags, + * SignalR service will use its globally default value. Note that, default + * value doesn't mean "false". It varies in terms of different FeatureFlags. + */ + features?: SignalRFeature[]; + /** + * @member {ProvisioningState} [provisioningState] Provisioning state of the + * resource. Possible values include: 'Unknown', 'Succeeded', 'Failed', + * 'Canceled', 'Running', 'Creating', 'Updating', 'Deleting', 'Moving' + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly provisioningState?: ProvisioningState; + /** + * @member {string} [externalIP] The publicly accessible IP of the SignalR + * service. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly externalIP?: string; + /** + * @member {string} [hostName] FQDN of the SignalR service instance. Format: + * xxx.service.signalr.net + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly hostName?: string; + /** + * @member {number} [publicPort] The publicly accessible port of the SignalR + * service which is designed for browser/client side usage. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly publicPort?: number; + /** + * @member {number} [serverPort] The publicly accessible port of the SignalR + * service which is designed for customer server side usage. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly serverPort?: number; + /** + * @member {string} [version] Version of the SignalR resource. Probably you + * need the same or higher version of client SDKs. + */ + version?: string; +} + +/** + * @interface + * An interface representing SignalRFeature. + * Feature of a SignalR resource, which controls the SignalR runtime behavior. + * + */ +export interface SignalRFeature { + /** + * @member {string} value Value of the feature flag. See Azure SignalR + * service document https://docs.microsoft.com/en-us/azure/azure-signalr/ for + * allowed values. + */ + value: string; + /** + * @member {{ [propertyName: string]: string }} [properties] Optional + * properties related to this feature. + */ + properties?: { [propertyName: string]: string }; +} + +/** + * @interface + * An interface representing SignalRCreateOrUpdateProperties. + * Settings used to provision or configure the resource. + * + */ +export interface SignalRCreateOrUpdateProperties { + /** + * @member {string} [hostNamePrefix] Prefix for the hostName of the SignalR + * service. Retained for future use. + * The hostname will be of format: + * <hostNamePrefix>.service.signalr.net. + */ + hostNamePrefix?: string; + /** + * @member {SignalRFeature[]} [features] List of SignalR featureFlags. e.g. + * ServiceMode. + * + * When updating featureFlags, if certain featureFlag is not included in + * parameters, SignalR service will remain it unchanged. + * And when you GET a SignalR resource, the response will include only those + * featureFlags explicitly set by you. For other featureFlags, + * SignalR service will use its globally default value. Note that, default + * value doesn't mean "false". It varies in terms of different FeatureFlags. + */ + features?: SignalRFeature[]; +} + +/** + * @interface + * An interface representing SignalRKeys. + * A class represents the access keys of SignalR service. + * + */ +export interface SignalRKeys { + /** + * @member {string} [primaryKey] The primary access key. + */ + primaryKey?: string; + /** + * @member {string} [secondaryKey] The secondary access key. + */ + secondaryKey?: string; + /** + * @member {string} [primaryConnectionString] SignalR connection string + * constructed via the primaryKey + */ + primaryConnectionString?: string; + /** + * @member {string} [secondaryConnectionString] SignalR connection string + * constructed via the secondaryKey + */ + secondaryConnectionString?: string; +} + +/** + * @interface + * An interface representing RegenerateKeyParameters. + * Parameters describes the request to regenerate access keys + * + */ +export interface RegenerateKeyParameters { + /** + * @member {KeyType} [keyType] The keyType to regenerate. Must be either + * 'primary' or 'secondary'(case-insensitive). Possible values include: + * 'Primary', 'Secondary' + */ + keyType?: KeyType; +} + +/** + * @interface + * An interface representing SignalRUpdateParameters. + * Parameters for SignalR service update operation + * + */ +export interface SignalRUpdateParameters { + /** + * @member {{ [propertyName: string]: string }} [tags] A list of key value + * pairs that describe the resource. + */ + tags?: { [propertyName: string]: string }; + /** + * @member {ResourceSku} [sku] The billing information of the resource.(e.g. + * basic vs. standard) + */ + sku?: ResourceSku; + /** + * @member {SignalRCreateOrUpdateProperties} [properties] Settings used to + * provision or configure the resource + */ + properties?: SignalRCreateOrUpdateProperties; +} + +/** + * @interface + * An interface representing SignalRCreateParameters. + * Parameters for SignalR service create/update operation. + * + * Keep the same schema as AzSignalR.Models.SignalRResource + * + * @extends SignalRUpdateParameters + */ +export interface SignalRCreateParameters extends SignalRUpdateParameters { + /** + * @member {string} location Azure GEO region: e.g. West US | East US | North + * Central US | South Central US | West Europe | North Europe | East Asia | + * Southeast Asia | etc. + * The geo region of a resource never changes after it is created. + */ + location: string; +} + +/** + * @interface + * An interface representing SignalRUsageName. + * Localizable String object containing the name and a localized value. + * + */ +export interface SignalRUsageName { + /** + * @member {string} [value] The identifier of the usage. + */ + value?: string; + /** + * @member {string} [localizedValue] Localized name of the usage. + */ + localizedValue?: string; +} + +/** + * @interface + * An interface representing SignalRUsage. + * Object that describes a specific usage of SignalR resources. + * + */ +export interface SignalRUsage { + /** + * @member {string} [id] Fully qualified ARM resource id + */ + id?: string; + /** + * @member {number} [currentValue] Current value for the usage quota. + */ + currentValue?: number; + /** + * @member {number} [limit] The maximum permitted value for the usage quota. + * If there is no limit, this value will be -1. + */ + limit?: number; + /** + * @member {SignalRUsageName} [name] Localizable String object containing the + * name and a localized value. + */ + name?: SignalRUsageName; + /** + * @member {string} [unit] Representing the units of the usage quota. + * Possible values are: Count, Bytes, Seconds, Percent, CountPerSecond, + * BytesPerSecond. + */ + unit?: string; +} + +/** + * @interface + * An interface representing SignalRCheckNameAvailabilityOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface SignalRCheckNameAvailabilityOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {NameAvailabilityParameters} [parameters] Parameters supplied to + * the operation. + */ + parameters?: NameAvailabilityParameters; +} + +/** + * @interface + * An interface representing SignalRRegenerateKeyOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface SignalRRegenerateKeyOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {RegenerateKeyParameters} [parameters] Parameter that describes + * the Regenerate Key Operation. + */ + parameters?: RegenerateKeyParameters; +} + +/** + * @interface + * An interface representing SignalRCreateOrUpdateOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface SignalRCreateOrUpdateOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {SignalRCreateParameters} [parameters] Parameters for the create + * or update operation + */ + parameters?: SignalRCreateParameters; +} + +/** + * @interface + * An interface representing SignalRUpdateOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface SignalRUpdateOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {SignalRUpdateParameters} [parameters] Parameters for the update + * operation + */ + parameters?: SignalRUpdateParameters; +} + +/** + * @interface + * An interface representing SignalRBeginRegenerateKeyOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface SignalRBeginRegenerateKeyOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {RegenerateKeyParameters} [parameters] Parameter that describes + * the Regenerate Key Operation. + */ + parameters?: RegenerateKeyParameters; +} + +/** + * @interface + * An interface representing SignalRBeginCreateOrUpdateOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface SignalRBeginCreateOrUpdateOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {SignalRCreateParameters} [parameters] Parameters for the create + * or update operation + */ + parameters?: SignalRCreateParameters; +} + +/** + * @interface + * An interface representing SignalRBeginUpdateOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface SignalRBeginUpdateOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {SignalRUpdateParameters} [parameters] Parameters for the update + * operation + */ + parameters?: SignalRUpdateParameters; +} + +/** + * @interface + * An interface representing SignalRManagementClientOptions. + * @extends AzureServiceClientOptions + */ +export interface SignalRManagementClientOptions extends AzureServiceClientOptions { + /** + * @member {string} [baseUri] + */ + baseUri?: string; +} + + +/** + * @interface + * An interface representing the OperationList. + * Result of the request to list REST API operations. It contains a list of + * operations. + * + * @extends Array + */ +export interface OperationList extends Array { + /** + * @member {string} [nextLink] The URL the client should use to fetch the + * next page (per server side paging). + * It's null for now, added for future use. + */ + nextLink?: string; +} + +/** + * @interface + * An interface representing the SignalRResourceList. + * Object that includes an array of SignalR services and a possible link for + * next set. + * + * @extends Array + */ +export interface SignalRResourceList extends Array { + /** + * @member {string} [nextLink] The URL the client should use to fetch the + * next page (per server side paging). + * It's null for now, added for future use. + */ + nextLink?: string; +} + +/** + * @interface + * An interface representing the SignalRUsageList. + * Object that includes an array of SignalR resource usages and a possible link + * for next set. + * + * @extends Array + */ +export interface SignalRUsageList extends Array { + /** + * @member {string} [nextLink] The URL the client should use to fetch the + * next page (per server side paging). + * It's null for now, added for future use. + */ + nextLink?: string; +} + +/** + * Defines values for SignalRSkuTier. + * Possible values include: 'Free', 'Basic', 'Standard', 'Premium' + * @readonly + * @enum {string} + */ +export type SignalRSkuTier = 'Free' | 'Basic' | 'Standard' | 'Premium'; + +/** + * Defines values for ProvisioningState. + * Possible values include: 'Unknown', 'Succeeded', 'Failed', 'Canceled', 'Running', 'Creating', + * 'Updating', 'Deleting', 'Moving' + * @readonly + * @enum {string} + */ +export type ProvisioningState = 'Unknown' | 'Succeeded' | 'Failed' | 'Canceled' | 'Running' | 'Creating' | 'Updating' | 'Deleting' | 'Moving'; + +/** + * Defines values for KeyType. + * Possible values include: 'Primary', 'Secondary' + * @readonly + * @enum {string} + */ +export type KeyType = 'Primary' | 'Secondary'; + +/** + * Contains response data for the list operation. + */ +export type OperationsListResponse = OperationList & { + /** + * 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: OperationList; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type OperationsListNextResponse = OperationList & { + /** + * 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: OperationList; + }; +}; + +/** + * Contains response data for the checkNameAvailability operation. + */ +export type SignalRCheckNameAvailabilityResponse = NameAvailability & { + /** + * 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: NameAvailability; + }; +}; + +/** + * Contains response data for the listBySubscription operation. + */ +export type SignalRListBySubscriptionResponse = SignalRResourceList & { + /** + * 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: SignalRResourceList; + }; +}; + +/** + * Contains response data for the listByResourceGroup operation. + */ +export type SignalRListByResourceGroupResponse = SignalRResourceList & { + /** + * 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: SignalRResourceList; + }; +}; + +/** + * Contains response data for the listKeys operation. + */ +export type SignalRListKeysResponse = SignalRKeys & { + /** + * 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: SignalRKeys; + }; +}; + +/** + * Contains response data for the regenerateKey operation. + */ +export type SignalRRegenerateKeyResponse = SignalRKeys & { + /** + * 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: SignalRKeys; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type SignalRGetResponse = SignalRResource & { + /** + * 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: SignalRResource; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type SignalRCreateOrUpdateResponse = SignalRResource & { + /** + * 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: SignalRResource; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type SignalRUpdateResponse = SignalRResource & { + /** + * 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: SignalRResource; + }; +}; + +/** + * Contains response data for the beginRegenerateKey operation. + */ +export type SignalRBeginRegenerateKeyResponse = SignalRKeys & { + /** + * 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: SignalRKeys; + }; +}; + +/** + * Contains response data for the beginCreateOrUpdate operation. + */ +export type SignalRBeginCreateOrUpdateResponse = SignalRResource & { + /** + * 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: SignalRResource; + }; +}; + +/** + * Contains response data for the beginUpdate operation. + */ +export type SignalRBeginUpdateResponse = SignalRResource & { + /** + * 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: SignalRResource; + }; +}; + +/** + * Contains response data for the listBySubscriptionNext operation. + */ +export type SignalRListBySubscriptionNextResponse = SignalRResourceList & { + /** + * 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: SignalRResourceList; + }; +}; + +/** + * Contains response data for the listByResourceGroupNext operation. + */ +export type SignalRListByResourceGroupNextResponse = SignalRResourceList & { + /** + * 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: SignalRResourceList; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type UsagesListResponse = SignalRUsageList & { + /** + * 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: SignalRUsageList; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type UsagesListNextResponse = SignalRUsageList & { + /** + * 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: SignalRUsageList; + }; +}; diff --git a/sdk/signalr/arm-signalr/lib/models/mappers.ts b/sdk/signalr/arm-signalr/lib/models/mappers.ts new file mode 100644 index 000000000000..406643f3e2aa --- /dev/null +++ b/sdk/signalr/arm-signalr/lib/models/mappers.ts @@ -0,0 +1,770 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import { CloudErrorMapper, BaseResourceMapper } from "@azure/ms-rest-azure-js"; +import * as msRest from "@azure/ms-rest-js"; + +export const CloudError = CloudErrorMapper; +export const BaseResource = BaseResourceMapper; + +export const OperationDisplay: msRest.CompositeMapper = { + serializedName: "OperationDisplay", + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + } + } + } +}; + +export const Dimension: msRest.CompositeMapper = { + serializedName: "Dimension", + type: { + name: "Composite", + className: "Dimension", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + displayName: { + serializedName: "displayName", + type: { + name: "String" + } + }, + internalName: { + serializedName: "internalName", + type: { + name: "String" + } + }, + toBeExportedForShoebox: { + serializedName: "toBeExportedForShoebox", + type: { + name: "Boolean" + } + } + } + } +}; + +export const MetricSpecification: msRest.CompositeMapper = { + serializedName: "MetricSpecification", + type: { + name: "Composite", + className: "MetricSpecification", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + displayName: { + serializedName: "displayName", + type: { + name: "String" + } + }, + displayDescription: { + serializedName: "displayDescription", + type: { + name: "String" + } + }, + unit: { + serializedName: "unit", + type: { + name: "String" + } + }, + aggregationType: { + serializedName: "aggregationType", + type: { + name: "String" + } + }, + fillGapWithZero: { + serializedName: "fillGapWithZero", + type: { + name: "String" + } + }, + category: { + serializedName: "category", + type: { + name: "String" + } + }, + dimensions: { + serializedName: "dimensions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Dimension" + } + } + } + } + } + } +}; + +export const ServiceSpecification: msRest.CompositeMapper = { + serializedName: "ServiceSpecification", + type: { + name: "Composite", + className: "ServiceSpecification", + modelProperties: { + metricSpecifications: { + serializedName: "metricSpecifications", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MetricSpecification" + } + } + } + } + } + } +}; + +export const OperationProperties: msRest.CompositeMapper = { + serializedName: "OperationProperties", + type: { + name: "Composite", + className: "OperationProperties", + modelProperties: { + serviceSpecification: { + serializedName: "serviceSpecification", + type: { + name: "Composite", + className: "ServiceSpecification" + } + } + } + } +}; + +export const Operation: msRest.CompositeMapper = { + serializedName: "Operation", + type: { + name: "Composite", + className: "Operation", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + }, + origin: { + serializedName: "origin", + type: { + name: "String" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "OperationProperties" + } + } + } + } +}; + +export const NameAvailabilityParameters: msRest.CompositeMapper = { + serializedName: "NameAvailabilityParameters", + type: { + name: "Composite", + className: "NameAvailabilityParameters", + modelProperties: { + type: { + required: true, + serializedName: "type", + type: { + name: "String" + } + }, + name: { + required: true, + serializedName: "name", + type: { + name: "String" + } + } + } + } +}; + +export const NameAvailability: msRest.CompositeMapper = { + serializedName: "NameAvailability", + type: { + name: "Composite", + className: "NameAvailability", + modelProperties: { + nameAvailable: { + serializedName: "nameAvailable", + type: { + name: "Boolean" + } + }, + reason: { + serializedName: "reason", + type: { + name: "String" + } + }, + message: { + serializedName: "message", + type: { + name: "String" + } + } + } + } +}; + +export const ResourceSku: msRest.CompositeMapper = { + serializedName: "ResourceSku", + type: { + name: "Composite", + className: "ResourceSku", + modelProperties: { + name: { + required: true, + serializedName: "name", + type: { + name: "String" + } + }, + tier: { + serializedName: "tier", + type: { + name: "String" + } + }, + size: { + serializedName: "size", + type: { + name: "String" + } + }, + family: { + serializedName: "family", + type: { + name: "String" + } + }, + capacity: { + serializedName: "capacity", + type: { + name: "Number" + } + } + } + } +}; + +export const Resource: msRest.CompositeMapper = { + serializedName: "Resource", + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + +export const TrackedResource: msRest.CompositeMapper = { + serializedName: "TrackedResource", + type: { + name: "Composite", + className: "TrackedResource", + modelProperties: { + ...Resource.type.modelProperties, + location: { + serializedName: "location", + type: { + name: "String" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const SignalRResource: msRest.CompositeMapper = { + serializedName: "SignalRResource", + type: { + name: "Composite", + className: "SignalRResource", + modelProperties: { + ...TrackedResource.type.modelProperties, + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "ResourceSku" + } + }, + hostNamePrefix: { + serializedName: "properties.hostNamePrefix", + type: { + name: "String" + } + }, + features: { + serializedName: "properties.features", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SignalRFeature" + } + } + } + }, + provisioningState: { + readOnly: true, + serializedName: "properties.provisioningState", + type: { + name: "String" + } + }, + externalIP: { + readOnly: true, + serializedName: "properties.externalIP", + type: { + name: "String" + } + }, + hostName: { + readOnly: true, + serializedName: "properties.hostName", + type: { + name: "String" + } + }, + publicPort: { + readOnly: true, + serializedName: "properties.publicPort", + type: { + name: "Number" + } + }, + serverPort: { + readOnly: true, + serializedName: "properties.serverPort", + type: { + name: "Number" + } + }, + version: { + serializedName: "properties.version", + type: { + name: "String" + } + } + } + } +}; + +export const SignalRFeature: msRest.CompositeMapper = { + serializedName: "SignalRFeature", + type: { + name: "Composite", + className: "SignalRFeature", + modelProperties: { + flag: { + required: true, + isConstant: true, + serializedName: "flag", + defaultValue: 'ServiceMode', + type: { + name: "String" + } + }, + value: { + required: true, + serializedName: "value", + constraints: { + MaxLength: 128, + MinLength: 1 + }, + type: { + name: "String" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const SignalRCreateOrUpdateProperties: msRest.CompositeMapper = { + serializedName: "SignalRCreateOrUpdateProperties", + type: { + name: "Composite", + className: "SignalRCreateOrUpdateProperties", + modelProperties: { + hostNamePrefix: { + serializedName: "hostNamePrefix", + type: { + name: "String" + } + }, + features: { + serializedName: "features", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SignalRFeature" + } + } + } + } + } + } +}; + +export const SignalRKeys: msRest.CompositeMapper = { + serializedName: "SignalRKeys", + type: { + name: "Composite", + className: "SignalRKeys", + modelProperties: { + primaryKey: { + serializedName: "primaryKey", + type: { + name: "String" + } + }, + secondaryKey: { + serializedName: "secondaryKey", + type: { + name: "String" + } + }, + primaryConnectionString: { + serializedName: "primaryConnectionString", + type: { + name: "String" + } + }, + secondaryConnectionString: { + serializedName: "secondaryConnectionString", + type: { + name: "String" + } + } + } + } +}; + +export const RegenerateKeyParameters: msRest.CompositeMapper = { + serializedName: "RegenerateKeyParameters", + type: { + name: "Composite", + className: "RegenerateKeyParameters", + modelProperties: { + keyType: { + serializedName: "keyType", + type: { + name: "String" + } + } + } + } +}; + +export const SignalRUpdateParameters: msRest.CompositeMapper = { + serializedName: "SignalRUpdateParameters", + type: { + name: "Composite", + className: "SignalRUpdateParameters", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + }, + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "ResourceSku" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "SignalRCreateOrUpdateProperties" + } + } + } + } +}; + +export const SignalRCreateParameters: msRest.CompositeMapper = { + serializedName: "SignalRCreateParameters", + type: { + name: "Composite", + className: "SignalRCreateParameters", + modelProperties: { + ...SignalRUpdateParameters.type.modelProperties, + location: { + required: true, + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const SignalRUsageName: msRest.CompositeMapper = { + serializedName: "SignalRUsageName", + type: { + name: "Composite", + className: "SignalRUsageName", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "String" + } + }, + localizedValue: { + serializedName: "localizedValue", + type: { + name: "String" + } + } + } + } +}; + +export const SignalRUsage: msRest.CompositeMapper = { + serializedName: "SignalRUsage", + type: { + name: "Composite", + className: "SignalRUsage", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + }, + currentValue: { + serializedName: "currentValue", + type: { + name: "Number" + } + }, + limit: { + serializedName: "limit", + type: { + name: "Number" + } + }, + name: { + serializedName: "name", + type: { + name: "Composite", + className: "SignalRUsageName" + } + }, + unit: { + serializedName: "unit", + type: { + name: "String" + } + } + } + } +}; + +export const OperationList: msRest.CompositeMapper = { + serializedName: "OperationList", + type: { + name: "Composite", + className: "OperationList", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const SignalRResourceList: msRest.CompositeMapper = { + serializedName: "SignalRResourceList", + type: { + name: "Composite", + className: "SignalRResourceList", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SignalRResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const SignalRUsageList: msRest.CompositeMapper = { + serializedName: "SignalRUsageList", + type: { + name: "Composite", + className: "SignalRUsageList", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SignalRUsage" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/signalr/arm-signalr/lib/models/operationsMappers.ts b/sdk/signalr/arm-signalr/lib/models/operationsMappers.ts new file mode 100644 index 000000000000..d93e18a3f028 --- /dev/null +++ b/sdk/signalr/arm-signalr/lib/models/operationsMappers.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export { + OperationList, + Operation, + OperationDisplay, + OperationProperties, + ServiceSpecification, + MetricSpecification, + Dimension, + CloudError +} from "../models/mappers"; + diff --git a/sdk/signalr/arm-signalr/lib/models/parameters.ts b/sdk/signalr/arm-signalr/lib/models/parameters.ts new file mode 100644 index 000000000000..ec86d0d978e4 --- /dev/null +++ b/sdk/signalr/arm-signalr/lib/models/parameters.ts @@ -0,0 +1,83 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; + +export const acceptLanguage: msRest.OperationParameter = { + parameterPath: "acceptLanguage", + mapper: { + serializedName: "accept-language", + defaultValue: 'en-US', + type: { + name: "String" + } + } +}; +export const apiVersion: msRest.OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + required: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; +export const location: msRest.OperationURLParameter = { + parameterPath: "location", + mapper: { + required: true, + serializedName: "location", + type: { + name: "String" + } + } +}; +export const nextPageLink: msRest.OperationURLParameter = { + parameterPath: "nextPageLink", + mapper: { + required: true, + serializedName: "nextLink", + type: { + name: "String" + } + }, + skipEncoding: true +}; +export const resourceGroupName: msRest.OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + required: true, + serializedName: "resourceGroupName", + type: { + name: "String" + } + } +}; +export const resourceName: msRest.OperationURLParameter = { + parameterPath: "resourceName", + mapper: { + required: true, + serializedName: "resourceName", + type: { + name: "String" + } + } +}; +export const subscriptionId: msRest.OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + required: true, + serializedName: "subscriptionId", + type: { + name: "String" + } + } +}; diff --git a/sdk/signalr/arm-signalr/lib/models/signalRMappers.ts b/sdk/signalr/arm-signalr/lib/models/signalRMappers.ts new file mode 100644 index 000000000000..dcf2f9f9ad10 --- /dev/null +++ b/sdk/signalr/arm-signalr/lib/models/signalRMappers.ts @@ -0,0 +1,28 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export { + NameAvailabilityParameters, + NameAvailability, + CloudError, + SignalRResourceList, + SignalRResource, + TrackedResource, + Resource, + BaseResource, + ResourceSku, + SignalRFeature, + SignalRKeys, + RegenerateKeyParameters, + SignalRCreateParameters, + SignalRUpdateParameters, + SignalRCreateOrUpdateProperties +} from "../models/mappers"; + diff --git a/sdk/signalr/arm-signalr/lib/models/usagesMappers.ts b/sdk/signalr/arm-signalr/lib/models/usagesMappers.ts new file mode 100644 index 000000000000..0b672776f340 --- /dev/null +++ b/sdk/signalr/arm-signalr/lib/models/usagesMappers.ts @@ -0,0 +1,17 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export { + SignalRUsageList, + SignalRUsage, + SignalRUsageName, + CloudError +} from "../models/mappers"; + diff --git a/sdk/signalr/arm-signalr/lib/operations/index.ts b/sdk/signalr/arm-signalr/lib/operations/index.ts new file mode 100644 index 000000000000..1e9f2c2dc3dc --- /dev/null +++ b/sdk/signalr/arm-signalr/lib/operations/index.ts @@ -0,0 +1,13 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export * from "./operations"; +export * from "./signalR"; +export * from "./usages"; diff --git a/sdk/signalr/arm-signalr/lib/operations/operations.ts b/sdk/signalr/arm-signalr/lib/operations/operations.ts new file mode 100644 index 000000000000..b2828462ae65 --- /dev/null +++ b/sdk/signalr/arm-signalr/lib/operations/operations.ts @@ -0,0 +1,123 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/operationsMappers"; +import * as Parameters from "../models/parameters"; +import { SignalRManagementClientContext } from "../signalRManagementClientContext"; + +/** Class representing a Operations. */ +export class Operations { + private readonly client: SignalRManagementClientContext; + + /** + * Create a Operations. + * @param {SignalRManagementClientContext} client Reference to the service client. + */ + constructor(client: SignalRManagementClientContext) { + this.client = client; + } + + /** + * Lists all of the available REST API operations of the Microsoft.SignalRService provider. + * @param [options] The optional parameters + * @returns Promise + */ + list(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + list(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Lists all of the available REST API operations of the Microsoft.SignalRService provider. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.SignalRService/operations", + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OperationList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OperationList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/signalr/arm-signalr/lib/operations/signalR.ts b/sdk/signalr/arm-signalr/lib/operations/signalR.ts new file mode 100644 index 000000000000..acb3200beeba --- /dev/null +++ b/sdk/signalr/arm-signalr/lib/operations/signalR.ts @@ -0,0 +1,718 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; +import * as Models from "../models"; +import * as Mappers from "../models/signalRMappers"; +import * as Parameters from "../models/parameters"; +import { SignalRManagementClientContext } from "../signalRManagementClientContext"; + +/** Class representing a SignalR. */ +export class SignalR { + private readonly client: SignalRManagementClientContext; + + /** + * Create a SignalR. + * @param {SignalRManagementClientContext} client Reference to the service client. + */ + constructor(client: SignalRManagementClientContext) { + this.client = client; + } + + /** + * Checks that the SignalR name is valid and is not already in use. + * @param location the region + * @param [options] The optional parameters + * @returns Promise + */ + checkNameAvailability(location: string, options?: Models.SignalRCheckNameAvailabilityOptionalParams): Promise; + /** + * @param location the region + * @param callback The callback + */ + checkNameAvailability(location: string, callback: msRest.ServiceCallback): void; + /** + * @param location the region + * @param options The optional parameters + * @param callback The callback + */ + checkNameAvailability(location: string, options: Models.SignalRCheckNameAvailabilityOptionalParams, callback: msRest.ServiceCallback): void; + checkNameAvailability(location: string, options?: Models.SignalRCheckNameAvailabilityOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + location, + options + }, + checkNameAvailabilityOperationSpec, + callback) as Promise; + } + + /** + * Handles requests to list all resources in a subscription. + * @param [options] The optional parameters + * @returns Promise + */ + listBySubscription(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + listBySubscription(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + listBySubscription(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listBySubscription(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listBySubscriptionOperationSpec, + callback) as Promise; + } + + /** + * Handles requests to list all resources in a resource group. + * @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 [options] The optional parameters + * @returns Promise + */ + listByResourceGroup(resourceGroupName: 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 callback The callback + */ + listByResourceGroup(resourceGroupName: 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 options The optional parameters + * @param callback The callback + */ + listByResourceGroup(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + options + }, + listByResourceGroupOperationSpec, + callback) as Promise; + } + + /** + * Get the access keys of the SignalR 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 SignalR resource. + * @param [options] The optional parameters + * @returns Promise + */ + listKeys(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 SignalR resource. + * @param callback The callback + */ + listKeys(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 SignalR resource. + * @param options The optional parameters + * @param callback The callback + */ + listKeys(resourceGroupName: string, resourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listKeys(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + resourceName, + options + }, + listKeysOperationSpec, + callback) as Promise; + } + + /** + * Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be regenerated at the + * same time. + * @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 SignalR resource. + * @param [options] The optional parameters + * @returns Promise + */ + regenerateKey(resourceGroupName: string, resourceName: string, options?: Models.SignalRRegenerateKeyOptionalParams): Promise { + return this.beginRegenerateKey(resourceGroupName,resourceName,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Get the SignalR service and its properties. + * @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 SignalR resource. + * @param [options] The optional parameters + * @returns Promise + */ + get(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 SignalR resource. + * @param callback The callback + */ + get(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 SignalR resource. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, resourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + resourceName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Create a new SignalR service and update an exiting SignalR service. + * @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 SignalR resource. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(resourceGroupName: string, resourceName: string, options?: Models.SignalRCreateOrUpdateOptionalParams): Promise { + return this.beginCreateOrUpdate(resourceGroupName,resourceName,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Operation to delete a SignalR service. + * @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 SignalR resource. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteMethod(resourceGroupName,resourceName,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Operation to update an exiting SignalR service. + * @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 SignalR resource. + * @param [options] The optional parameters + * @returns Promise + */ + update(resourceGroupName: string, resourceName: string, options?: Models.SignalRUpdateOptionalParams): Promise { + return this.beginUpdate(resourceGroupName,resourceName,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Operation to restart a SignalR service. + * @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 SignalR resource. + * @param [options] The optional parameters + * @returns Promise + */ + restart(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginRestart(resourceGroupName,resourceName,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be regenerated at the + * same time. + * @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 SignalR resource. + * @param [options] The optional parameters + * @returns Promise + */ + beginRegenerateKey(resourceGroupName: string, resourceName: string, options?: Models.SignalRBeginRegenerateKeyOptionalParams): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + resourceName, + options + }, + beginRegenerateKeyOperationSpec, + options); + } + + /** + * Create a new SignalR service and update an exiting SignalR service. + * @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 SignalR resource. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreateOrUpdate(resourceGroupName: string, resourceName: string, options?: Models.SignalRBeginCreateOrUpdateOptionalParams): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + resourceName, + options + }, + beginCreateOrUpdateOperationSpec, + options); + } + + /** + * Operation to delete a SignalR service. + * @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 SignalR resource. + * @param [options] The optional parameters + * @returns Promise + */ + beginDeleteMethod(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + resourceName, + options + }, + beginDeleteMethodOperationSpec, + options); + } + + /** + * Operation to update an exiting SignalR service. + * @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 SignalR resource. + * @param [options] The optional parameters + * @returns Promise + */ + beginUpdate(resourceGroupName: string, resourceName: string, options?: Models.SignalRBeginUpdateOptionalParams): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + resourceName, + options + }, + beginUpdateOperationSpec, + options); + } + + /** + * Operation to restart a SignalR service. + * @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 SignalR resource. + * @param [options] The optional parameters + * @returns Promise + */ + beginRestart(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + resourceName, + options + }, + beginRestartOperationSpec, + options); + } + + /** + * Handles requests to list all resources in a subscription. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listBySubscriptionNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listBySubscriptionNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listBySubscriptionNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listBySubscriptionNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listBySubscriptionNextOperationSpec, + callback) as Promise; + } + + /** + * Handles requests to list all resources in a resource group. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listByResourceGroupNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listByResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listByResourceGroupNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const checkNameAvailabilityOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/Microsoft.SignalRService/locations/{location}/checkNameAvailability", + urlParameters: [ + Parameters.location, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: [ + "options", + "parameters" + ], + mapper: Mappers.NameAvailabilityParameters + }, + responses: { + 200: { + bodyMapper: Mappers.NameAvailability + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listBySubscriptionOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.SignalRService/SignalR", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SignalRResourceList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listByResourceGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/SignalR", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SignalRResourceList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listKeysOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/SignalR/{resourceName}/listKeys", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SignalRKeys + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SignalRResource + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginRegenerateKeyOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/SignalR/{resourceName}/regenerateKey", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: [ + "options", + "parameters" + ], + mapper: Mappers.RegenerateKeyParameters + }, + responses: { + 201: { + bodyMapper: Mappers.SignalRKeys + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: [ + "options", + "parameters" + ], + mapper: Mappers.SignalRCreateParameters + }, + responses: { + 201: { + bodyMapper: Mappers.SignalRResource + }, + 202: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginDeleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: [ + "options", + "parameters" + ], + mapper: Mappers.SignalRUpdateParameters + }, + responses: { + 200: { + bodyMapper: Mappers.SignalRResource + }, + 202: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginRestartOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/restart", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listBySubscriptionNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SignalRResourceList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SignalRResourceList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/signalr/arm-signalr/lib/operations/usages.ts b/sdk/signalr/arm-signalr/lib/operations/usages.ts new file mode 100644 index 000000000000..e7fab0c70031 --- /dev/null +++ b/sdk/signalr/arm-signalr/lib/operations/usages.ts @@ -0,0 +1,131 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/usagesMappers"; +import * as Parameters from "../models/parameters"; +import { SignalRManagementClientContext } from "../signalRManagementClientContext"; + +/** Class representing a Usages. */ +export class Usages { + private readonly client: SignalRManagementClientContext; + + /** + * Create a Usages. + * @param {SignalRManagementClientContext} client Reference to the service client. + */ + constructor(client: SignalRManagementClientContext) { + this.client = client; + } + + /** + * List usage quotas for Azure SignalR service by location. + * @param location the location like "eastus" + * @param [options] The optional parameters + * @returns Promise + */ + list(location: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param location the location like "eastus" + * @param callback The callback + */ + list(location: string, callback: msRest.ServiceCallback): void; + /** + * @param location the location like "eastus" + * @param options The optional parameters + * @param callback The callback + */ + list(location: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(location: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + location, + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * List usage quotas for Azure SignalR service by location. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.SignalRService/locations/{location}/usages", + urlParameters: [ + Parameters.location, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SignalRUsageList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SignalRUsageList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/signalr/arm-signalr/lib/signalRManagementClient.ts b/sdk/signalr/arm-signalr/lib/signalRManagementClient.ts new file mode 100644 index 000000000000..f83378e7b55b --- /dev/null +++ b/sdk/signalr/arm-signalr/lib/signalRManagementClient.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "./models"; +import * as Mappers from "./models/mappers"; +import * as operations from "./operations"; +import { SignalRManagementClientContext } from "./signalRManagementClientContext"; + + +class SignalRManagementClient extends SignalRManagementClientContext { + // Operation groups + operations: operations.Operations; + signalR: operations.SignalR; + usages: operations.Usages; + + /** + * Initializes a new instance of the SignalRManagementClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId Gets subscription Id which uniquely identify the Microsoft Azure + * subscription. The subscription ID forms part of the URI for every service call. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.SignalRManagementClientOptions) { + super(credentials, subscriptionId, options); + this.operations = new operations.Operations(this); + this.signalR = new operations.SignalR(this); + this.usages = new operations.Usages(this); + } +} + +// Operation Specifications + +export { + SignalRManagementClient, + SignalRManagementClientContext, + Models as SignalRManagementModels, + Mappers as SignalRManagementMappers +}; +export * from "./operations"; diff --git a/sdk/signalr/arm-signalr/lib/signalRManagementClientContext.ts b/sdk/signalr/arm-signalr/lib/signalRManagementClientContext.ts new file mode 100644 index 000000000000..34a8d9a26995 --- /dev/null +++ b/sdk/signalr/arm-signalr/lib/signalRManagementClientContext.ts @@ -0,0 +1,63 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as Models from "./models"; +import * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; + +const packageName = "@azure/arm-signalr"; +const packageVersion = "1.2.0"; + +export class SignalRManagementClientContext extends msRestAzure.AzureServiceClient { + credentials: msRest.ServiceClientCredentials; + apiVersion?: string; + subscriptionId: string; + + /** + * Initializes a new instance of the SignalRManagementClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId Gets subscription Id which uniquely identify the Microsoft Azure + * subscription. The subscription ID forms part of the URI for every service call. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.SignalRManagementClientOptions) { + if (credentials == undefined) { + throw new Error('\'credentials\' cannot be null.'); + } + if (subscriptionId == undefined) { + throw new Error('\'subscriptionId\' cannot be null.'); + } + + if (!options) { + options = {}; + } + if(!options.userAgent) { + const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); + options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; + } + + super(credentials, options); + + this.apiVersion = '2018-10-01'; + this.acceptLanguage = 'en-US'; + this.longRunningOperationRetryTimeout = 30; + this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; + this.requestContentType = "application/json; charset=utf-8"; + this.credentials = credentials; + this.subscriptionId = subscriptionId; + + if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { + this.acceptLanguage = options.acceptLanguage; + } + if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { + this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; + } + } +} diff --git a/sdk/signalr/arm-signalr/package.json b/sdk/signalr/arm-signalr/package.json index ee959f237a24..00a50acaf4ec 100644 --- a/sdk/signalr/arm-signalr/package.json +++ b/sdk/signalr/arm-signalr/package.json @@ -4,8 +4,8 @@ "description": "SignalRManagementClient Library with typescript type definitions for node.js and browser.", "version": "1.2.0", "dependencies": { - "@azure/ms-rest-azure-js": "^1.1.0", - "@azure/ms-rest-js": "^1.1.0", + "@azure/ms-rest-azure-js": "^1.2.0", + "@azure/ms-rest-js": "^1.2.0", "tslib": "^1.9.3" }, "keywords": [ @@ -23,9 +23,10 @@ "typescript": "^3.1.1", "rollup": "^0.66.2", "rollup-plugin-node-resolve": "^3.4.0", + "rollup-plugin-sourcemaps": "^0.4.2", "uglify-js": "^3.4.9" }, - "homepage": "https://github.com/azure/azure-sdk-for-js/tree/master/sdk/signalr/arm-signalr", + "homepage": "https://github.com/azure/azure-sdk-for-js", "repository": { "type": "git", "url": "https://github.com/azure/azure-sdk-for-js.git" @@ -42,7 +43,7 @@ "esm/**/*.js.map", "esm/**/*.d.ts", "esm/**/*.d.ts.map", - "src/**/*.ts", + "lib/**/*.ts", "rollup.config.js", "tsconfig.json" ], @@ -51,6 +52,5 @@ "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-signalr.js.map'\" -o ./dist/arm-signalr.min.js ./dist/arm-signalr.js", "prepack": "npm install && npm run build" }, - "sideEffects": false, - "authPublish": true + "sideEffects": false } diff --git a/sdk/signalr/arm-signalr/rollup.config.js b/sdk/signalr/arm-signalr/rollup.config.js index 5ce4fd696a08..7ee4e27aa63f 100644 --- a/sdk/signalr/arm-signalr/rollup.config.js +++ b/sdk/signalr/arm-signalr/rollup.config.js @@ -1,10 +1,16 @@ +import rollup from "rollup"; import nodeResolve from "rollup-plugin-node-resolve"; +import sourcemaps from "rollup-plugin-sourcemaps"; + /** - * @type {import('rollup').RollupFileOptions} + * @type {rollup.RollupFileOptions} */ const config = { - input: './esm/signalRManagementClient.js', - external: ["@azure/ms-rest-js", "@azure/ms-rest-azure-js"], + input: "./esm/signalRManagementClient.js", + external: [ + "@azure/ms-rest-js", + "@azure/ms-rest-azure-js" + ], output: { file: "./dist/arm-signalr.js", format: "umd", @@ -16,16 +22,16 @@ const config = { }, banner: `/* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Licensed under the MIT License. See License.txt in the project root for license information. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */` }, plugins: [ - nodeResolve({ module: true }) + nodeResolve({ module: true }), + sourcemaps() ] }; + export default config; diff --git a/sdk/signalr/arm-signalr/tsconfig.json b/sdk/signalr/arm-signalr/tsconfig.json index 87bbf5b5fa49..51ea90961ce5 100644 --- a/sdk/signalr/arm-signalr/tsconfig.json +++ b/sdk/signalr/arm-signalr/tsconfig.json @@ -14,6 +14,6 @@ "outDir": "./esm", "importHelpers": true }, - "include": ["./src/**/*.ts"], + "include": ["./lib/**/*.ts"], "exclude": ["node_modules"] }