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..5e2bff4b1565 100644 --- a/sdk/azurestack/arm-azurestack/README.md +++ b/sdk/azurestack/arm-azurestack/README.md @@ -1,90 +1,97 @@ ## Azure AzureStackManagementClient SDK for JavaScript -This package contains an isomorphic SDK for AzureStackManagementClient. +This package contains an isomorphic SDK (runs both in node.js and in browsers) for AzureStackManagementClient. ### Currently supported environments -- Node.js version 6.x.x or higher +- Node.js version 8.x.x or higher - Browser JavaScript -### How to Install +### Prerequisites +You must have an [Azure subscription](https://azure.microsoft.com/free/). + +### How to install + +To use this SDK in your project, you will need to install two packages. +- `@azure/arm-azurestack` that contains the client. +- `@azure/identity` that provides different mechanisms for the client to authenticate your requests using Azure Active Directory. + +Install both packages using the below command: ```bash -npm install @azure/arm-azurestack +npm install --save @azure/arm-azurestack @azure/identity ``` +> **Note**: You may have used either `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` in the past. These packages are in maintenance mode receiving critical bug fixes, but no new features. +If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/), or are writing a client side browser application, we strongly encourage you to upgrade to `@azure/identity` which uses the latest versions of Azure Active Directory and MSAL APIs and provides more authentication options. ### How to use -#### nodejs - Authentication, client creation and list operations as an example written in TypeScript. +- If you are writing a client side browser application, + - Follow the instructions in the section on Authenticating client side browser applications in [Azure Identity examples](https://aka.ms/azsdk/js/identity/examples) to register your application in the Microsoft identity platform and set the right permissions. + - Copy the client ID and tenant ID from the Overview section of your app registration in Azure portal and use it in the browser sample below. +- If you are writing a server side application, + - [Select a credential from `@azure/identity` based on the authentication method of your choice](https://aka.ms/azsdk/js/identity/examples) + - Complete the set up steps required by the credential if any. + - Use the credential you picked in the place of `DefaultAzureCredential` in the Node.js sample below. -##### Install @azure/ms-rest-nodeauth - -- Please install minimum version of `"@azure/ms-rest-nodeauth": "^3.0.0"`. -```bash -npm install @azure/ms-rest-nodeauth@"^3.0.0" -``` +In the below samples, we pass the credential and the Azure subscription id to instantiate the client. +Once the client is created, explore the operations on it either in your favorite editor or in our [API reference documentation](https://docs.microsoft.com/javascript/api) to get started. +#### nodejs - Authentication, client creation, and list operations as an example written in JavaScript. ##### Sample code -```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"; +```javascript +const { DefaultAzureCredential } = require("@azure/identity"); +const { AzureStackManagementClient } = require("@azure/arm-azurestack"); const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; -msRestNodeAuth.interactiveLogin().then((creds) => { - const client = new AzureStackManagementClient(creds, subscriptionId); - client.operations.list().then((result) => { - console.log("The result is:"); - console.log(result); - }); +// Use `DefaultAzureCredential` or any other credential of your choice based on https://aka.ms/azsdk/js/identity/examples +// Please note that you can also use credentials from the `@azure/ms-rest-nodeauth` package instead. +const creds = new DefaultAzureCredential(); +const client = new AzureStackManagementClient(creds, subscriptionId); +client.operations.list().then((result) => { + console.log("The result is:"); + console.log(result); }).catch((err) => { + console.log("An error occurred:"); console.error(err); }); ``` -#### browser - Authentication, client creation and list operations as an example written in JavaScript. +#### browser - Authentication, client creation, and list operations as an example written in JavaScript. -##### Install @azure/ms-rest-browserauth - -```bash -npm install @azure/ms-rest-browserauth -``` +In browser applications, we recommend using the `InteractiveBrowserCredential` that interactively authenticates using the default system browser. + - See [Single-page application: App registration guide](https://docs.microsoft.com/azure/active-directory/develop/scenario-spa-app-registration) to configure your app registration for the browser. + - Note down the client Id from the previous step and use it in the browser sample below. ##### Sample code -See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser. - - index.html + ```html @azure/arm-azurestack sample - - + diff --git a/sdk/azurestack/arm-azurestack/package.json b/sdk/azurestack/arm-azurestack/package.json index 10036d2a7aec..f6d4dc30e2cc 100644 --- a/sdk/azurestack/arm-azurestack/package.json +++ b/sdk/azurestack/arm-azurestack/package.json @@ -4,8 +4,9 @@ "description": "AzureStackManagementClient Library with typescript type definitions for node.js and browser.", "version": "2.0.0", "dependencies": { - "@azure/ms-rest-azure-js": "^2.0.1", - "@azure/ms-rest-js": "^2.0.4", + "@azure/ms-rest-azure-js": "^2.1.0", + "@azure/ms-rest-js": "^2.2.0", + "@azure/core-auth": "^1.1.4", "tslib": "^1.10.0" }, "keywords": [ @@ -20,7 +21,7 @@ "module": "./esm/azureStackManagementClient.js", "types": "./esm/azureStackManagementClient.d.ts", "devDependencies": { - "typescript": "^3.5.3", + "typescript": "^3.6.0", "rollup": "^1.18.0", "rollup-plugin-node-resolve": "^5.2.0", "rollup-plugin-sourcemaps": "^0.4.2", 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..c8727274f00f 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 @@ -9,6 +8,7 @@ */ import * as msRest from "@azure/ms-rest-js"; +import { TokenCredential } from "@azure/core-auth"; import * as Models from "./models"; import * as Mappers from "./models/mappers"; import * as operations from "./operations"; @@ -18,23 +18,32 @@ 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. - * @param credentials Credentials needed for the client to connect to Azure. + * @param credentials Credentials needed for the client to connect to Azure. Credentials + * implementing the TokenCredential interface from the @azure/identity package are recommended. For + * more information about these credentials, see + * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the + * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and + * @azure/ms-rest-browserauth are also supported. * @param subscriptionId Subscription credentials that uniquely identify Microsoft Azure * subscription. The subscription ID forms part of the URI for every service call. * @param [options] The parameter options */ - constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.AzureStackManagementClientOptions) { + constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, 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..18e8042afa67 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 @@ -11,23 +10,29 @@ import * as Models from "./models"; import * as msRest from "@azure/ms-rest-js"; import * as msRestAzure from "@azure/ms-rest-azure-js"; +import { TokenCredential } from "@azure/core-auth"; const packageName = "@azure/arm-azurestack"; const packageVersion = "2.0.0"; export class AzureStackManagementClientContext extends msRestAzure.AzureServiceClient { - credentials: msRest.ServiceClientCredentials; + credentials: msRest.ServiceClientCredentials | TokenCredential; subscriptionId: string; apiVersion?: string; /** * Initializes a new instance of the AzureStackManagementClient class. - * @param credentials Credentials needed for the client to connect to Azure. + * @param credentials Credentials needed for the client to connect to Azure. Credentials + * implementing the TokenCredential interface from the @azure/identity package are recommended. For + * more information about these credentials, see + * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the + * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and + * @azure/ms-rest-browserauth are also supported. * @param subscriptionId Subscription credentials that uniquely identify Microsoft Azure * subscription. The subscription ID forms part of the URI for every service call. * @param [options] The parameter options */ - constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.AzureStackManagementClientOptions) { + constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.AzureStackManagementClientOptions) { if (credentials == undefined) { throw new Error('\'credentials\' cannot be null.'); } @@ -38,14 +43,14 @@ export class AzureStackManagementClientContext extends msRestAzure.AzureServiceC if (!options) { options = {}; } - if(!options.userAgent) { + if (!options.userAgent) { const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; } 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"; @@ -53,10 +58,10 @@ export class AzureStackManagementClientContext extends msRestAzure.AzureServiceC this.credentials = credentials; this.subscriptionId = subscriptionId; - if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { + if (options.acceptLanguage !== null && options.acceptLanguage !== undefined) { this.acceptLanguage = options.acceptLanguage; } - if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { + if (options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; } } 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..319866544eb6 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; /** - * Location of the resource. Possible values include: 'global' + * The identifier associated with the device registration. */ - location?: Location; + 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; + /** + * 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.** + */ + 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. */ @@ -911,6 +1189,26 @@ export type RegistrationsListResponse = RegistrationList & { }; }; +/** + * Contains response data for the listBySubscription operation. + */ +export type RegistrationsListBySubscriptionResponse = RegistrationList & { + /** + * 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: RegistrationList; + }; +}; + /** * Contains response data for the get operation. */ @@ -1012,9 +1310,9 @@ export type RegistrationsListNextResponse = RegistrationList & { }; /** - * Contains response data for the list operation. + * Contains response data for the listBySubscriptionNext operation. */ -export type CustomerSubscriptionsListResponse = CustomerSubscriptionList & { +export type RegistrationsListBySubscriptionNextResponse = RegistrationList & { /** * The underlying HTTP response. */ @@ -1027,14 +1325,54 @@ export type CustomerSubscriptionsListResponse = CustomerSubscriptionList & { /** * The response body as parsed JSON or XML */ - parsedBody: CustomerSubscriptionList; + parsedBody: RegistrationList; + }; +}; + +/** + * Contains response data for the listByResourceGroup operation. + */ +export type LinkedSubscriptionsListByResourceGroupResponse = 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 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 +1385,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 +1405,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 +1425,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..740ddd0068b2 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 @@ -54,6 +53,30 @@ export class Registrations { callback) as Promise; } + /** + * Returns a list of all registrations 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 an Azure Stack registration. * @param resourceGroup Name of the resource group. @@ -222,6 +245,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. @@ -249,6 +304,34 @@ export class Registrations { listNextOperationSpec, callback) as Promise; } + + /** + * Returns a list of all registrations 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 @@ -277,6 +360,29 @@ const listOperationSpec: msRest.OperationSpec = { serializer }; +const listBySubscriptionOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.AzureStack/registrations", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.RegistrationList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + const getOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack/registrations/{registrationName}", @@ -355,7 +461,7 @@ const createOrUpdateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.Registration }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -412,7 +518,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 +551,33 @@ const listNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.RegistrationList + }, + 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 ],