From d0ef94ba56014394acda7490a09b93b3bfa59d00 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 17 Feb 2021 00:27:26 +0000 Subject: [PATCH] CodeGen from PR 12876 in Azure/azure-rest-api-specs Merge ef8ee958247842aae4999d43499c36d30a40a34f into 365bbe9f3d15ae393238db3aeb977230fe6e6a32 --- sdk/azurestack/arm-azurestack/LICENSE.txt | 2 +- sdk/azurestack/arm-azurestack/README.md | 9 +- .../arm-azurestack/rollup.config.js | 4 +- .../src/azureStackManagementClient.ts | 13 +- .../src/azureStackManagementClientContext.ts | 7 +- .../src/models/cloudManifestFileMappers.ts | 27 + .../models/customerSubscriptionsMappers.ts | 10 +- .../arm-azurestack/src/models/index.ts | 398 ++++++++++++-- .../src/models/linkedSubscriptionsMappers.ts | 29 ++ .../arm-azurestack/src/models/mappers.ts | 295 ++++++++++- .../src/models/operationsMappers.ts | 7 +- .../arm-azurestack/src/models/parameters.ts | 39 +- .../src/models/productsMappers.ts | 10 +- .../src/models/registrationsMappers.ts | 10 +- .../src/operations/cloudManifestFile.ts | 125 +++++ .../src/operations/customerSubscriptions.ts | 12 +- .../arm-azurestack/src/operations/index.ts | 9 +- .../src/operations/linkedSubscriptions.ts | 484 ++++++++++++++++++ .../src/operations/operations.ts | 12 +- .../arm-azurestack/src/operations/products.ts | 29 +- .../src/operations/registrations.ts | 64 ++- 21 files changed, 1490 insertions(+), 105 deletions(-) create mode 100644 sdk/azurestack/arm-azurestack/src/models/cloudManifestFileMappers.ts create mode 100644 sdk/azurestack/arm-azurestack/src/models/linkedSubscriptionsMappers.ts create mode 100644 sdk/azurestack/arm-azurestack/src/operations/cloudManifestFile.ts create mode 100644 sdk/azurestack/arm-azurestack/src/operations/linkedSubscriptions.ts diff --git a/sdk/azurestack/arm-azurestack/LICENSE.txt b/sdk/azurestack/arm-azurestack/LICENSE.txt index ea8fb1516028..2d3163745319 100644 --- a/sdk/azurestack/arm-azurestack/LICENSE.txt +++ b/sdk/azurestack/arm-azurestack/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2020 Microsoft +Copyright (c) 2021 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/sdk/azurestack/arm-azurestack/README.md b/sdk/azurestack/arm-azurestack/README.md index 65e5624b65d3..dd3416a16576 100644 --- a/sdk/azurestack/arm-azurestack/README.md +++ b/sdk/azurestack/arm-azurestack/README.md @@ -15,7 +15,7 @@ npm install @azure/arm-azurestack ### How to use -#### nodejs - Authentication, client creation and list operations as an example written in TypeScript. +#### nodejs - client creation and list operations as an example written in TypeScript. ##### Install @azure/ms-rest-nodeauth @@ -26,11 +26,10 @@ npm install @azure/ms-rest-nodeauth@"^3.0.0" ##### Sample code +While the below sample uses the interactive login, other authentication options can be found in the [README.md file of @azure/ms-rest-nodeauth](https://www.npmjs.com/package/@azure/ms-rest-nodeauth) package ```typescript -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as msRestNodeAuth from "@azure/ms-rest-nodeauth"; -import { AzureStackManagementClient, AzureStackManagementModels, AzureStackManagementMappers } from "@azure/arm-azurestack"; +const msRestNodeAuth = require("@azure/ms-rest-nodeauth"); +const { AzureStackManagementClient } = require("@azure/arm-azurestack"); const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; msRestNodeAuth.interactiveLogin().then((creds) => { diff --git a/sdk/azurestack/arm-azurestack/rollup.config.js b/sdk/azurestack/arm-azurestack/rollup.config.js index 43e870f5a495..28d093ee0c0b 100644 --- a/sdk/azurestack/arm-azurestack/rollup.config.js +++ b/sdk/azurestack/arm-azurestack/rollup.config.js @@ -21,8 +21,8 @@ const config = { "@azure/ms-rest-azure-js": "msRestAzure" }, banner: `/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. diff --git a/sdk/azurestack/arm-azurestack/src/azureStackManagementClient.ts b/sdk/azurestack/arm-azurestack/src/azureStackManagementClient.ts index 04f21ebf7bfd..bc09d71c6879 100644 --- a/sdk/azurestack/arm-azurestack/src/azureStackManagementClient.ts +++ b/sdk/azurestack/arm-azurestack/src/azureStackManagementClient.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -18,9 +17,11 @@ import { AzureStackManagementClientContext } from "./azureStackManagementClientC class AzureStackManagementClient extends AzureStackManagementClientContext { // Operation groups operations: operations.Operations; + cloudManifestFile: operations.CloudManifestFile; + customerSubscriptions: operations.CustomerSubscriptions; products: operations.Products; registrations: operations.Registrations; - customerSubscriptions: operations.CustomerSubscriptions; + linkedSubscriptions: operations.LinkedSubscriptions; /** * Initializes a new instance of the AzureStackManagementClient class. @@ -32,9 +33,11 @@ class AzureStackManagementClient extends AzureStackManagementClientContext { constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.AzureStackManagementClientOptions) { super(credentials, subscriptionId, options); this.operations = new operations.Operations(this); + this.cloudManifestFile = new operations.CloudManifestFile(this); + this.customerSubscriptions = new operations.CustomerSubscriptions(this); this.products = new operations.Products(this); this.registrations = new operations.Registrations(this); - this.customerSubscriptions = new operations.CustomerSubscriptions(this); + this.linkedSubscriptions = new operations.LinkedSubscriptions(this); } } diff --git a/sdk/azurestack/arm-azurestack/src/azureStackManagementClientContext.ts b/sdk/azurestack/arm-azurestack/src/azureStackManagementClientContext.ts index 1af43d53f712..51eae0e08ba5 100644 --- a/sdk/azurestack/arm-azurestack/src/azureStackManagementClientContext.ts +++ b/sdk/azurestack/arm-azurestack/src/azureStackManagementClientContext.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -45,7 +44,7 @@ export class AzureStackManagementClientContext extends msRestAzure.AzureServiceC super(credentials, options); - this.apiVersion = '2017-06-01'; + this.apiVersion = '2020-06-01-preview'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; diff --git a/sdk/azurestack/arm-azurestack/src/models/cloudManifestFileMappers.ts b/sdk/azurestack/arm-azurestack/src/models/cloudManifestFileMappers.ts new file mode 100644 index 000000000000..fe72b937b963 --- /dev/null +++ b/sdk/azurestack/arm-azurestack/src/models/cloudManifestFileMappers.ts @@ -0,0 +1,27 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + BaseResource, + CloudManifestFileDeploymentData, + CloudManifestFileProperties, + CloudManifestFileResponse, + Compatibility, + CustomerSubscription, + ErrorDetails, + ErrorResponse, + IconUris, + LinkedSubscription, + Product, + ProductLink, + ProductProperties, + Registration, + Resource, + SystemData, + TrackedResource +} from "../models/mappers"; diff --git a/sdk/azurestack/arm-azurestack/src/models/customerSubscriptionsMappers.ts b/sdk/azurestack/arm-azurestack/src/models/customerSubscriptionsMappers.ts index 3fac26f64b26..1c3d48e1ce22 100644 --- a/sdk/azurestack/arm-azurestack/src/models/customerSubscriptionsMappers.ts +++ b/sdk/azurestack/arm-azurestack/src/models/customerSubscriptionsMappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -8,17 +8,21 @@ export { BaseResource, - CloudError, + CloudManifestFileDeploymentData, + CloudManifestFileProperties, + CloudManifestFileResponse, Compatibility, CustomerSubscription, CustomerSubscriptionList, ErrorDetails, ErrorResponse, IconUris, + LinkedSubscription, Product, ProductLink, ProductProperties, Registration, Resource, + SystemData, TrackedResource } from "../models/mappers"; diff --git a/sdk/azurestack/arm-azurestack/src/models/index.ts b/sdk/azurestack/arm-azurestack/src/models/index.ts index bc6c459c0000..6966a9101f77 100644 --- a/sdk/azurestack/arm-azurestack/src/models/index.ts +++ b/sdk/azurestack/arm-azurestack/src/models/index.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -36,6 +36,38 @@ export interface Resource extends BaseResource { etag?: string; } +/** + * Metadata pertaining to creation and last modification of the resource. + */ +export interface SystemData { + /** + * The identity that created the resource. + */ + createdBy?: string; + /** + * The type of identity that created the resource. Possible values include: 'User', + * 'Application', 'ManagedIdentity', 'Key' + */ + createdByType?: CreatedByType; + /** + * The timestamp of resource creation (UTC). + */ + createdAt?: Date; + /** + * The identity that last modified the resource. + */ + lastModifiedBy?: string; + /** + * The type of identity that last modified the resource. Possible values include: 'User', + * 'Application', 'ManagedIdentity', 'Key' + */ + lastModifiedByType?: CreatedByType; + /** + * The timestamp of resource last modification (UTC) + */ + lastModifiedAt?: Date; +} + /** * Base resource object. */ @@ -55,6 +87,12 @@ export interface TrackedResource extends BaseResource { * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly type?: string; + /** + * The kind of the resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly kind?: string; + systemData?: SystemData; /** * Custom tags for the resource. */ @@ -107,6 +145,52 @@ export interface Operation { origin?: string; } +/** + * Cloud specific manifest data for AzureStack deployment. + */ +export interface CloudManifestFileDeploymentData { + /** + * Dsms external certificates. + */ + externalDsmsCertificates?: string; + /** + * Signing verification public key. + */ + customCloudVerificationKey?: string; + /** + * ARM endpoint. + */ + customCloudArmEndpoint?: string; + /** + * Dsms endpoint. + */ + externalDsmsEndpoint?: string; +} + +/** + * Cloud specific manifest JSON properties. + */ +export interface CloudManifestFileProperties { + /** + * Cloud specific manifest data. + */ + deploymentData?: CloudManifestFileDeploymentData; + /** + * Signature of the cloud specific manifest data. + */ + signature?: string; +} + +/** + * Cloud specific manifest GET response. + */ +export interface CloudManifestFileResponse extends Resource { + /** + * Cloud specific manifest data. + */ + properties?: CloudManifestFileProperties; +} + /** * The details of the error. */ @@ -139,6 +223,17 @@ export interface ErrorResponse { error?: ErrorDetails; } +/** + * Customer subscription. + */ +export interface CustomerSubscription extends Resource { + /** + * Tenant Id. + */ + tenantId?: string; + systemData?: SystemData; +} + /** * OS disk image. */ @@ -447,6 +542,7 @@ export interface Product extends Resource { * Product compatibility with current device. */ compatibility?: Compatibility; + systemData?: SystemData; } /** @@ -588,20 +684,70 @@ export interface RegistrationParameter { * The token identifying registered Azure Stack */ registrationToken: string; +} + +/** + * Linked Subscription information. + */ +export interface LinkedSubscription extends TrackedResource { + /** + * The identifier associated with the device subscription. + */ + linkedSubscriptionId?: string; + /** + * The identifier associated with the device registration. + */ + registrationResourceId?: string; + /** + * The identifier of the Azure Stack device for remote management. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly deviceId?: string; /** - * Location of the resource. Possible values include: 'global' + * The object identifier associated with the Azure Stack device connecting to Azure. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly deviceObjectId?: string; + /** + * The connection state of the Azure Stack device. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - location?: Location; + readonly deviceLinkState?: string; + /** + * The last remote management connection time for the Azure Stack device connected to the linked + * subscription resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly lastConnectedTime?: string; + /** + * The status of the remote management connection of the Azure Stack device. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly deviceConnectionStatus?: string; } /** - * Customer subscription. + * Linked Subscription resource */ -export interface CustomerSubscription extends Resource { +export interface LinkedSubscriptionParameter { /** - * Tenant Id. + * The identifier associated with the device subscription. */ - tenantId?: string; + linkedSubscriptionId: string; + /** + * The identifier associated with the device registration. + */ + registrationResourceId: string; +} + +/** + * Optional Parameters. + */ +export interface CloudManifestFileGetOptionalParams extends msRest.RequestOptionsBase { + /** + * Signing verification key version creation date. + */ + versionCreationDate?: string; } /** @@ -623,6 +769,18 @@ export interface OperationList extends Array { nextLink?: string; } +/** + * @interface + * Pageable list of customer subscriptions. + * @extends Array + */ +export interface CustomerSubscriptionList extends Array { + /** + * URI to the next page. + */ + nextLink?: string; +} + /** * @interface * Pageable list of products. @@ -649,16 +807,24 @@ export interface RegistrationList extends Array { /** * @interface - * Pageable list of customer subscriptions. - * @extends Array + * List of linked subscriptions with paging support. + * @extends Array */ -export interface CustomerSubscriptionList extends Array { +export interface LinkedSubscriptionsList extends Array { /** * URI to the next page. */ nextLink?: string; } +/** + * Defines values for CreatedByType. + * Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + * @readonly + * @enum {string} + */ +export type CreatedByType = 'User' | 'Application' | 'ManagedIdentity' | 'Key'; + /** * Defines values for ProvisioningState. * Possible values include: 'Creating', 'Failed', 'Succeeded', 'Canceled' @@ -703,14 +869,6 @@ export type CompatibilityIssue = 'HigherDeviceVersionRequired' | 'LowerDeviceVer */ export type Category = 'AzureAD' | 'ADFS'; -/** - * Defines values for Location. - * Possible values include: 'global' - * @readonly - * @enum {string} - */ -export type Location = 'global'; - /** * Contains response data for the list operation. */ @@ -751,6 +909,126 @@ export type OperationsListNextResponse = OperationList & { }; }; +/** + * Contains response data for the list operation. + */ +export type CloudManifestFileListResponse = CloudManifestFileResponse & { + /** + * 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: CloudManifestFileResponse; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type CloudManifestFileGetResponse = CloudManifestFileResponse & { + /** + * 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: CloudManifestFileResponse; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type CustomerSubscriptionsListResponse = CustomerSubscriptionList & { + /** + * 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: CustomerSubscriptionList; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type CustomerSubscriptionsGetResponse = CustomerSubscription & { + /** + * 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: CustomerSubscription; + }; +}; + +/** + * Contains response data for the create operation. + */ +export type CustomerSubscriptionsCreateResponse = CustomerSubscription & { + /** + * 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: CustomerSubscription; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type CustomerSubscriptionsListNextResponse = CustomerSubscriptionList & { + /** + * 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: CustomerSubscriptionList; + }; +}; + /** * Contains response data for the list operation. */ @@ -1012,9 +1290,9 @@ export type RegistrationsListNextResponse = RegistrationList & { }; /** - * Contains response data for the list operation. + * Contains response data for the listByResourceGroup operation. */ -export type CustomerSubscriptionsListResponse = CustomerSubscriptionList & { +export type LinkedSubscriptionsListByResourceGroupResponse = LinkedSubscriptionsList & { /** * The underlying HTTP response. */ @@ -1027,14 +1305,34 @@ export type CustomerSubscriptionsListResponse = CustomerSubscriptionList & { /** * The response body as parsed JSON or XML */ - parsedBody: CustomerSubscriptionList; + parsedBody: LinkedSubscriptionsList; + }; +}; + +/** + * Contains response data for the listBySubscription operation. + */ +export type LinkedSubscriptionsListBySubscriptionResponse = LinkedSubscriptionsList & { + /** + * 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: LinkedSubscriptionsList; }; }; /** * Contains response data for the get operation. */ -export type CustomerSubscriptionsGetResponse = CustomerSubscription & { +export type LinkedSubscriptionsGetResponse = LinkedSubscription & { /** * The underlying HTTP response. */ @@ -1047,14 +1345,14 @@ export type CustomerSubscriptionsGetResponse = CustomerSubscription & { /** * The response body as parsed JSON or XML */ - parsedBody: CustomerSubscription; + parsedBody: LinkedSubscription; }; }; /** - * Contains response data for the create operation. + * Contains response data for the createOrUpdate operation. */ -export type CustomerSubscriptionsCreateResponse = CustomerSubscription & { +export type LinkedSubscriptionsCreateOrUpdateResponse = LinkedSubscription & { /** * The underlying HTTP response. */ @@ -1067,14 +1365,14 @@ export type CustomerSubscriptionsCreateResponse = CustomerSubscription & { /** * The response body as parsed JSON or XML */ - parsedBody: CustomerSubscription; + parsedBody: LinkedSubscription; }; }; /** - * Contains response data for the listNext operation. + * Contains response data for the update operation. */ -export type CustomerSubscriptionsListNextResponse = CustomerSubscriptionList & { +export type LinkedSubscriptionsUpdateResponse = LinkedSubscription & { /** * The underlying HTTP response. */ @@ -1087,6 +1385,46 @@ export type CustomerSubscriptionsListNextResponse = CustomerSubscriptionList & { /** * The response body as parsed JSON or XML */ - parsedBody: CustomerSubscriptionList; + parsedBody: LinkedSubscription; + }; +}; + +/** + * Contains response data for the listByResourceGroupNext operation. + */ +export type LinkedSubscriptionsListByResourceGroupNextResponse = LinkedSubscriptionsList & { + /** + * 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: LinkedSubscriptionsList; + }; +}; + +/** + * Contains response data for the listBySubscriptionNext operation. + */ +export type LinkedSubscriptionsListBySubscriptionNextResponse = LinkedSubscriptionsList & { + /** + * 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: LinkedSubscriptionsList; }; }; diff --git a/sdk/azurestack/arm-azurestack/src/models/linkedSubscriptionsMappers.ts b/sdk/azurestack/arm-azurestack/src/models/linkedSubscriptionsMappers.ts new file mode 100644 index 000000000000..4eb50796a7c1 --- /dev/null +++ b/sdk/azurestack/arm-azurestack/src/models/linkedSubscriptionsMappers.ts @@ -0,0 +1,29 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + BaseResource, + CloudManifestFileDeploymentData, + CloudManifestFileProperties, + CloudManifestFileResponse, + Compatibility, + CustomerSubscription, + ErrorDetails, + ErrorResponse, + IconUris, + LinkedSubscription, + LinkedSubscriptionParameter, + LinkedSubscriptionsList, + Product, + ProductLink, + ProductProperties, + Registration, + Resource, + SystemData, + TrackedResource +} from "../models/mappers"; diff --git a/sdk/azurestack/arm-azurestack/src/models/mappers.ts b/sdk/azurestack/arm-azurestack/src/models/mappers.ts index 0a241079ca23..37b15093870b 100644 --- a/sdk/azurestack/arm-azurestack/src/models/mappers.ts +++ b/sdk/azurestack/arm-azurestack/src/models/mappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -49,6 +49,52 @@ export const Resource: msRest.CompositeMapper = { } }; +export const SystemData: msRest.CompositeMapper = { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData", + modelProperties: { + createdBy: { + serializedName: "createdBy", + type: { + name: "String" + } + }, + createdByType: { + serializedName: "createdByType", + type: { + name: "String" + } + }, + createdAt: { + serializedName: "createdAt", + type: { + name: "DateTime" + } + }, + lastModifiedBy: { + serializedName: "lastModifiedBy", + type: { + name: "String" + } + }, + lastModifiedByType: { + serializedName: "lastModifiedByType", + type: { + name: "String" + } + }, + lastModifiedAt: { + serializedName: "lastModifiedAt", + type: { + name: "DateTime" + } + } + } + } +}; + export const TrackedResource: msRest.CompositeMapper = { serializedName: "TrackedResource", type: { @@ -76,6 +122,20 @@ export const TrackedResource: msRest.CompositeMapper = { name: "String" } }, + kind: { + readOnly: true, + serializedName: "kind", + type: { + name: "String" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, location: { required: true, isConstant: true, @@ -169,6 +229,81 @@ export const Operation: msRest.CompositeMapper = { } }; +export const CloudManifestFileDeploymentData: msRest.CompositeMapper = { + serializedName: "CloudManifestFileDeploymentData", + type: { + name: "Composite", + className: "CloudManifestFileDeploymentData", + modelProperties: { + externalDsmsCertificates: { + serializedName: "externalDsmsCertificates", + type: { + name: "String" + } + }, + customCloudVerificationKey: { + serializedName: "customCloudVerificationKey", + type: { + name: "String" + } + }, + customCloudArmEndpoint: { + serializedName: "customEnvironmentEndpoints.customCloudArmEndpoint", + type: { + name: "String" + } + }, + externalDsmsEndpoint: { + serializedName: "customEnvironmentEndpoints.externalDsmsEndpoint", + type: { + name: "String" + } + } + } + } +}; + +export const CloudManifestFileProperties: msRest.CompositeMapper = { + serializedName: "CloudManifestFileProperties", + type: { + name: "Composite", + className: "CloudManifestFileProperties", + modelProperties: { + deploymentData: { + serializedName: "deploymentData", + type: { + name: "Composite", + className: "CloudManifestFileDeploymentData" + } + }, + signature: { + serializedName: "signature", + type: { + name: "String" + } + } + } + } +}; + +export const CloudManifestFileResponse: msRest.CompositeMapper = { + serializedName: "CloudManifestFileResponse", + type: { + name: "Composite", + className: "CloudManifestFileResponse", + modelProperties: { + ...Resource.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "CloudManifestFileProperties" + } + } + } + } +}; + export const ErrorDetails: msRest.CompositeMapper = { serializedName: "ErrorDetails", type: { @@ -217,6 +352,30 @@ export const ErrorResponse: msRest.CompositeMapper = { } }; +export const CustomerSubscription: msRest.CompositeMapper = { + serializedName: "CustomerSubscription", + type: { + name: "Composite", + className: "CustomerSubscription", + modelProperties: { + ...Resource.type.modelProperties, + tenantId: { + serializedName: "properties.tenantId", + type: { + name: "String" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + } + } + } +}; + export const OsDiskImage: msRest.CompositeMapper = { serializedName: "OsDiskImage", type: { @@ -696,6 +855,13 @@ export const Product: msRest.CompositeMapper = { name: "Composite", className: "Compatibility" } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } } } } @@ -909,7 +1075,10 @@ export const RegistrationParameter: msRest.CompositeMapper = { } }, location: { + required: true, + isConstant: true, serializedName: "location", + defaultValue: 'global', type: { name: "String" } @@ -918,15 +1087,89 @@ export const RegistrationParameter: msRest.CompositeMapper = { } }; -export const CustomerSubscription: msRest.CompositeMapper = { - serializedName: "CustomerSubscription", +export const LinkedSubscription: msRest.CompositeMapper = { + serializedName: "LinkedSubscription", type: { name: "Composite", - className: "CustomerSubscription", + className: "LinkedSubscription", modelProperties: { - ...Resource.type.modelProperties, - tenantId: { - serializedName: "properties.tenantId", + ...TrackedResource.type.modelProperties, + linkedSubscriptionId: { + serializedName: "properties.linkedSubscriptionId", + type: { + name: "String" + } + }, + registrationResourceId: { + serializedName: "properties.registrationResourceId", + type: { + name: "String" + } + }, + deviceId: { + readOnly: true, + serializedName: "properties.deviceId", + type: { + name: "String" + } + }, + deviceObjectId: { + readOnly: true, + serializedName: "properties.deviceObjectId", + type: { + name: "String" + } + }, + deviceLinkState: { + readOnly: true, + serializedName: "properties.deviceLinkState", + type: { + name: "String" + } + }, + lastConnectedTime: { + readOnly: true, + serializedName: "properties.lastConnectedTime", + type: { + name: "String" + } + }, + deviceConnectionStatus: { + readOnly: true, + serializedName: "properties.deviceConnectionStatus", + type: { + name: "String" + } + } + } + } +}; + +export const LinkedSubscriptionParameter: msRest.CompositeMapper = { + serializedName: "LinkedSubscriptionParameter", + type: { + name: "Composite", + className: "LinkedSubscriptionParameter", + modelProperties: { + linkedSubscriptionId: { + required: true, + serializedName: "properties.linkedSubscriptionId", + type: { + name: "String" + } + }, + registrationResourceId: { + required: true, + serializedName: "properties.registrationResourceId", + type: { + name: "String" + } + }, + location: { + required: true, + isConstant: true, + serializedName: "location", + defaultValue: 'global', type: { name: "String" } @@ -963,6 +1206,34 @@ export const OperationList: msRest.CompositeMapper = { } }; +export const CustomerSubscriptionList: msRest.CompositeMapper = { + serializedName: "CustomerSubscriptionList", + type: { + name: "Composite", + className: "CustomerSubscriptionList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CustomerSubscription" + } + } + } + } + } + } +}; + export const ProductList: msRest.CompositeMapper = { serializedName: "ProductList", type: { @@ -1019,11 +1290,11 @@ export const RegistrationList: msRest.CompositeMapper = { } }; -export const CustomerSubscriptionList: msRest.CompositeMapper = { - serializedName: "CustomerSubscriptionList", +export const LinkedSubscriptionsList: msRest.CompositeMapper = { + serializedName: "LinkedSubscriptionsList", type: { name: "Composite", - className: "CustomerSubscriptionList", + className: "LinkedSubscriptionsList", modelProperties: { nextLink: { serializedName: "nextLink", @@ -1038,7 +1309,7 @@ export const CustomerSubscriptionList: msRest.CompositeMapper = { element: { type: { name: "Composite", - className: "CustomerSubscription" + className: "LinkedSubscription" } } } diff --git a/sdk/azurestack/arm-azurestack/src/models/operationsMappers.ts b/sdk/azurestack/arm-azurestack/src/models/operationsMappers.ts index a985ca7f4ca9..faa15c414064 100644 --- a/sdk/azurestack/arm-azurestack/src/models/operationsMappers.ts +++ b/sdk/azurestack/arm-azurestack/src/models/operationsMappers.ts @@ -1,14 +1,15 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export { - CloudError, Display, + ErrorDetails, + ErrorResponse, Operation, OperationList } from "../models/mappers"; diff --git a/sdk/azurestack/arm-azurestack/src/models/parameters.ts b/sdk/azurestack/arm-azurestack/src/models/parameters.ts index e13086b4e5df..d52f9c53a39c 100644 --- a/sdk/azurestack/arm-azurestack/src/models/parameters.ts +++ b/sdk/azurestack/arm-azurestack/src/models/parameters.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -25,7 +24,7 @@ export const apiVersion: msRest.OperationQueryParameter = { mapper: { required: true, serializedName: "api-version", - defaultValue: '2017-06-01', + defaultValue: '2020-06-01-preview', type: { name: "String" } @@ -41,6 +40,16 @@ export const customerSubscriptionName: msRest.OperationURLParameter = { } } }; +export const linkedSubscriptionName: msRest.OperationURLParameter = { + parameterPath: "linkedSubscriptionName", + mapper: { + required: true, + serializedName: "linkedSubscriptionName", + type: { + name: "String" + } + } +}; export const nextPageLink: msRest.OperationURLParameter = { parameterPath: "nextPageLink", mapper: { @@ -92,3 +101,25 @@ export const subscriptionId: msRest.OperationURLParameter = { } } }; +export const verificationVersion: msRest.OperationURLParameter = { + parameterPath: "verificationVersion", + mapper: { + required: true, + serializedName: "verificationVersion", + type: { + name: "String" + } + } +}; +export const versionCreationDate: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "versionCreationDate" + ], + mapper: { + serializedName: "versionCreationDate", + type: { + name: "String" + } + } +}; diff --git a/sdk/azurestack/arm-azurestack/src/models/productsMappers.ts b/sdk/azurestack/arm-azurestack/src/models/productsMappers.ts index 8690235a808d..47cc85ccef05 100644 --- a/sdk/azurestack/arm-azurestack/src/models/productsMappers.ts +++ b/sdk/azurestack/arm-azurestack/src/models/productsMappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -8,7 +8,9 @@ export { BaseResource, - CloudError, + CloudManifestFileDeploymentData, + CloudManifestFileProperties, + CloudManifestFileResponse, Compatibility, CustomerSubscription, DataDiskImage, @@ -17,6 +19,7 @@ export { ErrorResponse, ExtendedProduct, IconUris, + LinkedSubscription, MarketplaceProductLogUpdate, OsDiskImage, Product, @@ -26,5 +29,6 @@ export { ProductProperties, Registration, Resource, + SystemData, TrackedResource } from "../models/mappers"; diff --git a/sdk/azurestack/arm-azurestack/src/models/registrationsMappers.ts b/sdk/azurestack/arm-azurestack/src/models/registrationsMappers.ts index e9cf05e71ce8..925c2736a7b5 100644 --- a/sdk/azurestack/arm-azurestack/src/models/registrationsMappers.ts +++ b/sdk/azurestack/arm-azurestack/src/models/registrationsMappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -9,12 +9,15 @@ export { ActivationKeyResult, BaseResource, - CloudError, + CloudManifestFileDeploymentData, + CloudManifestFileProperties, + CloudManifestFileResponse, Compatibility, CustomerSubscription, ErrorDetails, ErrorResponse, IconUris, + LinkedSubscription, Product, ProductLink, ProductProperties, @@ -22,5 +25,6 @@ export { RegistrationList, RegistrationParameter, Resource, + SystemData, TrackedResource } from "../models/mappers"; diff --git a/sdk/azurestack/arm-azurestack/src/operations/cloudManifestFile.ts b/sdk/azurestack/arm-azurestack/src/operations/cloudManifestFile.ts new file mode 100644 index 000000000000..ce41238cc0ad --- /dev/null +++ b/sdk/azurestack/arm-azurestack/src/operations/cloudManifestFile.ts @@ -0,0 +1,125 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/cloudManifestFileMappers"; +import * as Parameters from "../models/parameters"; +import { AzureStackManagementClientContext } from "../azureStackManagementClientContext"; + +/** Class representing a CloudManifestFile. */ +export class CloudManifestFile { + private readonly client: AzureStackManagementClientContext; + + /** + * Create a CloudManifestFile. + * @param {AzureStackManagementClientContext} client Reference to the service client. + */ + constructor(client: AzureStackManagementClientContext) { + this.client = client; + } + + /** + * Returns a cloud specific manifest JSON file with latest version. + * @param [options] The optional parameters + * @returns Promise + */ + list(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + list(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Returns a cloud specific manifest JSON file. + * @param verificationVersion Signing verification key version. + * @param [options] The optional parameters + * @returns Promise + */ + get(verificationVersion: string, options?: Models.CloudManifestFileGetOptionalParams): Promise; + /** + * @param verificationVersion Signing verification key version. + * @param callback The callback + */ + get(verificationVersion: string, callback: msRest.ServiceCallback): void; + /** + * @param verificationVersion Signing verification key version. + * @param options The optional parameters + * @param callback The callback + */ + get(verificationVersion: string, options: Models.CloudManifestFileGetOptionalParams, callback: msRest.ServiceCallback): void; + get(verificationVersion: string, options?: Models.CloudManifestFileGetOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + verificationVersion, + options + }, + getOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.AzureStack/cloudManifestFiles", + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.CloudManifestFileResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.AzureStack/cloudManifestFiles/{verificationVersion}", + urlParameters: [ + Parameters.verificationVersion + ], + queryParameters: [ + Parameters.versionCreationDate, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.CloudManifestFileResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/azurestack/arm-azurestack/src/operations/customerSubscriptions.ts b/sdk/azurestack/arm-azurestack/src/operations/customerSubscriptions.ts index 9435b74b2f6e..eb67a39e6631 100644 --- a/sdk/azurestack/arm-azurestack/src/operations/customerSubscriptions.ts +++ b/sdk/azurestack/arm-azurestack/src/operations/customerSubscriptions.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -271,7 +270,7 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { 200: {}, 204: {}, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -304,7 +303,7 @@ const createOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CustomerSubscription }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -317,6 +316,9 @@ const listNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], diff --git a/sdk/azurestack/arm-azurestack/src/operations/index.ts b/sdk/azurestack/arm-azurestack/src/operations/index.ts index 1babd06f2711..d7b49aa78ae8 100644 --- a/sdk/azurestack/arm-azurestack/src/operations/index.ts +++ b/sdk/azurestack/arm-azurestack/src/operations/index.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -9,6 +8,8 @@ */ export * from "./operations"; +export * from "./cloudManifestFile"; +export * from "./customerSubscriptions"; export * from "./products"; export * from "./registrations"; -export * from "./customerSubscriptions"; +export * from "./linkedSubscriptions"; diff --git a/sdk/azurestack/arm-azurestack/src/operations/linkedSubscriptions.ts b/sdk/azurestack/arm-azurestack/src/operations/linkedSubscriptions.ts new file mode 100644 index 000000000000..322b3742bdd8 --- /dev/null +++ b/sdk/azurestack/arm-azurestack/src/operations/linkedSubscriptions.ts @@ -0,0 +1,484 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/linkedSubscriptionsMappers"; +import * as Parameters from "../models/parameters"; +import { AzureStackManagementClientContext } from "../azureStackManagementClientContext"; + +/** Class representing a LinkedSubscriptions. */ +export class LinkedSubscriptions { + private readonly client: AzureStackManagementClientContext; + + /** + * Create a LinkedSubscriptions. + * @param {AzureStackManagementClientContext} client Reference to the service client. + */ + constructor(client: AzureStackManagementClientContext) { + this.client = client; + } + + /** + * Returns a list of all linked subscriptions under current resource group. + * @param resourceGroup Name of the resource group. + * @param [options] The optional parameters + * @returns Promise + */ + listByResourceGroup(resourceGroup: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroup Name of the resource group. + * @param callback The callback + */ + listByResourceGroup(resourceGroup: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroup Name of the resource group. + * @param options The optional parameters + * @param callback The callback + */ + listByResourceGroup(resourceGroup: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByResourceGroup(resourceGroup: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroup, + options + }, + listByResourceGroupOperationSpec, + callback) as Promise; + } + + /** + * Returns a list of all linked subscriptions under current subscription. + * @param [options] The optional parameters + * @returns Promise + */ + listBySubscription(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + listBySubscription(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + listBySubscription(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listBySubscription(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listBySubscriptionOperationSpec, + callback) as Promise; + } + + /** + * Returns the properties of a Linked Subscription resource. + * @param resourceGroup Name of the resource group. + * @param linkedSubscriptionName Name of the Linked Subscription resource. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroup: string, linkedSubscriptionName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroup Name of the resource group. + * @param linkedSubscriptionName Name of the Linked Subscription resource. + * @param callback The callback + */ + get(resourceGroup: string, linkedSubscriptionName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroup Name of the resource group. + * @param linkedSubscriptionName Name of the Linked Subscription resource. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroup: string, linkedSubscriptionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroup: string, linkedSubscriptionName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroup, + linkedSubscriptionName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Delete the requested Linked Subscription resource. + * @param resourceGroup Name of the resource group. + * @param linkedSubscriptionName Name of the Linked Subscription resource. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroup: string, linkedSubscriptionName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroup Name of the resource group. + * @param linkedSubscriptionName Name of the Linked Subscription resource. + * @param callback The callback + */ + deleteMethod(resourceGroup: string, linkedSubscriptionName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroup Name of the resource group. + * @param linkedSubscriptionName Name of the Linked Subscription resource. + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(resourceGroup: string, linkedSubscriptionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(resourceGroup: string, linkedSubscriptionName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroup, + linkedSubscriptionName, + options + }, + deleteMethodOperationSpec, + callback); + } + + /** + * Create or update a linked subscription resource. + * @param resourceGroup Name of the resource group. + * @param linkedSubscriptionName Name of the Linked Subscription resource. + * @param resource Linked subscription resource parameter. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(resourceGroup: string, linkedSubscriptionName: string, resource: Models.LinkedSubscriptionParameter, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroup Name of the resource group. + * @param linkedSubscriptionName Name of the Linked Subscription resource. + * @param resource Linked subscription resource parameter. + * @param callback The callback + */ + createOrUpdate(resourceGroup: string, linkedSubscriptionName: string, resource: Models.LinkedSubscriptionParameter, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroup Name of the resource group. + * @param linkedSubscriptionName Name of the Linked Subscription resource. + * @param resource Linked subscription resource parameter. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdate(resourceGroup: string, linkedSubscriptionName: string, resource: Models.LinkedSubscriptionParameter, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdate(resourceGroup: string, linkedSubscriptionName: string, resource: Models.LinkedSubscriptionParameter, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroup, + linkedSubscriptionName, + resource, + options + }, + createOrUpdateOperationSpec, + callback) as Promise; + } + + /** + * Patch a Linked Subscription resource. + * @param resourceGroup Name of the resource group. + * @param linkedSubscriptionName Name of the Linked Subscription resource. + * @param resource Linked subscription resource parameter. + * @param [options] The optional parameters + * @returns Promise + */ + update(resourceGroup: string, linkedSubscriptionName: string, resource: Models.LinkedSubscriptionParameter, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroup Name of the resource group. + * @param linkedSubscriptionName Name of the Linked Subscription resource. + * @param resource Linked subscription resource parameter. + * @param callback The callback + */ + update(resourceGroup: string, linkedSubscriptionName: string, resource: Models.LinkedSubscriptionParameter, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroup Name of the resource group. + * @param linkedSubscriptionName Name of the Linked Subscription resource. + * @param resource Linked subscription resource parameter. + * @param options The optional parameters + * @param callback The callback + */ + update(resourceGroup: string, linkedSubscriptionName: string, resource: Models.LinkedSubscriptionParameter, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + update(resourceGroup: string, linkedSubscriptionName: string, resource: Models.LinkedSubscriptionParameter, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroup, + linkedSubscriptionName, + resource, + options + }, + updateOperationSpec, + callback) as Promise; + } + + /** + * Returns a list of all linked subscriptions under current resource group. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listByResourceGroupNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listByResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listByResourceGroupNextOperationSpec, + callback) as Promise; + } + + /** + * Returns a list of all linked subscriptions under current subscription. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listBySubscriptionNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listBySubscriptionNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listBySubscriptionNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listBySubscriptionNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listBySubscriptionNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listByResourceGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack/linkedSubscriptions", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroup + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.LinkedSubscriptionsList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listBySubscriptionOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.AzureStack/linkedSubscriptions", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.LinkedSubscriptionsList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack/linkedSubscriptions/{linkedSubscriptionName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroup, + Parameters.linkedSubscriptionName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.LinkedSubscription + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack/linkedSubscriptions/{linkedSubscriptionName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroup, + Parameters.linkedSubscriptionName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const createOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack/linkedSubscriptions/{linkedSubscriptionName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroup, + Parameters.linkedSubscriptionName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "resource", + mapper: { + ...Mappers.LinkedSubscriptionParameter, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.LinkedSubscription + }, + 201: { + bodyMapper: Mappers.LinkedSubscription + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const updateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack/linkedSubscriptions/{linkedSubscriptionName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroup, + Parameters.linkedSubscriptionName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "resource", + mapper: { + ...Mappers.LinkedSubscriptionParameter, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.LinkedSubscription + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.LinkedSubscriptionsList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listBySubscriptionNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.LinkedSubscriptionsList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/azurestack/arm-azurestack/src/operations/operations.ts b/sdk/azurestack/arm-azurestack/src/operations/operations.ts index 197d13211f8e..1bc024f6d15d 100644 --- a/sdk/azurestack/arm-azurestack/src/operations/operations.ts +++ b/sdk/azurestack/arm-azurestack/src/operations/operations.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -95,7 +94,7 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.OperationList }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -108,6 +107,9 @@ const listNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], @@ -116,7 +118,7 @@ const listNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.OperationList }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, serializer diff --git a/sdk/azurestack/arm-azurestack/src/operations/products.ts b/sdk/azurestack/arm-azurestack/src/operations/products.ts index 5854a5a2df7d..f54df7455285 100644 --- a/sdk/azurestack/arm-azurestack/src/operations/products.ts +++ b/sdk/azurestack/arm-azurestack/src/operations/products.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -134,28 +133,32 @@ export class Products { * Returns a list of products. * @param resourceGroup Name of the resource group. * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. * @param [options] The optional parameters * @returns Promise */ - getProducts(resourceGroup: string, registrationName: string, options?: msRest.RequestOptionsBase): Promise; + getProducts(resourceGroup: string, registrationName: string, productName: string, options?: msRest.RequestOptionsBase): Promise; /** * @param resourceGroup Name of the resource group. * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. * @param callback The callback */ - getProducts(resourceGroup: string, registrationName: string, callback: msRest.ServiceCallback): void; + getProducts(resourceGroup: string, registrationName: string, productName: string, callback: msRest.ServiceCallback): void; /** * @param resourceGroup Name of the resource group. * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. * @param options The optional parameters * @param callback The callback */ - getProducts(resourceGroup: string, registrationName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getProducts(resourceGroup: string, registrationName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + getProducts(resourceGroup: string, registrationName: string, productName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getProducts(resourceGroup: string, registrationName: string, productName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroup, registrationName, + productName, options }, getProductsOperationSpec, @@ -336,7 +339,7 @@ const listDetailsOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ExtendedProduct }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -344,11 +347,12 @@ const listDetailsOperationSpec: msRest.OperationSpec = { const getProductsOperationSpec: msRest.OperationSpec = { httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack/registrations/{registrationName}/products/_all/GetProducts", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack/registrations/{registrationName}/products/{productName}/getProducts", urlParameters: [ Parameters.subscriptionId, Parameters.resourceGroup, - Parameters.registrationName + Parameters.registrationName, + Parameters.productName ], queryParameters: [ Parameters.apiVersion @@ -376,7 +380,7 @@ const getProductsOperationSpec: msRest.OperationSpec = { const getProductOperationSpec: msRest.OperationSpec = { httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack/registrations/{registrationName}/products/{productName}/GetProduct", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack/registrations/{registrationName}/products/{productName}/getProduct", urlParameters: [ Parameters.subscriptionId, Parameters.resourceGroup, @@ -447,6 +451,9 @@ const listNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], diff --git a/sdk/azurestack/arm-azurestack/src/operations/registrations.ts b/sdk/azurestack/arm-azurestack/src/operations/registrations.ts index ff7c5d1122a4..1aea52885f5a 100644 --- a/sdk/azurestack/arm-azurestack/src/operations/registrations.ts +++ b/sdk/azurestack/arm-azurestack/src/operations/registrations.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -222,6 +221,38 @@ export class Registrations { callback) as Promise; } + /** + * Enables remote management for device under the Azure Stack registration. + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param [options] The optional parameters + * @returns Promise + */ + enableRemoteManagement(resourceGroup: string, registrationName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param callback The callback + */ + enableRemoteManagement(resourceGroup: string, registrationName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param options The optional parameters + * @param callback The callback + */ + enableRemoteManagement(resourceGroup: string, registrationName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + enableRemoteManagement(resourceGroup: string, registrationName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroup, + registrationName, + options + }, + enableRemoteManagementOperationSpec, + callback); + } + /** * Returns a list of all registrations. * @param nextPageLink The NextLink from the previous successful call to List operation. @@ -355,7 +386,7 @@ const createOrUpdateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.Registration }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -412,7 +443,27 @@ const getActivationKeyOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ActivationKeyResult }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const enableRemoteManagementOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack/registrations/{registrationName}/enableRemoteManagement", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroup, + Parameters.registrationName + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + default: { + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -425,6 +476,9 @@ const listNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ],