From b8bbae9cc21ccfb6efa0384fb9923bf3751c5e15 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 12 Oct 2018 17:01:01 +0000 Subject: [PATCH 1/2] Generated from f40292b667f4b6ce5b580131a308c336c9a9c9fc Add deviceprovisioningservices/resource-manager/readme.typescript.md --- .../arm-deviceprovisioningservices/.npmignore | 35 + .../LICENSE.txt | 21 + .../arm-deviceprovisioningservices/README.md | 67 + .../lib/iotDpsClient.ts | 46 + .../lib/iotDpsClientContext.ts | 65 + .../lib/models/dpsCertificateMappers.ts | 28 + .../lib/models/index.ts | 1403 +++++++++++++++++ .../lib/models/iotDpsResourceMappers.ts | 35 + .../lib/models/mappers.ts | 872 ++++++++++ .../lib/models/operationsMappers.ts | 17 + .../lib/models/parameters.ts | 245 +++ .../lib/operations/dpsCertificate.ts | 478 ++++++ .../lib/operations/index.ts | 13 + .../lib/operations/iotDpsResource.ts | 907 +++++++++++ .../lib/operations/operations.ts | 123 ++ .../package.json | 39 + .../tsconfig.esm.json | 8 + .../tsconfig.json | 18 + .../webpack.config.js | 30 + 19 files changed, 4450 insertions(+) create mode 100644 packages/@azure/arm-deviceprovisioningservices/.npmignore create mode 100644 packages/@azure/arm-deviceprovisioningservices/LICENSE.txt create mode 100644 packages/@azure/arm-deviceprovisioningservices/README.md create mode 100644 packages/@azure/arm-deviceprovisioningservices/lib/iotDpsClient.ts create mode 100644 packages/@azure/arm-deviceprovisioningservices/lib/iotDpsClientContext.ts create mode 100644 packages/@azure/arm-deviceprovisioningservices/lib/models/dpsCertificateMappers.ts create mode 100644 packages/@azure/arm-deviceprovisioningservices/lib/models/index.ts create mode 100644 packages/@azure/arm-deviceprovisioningservices/lib/models/iotDpsResourceMappers.ts create mode 100644 packages/@azure/arm-deviceprovisioningservices/lib/models/mappers.ts create mode 100644 packages/@azure/arm-deviceprovisioningservices/lib/models/operationsMappers.ts create mode 100644 packages/@azure/arm-deviceprovisioningservices/lib/models/parameters.ts create mode 100644 packages/@azure/arm-deviceprovisioningservices/lib/operations/dpsCertificate.ts create mode 100644 packages/@azure/arm-deviceprovisioningservices/lib/operations/index.ts create mode 100644 packages/@azure/arm-deviceprovisioningservices/lib/operations/iotDpsResource.ts create mode 100644 packages/@azure/arm-deviceprovisioningservices/lib/operations/operations.ts create mode 100644 packages/@azure/arm-deviceprovisioningservices/package.json create mode 100644 packages/@azure/arm-deviceprovisioningservices/tsconfig.esm.json create mode 100644 packages/@azure/arm-deviceprovisioningservices/tsconfig.json create mode 100644 packages/@azure/arm-deviceprovisioningservices/webpack.config.js diff --git a/packages/@azure/arm-deviceprovisioningservices/.npmignore b/packages/@azure/arm-deviceprovisioningservices/.npmignore new file mode 100644 index 000000000000..a07a455ac10c --- /dev/null +++ b/packages/@azure/arm-deviceprovisioningservices/.npmignore @@ -0,0 +1,35 @@ +#git +.git +.gitignore +#gulp +gulpfile.js +#documentation +doc/ +docs/ +#dependencies +node_modules/ +#samples +sample/ +samples/ +#tests +test/ +tests/ +coverage/ +#tools and scripts +tools/ +scripts/ +#IDE settings +*.sln +.vscode/ +.idea +.editorconfig +.ntvs_analysis.* +#build tools +.travis.yml +.jenkins.yml +.codeclimate.yml +appveyor.yml +# Nuget packages # +.nuget/ +packages/ +packages.config diff --git a/packages/@azure/arm-deviceprovisioningservices/LICENSE.txt b/packages/@azure/arm-deviceprovisioningservices/LICENSE.txt new file mode 100644 index 000000000000..5431ba98b936 --- /dev/null +++ b/packages/@azure/arm-deviceprovisioningservices/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2018 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 +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/@azure/arm-deviceprovisioningservices/README.md b/packages/@azure/arm-deviceprovisioningservices/README.md new file mode 100644 index 000000000000..7e9f982c31ae --- /dev/null +++ b/packages/@azure/arm-deviceprovisioningservices/README.md @@ -0,0 +1,67 @@ +# Azure IotDpsClient SDK for JavaScript +This package contains an isomorphic SDK for IotDpsClient. + +## Currently supported environments +- Node.js version 6.x.x or higher +- Browser JavaScript + +## How to Install +``` +npm install @azure/arm-deviceprovisioningservices +``` + + +## How to use + +### nodejs - Authentication, client creation and list operations as an example written in TypeScript. + +```ts +import * as msRest from "ms-rest-js"; +import * as msRestAzure from "ms-rest-azure-js"; +import * as msRestNodeAuth from "ms-rest-nodeauth"; +import { IotDpsClient, IotDpsModels, IotDpsMappers } from "@azure/arm-deviceprovisioningservices"; +const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; + +msRestNodeAuth.interactiveLogin().then((creds) => { + const client = new IotDpsClient(creds, subscriptionId); + client.operations.list().then((result) => { + console.log("The result is:"); + console.log(result); + }); +}).catch((err) => { + console.error(err); +}); +``` + +### browser - Authentication, client creation and list operations as an example written in JavaScript. + +- index.html +```html + + + + @azure/arm-deviceprovisioningservices sample + + + + + + + + +``` + +# Related projects + - [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) diff --git a/packages/@azure/arm-deviceprovisioningservices/lib/iotDpsClient.ts b/packages/@azure/arm-deviceprovisioningservices/lib/iotDpsClient.ts new file mode 100644 index 000000000000..7a074ec997bb --- /dev/null +++ b/packages/@azure/arm-deviceprovisioningservices/lib/iotDpsClient.ts @@ -0,0 +1,46 @@ +/* + * 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 "ms-rest-js"; +import * as Models from "./models"; +import * as Mappers from "./models/mappers"; +import * as operations from "./operations"; +import { IotDpsClientContext } from "./iotDpsClientContext"; + + +class IotDpsClient extends IotDpsClientContext { + // Operation groups + operations: operations.Operations; + dpsCertificate: operations.DpsCertificate; + iotDpsResource: operations.IotDpsResource; + + /** + * Initializes a new instance of the IotDpsClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId The subscription identifier. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.IotDpsClientOptions) { + super(credentials, subscriptionId, options); + this.operations = new operations.Operations(this); + this.dpsCertificate = new operations.DpsCertificate(this); + this.iotDpsResource = new operations.IotDpsResource(this); + } +} + +// Operation Specifications + +export { + IotDpsClient, + IotDpsClientContext, + Models as IotDpsModels, + Mappers as IotDpsMappers +}; +export * from "./operations"; diff --git a/packages/@azure/arm-deviceprovisioningservices/lib/iotDpsClientContext.ts b/packages/@azure/arm-deviceprovisioningservices/lib/iotDpsClientContext.ts new file mode 100644 index 000000000000..92d541c812a3 --- /dev/null +++ b/packages/@azure/arm-deviceprovisioningservices/lib/iotDpsClientContext.ts @@ -0,0 +1,65 @@ +/* + * 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 "ms-rest-js"; +import * as msRestAzure from "ms-rest-azure-js"; + +const packageName = "@azure/arm-deviceprovisioningservices"; +const packageVersion = "1.0.0"; + +export class IotDpsClientContext extends msRestAzure.AzureServiceClient { + + credentials: msRest.ServiceClientCredentials; + + subscriptionId: string; + + apiVersion: string; + + acceptLanguage: string; + + longRunningOperationRetryTimeout: number; + + /** + * Initializes a new instance of the IotDpsClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId The subscription identifier. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.IotDpsClientOptions) { + if (credentials == undefined) { + throw new Error('\'credentials\' cannot be null.'); + } + if (subscriptionId == undefined) { + throw new Error('\'subscriptionId\' cannot be null.'); + } + + if (!options) { + options = {}; + } + super(credentials, options); + + this.apiVersion = '2018-01-22'; + 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; + + this.addUserAgentInfo(`${packageName}/${packageVersion}`); + 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/packages/@azure/arm-deviceprovisioningservices/lib/models/dpsCertificateMappers.ts b/packages/@azure/arm-deviceprovisioningservices/lib/models/dpsCertificateMappers.ts new file mode 100644 index 000000000000..1f211111d514 --- /dev/null +++ b/packages/@azure/arm-deviceprovisioningservices/lib/models/dpsCertificateMappers.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 { + CertificateResponse, + BaseResource, + CertificateProperties, + ErrorDetails, + CertificateBodyDescription, + CertificateListDescription, + VerificationCodeResponse, + VerificationCodeResponseProperties, + VerificationCodeRequest, + Resource, + ProvisioningServiceDescription, + IotDpsPropertiesDescription, + IotHubDefinitionDescription, + SharedAccessSignatureAuthorizationRuleAccessRightsDescription, + IotDpsSkuInfo +} from "../models/mappers"; + diff --git a/packages/@azure/arm-deviceprovisioningservices/lib/models/index.ts b/packages/@azure/arm-deviceprovisioningservices/lib/models/index.ts new file mode 100644 index 000000000000..91a8ffa13b24 --- /dev/null +++ b/packages/@azure/arm-deviceprovisioningservices/lib/models/index.ts @@ -0,0 +1,1403 @@ +/* + * 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 "ms-rest-azure-js"; +import * as msRest from "ms-rest-js"; + +export { BaseResource, CloudError }; + + +/** + * @interface + * An interface representing ErrorMesssage. + * Error response containing message and code. + * + */ +export interface ErrorMesssage { + /** + * @member {string} [code] standard error code + */ + code?: string; + /** + * @member {string} [message] standard error description + */ + message?: string; + /** + * @member {string} [details] detailed summary of error + */ + details?: string; +} + +/** + * @interface + * An interface representing AsyncOperationResult. + * Result of a long running operation. + * + */ +export interface AsyncOperationResult { + /** + * @member {string} [status] current status of a long running operation. + */ + status?: string; + /** + * @member {ErrorMesssage} [error] Error message containing code, description + * and details + */ + error?: ErrorMesssage; +} + +/** + * @interface + * An interface representing CertificateProperties. + * The description of an X509 CA Certificate. + * + */ +export interface CertificateProperties { + /** + * @member {string} [subject] The certificate's subject name. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly subject?: string; + /** + * @member {Date} [expiry] The certificate's expiration date and time. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly expiry?: Date; + /** + * @member {string} [thumbprint] The certificate's thumbprint. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly thumbprint?: string; + /** + * @member {boolean} [isVerified] Determines whether certificate has been + * verified. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly isVerified?: boolean; + /** + * @member {Date} [created] The certificate's creation date and time. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly created?: Date; + /** + * @member {Date} [updated] The certificate's last update date and time. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly updated?: Date; +} + +/** + * @interface + * An interface representing CertificateResponse. + * The X509 Certificate. + * + * @extends BaseResource + */ +export interface CertificateResponse extends BaseResource { + /** + * @member {CertificateProperties} [properties] properties of a certificate + */ + properties?: CertificateProperties; + /** + * @member {string} [id] The resource identifier. + * **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 certificate. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {string} [etag] The entity tag. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly etag?: string; + /** + * @member {string} [type] The resource type. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly type?: string; +} + +/** + * @interface + * An interface representing CertificateListDescription. + * The JSON-serialized array of Certificate objects. + * + */ +export interface CertificateListDescription { + /** + * @member {CertificateResponse[]} [value] The array of Certificate objects. + */ + value?: CertificateResponse[]; +} + +/** + * @interface + * An interface representing CertificateBodyDescription. + * The JSON-serialized X509 Certificate. + * + */ +export interface CertificateBodyDescription { + /** + * @member {string} [certificate] Base-64 representation of the X509 leaf + * certificate .cer file or just .pem file content. + */ + certificate?: string; +} + +/** + * @interface + * An interface representing IotDpsSkuInfo. + * List of possible provisoning service SKUs. + * + */ +export interface IotDpsSkuInfo { + /** + * @member {IotDpsSku} [name] Sku name. Possible values include: 'S1' + */ + name?: IotDpsSku; + /** + * @member {string} [tier] Pricing tier name of the provisioning service. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly tier?: string; + /** + * @member {number} [capacity] The number of units to provision + */ + capacity?: number; +} + +/** + * @interface + * An interface representing IotHubDefinitionDescription. + * Description of the IoT hub. + * + */ +export interface IotHubDefinitionDescription { + /** + * @member {boolean} [applyAllocationPolicy] flag for applying + * allocationPolicy or not for a given iot hub. + */ + applyAllocationPolicy?: boolean; + /** + * @member {number} [allocationWeight] weight to apply for a given iot h. + */ + allocationWeight?: number; + /** + * @member {string} [name] Host name of the IoT hub. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {string} connectionString Connection string og the IoT hub. + */ + connectionString: string; + /** + * @member {string} location ARM region of the IoT hub. + */ + location: string; +} + +/** + * @interface + * An interface representing SharedAccessSignatureAuthorizationRuleAccessRightsDescription. + * Description of the shared access key. + * + */ +export interface SharedAccessSignatureAuthorizationRuleAccessRightsDescription { + /** + * @member {string} keyName Name of the key. + */ + keyName: string; + /** + * @member {string} [primaryKey] Primary SAS key value. + */ + primaryKey?: string; + /** + * @member {string} [secondaryKey] Secondary SAS key value. + */ + secondaryKey?: string; + /** + * @member {AccessRightsDescription} rights Rights that this key has. + * Possible values include: 'ServiceConfig', 'EnrollmentRead', + * 'EnrollmentWrite', 'DeviceConnect', 'RegistrationStatusRead', + * 'RegistrationStatusWrite' + */ + rights: AccessRightsDescription; +} + +/** + * @interface + * An interface representing IotDpsPropertiesDescription. + * the service specific properties of a provisoning service, including keys, + * linked iot hubs, current state, and system generated properties such as + * hostname and idScope + * + */ +export interface IotDpsPropertiesDescription { + /** + * @member {State} [state] Current state of the provisioning service. + * Possible values include: 'Activating', 'Active', 'Deleting', 'Deleted', + * 'ActivationFailed', 'DeletionFailed', 'Transitioning', 'Suspending', + * 'Suspended', 'Resuming', 'FailingOver', 'FailoverFailed' + */ + state?: State; + /** + * @member {string} [provisioningState] The ARM provisioning state of the + * provisioning service. + */ + provisioningState?: string; + /** + * @member {IotHubDefinitionDescription[]} [iotHubs] List of IoT hubs + * assosciated with this provisioning service. + */ + iotHubs?: IotHubDefinitionDescription[]; + /** + * @member {AllocationPolicy} [allocationPolicy] Allocation policy to be used + * by this provisioning service. Possible values include: 'Hashed', + * 'GeoLatency', 'Static' + */ + allocationPolicy?: AllocationPolicy; + /** + * @member {string} [serviceOperationsHostName] Service endpoint for + * provisioning service. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly serviceOperationsHostName?: string; + /** + * @member {string} [deviceProvisioningHostName] Device endpoint for this + * provisioning service. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly deviceProvisioningHostName?: string; + /** + * @member {string} [idScope] Unique identifier of this provisioning service. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly idScope?: string; + /** + * @member {SharedAccessSignatureAuthorizationRuleAccessRightsDescription[]} + * [authorizationPolicies] List of authorization keys for a provisioning + * service. + */ + authorizationPolicies?: SharedAccessSignatureAuthorizationRuleAccessRightsDescription[]; +} + +/** + * @interface + * An interface representing Resource. + * The common properties of an Azure resource. + * + * @extends BaseResource + */ +export interface Resource extends BaseResource { + /** + * @member {string} [id] The resource identifier. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [name] The resource name. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {string} [type] The resource type. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly type?: string; + /** + * @member {string} location The resource location. + */ + location: string; + /** + * @member {{ [propertyName: string]: string }} [tags] The resource tags. + */ + tags?: { [propertyName: string]: string }; +} + +/** + * @interface + * An interface representing ProvisioningServiceDescription. + * The description of the provisioning service. + * + * @extends Resource + */ +export interface ProvisioningServiceDescription extends Resource { + /** + * @member {string} [etag] The Etag field is *not* required. If it is + * provided in the response body, it must also be provided as a header per + * the normal ETag convention. + */ + etag?: string; + /** + * @member {IotDpsPropertiesDescription} properties Service specific + * properties for a provisioning service + */ + properties: IotDpsPropertiesDescription; + /** + * @member {IotDpsSkuInfo} sku Sku info for a provisioning Service. + */ + sku: IotDpsSkuInfo; +} + +/** + * @interface + * An interface representing OperationDisplay. + * The object that represents the operation. + * + */ +export interface OperationDisplay { + /** + * @member {string} [provider] Service provider: Microsoft Devices. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly provider?: string; + /** + * @member {string} [resource] Resource Type: ProvisioningServices. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly resource?: string; + /** + * @member {string} [operation] Name of the operation. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly operation?: string; +} + +/** + * @interface + * An interface representing Operation. + * IoT Hub REST API operation. + * + */ +export interface Operation { + /** + * @member {string} [name] Operation name: {provider}/{resource}/{read | + * write | action | delete} + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {OperationDisplay} [display] The object that represents the + * operation. + */ + display?: OperationDisplay; +} + +/** + * @interface + * An interface representing ErrorDetails. + * Error details. + * + */ +export interface ErrorDetails { + /** + * @member {string} [code] The error code. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly code?: string; + /** + * @member {string} [httpStatusCode] The HTTP status code. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly httpStatusCode?: string; + /** + * @member {string} [message] The error message. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly message?: string; + /** + * @member {string} [details] The error details. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly details?: string; +} + +/** + * @interface + * An interface representing IotDpsSkuDefinition. + * Available Sku's of tier and units. + * + */ +export interface IotDpsSkuDefinition { + /** + * @member {IotDpsSku} [name] Sku name. Possible values include: 'S1' + */ + name?: IotDpsSku; +} + +/** + * @interface + * An interface representing OperationInputs. + * Input values for operation results call. + * + */ +export interface OperationInputs { + /** + * @member {string} name The name of the Provisioning Service to check. + */ + name: string; +} + +/** + * @interface + * An interface representing NameAvailabilityInfo. + * Description of name availability. + * + */ +export interface NameAvailabilityInfo { + /** + * @member {boolean} [nameAvailable] specifies if a name is available or not + */ + nameAvailable?: boolean; + /** + * @member {NameUnavailabilityReason} [reason] specifies the reason a name is + * unavailable. Possible values include: 'Invalid', 'AlreadyExists' + */ + reason?: NameUnavailabilityReason; + /** + * @member {string} [message] message containing a etailed reason name is + * unavailable + */ + message?: string; +} + +/** + * @interface + * An interface representing TagsResource. + * A container holding only the Tags for a resource, allowing the user to + * update the tags on a Provisioning Service instance. + * + */ +export interface TagsResource { + /** + * @member {{ [propertyName: string]: string }} [tags] Resource tags + */ + tags?: { [propertyName: string]: string }; +} + +/** + * @interface + * An interface representing VerificationCodeResponseProperties. + */ +export interface VerificationCodeResponseProperties { + /** + * @member {string} [verificationCode] Verification code. + */ + verificationCode?: string; + /** + * @member {string} [subject] Certificate subject. + */ + subject?: string; + /** + * @member {string} [expiry] Code expiry. + */ + expiry?: string; + /** + * @member {string} [thumbprint] Certificate thumbprint. + */ + thumbprint?: string; + /** + * @member {boolean} [isVerified] Indicate if the certificate is verified by + * owner of private key. + */ + isVerified?: boolean; + /** + * @member {string} [created] Certificate created time. + */ + created?: string; + /** + * @member {string} [updated] Certificate updated time. + */ + updated?: string; +} + +/** + * @interface + * An interface representing VerificationCodeResponse. + * Description of the response of the verification code. + * + * @extends BaseResource + */ +export interface VerificationCodeResponse extends BaseResource { + /** + * @member {string} [name] Name of certificate. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {string} [etag] Request etag. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly etag?: string; + /** + * @member {string} [id] The resource identifier. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [type] The resource type. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly type?: string; + /** + * @member {VerificationCodeResponseProperties} [properties] + */ + properties?: VerificationCodeResponseProperties; +} + +/** + * @interface + * An interface representing VerificationCodeRequest. + * The JSON-serialized leaf certificate + * + */ +export interface VerificationCodeRequest { + /** + * @member {string} [certificate] base-64 representation of X509 certificate + * .cer file or just .pem file content. + */ + certificate?: string; +} + +/** + * @interface + * An interface representing DpsCertificateGetOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface DpsCertificateGetOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {string} [ifMatch] ETag of the certificate. + */ + ifMatch?: string; +} + +/** + * @interface + * An interface representing DpsCertificateCreateOrUpdateOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface DpsCertificateCreateOrUpdateOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {string} [ifMatch] ETag of the certificate. This is required to + * update an existing certificate, and ignored while creating a brand new + * certificate. + */ + ifMatch?: string; +} + +/** + * @interface + * An interface representing DpsCertificateDeleteMethodOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface DpsCertificateDeleteMethodOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {string} [certificatename] This is optional, and it is the Common + * Name of the certificate. + */ + certificatename?: string; + /** + * @member {Uint8Array} [certificaterawBytes] Raw data within the + * certificate. + */ + certificaterawBytes?: Uint8Array; + /** + * @member {boolean} [certificateisVerified] Indicates if certificate has + * been verified by owner of the private key. + */ + certificateisVerified?: boolean; + /** + * @member {CertificatePurpose} [certificatepurpose] A description that + * mentions the purpose of the certificate. Possible values include: + * 'clientAuthentication', 'serverAuthentication' + */ + certificatepurpose?: CertificatePurpose; + /** + * @member {Date} [certificatecreated] Time the certificate is created. + */ + certificatecreated?: Date; + /** + * @member {Date} [certificatelastUpdated] Time the certificate is last + * updated. + */ + certificatelastUpdated?: Date; + /** + * @member {boolean} [certificatehasPrivateKey] Indicates if the certificate + * contains a private key. + */ + certificatehasPrivateKey?: boolean; + /** + * @member {string} [certificatenonce] Random number generated to indicate + * Proof of Possession. + */ + certificatenonce?: string; +} + +/** + * @interface + * An interface representing DpsCertificateGenerateVerificationCodeOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface DpsCertificateGenerateVerificationCodeOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {string} [certificatename] Common Name for the certificate. + */ + certificatename?: string; + /** + * @member {Uint8Array} [certificaterawBytes] Raw data of certificate. + */ + certificaterawBytes?: Uint8Array; + /** + * @member {boolean} [certificateisVerified] Indicates if the certificate has + * been verified by owner of the private key. + */ + certificateisVerified?: boolean; + /** + * @member {CertificatePurpose} [certificatepurpose] Description mentioning + * the purpose of the certificate. Possible values include: + * 'clientAuthentication', 'serverAuthentication' + */ + certificatepurpose?: CertificatePurpose; + /** + * @member {Date} [certificatecreated] Certificate creation time. + */ + certificatecreated?: Date; + /** + * @member {Date} [certificatelastUpdated] Certificate last updated time. + */ + certificatelastUpdated?: Date; + /** + * @member {boolean} [certificatehasPrivateKey] Indicates if the certificate + * contains private key. + */ + certificatehasPrivateKey?: boolean; + /** + * @member {string} [certificatenonce] Random number generated to indicate + * Proof of Possession. + */ + certificatenonce?: string; +} + +/** + * @interface + * An interface representing DpsCertificateVerifyCertificateOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface DpsCertificateVerifyCertificateOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {string} [certificatename] Common Name for the certificate. + */ + certificatename?: string; + /** + * @member {Uint8Array} [certificaterawBytes] Raw data of certificate. + */ + certificaterawBytes?: Uint8Array; + /** + * @member {boolean} [certificateisVerified] Indicates if the certificate has + * been verified by owner of the private key. + */ + certificateisVerified?: boolean; + /** + * @member {CertificatePurpose} [certificatepurpose] Describe the purpose of + * the certificate. Possible values include: 'clientAuthentication', + * 'serverAuthentication' + */ + certificatepurpose?: CertificatePurpose; + /** + * @member {Date} [certificatecreated] Certificate creation time. + */ + certificatecreated?: Date; + /** + * @member {Date} [certificatelastUpdated] Certificate last updated time. + */ + certificatelastUpdated?: Date; + /** + * @member {boolean} [certificatehasPrivateKey] Indicates if the certificate + * contains private key. + */ + certificatehasPrivateKey?: boolean; + /** + * @member {string} [certificatenonce] Random number generated to indicate + * Proof of Possession. + */ + certificatenonce?: string; +} + +/** + * @interface + * An interface representing IotDpsClientOptions. + * @extends AzureServiceClientOptions + */ +export interface IotDpsClientOptions extends AzureServiceClientOptions { + /** + * @member {string} [baseUri] + */ + baseUri?: string; +} + + +/** + * @interface + * An interface representing the OperationListResult. + * Result of the request to list IoT Hub operations. It contains a list of + * operations and a URL link to get the next set of results. + * + * @extends Array + */ +export interface OperationListResult extends Array { + /** + * @member {string} [nextLink] URL to get the next set of operation list + * results if there are any. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * An interface representing the ProvisioningServiceDescriptionListResult. + * List of provisioning service descriptions. + * + * @extends Array + */ +export interface ProvisioningServiceDescriptionListResult extends Array { + /** + * @member {string} [nextLink] the next link + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * An interface representing the IotDpsSkuDefinitionListResult. + * List of available SKUs. + * + * @extends Array + */ +export interface IotDpsSkuDefinitionListResult extends Array { + /** + * @member {string} [nextLink] The next link. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * An interface representing the SharedAccessSignatureAuthorizationRuleListResult. + * List of shared access keys. + * + * @extends Array + */ +export interface SharedAccessSignatureAuthorizationRuleListResult extends Array { + /** + * @member {string} [nextLink] The next link. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly nextLink?: string; +} + +/** + * Defines values for IotDpsSku. + * Possible values include: 'S1' + * There could be more values for this enum apart from the ones defined here.If + * you want to set a value that is not from the known values then you can do + * the following: + * let param: IotDpsSku = "someUnknownValueThatWillStillBeValid"; + * @readonly + * @enum {string} + */ +export enum IotDpsSku { + S1 = 'S1', +} + +/** + * Defines values for State. + * Possible values include: 'Activating', 'Active', 'Deleting', 'Deleted', + * 'ActivationFailed', 'DeletionFailed', 'Transitioning', 'Suspending', + * 'Suspended', 'Resuming', 'FailingOver', 'FailoverFailed' + * There could be more values for this enum apart from the ones defined here.If + * you want to set a value that is not from the known values then you can do + * the following: + * let param: State = "someUnknownValueThatWillStillBeValid"; + * @readonly + * @enum {string} + */ +export enum State { + Activating = 'Activating', + Active = 'Active', + Deleting = 'Deleting', + Deleted = 'Deleted', + ActivationFailed = 'ActivationFailed', + DeletionFailed = 'DeletionFailed', + Transitioning = 'Transitioning', + Suspending = 'Suspending', + Suspended = 'Suspended', + Resuming = 'Resuming', + FailingOver = 'FailingOver', + FailoverFailed = 'FailoverFailed', +} + +/** + * Defines values for AllocationPolicy. + * Possible values include: 'Hashed', 'GeoLatency', 'Static' + * There could be more values for this enum apart from the ones defined here.If + * you want to set a value that is not from the known values then you can do + * the following: + * let param: AllocationPolicy = + * "someUnknownValueThatWillStillBeValid"; + * @readonly + * @enum {string} + */ +export enum AllocationPolicy { + Hashed = 'Hashed', + GeoLatency = 'GeoLatency', + Static = 'Static', +} + +/** + * Defines values for AccessRightsDescription. + * Possible values include: 'ServiceConfig', 'EnrollmentRead', + * 'EnrollmentWrite', 'DeviceConnect', 'RegistrationStatusRead', + * 'RegistrationStatusWrite' + * There could be more values for this enum apart from the ones defined here.If + * you want to set a value that is not from the known values then you can do + * the following: + * let param: AccessRightsDescription = + * "someUnknownValueThatWillStillBeValid"; + * @readonly + * @enum {string} + */ +export enum AccessRightsDescription { + ServiceConfig = 'ServiceConfig', + EnrollmentRead = 'EnrollmentRead', + EnrollmentWrite = 'EnrollmentWrite', + DeviceConnect = 'DeviceConnect', + RegistrationStatusRead = 'RegistrationStatusRead', + RegistrationStatusWrite = 'RegistrationStatusWrite', +} + +/** + * Defines values for NameUnavailabilityReason. + * Possible values include: 'Invalid', 'AlreadyExists' + * There could be more values for this enum apart from the ones defined here.If + * you want to set a value that is not from the known values then you can do + * the following: + * let param: NameUnavailabilityReason = + * "someUnknownValueThatWillStillBeValid"; + * @readonly + * @enum {string} + */ +export enum NameUnavailabilityReason { + Invalid = 'Invalid', + AlreadyExists = 'AlreadyExists', +} + +/** + * Defines values for CertificatePurpose. + * Possible values include: 'clientAuthentication', 'serverAuthentication' + * There could be more values for this enum apart from the ones defined here.If + * you want to set a value that is not from the known values then you can do + * the following: + * let param: CertificatePurpose = + * "someUnknownValueThatWillStillBeValid"; + * @readonly + * @enum {string} + */ +export enum CertificatePurpose { + ClientAuthentication = 'clientAuthentication', + ServerAuthentication = 'serverAuthentication', +} + +/** + * Contains response data for the list operation. + */ +export type OperationsListResponse = OperationListResult & { + /** + * 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: OperationListResult; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type OperationsListNextResponse = OperationListResult & { + /** + * 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: OperationListResult; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type DpsCertificateGetResponse = CertificateResponse & { + /** + * 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: CertificateResponse; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type DpsCertificateCreateOrUpdateResponse = CertificateResponse & { + /** + * 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: CertificateResponse; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type DpsCertificateListResponse = CertificateListDescription & { + /** + * 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: CertificateListDescription; + }; +}; + +/** + * Contains response data for the generateVerificationCode operation. + */ +export type DpsCertificateGenerateVerificationCodeResponse = VerificationCodeResponse & { + /** + * 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: VerificationCodeResponse; + }; +}; + +/** + * Contains response data for the verifyCertificate operation. + */ +export type DpsCertificateVerifyCertificateResponse = CertificateResponse & { + /** + * 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: CertificateResponse; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type IotDpsResourceGetResponse = ProvisioningServiceDescription & { + /** + * 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: ProvisioningServiceDescription; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type IotDpsResourceCreateOrUpdateResponse = ProvisioningServiceDescription & { + /** + * 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: ProvisioningServiceDescription; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type IotDpsResourceUpdateResponse = ProvisioningServiceDescription & { + /** + * 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: ProvisioningServiceDescription; + }; +}; + +/** + * Contains response data for the listBySubscription operation. + */ +export type IotDpsResourceListBySubscriptionResponse = ProvisioningServiceDescriptionListResult & { + /** + * 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: ProvisioningServiceDescriptionListResult; + }; +}; + +/** + * Contains response data for the listByResourceGroup operation. + */ +export type IotDpsResourceListByResourceGroupResponse = ProvisioningServiceDescriptionListResult & { + /** + * 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: ProvisioningServiceDescriptionListResult; + }; +}; + +/** + * Contains response data for the getOperationResult operation. + */ +export type IotDpsResourceGetOperationResultResponse = AsyncOperationResult & { + /** + * 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: AsyncOperationResult; + }; +}; + +/** + * Contains response data for the listValidSkus operation. + */ +export type IotDpsResourceListValidSkusResponse = IotDpsSkuDefinitionListResult & { + /** + * 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: IotDpsSkuDefinitionListResult; + }; +}; + +/** + * Contains response data for the checkProvisioningServiceNameAvailability operation. + */ +export type IotDpsResourceCheckProvisioningServiceNameAvailabilityResponse = NameAvailabilityInfo & { + /** + * 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: NameAvailabilityInfo; + }; +}; + +/** + * Contains response data for the listKeys operation. + */ +export type IotDpsResourceListKeysResponse = SharedAccessSignatureAuthorizationRuleListResult & { + /** + * 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: SharedAccessSignatureAuthorizationRuleListResult; + }; +}; + +/** + * Contains response data for the listKeysForKeyName operation. + */ +export type IotDpsResourceListKeysForKeyNameResponse = SharedAccessSignatureAuthorizationRuleAccessRightsDescription & { + /** + * 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: SharedAccessSignatureAuthorizationRuleAccessRightsDescription; + }; +}; + +/** + * Contains response data for the beginCreateOrUpdate operation. + */ +export type IotDpsResourceBeginCreateOrUpdateResponse = ProvisioningServiceDescription & { + /** + * 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: ProvisioningServiceDescription; + }; +}; + +/** + * Contains response data for the beginUpdate operation. + */ +export type IotDpsResourceBeginUpdateResponse = ProvisioningServiceDescription & { + /** + * 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: ProvisioningServiceDescription; + }; +}; + +/** + * Contains response data for the listBySubscriptionNext operation. + */ +export type IotDpsResourceListBySubscriptionNextResponse = ProvisioningServiceDescriptionListResult & { + /** + * 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: ProvisioningServiceDescriptionListResult; + }; +}; + +/** + * Contains response data for the listByResourceGroupNext operation. + */ +export type IotDpsResourceListByResourceGroupNextResponse = ProvisioningServiceDescriptionListResult & { + /** + * 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: ProvisioningServiceDescriptionListResult; + }; +}; + +/** + * Contains response data for the listValidSkusNext operation. + */ +export type IotDpsResourceListValidSkusNextResponse = IotDpsSkuDefinitionListResult & { + /** + * 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: IotDpsSkuDefinitionListResult; + }; +}; + +/** + * Contains response data for the listKeysNext operation. + */ +export type IotDpsResourceListKeysNextResponse = SharedAccessSignatureAuthorizationRuleListResult & { + /** + * 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: SharedAccessSignatureAuthorizationRuleListResult; + }; +}; diff --git a/packages/@azure/arm-deviceprovisioningservices/lib/models/iotDpsResourceMappers.ts b/packages/@azure/arm-deviceprovisioningservices/lib/models/iotDpsResourceMappers.ts new file mode 100644 index 000000000000..cad91fb75ceb --- /dev/null +++ b/packages/@azure/arm-deviceprovisioningservices/lib/models/iotDpsResourceMappers.ts @@ -0,0 +1,35 @@ +/* + * 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 { + ProvisioningServiceDescription, + Resource, + BaseResource, + IotDpsPropertiesDescription, + IotHubDefinitionDescription, + SharedAccessSignatureAuthorizationRuleAccessRightsDescription, + IotDpsSkuInfo, + ErrorDetails, + TagsResource, + CloudError, + ProvisioningServiceDescriptionListResult, + AsyncOperationResult, + ErrorMesssage, + IotDpsSkuDefinitionListResult, + IotDpsSkuDefinition, + OperationInputs, + NameAvailabilityInfo, + SharedAccessSignatureAuthorizationRuleListResult, + CertificateResponse, + CertificateProperties, + VerificationCodeResponse, + VerificationCodeResponseProperties +} from "../models/mappers"; + diff --git a/packages/@azure/arm-deviceprovisioningservices/lib/models/mappers.ts b/packages/@azure/arm-deviceprovisioningservices/lib/models/mappers.ts new file mode 100644 index 000000000000..9e59f83b73cc --- /dev/null +++ b/packages/@azure/arm-deviceprovisioningservices/lib/models/mappers.ts @@ -0,0 +1,872 @@ +/* + * 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 "ms-rest-azure-js"; +import * as msRest from "ms-rest-js"; + +export const CloudError = CloudErrorMapper; +export const BaseResource = BaseResourceMapper; + +export const ErrorMesssage: msRest.CompositeMapper = { + serializedName: "ErrorMesssage", + type: { + name: "Composite", + className: "ErrorMesssage", + modelProperties: { + code: { + serializedName: "code", + type: { + name: "String" + } + }, + message: { + serializedName: "message", + type: { + name: "String" + } + }, + details: { + serializedName: "details", + type: { + name: "String" + } + } + } + } +}; + +export const AsyncOperationResult: msRest.CompositeMapper = { + serializedName: "AsyncOperationResult", + type: { + name: "Composite", + className: "AsyncOperationResult", + modelProperties: { + status: { + serializedName: "status", + type: { + name: "String" + } + }, + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorMesssage" + } + } + } + } +}; + +export const CertificateProperties: msRest.CompositeMapper = { + serializedName: "CertificateProperties", + type: { + name: "Composite", + className: "CertificateProperties", + modelProperties: { + subject: { + readOnly: true, + serializedName: "subject", + type: { + name: "String" + } + }, + expiry: { + readOnly: true, + serializedName: "expiry", + type: { + name: "DateTimeRfc1123" + } + }, + thumbprint: { + readOnly: true, + serializedName: "thumbprint", + type: { + name: "String" + } + }, + isVerified: { + readOnly: true, + serializedName: "isVerified", + type: { + name: "Boolean" + } + }, + created: { + readOnly: true, + serializedName: "created", + type: { + name: "DateTimeRfc1123" + } + }, + updated: { + readOnly: true, + serializedName: "updated", + type: { + name: "DateTimeRfc1123" + } + } + } + } +}; + +export const CertificateResponse: msRest.CompositeMapper = { + serializedName: "CertificateResponse", + type: { + name: "Composite", + className: "CertificateResponse", + modelProperties: { + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "CertificateProperties" + } + }, + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + etag: { + readOnly: true, + serializedName: "etag", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + +export const CertificateListDescription: msRest.CompositeMapper = { + serializedName: "CertificateListDescription", + type: { + name: "Composite", + className: "CertificateListDescription", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CertificateResponse" + } + } + } + } + } + } +}; + +export const CertificateBodyDescription: msRest.CompositeMapper = { + serializedName: "CertificateBodyDescription", + type: { + name: "Composite", + className: "CertificateBodyDescription", + modelProperties: { + certificate: { + serializedName: "certificate", + type: { + name: "String" + } + } + } + } +}; + +export const IotDpsSkuInfo: msRest.CompositeMapper = { + serializedName: "IotDpsSkuInfo", + type: { + name: "Composite", + className: "IotDpsSkuInfo", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + tier: { + readOnly: true, + serializedName: "tier", + type: { + name: "String" + } + }, + capacity: { + serializedName: "capacity", + type: { + name: "Number" + } + } + } + } +}; + +export const IotHubDefinitionDescription: msRest.CompositeMapper = { + serializedName: "IotHubDefinitionDescription", + type: { + name: "Composite", + className: "IotHubDefinitionDescription", + modelProperties: { + applyAllocationPolicy: { + serializedName: "applyAllocationPolicy", + type: { + name: "Boolean" + } + }, + allocationWeight: { + serializedName: "allocationWeight", + type: { + name: "Number" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + connectionString: { + required: true, + serializedName: "connectionString", + type: { + name: "String" + } + }, + location: { + required: true, + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const SharedAccessSignatureAuthorizationRuleAccessRightsDescription: msRest.CompositeMapper = { + serializedName: "SharedAccessSignatureAuthorizationRule_AccessRightsDescription_", + type: { + name: "Composite", + className: "SharedAccessSignatureAuthorizationRuleAccessRightsDescription", + modelProperties: { + keyName: { + required: true, + serializedName: "keyName", + type: { + name: "String" + } + }, + primaryKey: { + serializedName: "primaryKey", + type: { + name: "String" + } + }, + secondaryKey: { + serializedName: "secondaryKey", + type: { + name: "String" + } + }, + rights: { + required: true, + serializedName: "rights", + type: { + name: "String" + } + } + } + } +}; + +export const IotDpsPropertiesDescription: msRest.CompositeMapper = { + serializedName: "IotDpsPropertiesDescription", + type: { + name: "Composite", + className: "IotDpsPropertiesDescription", + modelProperties: { + state: { + serializedName: "state", + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "provisioningState", + type: { + name: "String" + } + }, + iotHubs: { + serializedName: "iotHubs", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "IotHubDefinitionDescription" + } + } + } + }, + allocationPolicy: { + serializedName: "allocationPolicy", + type: { + name: "String" + } + }, + serviceOperationsHostName: { + readOnly: true, + serializedName: "serviceOperationsHostName", + type: { + name: "String" + } + }, + deviceProvisioningHostName: { + readOnly: true, + serializedName: "deviceProvisioningHostName", + type: { + name: "String" + } + }, + idScope: { + readOnly: true, + serializedName: "idScope", + type: { + name: "String" + } + }, + authorizationPolicies: { + serializedName: "authorizationPolicies", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SharedAccessSignatureAuthorizationRuleAccessRightsDescription" + } + } + } + } + } + } +}; + +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", + constraints: { + Pattern: /^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{2,49}[a-zA-Z0-9]$/ + }, + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + }, + location: { + required: true, + serializedName: "location", + type: { + name: "String" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const ProvisioningServiceDescription: msRest.CompositeMapper = { + serializedName: "ProvisioningServiceDescription", + type: { + name: "Composite", + className: "ProvisioningServiceDescription", + modelProperties: { + ...Resource.type.modelProperties, + etag: { + serializedName: "etag", + type: { + name: "String" + } + }, + properties: { + required: true, + serializedName: "properties", + type: { + name: "Composite", + className: "IotDpsPropertiesDescription" + } + }, + sku: { + required: true, + serializedName: "sku", + type: { + name: "Composite", + className: "IotDpsSkuInfo" + } + } + } + } +}; + +export const OperationDisplay: msRest.CompositeMapper = { + serializedName: "Operation_display", + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + readOnly: true, + serializedName: "provider", + type: { + name: "String" + } + }, + resource: { + readOnly: true, + serializedName: "resource", + type: { + name: "String" + } + }, + operation: { + readOnly: true, + serializedName: "operation", + type: { + name: "String" + } + } + } + } +}; + +export const Operation: msRest.CompositeMapper = { + serializedName: "Operation", + type: { + name: "Composite", + className: "Operation", + modelProperties: { + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + } + } + } +}; + +export const ErrorDetails: msRest.CompositeMapper = { + serializedName: "ErrorDetails", + type: { + name: "Composite", + className: "ErrorDetails", + modelProperties: { + code: { + readOnly: true, + serializedName: "code", + type: { + name: "String" + } + }, + httpStatusCode: { + readOnly: true, + serializedName: "httpStatusCode", + type: { + name: "String" + } + }, + message: { + readOnly: true, + serializedName: "message", + type: { + name: "String" + } + }, + details: { + readOnly: true, + serializedName: "details", + type: { + name: "String" + } + } + } + } +}; + +export const IotDpsSkuDefinition: msRest.CompositeMapper = { + serializedName: "IotDpsSkuDefinition", + type: { + name: "Composite", + className: "IotDpsSkuDefinition", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + } + } + } +}; + +export const OperationInputs: msRest.CompositeMapper = { + serializedName: "OperationInputs", + type: { + name: "Composite", + className: "OperationInputs", + modelProperties: { + name: { + required: true, + serializedName: "name", + type: { + name: "String" + } + } + } + } +}; + +export const NameAvailabilityInfo: msRest.CompositeMapper = { + serializedName: "NameAvailabilityInfo", + type: { + name: "Composite", + className: "NameAvailabilityInfo", + modelProperties: { + nameAvailable: { + serializedName: "nameAvailable", + type: { + name: "Boolean" + } + }, + reason: { + serializedName: "reason", + type: { + name: "String" + } + }, + message: { + serializedName: "message", + type: { + name: "String" + } + } + } + } +}; + +export const TagsResource: msRest.CompositeMapper = { + serializedName: "TagsResource", + type: { + name: "Composite", + className: "TagsResource", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const VerificationCodeResponseProperties: msRest.CompositeMapper = { + serializedName: "VerificationCodeResponse_properties", + type: { + name: "Composite", + className: "VerificationCodeResponseProperties", + modelProperties: { + verificationCode: { + serializedName: "verificationCode", + type: { + name: "String" + } + }, + subject: { + serializedName: "subject", + type: { + name: "String" + } + }, + expiry: { + serializedName: "expiry", + type: { + name: "String" + } + }, + thumbprint: { + serializedName: "thumbprint", + type: { + name: "String" + } + }, + isVerified: { + serializedName: "isVerified", + type: { + name: "Boolean" + } + }, + created: { + serializedName: "created", + type: { + name: "String" + } + }, + updated: { + serializedName: "updated", + type: { + name: "String" + } + } + } + } +}; + +export const VerificationCodeResponse: msRest.CompositeMapper = { + serializedName: "VerificationCodeResponse", + type: { + name: "Composite", + className: "VerificationCodeResponse", + modelProperties: { + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + etag: { + readOnly: true, + serializedName: "etag", + type: { + name: "String" + } + }, + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "VerificationCodeResponseProperties" + } + } + } + } +}; + +export const VerificationCodeRequest: msRest.CompositeMapper = { + serializedName: "VerificationCodeRequest", + type: { + name: "Composite", + className: "VerificationCodeRequest", + modelProperties: { + certificate: { + serializedName: "certificate", + type: { + name: "String" + } + } + } + } +}; + +export const OperationListResult: msRest.CompositeMapper = { + serializedName: "OperationListResult", + type: { + name: "Composite", + className: "OperationListResult", + modelProperties: { + value: { + readOnly: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const ProvisioningServiceDescriptionListResult: msRest.CompositeMapper = { + serializedName: "ProvisioningServiceDescriptionListResult", + type: { + name: "Composite", + className: "ProvisioningServiceDescriptionListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ProvisioningServiceDescription" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const IotDpsSkuDefinitionListResult: msRest.CompositeMapper = { + serializedName: "IotDpsSkuDefinitionListResult", + type: { + name: "Composite", + className: "IotDpsSkuDefinitionListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "IotDpsSkuDefinition" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const SharedAccessSignatureAuthorizationRuleListResult: msRest.CompositeMapper = { + serializedName: "SharedAccessSignatureAuthorizationRuleListResult", + type: { + name: "Composite", + className: "SharedAccessSignatureAuthorizationRuleListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SharedAccessSignatureAuthorizationRuleAccessRightsDescription" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; diff --git a/packages/@azure/arm-deviceprovisioningservices/lib/models/operationsMappers.ts b/packages/@azure/arm-deviceprovisioningservices/lib/models/operationsMappers.ts new file mode 100644 index 000000000000..50fee90a2573 --- /dev/null +++ b/packages/@azure/arm-deviceprovisioningservices/lib/models/operationsMappers.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 { + OperationListResult, + Operation, + OperationDisplay, + ErrorDetails +} from "../models/mappers"; + diff --git a/packages/@azure/arm-deviceprovisioningservices/lib/models/parameters.ts b/packages/@azure/arm-deviceprovisioningservices/lib/models/parameters.ts new file mode 100644 index 000000000000..f3c90c4add60 --- /dev/null +++ b/packages/@azure/arm-deviceprovisioningservices/lib/models/parameters.ts @@ -0,0 +1,245 @@ +/* + * 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 "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 asyncinfo: msRest.OperationQueryParameter = { + parameterPath: "asyncinfo", + mapper: { + required: true, + serializedName: "asyncinfo", + defaultValue: 'true', + type: { + name: "String" + } + } +}; +export const certificatecreated: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "certificatecreated" + ], + mapper: { + serializedName: "certificate.created", + type: { + name: "DateTime" + } + } +}; +export const certificatehasPrivateKey: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "certificatehasPrivateKey" + ], + mapper: { + serializedName: "certificate.hasPrivateKey", + type: { + name: "Boolean" + } + } +}; +export const certificateisVerified: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "certificateisVerified" + ], + mapper: { + serializedName: "certificate.isVerified", + type: { + name: "Boolean" + } + } +}; +export const certificatelastUpdated: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "certificatelastUpdated" + ], + mapper: { + serializedName: "certificate.lastUpdated", + type: { + name: "DateTime" + } + } +}; +export const certificatename: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "certificatename" + ], + mapper: { + serializedName: "certificate.name", + type: { + name: "String" + } + } +}; +export const certificateName0: msRest.OperationURLParameter = { + parameterPath: "certificateName", + mapper: { + required: true, + serializedName: "certificateName", + type: { + name: "String" + } + } +}; +export const certificateName1: msRest.OperationURLParameter = { + parameterPath: "certificateName", + mapper: { + required: true, + serializedName: "certificateName", + constraints: { + MaxLength: 256 + }, + type: { + name: "String" + } + } +}; +export const certificatenonce: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "certificatenonce" + ], + mapper: { + serializedName: "certificate.nonce", + type: { + name: "String" + } + } +}; +export const certificatepurpose: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "certificatepurpose" + ], + mapper: { + serializedName: "certificate.purpose", + type: { + name: "String" + } + } +}; +export const certificaterawBytes: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "certificaterawBytes" + ], + mapper: { + serializedName: "certificate.rawBytes", + type: { + name: "ByteArray" + } + } +}; +export const ifMatch0: msRest.OperationParameter = { + parameterPath: [ + "options", + "ifMatch" + ], + mapper: { + serializedName: "If-Match", + type: { + name: "String" + } + } +}; +export const ifMatch1: msRest.OperationParameter = { + parameterPath: "ifMatch", + mapper: { + required: true, + serializedName: "If-Match", + type: { + name: "String" + } + } +}; +export const keyName: msRest.OperationURLParameter = { + parameterPath: "keyName", + mapper: { + required: true, + serializedName: "keyName", + type: { + name: "String" + } + } +}; +export const nextPageLink: msRest.OperationURLParameter = { + parameterPath: "nextPageLink", + mapper: { + required: true, + serializedName: "nextLink", + type: { + name: "String" + } + }, + skipEncoding: true +}; +export const operationId: msRest.OperationURLParameter = { + parameterPath: "operationId", + mapper: { + required: true, + serializedName: "operationId", + type: { + name: "String" + } + } +}; +export const provisioningServiceName: msRest.OperationURLParameter = { + parameterPath: "provisioningServiceName", + mapper: { + required: true, + serializedName: "provisioningServiceName", + type: { + name: "String" + } + } +}; +export const resourceGroupName: msRest.OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + required: true, + serializedName: "resourceGroupName", + type: { + name: "String" + } + } +}; +export const subscriptionId: msRest.OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + required: true, + serializedName: "subscriptionId", + type: { + name: "String" + } + } +}; diff --git a/packages/@azure/arm-deviceprovisioningservices/lib/operations/dpsCertificate.ts b/packages/@azure/arm-deviceprovisioningservices/lib/operations/dpsCertificate.ts new file mode 100644 index 000000000000..8e296860e231 --- /dev/null +++ b/packages/@azure/arm-deviceprovisioningservices/lib/operations/dpsCertificate.ts @@ -0,0 +1,478 @@ +/* + * 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 "ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/dpsCertificateMappers"; +import * as Parameters from "../models/parameters"; +import { IotDpsClientContext } from "../iotDpsClientContext"; + +/** Class representing a DpsCertificate. */ +export class DpsCertificate { + private readonly client: IotDpsClientContext; + + /** + * Create a DpsCertificate. + * @param {IotDpsClientContext} client Reference to the service client. + */ + constructor(client: IotDpsClientContext) { + this.client = client; + } + + /** + * Get the certificate from the provisioning service. + * @param certificateName Name of the certificate to retrieve. + * @param resourceGroupName Resource group identifier. + * @param provisioningServiceName Name of the provisioning service the certificate is associated + * with. + * @param [options] The optional parameters + * @returns Promise + */ + get(certificateName: string, resourceGroupName: string, provisioningServiceName: string, options?: Models.DpsCertificateGetOptionalParams): Promise; + /** + * @param certificateName Name of the certificate to retrieve. + * @param resourceGroupName Resource group identifier. + * @param provisioningServiceName Name of the provisioning service the certificate is associated + * with. + * @param callback The callback + */ + get(certificateName: string, resourceGroupName: string, provisioningServiceName: string, callback: msRest.ServiceCallback): void; + /** + * @param certificateName Name of the certificate to retrieve. + * @param resourceGroupName Resource group identifier. + * @param provisioningServiceName Name of the provisioning service the certificate is associated + * with. + * @param options The optional parameters + * @param callback The callback + */ + get(certificateName: string, resourceGroupName: string, provisioningServiceName: string, options: Models.DpsCertificateGetOptionalParams, callback: msRest.ServiceCallback): void; + get(certificateName: string, resourceGroupName: string, provisioningServiceName: string, options?: Models.DpsCertificateGetOptionalParams, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + certificateName, + resourceGroupName, + provisioningServiceName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Add new certificate or update an existing certificate. + * @summary Upload the certificate to the provisioning service. + * @param resourceGroupName Resource group identifier. + * @param provisioningServiceName The name of the provisioning service. + * @param certificateName The name of the certificate create or update. + * @param certificateDescription The certificate body. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(resourceGroupName: string, provisioningServiceName: string, certificateName: string, certificateDescription: Models.CertificateBodyDescription, options?: Models.DpsCertificateCreateOrUpdateOptionalParams): Promise; + /** + * @param resourceGroupName Resource group identifier. + * @param provisioningServiceName The name of the provisioning service. + * @param certificateName The name of the certificate create or update. + * @param certificateDescription The certificate body. + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, provisioningServiceName: string, certificateName: string, certificateDescription: Models.CertificateBodyDescription, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Resource group identifier. + * @param provisioningServiceName The name of the provisioning service. + * @param certificateName The name of the certificate create or update. + * @param certificateDescription The certificate body. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, provisioningServiceName: string, certificateName: string, certificateDescription: Models.CertificateBodyDescription, options: Models.DpsCertificateCreateOrUpdateOptionalParams, callback: msRest.ServiceCallback): void; + createOrUpdate(resourceGroupName: string, provisioningServiceName: string, certificateName: string, certificateDescription: Models.CertificateBodyDescription, options?: Models.DpsCertificateCreateOrUpdateOptionalParams, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + provisioningServiceName, + certificateName, + certificateDescription, + options + }, + createOrUpdateOperationSpec, + callback) as Promise; + } + + /** + * Deletes the specified certificate assosciated with the Provisioning Service + * @summary Delete the Provisioning Service Certificate. + * @param resourceGroupName Resource group identifier. + * @param ifMatch ETag of the certificate + * @param provisioningServiceName The name of the provisioning service. + * @param certificateName This is a mandatory field, and is the logical name of the certificate + * that the provisioning service will access by. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, ifMatch: string, provisioningServiceName: string, certificateName: string, options?: Models.DpsCertificateDeleteMethodOptionalParams): Promise; + /** + * @param resourceGroupName Resource group identifier. + * @param ifMatch ETag of the certificate + * @param provisioningServiceName The name of the provisioning service. + * @param certificateName This is a mandatory field, and is the logical name of the certificate + * that the provisioning service will access by. + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, ifMatch: string, provisioningServiceName: string, certificateName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Resource group identifier. + * @param ifMatch ETag of the certificate + * @param provisioningServiceName The name of the provisioning service. + * @param certificateName This is a mandatory field, and is the logical name of the certificate + * that the provisioning service will access by. + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, ifMatch: string, provisioningServiceName: string, certificateName: string, options: Models.DpsCertificateDeleteMethodOptionalParams, callback: msRest.ServiceCallback): void; + deleteMethod(resourceGroupName: string, ifMatch: string, provisioningServiceName: string, certificateName: string, options?: Models.DpsCertificateDeleteMethodOptionalParams, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + ifMatch, + provisioningServiceName, + certificateName, + options + }, + deleteMethodOperationSpec, + callback); + } + + /** + * Get all the certificates tied to the provisioning service. + * @param resourceGroupName Name of resource group. + * @param provisioningServiceName Name of provisioning service to retrieve certificates for. + * @param [options] The optional parameters + * @returns Promise + */ + list(resourceGroupName: string, provisioningServiceName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of resource group. + * @param provisioningServiceName Name of provisioning service to retrieve certificates for. + * @param callback The callback + */ + list(resourceGroupName: string, provisioningServiceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of resource group. + * @param provisioningServiceName Name of provisioning service to retrieve certificates for. + * @param options The optional parameters + * @param callback The callback + */ + list(resourceGroupName: string, provisioningServiceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(resourceGroupName: string, provisioningServiceName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + provisioningServiceName, + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Generate verification code for Proof of Possession. + * @param certificateName The mandatory logical name of the certificate, that the provisioning + * service uses to access. + * @param ifMatch ETag of the certificate. This is required to update an existing certificate, and + * ignored while creating a brand new certificate. + * @param resourceGroupName name of resource group. + * @param provisioningServiceName Name of provisioning service. + * @param [options] The optional parameters + * @returns Promise + */ + generateVerificationCode(certificateName: string, ifMatch: string, resourceGroupName: string, provisioningServiceName: string, options?: Models.DpsCertificateGenerateVerificationCodeOptionalParams): Promise; + /** + * @param certificateName The mandatory logical name of the certificate, that the provisioning + * service uses to access. + * @param ifMatch ETag of the certificate. This is required to update an existing certificate, and + * ignored while creating a brand new certificate. + * @param resourceGroupName name of resource group. + * @param provisioningServiceName Name of provisioning service. + * @param callback The callback + */ + generateVerificationCode(certificateName: string, ifMatch: string, resourceGroupName: string, provisioningServiceName: string, callback: msRest.ServiceCallback): void; + /** + * @param certificateName The mandatory logical name of the certificate, that the provisioning + * service uses to access. + * @param ifMatch ETag of the certificate. This is required to update an existing certificate, and + * ignored while creating a brand new certificate. + * @param resourceGroupName name of resource group. + * @param provisioningServiceName Name of provisioning service. + * @param options The optional parameters + * @param callback The callback + */ + generateVerificationCode(certificateName: string, ifMatch: string, resourceGroupName: string, provisioningServiceName: string, options: Models.DpsCertificateGenerateVerificationCodeOptionalParams, callback: msRest.ServiceCallback): void; + generateVerificationCode(certificateName: string, ifMatch: string, resourceGroupName: string, provisioningServiceName: string, options?: Models.DpsCertificateGenerateVerificationCodeOptionalParams, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + certificateName, + ifMatch, + resourceGroupName, + provisioningServiceName, + options + }, + generateVerificationCodeOperationSpec, + callback) as Promise; + } + + /** + * Verifies the certificate's private key possession by providing the leaf cert issued by the + * verifying pre uploaded certificate. + * @summary Verify certificate's private key possession. + * @param certificateName The mandatory logical name of the certificate, that the provisioning + * service uses to access. + * @param ifMatch ETag of the certificate. + * @param request The name of the certificate + * @param resourceGroupName Resource group name. + * @param provisioningServiceName Provisioning service name. + * @param [options] The optional parameters + * @returns Promise + */ + verifyCertificate(certificateName: string, ifMatch: string, request: Models.VerificationCodeRequest, resourceGroupName: string, provisioningServiceName: string, options?: Models.DpsCertificateVerifyCertificateOptionalParams): Promise; + /** + * @param certificateName The mandatory logical name of the certificate, that the provisioning + * service uses to access. + * @param ifMatch ETag of the certificate. + * @param request The name of the certificate + * @param resourceGroupName Resource group name. + * @param provisioningServiceName Provisioning service name. + * @param callback The callback + */ + verifyCertificate(certificateName: string, ifMatch: string, request: Models.VerificationCodeRequest, resourceGroupName: string, provisioningServiceName: string, callback: msRest.ServiceCallback): void; + /** + * @param certificateName The mandatory logical name of the certificate, that the provisioning + * service uses to access. + * @param ifMatch ETag of the certificate. + * @param request The name of the certificate + * @param resourceGroupName Resource group name. + * @param provisioningServiceName Provisioning service name. + * @param options The optional parameters + * @param callback The callback + */ + verifyCertificate(certificateName: string, ifMatch: string, request: Models.VerificationCodeRequest, resourceGroupName: string, provisioningServiceName: string, options: Models.DpsCertificateVerifyCertificateOptionalParams, callback: msRest.ServiceCallback): void; + verifyCertificate(certificateName: string, ifMatch: string, request: Models.VerificationCodeRequest, resourceGroupName: string, provisioningServiceName: string, options?: Models.DpsCertificateVerifyCertificateOptionalParams, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + certificateName, + ifMatch, + request, + resourceGroupName, + provisioningServiceName, + options + }, + verifyCertificateOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/certificates/{certificateName}", + urlParameters: [ + Parameters.certificateName0, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.provisioningServiceName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.ifMatch0, + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.CertificateResponse + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + serializer +}; + +const createOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/certificates/{certificateName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.provisioningServiceName, + Parameters.certificateName1 + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.ifMatch0, + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "certificateDescription", + mapper: { + ...Mappers.CertificateBodyDescription, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.CertificateResponse + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/certificates/{certificateName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.provisioningServiceName, + Parameters.certificateName0 + ], + queryParameters: [ + Parameters.certificatename, + Parameters.certificaterawBytes, + Parameters.certificateisVerified, + Parameters.certificatepurpose, + Parameters.certificatecreated, + Parameters.certificatelastUpdated, + Parameters.certificatehasPrivateKey, + Parameters.certificatenonce, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.ifMatch1, + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + serializer +}; + +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/certificates", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.provisioningServiceName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.CertificateListDescription + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + serializer +}; + +const generateVerificationCodeOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/certificates/{certificateName}/generateVerificationCode", + urlParameters: [ + Parameters.certificateName0, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.provisioningServiceName + ], + queryParameters: [ + Parameters.certificatename, + Parameters.certificaterawBytes, + Parameters.certificateisVerified, + Parameters.certificatepurpose, + Parameters.certificatecreated, + Parameters.certificatelastUpdated, + Parameters.certificatehasPrivateKey, + Parameters.certificatenonce, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.ifMatch1, + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.VerificationCodeResponse + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + serializer +}; + +const verifyCertificateOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/certificates/{certificateName}/verify", + urlParameters: [ + Parameters.certificateName0, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.provisioningServiceName + ], + queryParameters: [ + Parameters.certificatename, + Parameters.certificaterawBytes, + Parameters.certificateisVerified, + Parameters.certificatepurpose, + Parameters.certificatecreated, + Parameters.certificatelastUpdated, + Parameters.certificatehasPrivateKey, + Parameters.certificatenonce, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.ifMatch1, + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "request", + mapper: { + ...Mappers.VerificationCodeRequest, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.CertificateResponse + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + serializer +}; diff --git a/packages/@azure/arm-deviceprovisioningservices/lib/operations/index.ts b/packages/@azure/arm-deviceprovisioningservices/lib/operations/index.ts new file mode 100644 index 000000000000..1bae816c5e6e --- /dev/null +++ b/packages/@azure/arm-deviceprovisioningservices/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 "./dpsCertificate"; +export * from "./iotDpsResource"; diff --git a/packages/@azure/arm-deviceprovisioningservices/lib/operations/iotDpsResource.ts b/packages/@azure/arm-deviceprovisioningservices/lib/operations/iotDpsResource.ts new file mode 100644 index 000000000000..7fa23df87438 --- /dev/null +++ b/packages/@azure/arm-deviceprovisioningservices/lib/operations/iotDpsResource.ts @@ -0,0 +1,907 @@ +/* + * 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 "ms-rest-js"; +import * as msRestAzure from "ms-rest-azure-js"; +import * as Models from "../models"; +import * as Mappers from "../models/iotDpsResourceMappers"; +import * as Parameters from "../models/parameters"; +import { IotDpsClientContext } from "../iotDpsClientContext"; + +/** Class representing a IotDpsResource. */ +export class IotDpsResource { + private readonly client: IotDpsClientContext; + + /** + * Create a IotDpsResource. + * @param {IotDpsClientContext} client Reference to the service client. + */ + constructor(client: IotDpsClientContext) { + this.client = client; + } + + /** + * Get the metadata of the provisioning service without SAS keys. + * @summary Get the non-security related metadata of the provisioning service. + * @param provisioningServiceName Name of the provisioning service to retrieve. + * @param resourceGroupName Resource group name. + * @param [options] The optional parameters + * @returns Promise + */ + get(provisioningServiceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param provisioningServiceName Name of the provisioning service to retrieve. + * @param resourceGroupName Resource group name. + * @param callback The callback + */ + get(provisioningServiceName: string, resourceGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param provisioningServiceName Name of the provisioning service to retrieve. + * @param resourceGroupName Resource group name. + * @param options The optional parameters + * @param callback The callback + */ + get(provisioningServiceName: string, resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(provisioningServiceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + provisioningServiceName, + resourceGroupName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Create or update the metadata of the provisioning service. The usual pattern to modify a + * property is to retrieve the provisioning service metadata and security metadata, and then + * combine them with the modified values in a new body to update the provisioning service. + * @summary Create or update the metadata of the provisioning service. + * @param resourceGroupName Resource group identifier. + * @param provisioningServiceName Name of provisioning service to create or update. + * @param iotDpsDescription Description of the provisioning service to create or update. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(resourceGroupName: string, provisioningServiceName: string, iotDpsDescription: Models.ProvisioningServiceDescription, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateOrUpdate(resourceGroupName,provisioningServiceName,iotDpsDescription,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Update an existing provisioning service's tags. to update other fields use the CreateOrUpdate + * method + * @summary Update an existing provisioning service's tags. + * @param resourceGroupName Resource group identifier. + * @param provisioningServiceName Name of provisioning service to create or update. + * @param provisioningServiceTags Updated tag information to set into the provisioning service + * instance. + * @param [options] The optional parameters + * @returns Promise + */ + update(resourceGroupName: string, provisioningServiceName: string, provisioningServiceTags: Models.TagsResource, options?: msRest.RequestOptionsBase): Promise { + return this.beginUpdate(resourceGroupName,provisioningServiceName,provisioningServiceTags,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Deletes the Provisioning Service. + * @summary Delete the Provisioning Service + * @param provisioningServiceName Name of provisioning service to delete. + * @param resourceGroupName Resource group identifier. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(provisioningServiceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteMethod(provisioningServiceName,resourceGroupName,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * List all the provisioning services for a given subscription id. + * @summary Get all the provisioning services 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, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listBySubscriptionOperationSpec, + callback) as Promise; + } + + /** + * Get a list of all provisioning services in the given resource group. + * @param resourceGroupName Resource group identifier. + * @param [options] The optional parameters + * @returns Promise + */ + listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Resource group identifier. + * @param callback The callback + */ + listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Resource group identifier. + * @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, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + options + }, + listByResourceGroupOperationSpec, + callback) as Promise; + } + + /** + * Gets the status of a long running operation, such as create, update or delete a provisioning + * service. + * @param operationId Operation id corresponding to long running operation. Use this to poll for + * the status. + * @param resourceGroupName Resource group identifier. + * @param provisioningServiceName Name of provisioning service that the operation is running on. + * @param asyncinfo Async header used to poll on the status of the operation, obtained while + * creating the long running operation. + * @param [options] The optional parameters + * @returns Promise + */ + getOperationResult(operationId: string, resourceGroupName: string, provisioningServiceName: string, asyncinfo: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param operationId Operation id corresponding to long running operation. Use this to poll for + * the status. + * @param resourceGroupName Resource group identifier. + * @param provisioningServiceName Name of provisioning service that the operation is running on. + * @param asyncinfo Async header used to poll on the status of the operation, obtained while + * creating the long running operation. + * @param callback The callback + */ + getOperationResult(operationId: string, resourceGroupName: string, provisioningServiceName: string, asyncinfo: string, callback: msRest.ServiceCallback): void; + /** + * @param operationId Operation id corresponding to long running operation. Use this to poll for + * the status. + * @param resourceGroupName Resource group identifier. + * @param provisioningServiceName Name of provisioning service that the operation is running on. + * @param asyncinfo Async header used to poll on the status of the operation, obtained while + * creating the long running operation. + * @param options The optional parameters + * @param callback The callback + */ + getOperationResult(operationId: string, resourceGroupName: string, provisioningServiceName: string, asyncinfo: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getOperationResult(operationId: string, resourceGroupName: string, provisioningServiceName: string, asyncinfo: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + operationId, + resourceGroupName, + provisioningServiceName, + asyncinfo, + options + }, + getOperationResultOperationSpec, + callback) as Promise; + } + + /** + * Gets the list of valid SKUs and tiers for a provisioning service. + * @summary Get the list of valid SKUs for a provisioning service. + * @param provisioningServiceName Name of provisioning service. + * @param resourceGroupName Name of resource group. + * @param [options] The optional parameters + * @returns Promise + */ + listValidSkus(provisioningServiceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param provisioningServiceName Name of provisioning service. + * @param resourceGroupName Name of resource group. + * @param callback The callback + */ + listValidSkus(provisioningServiceName: string, resourceGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param provisioningServiceName Name of provisioning service. + * @param resourceGroupName Name of resource group. + * @param options The optional parameters + * @param callback The callback + */ + listValidSkus(provisioningServiceName: string, resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listValidSkus(provisioningServiceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + provisioningServiceName, + resourceGroupName, + options + }, + listValidSkusOperationSpec, + callback) as Promise; + } + + /** + * Check if a provisioning service name is available. This will validate if the name is + * syntactically valid and if the name is usable + * @summary Check if a provisioning service name is available. + * @param argumentsParameter Set the name parameter in the OperationInputs structure to the name of + * the provisioning service to check. + * @param [options] The optional parameters + * @returns Promise + */ + checkProvisioningServiceNameAvailability(argumentsParameter: Models.OperationInputs, options?: msRest.RequestOptionsBase): Promise; + /** + * @param argumentsParameter Set the name parameter in the OperationInputs structure to the name of + * the provisioning service to check. + * @param callback The callback + */ + checkProvisioningServiceNameAvailability(argumentsParameter: Models.OperationInputs, callback: msRest.ServiceCallback): void; + /** + * @param argumentsParameter Set the name parameter in the OperationInputs structure to the name of + * the provisioning service to check. + * @param options The optional parameters + * @param callback The callback + */ + checkProvisioningServiceNameAvailability(argumentsParameter: Models.OperationInputs, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + checkProvisioningServiceNameAvailability(argumentsParameter: Models.OperationInputs, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + argumentsParameter, + options + }, + checkProvisioningServiceNameAvailabilityOperationSpec, + callback) as Promise; + } + + /** + * List the primary and secondary keys for a provisioning service. + * @summary Get the security metadata for a provisioning service. + * @param provisioningServiceName The provisioning service name to get the shared access keys for. + * @param resourceGroupName resource group name + * @param [options] The optional parameters + * @returns Promise + */ + listKeys(provisioningServiceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param provisioningServiceName The provisioning service name to get the shared access keys for. + * @param resourceGroupName resource group name + * @param callback The callback + */ + listKeys(provisioningServiceName: string, resourceGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param provisioningServiceName The provisioning service name to get the shared access keys for. + * @param resourceGroupName resource group name + * @param options The optional parameters + * @param callback The callback + */ + listKeys(provisioningServiceName: string, resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listKeys(provisioningServiceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + provisioningServiceName, + resourceGroupName, + options + }, + listKeysOperationSpec, + callback) as Promise; + } + + /** + * List primary and secondary keys for a specific key name + * @summary Get a shared access policy by name from a provisioning service. + * @param provisioningServiceName Name of the provisioning service. + * @param keyName Logical key name to get key-values for. + * @param resourceGroupName The name of the resource group that contains the provisioning service. + * @param [options] The optional parameters + * @returns Promise + */ + listKeysForKeyName(provisioningServiceName: string, keyName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param provisioningServiceName Name of the provisioning service. + * @param keyName Logical key name to get key-values for. + * @param resourceGroupName The name of the resource group that contains the provisioning service. + * @param callback The callback + */ + listKeysForKeyName(provisioningServiceName: string, keyName: string, resourceGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param provisioningServiceName Name of the provisioning service. + * @param keyName Logical key name to get key-values for. + * @param resourceGroupName The name of the resource group that contains the provisioning service. + * @param options The optional parameters + * @param callback The callback + */ + listKeysForKeyName(provisioningServiceName: string, keyName: string, resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listKeysForKeyName(provisioningServiceName: string, keyName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + provisioningServiceName, + keyName, + resourceGroupName, + options + }, + listKeysForKeyNameOperationSpec, + callback) as Promise; + } + + /** + * Create or update the metadata of the provisioning service. The usual pattern to modify a + * property is to retrieve the provisioning service metadata and security metadata, and then + * combine them with the modified values in a new body to update the provisioning service. + * @summary Create or update the metadata of the provisioning service. + * @param resourceGroupName Resource group identifier. + * @param provisioningServiceName Name of provisioning service to create or update. + * @param iotDpsDescription Description of the provisioning service to create or update. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreateOrUpdate(resourceGroupName: string, provisioningServiceName: string, iotDpsDescription: Models.ProvisioningServiceDescription, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + provisioningServiceName, + iotDpsDescription, + options + }, + beginCreateOrUpdateOperationSpec, + options); + } + + /** + * Update an existing provisioning service's tags. to update other fields use the CreateOrUpdate + * method + * @summary Update an existing provisioning service's tags. + * @param resourceGroupName Resource group identifier. + * @param provisioningServiceName Name of provisioning service to create or update. + * @param provisioningServiceTags Updated tag information to set into the provisioning service + * instance. + * @param [options] The optional parameters + * @returns Promise + */ + beginUpdate(resourceGroupName: string, provisioningServiceName: string, provisioningServiceTags: Models.TagsResource, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + provisioningServiceName, + provisioningServiceTags, + options + }, + beginUpdateOperationSpec, + options); + } + + /** + * Deletes the Provisioning Service. + * @summary Delete the Provisioning Service + * @param provisioningServiceName Name of provisioning service to delete. + * @param resourceGroupName Resource group identifier. + * @param [options] The optional parameters + * @returns Promise + */ + beginDeleteMethod(provisioningServiceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + provisioningServiceName, + resourceGroupName, + options + }, + beginDeleteMethodOperationSpec, + options); + } + + /** + * List all the provisioning services for a given subscription id. + * @summary Get all the provisioning services 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, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listBySubscriptionNextOperationSpec, + callback) as Promise; + } + + /** + * Get a list of all provisioning services in the given 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, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listByResourceGroupNextOperationSpec, + callback) as Promise; + } + + /** + * Gets the list of valid SKUs and tiers for a provisioning service. + * @summary Get the list of valid SKUs for a provisioning service. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listValidSkusNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listValidSkusNext(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 + */ + listValidSkusNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listValidSkusNext(nextPageLink: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listValidSkusNextOperationSpec, + callback) as Promise; + } + + /** + * List the primary and secondary keys for a provisioning service. + * @summary Get the security metadata for a provisioning service. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listKeysNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listKeysNext(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 + */ + listKeysNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listKeysNext(nextPageLink: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listKeysNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}", + urlParameters: [ + Parameters.provisioningServiceName, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ProvisioningServiceDescription + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + serializer +}; + +const listBySubscriptionOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Devices/provisioningServices", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ProvisioningServiceDescriptionListResult + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + serializer +}; + +const listByResourceGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ProvisioningServiceDescriptionListResult + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + serializer +}; + +const getOperationResultOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/operationresults/{operationId}", + urlParameters: [ + Parameters.operationId, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.provisioningServiceName + ], + queryParameters: [ + Parameters.asyncinfo, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.AsyncOperationResult + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + serializer +}; + +const listValidSkusOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/skus", + urlParameters: [ + Parameters.provisioningServiceName, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.IotDpsSkuDefinitionListResult + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + serializer +}; + +const checkProvisioningServiceNameAvailabilityOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Devices/checkProvisioningServiceNameAvailability", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "argumentsParameter", + mapper: { + ...Mappers.OperationInputs, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.NameAvailabilityInfo + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + serializer +}; + +const listKeysOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/listkeys", + urlParameters: [ + Parameters.provisioningServiceName, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SharedAccessSignatureAuthorizationRuleListResult + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + serializer +}; + +const listKeysForKeyNameOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/keys/{keyName}/listkeys", + urlParameters: [ + Parameters.provisioningServiceName, + Parameters.keyName, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SharedAccessSignatureAuthorizationRuleAccessRightsDescription + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + serializer +}; + +const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.provisioningServiceName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "iotDpsDescription", + mapper: { + ...Mappers.ProvisioningServiceDescription, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.ProvisioningServiceDescription + }, + 201: { + bodyMapper: Mappers.ProvisioningServiceDescription + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + serializer +}; + +const beginUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.provisioningServiceName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "provisioningServiceTags", + mapper: { + ...Mappers.TagsResource, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.ProvisioningServiceDescription + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginDeleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}", + urlParameters: [ + Parameters.provisioningServiceName, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 202: {}, + 204: {}, + 404: {}, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + serializer +}; + +const listBySubscriptionNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ProvisioningServiceDescriptionListResult + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + serializer +}; + +const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ProvisioningServiceDescriptionListResult + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + serializer +}; + +const listValidSkusNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.IotDpsSkuDefinitionListResult + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + serializer +}; + +const listKeysNextOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SharedAccessSignatureAuthorizationRuleListResult + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + serializer +}; diff --git a/packages/@azure/arm-deviceprovisioningservices/lib/operations/operations.ts b/packages/@azure/arm-deviceprovisioningservices/lib/operations/operations.ts new file mode 100644 index 000000000000..3ea545a6f09f --- /dev/null +++ b/packages/@azure/arm-deviceprovisioningservices/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 "ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/operationsMappers"; +import * as Parameters from "../models/parameters"; +import { IotDpsClientContext } from "../iotDpsClientContext"; + +/** Class representing a Operations. */ +export class Operations { + private readonly client: IotDpsClientContext; + + /** + * Create a Operations. + * @param {IotDpsClientContext} client Reference to the service client. + */ + constructor(client: IotDpsClientContext) { + this.client = client; + } + + /** + * Lists all of the available Microsoft.Devices REST API operations. + * @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, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Lists all of the available Microsoft.Devices REST API operations. + * @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, 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.Devices/operations", + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + serializer +}; diff --git a/packages/@azure/arm-deviceprovisioningservices/package.json b/packages/@azure/arm-deviceprovisioningservices/package.json new file mode 100644 index 000000000000..1fa66ddf9680 --- /dev/null +++ b/packages/@azure/arm-deviceprovisioningservices/package.json @@ -0,0 +1,39 @@ +{ + "name": "@azure/arm-deviceprovisioningservices", + "author": "Microsoft Corporation", + "description": "IotDpsClient Library with typescript type definitions for node.js and browser.", + "version": "1.0.0", + "dependencies": { + "ms-rest-azure-js": "~0.17.165", + "ms-rest-js": "~0.22.434" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "license": "MIT", + "main": "./cjs/iotDpsClient.js", + "module": "./esm/iotDpsClient.js", + "types": "./cjs/iotDpsClient.d.ts", + "devDependencies": { + "tslib": "^1.9.3", + "typescript": "^3.0.3", + "webpack": "^4.17.2", + "webpack-cli": "^3.1.0" + }, + "homepage": "https://github.com/azure/azure-sdk-for-js/tree/master/packages/@azure/arm-deviceprovisioningservices", + "repository": { + "type": "git", + "url": "https://github.com/azure/azure-sdk-for-js.git" + }, + "bugs": { + "url": "https://github.com/azure/azure-sdk-for-js/issues" + }, + "scripts": { + "build": "tsc && tsc -p tsconfig.esm.json && webpack", + "prepare": "npm run build" + } +} diff --git a/packages/@azure/arm-deviceprovisioningservices/tsconfig.esm.json b/packages/@azure/arm-deviceprovisioningservices/tsconfig.esm.json new file mode 100644 index 000000000000..0b3aed07505c --- /dev/null +++ b/packages/@azure/arm-deviceprovisioningservices/tsconfig.esm.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "outDir": "./esm", + "module": "es6", + "target": "es5" + } +} diff --git a/packages/@azure/arm-deviceprovisioningservices/tsconfig.json b/packages/@azure/arm-deviceprovisioningservices/tsconfig.json new file mode 100644 index 000000000000..d5b25971c029 --- /dev/null +++ b/packages/@azure/arm-deviceprovisioningservices/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "module": "commonjs", + "moduleResolution": "node", + "strict": true, + "target": "es6", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": ["es6"], + "declaration": true, + "outDir": "./cjs" + }, + "include": ["./lib/**/*"], + "exclude": ["node_modules"] +} diff --git a/packages/@azure/arm-deviceprovisioningservices/webpack.config.js b/packages/@azure/arm-deviceprovisioningservices/webpack.config.js new file mode 100644 index 000000000000..a0b85f94f61f --- /dev/null +++ b/packages/@azure/arm-deviceprovisioningservices/webpack.config.js @@ -0,0 +1,30 @@ +// This is a template webpack config file with minimal configuration. +// Users are free to create their own webpack configuration files in their application. +const path = require('path'); + +/** + * @type {import('webpack').Configuration} + */ +const config = { + mode: 'production', + entry: './esm/iotDpsClient.js', + devtool: 'source-map', + output: { + filename: 'iotDpsClientBundle.js', + path: __dirname, + libraryTarget: 'var', + library: 'iotDpsClient' + }, + // "ms-rest-js" and "ms-rest-azure-js" are dependencies of this library. + // Customer is expected to import/include this library in browser javascript + // (probably using the script tag in their html file). + externals: { + "ms-rest-js": "msRest", + "ms-rest-azure-js": "msRestAzure" + }, + resolve: { + extensions: [".tsx", ".ts", ".js"] + } +}; + +module.exports = config; From 03090265cef3c07974b9c2e9d0afbdafb73fcedc Mon Sep 17 00:00:00 2001 From: Kamil Pajdzik Date: Wed, 17 Oct 2018 11:40:22 -0700 Subject: [PATCH 2/2] Regenerate package --- packages/@azure/arm-deviceprovisioningservices/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/@azure/arm-deviceprovisioningservices/package.json b/packages/@azure/arm-deviceprovisioningservices/package.json index f287e290b294..b73c63cb9e8b 100644 --- a/packages/@azure/arm-deviceprovisioningservices/package.json +++ b/packages/@azure/arm-deviceprovisioningservices/package.json @@ -4,8 +4,8 @@ "description": "IotDpsClient Library with typescript type definitions for node.js and browser.", "version": "1.0.0", "dependencies": { - "ms-rest-azure-js": "^1.0.166", - "ms-rest-js": "^1.0.439", + "ms-rest-azure-js": "^1.0.172", + "ms-rest-js": "^1.0.443", "tslib": "^1.9.3" }, "keywords": [