diff --git a/lib/services/subscriptionManagement2/lib/models/index.d.ts b/lib/services/subscriptionManagement2/lib/models/index.d.ts index adc3ce8f13..b8ac7bcff1 100644 --- a/lib/services/subscriptionManagement2/lib/models/index.d.ts +++ b/lib/services/subscriptionManagement2/lib/models/index.d.ts @@ -1,292 +1,280 @@ /* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Licensed under the MIT License. See License.txt in the project root for license information. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { BaseResource } from 'ms-rest-azure'; -import { CloudError } from 'ms-rest-azure'; -import * as moment from 'moment'; +import { BaseResource, CloudError } from "ms-rest-azure"; +import * as moment from "moment"; -export { BaseResource } from 'ms-rest-azure'; -export { CloudError } from 'ms-rest-azure'; +export { + BaseResource, + CloudError +}; /** - * @class - * Initializes a new instance of the SubscriptionCreationResult class. - * @constructor * The created subscription object. - * - * @property {string} [subscriptionLink] The link to the new subscription. */ export interface SubscriptionCreationResult { + /** + * The link to the new subscription. + */ subscriptionLink?: string; } /** - * @class - * Initializes a new instance of the AdPrincipal class. - * @constructor * Active Directory Principal for subscription creation delegated permission - * - * @property {string} objectId Object id of the Principal */ export interface AdPrincipal { + /** + * Object id of the Principal + */ objectId: string; } /** - * @class - * Initializes a new instance of the SubscriptionCreationParameters class. - * @constructor - * Subscription Creation Parameters required to create a new Azure - * subscription. - * - * @property {string} [displayName] The display name of the subscription. - * @property {array} [owners] The list of principals that should be granted - * Owner access on the subscription. Principals should be of type User, Service - * Principal or Security Group. - * @property {string} [offerType] The offer type of the subscription. For - * example, MS-AZR-0017P (EnterpriseAgreement) and MS-AZR-0148P - * (EnterpriseAgreement devTest) are available. Only valid when creating a - * subscription in a enrollment account scope. Possible values include: - * 'MS-AZR-0017P', 'MS-AZR-0148P' - * @property {object} [additionalParameters] Additional, untyped parameters to - * support custom subscription creation scenarios. + * Subscription Creation Parameters required to create a new Azure subscription. */ export interface SubscriptionCreationParameters { + /** + * The display name of the subscription. + */ displayName?: string; - owners?: AdPrincipal[]; - offerType?: string; + /** + * The ARM id of the billing profile. + */ + billingProfileId?: string; + /** + * The commerce id of the sku. + */ + skuId?: string; + /** + * optional customer cost center + */ + costCenter?: string; + /** + * rbac owner of the subscription + */ + owner?: AdPrincipal; + /** + * Additional, untyped parameters to support custom subscription creation scenarios. + */ additionalParameters?: { [propertyName: string]: any }; } /** - * @class - * Initializes a new instance of the ErrorResponse class. - * @constructor * Describes the format of Error response. - * - * @property {string} [code] Error code - * @property {string} [message] Error message indicating why the operation - * failed. */ export interface ErrorResponse { + /** + * Error code + */ code?: string; + /** + * Error message indicating why the operation failed. + */ message?: string; } /** - * @class - * Initializes a new instance of the SubscriptionOperation class. - * @constructor * status of the subscription POST operation. - * - * @property {string} [id] The operation Id. - * @property {string} [status] Status of the pending subscription - * @property {string} [statusDetail] Status Detail of the pending subscription */ export interface SubscriptionOperation { + /** + * The operation Id. + */ readonly id?: string; + /** + * Status of the pending subscription + */ status?: string; + /** + * Status Detail of the pending subscription + */ statusDetail?: string; } /** - * @class - * Initializes a new instance of the SubscriptionOperationListResult class. - * @constructor * A list of pending subscription operations. - * - * @property {array} [value] A list of pending SubscriptionOperations */ export interface SubscriptionOperationListResult { + /** + * A list of pending SubscriptionOperations + */ value?: SubscriptionOperation[]; } /** - * @class - * Initializes a new instance of the OperationDisplay class. - * @constructor * The object that represents the operation. - * - * @property {string} [provider] Service provider: Microsoft.Subscription - * @property {string} [resource] Resource on which the operation is performed: - * Profile, endpoint, etc. - * @property {string} [operation] Operation type: Read, write, delete, etc. */ export interface OperationDisplay { + /** + * Service provider: Microsoft.Subscription + */ provider?: string; + /** + * Resource on which the operation is performed: Profile, endpoint, etc. + */ resource?: string; + /** + * Operation type: Read, write, delete, etc. + */ operation?: string; } /** - * @class - * Initializes a new instance of the Operation class. - * @constructor * REST API operation - * - * @property {string} [name] Operation name: {provider}/{resource}/{operation} - * @property {object} [display] The object that represents the operation. - * @property {string} [display.provider] Service provider: - * Microsoft.Subscription - * @property {string} [display.resource] Resource on which the operation is - * performed: Profile, endpoint, etc. - * @property {string} [display.operation] Operation type: Read, write, delete, - * etc. */ export interface Operation { + /** + * Operation name: {provider}/{resource}/{operation} + */ name?: string; + /** + * The object that represents the operation. + */ display?: OperationDisplay; } /** - * @class - * Initializes a new instance of the OperationListResult class. - * @constructor - * Result of the request to list operations. It contains a list of operations - * and a URL link to get the next set of results. - * - * @property {array} [value] List of operations. - * @property {string} [nextLink] URL to get the next set of operation list - * results if there are any. + * Result of the request to list operations. It contains a list of operations and a URL link to get + * the next set of results. */ export interface OperationListResult { + /** + * List of operations. + */ value?: Operation[]; + /** + * URL to get the next set of operation list results if there are any. + */ nextLink?: string; } /** - * @class - * Initializes a new instance of the Location class. - * @constructor * Location information. - * - * @property {string} [id] The fully qualified ID of the location. For example, - * /subscriptions/00000000-0000-0000-0000-000000000000/locations/westus. - * @property {string} [subscriptionId] The subscription ID. - * @property {string} [name] The location name. - * @property {string} [displayName] The display name of the location. - * @property {string} [latitude] The latitude of the location. - * @property {string} [longitude] The longitude of the location. */ export interface Location { + /** + * The fully qualified ID of the location. For example, + * /subscriptions/00000000-0000-0000-0000-000000000000/locations/westus. + */ readonly id?: string; + /** + * The subscription ID. + */ readonly subscriptionId?: string; + /** + * The location name. + */ readonly name?: string; + /** + * The display name of the location. + */ readonly displayName?: string; + /** + * The latitude of the location. + */ readonly latitude?: string; + /** + * The longitude of the location. + */ readonly longitude?: string; } /** - * @class - * Initializes a new instance of the SubscriptionPolicies class. - * @constructor * Subscription policies. - * - * @property {string} [locationPlacementId] The subscription location placement - * ID. The ID indicates which regions are visible for a subscription. For - * example, a subscription with a location placement Id of Public_2014-09-01 - * has access to Azure public regions. - * @property {string} [quotaId] The subscription quota ID. - * @property {string} [spendingLimit] The subscription spending limit. Possible - * values include: 'On', 'Off', 'CurrentPeriodOff' */ export interface SubscriptionPolicies { + /** + * The subscription location placement ID. The ID indicates which regions are visible for a + * subscription. For example, a subscription with a location placement Id of Public_2014-09-01 + * has access to Azure public regions. + */ readonly locationPlacementId?: string; + /** + * The subscription quota ID. + */ readonly quotaId?: string; + /** + * The subscription spending limit. Possible values include: 'On', 'Off', 'CurrentPeriodOff' + */ readonly spendingLimit?: string; } /** - * @class - * Initializes a new instance of the Subscription class. - * @constructor * Subscription information. - * - * @property {string} [id] The fully qualified ID for the subscription. For - * example, /subscriptions/00000000-0000-0000-0000-000000000000. - * @property {string} [subscriptionId] The subscription ID. - * @property {string} [displayName] The subscription display name. - * @property {string} [state] The subscription state. Possible values are - * Enabled, Warned, PastDue, Disabled, and Deleted. Possible values include: - * 'Enabled', 'Warned', 'PastDue', 'Disabled', 'Deleted' - * @property {object} [subscriptionPolicies] The subscription policies. - * @property {string} [subscriptionPolicies.locationPlacementId] The - * subscription location placement ID. The ID indicates which regions are - * visible for a subscription. For example, a subscription with a location - * placement Id of Public_2014-09-01 has access to Azure public regions. - * @property {string} [subscriptionPolicies.quotaId] The subscription quota ID. - * @property {string} [subscriptionPolicies.spendingLimit] The subscription - * spending limit. Possible values include: 'On', 'Off', 'CurrentPeriodOff' - * @property {string} [authorizationSource] The authorization source of the - * request. Valid values are one or more combinations of Legacy, RoleBased, - * Bypassed, Direct and Management. For example, 'Legacy, RoleBased'. */ export interface Subscription { + /** + * The fully qualified ID for the subscription. For example, + * /subscriptions/00000000-0000-0000-0000-000000000000. + */ readonly id?: string; + /** + * The subscription ID. + */ readonly subscriptionId?: string; + /** + * The subscription display name. + */ readonly displayName?: string; + /** + * The subscription state. Possible values are Enabled, Warned, PastDue, Disabled, and Deleted. + * Possible values include: 'Enabled', 'Warned', 'PastDue', 'Disabled', 'Deleted' + */ readonly state?: string; + /** + * The subscription policies. + */ subscriptionPolicies?: SubscriptionPolicies; + /** + * The authorization source of the request. Valid values are one or more combinations of Legacy, + * RoleBased, Bypassed, Direct and Management. For example, 'Legacy, RoleBased'. + */ authorizationSource?: string; } /** - * @class - * Initializes a new instance of the TenantIdDescription class. - * @constructor * Tenant Id information. - * - * @property {string} [id] The fully qualified ID of the tenant. For example, - * /tenants/00000000-0000-0000-0000-000000000000. - * @property {string} [tenantId] The tenant ID. For example, - * 00000000-0000-0000-0000-000000000000. */ export interface TenantIdDescription { + /** + * The fully qualified ID of the tenant. For example, + * /tenants/00000000-0000-0000-0000-000000000000. + */ readonly id?: string; + /** + * The tenant ID. For example, 00000000-0000-0000-0000-000000000000. + */ readonly tenantId?: string; } - /** - * @class - * Initializes a new instance of the LocationListResult class. - * @constructor * Location list operation response. - * */ export interface LocationListResult extends Array { } /** - * @class - * Initializes a new instance of the SubscriptionListResult class. - * @constructor * Subscription list operation response. - * - * @property {string} nextLink The URL to get the next set of results. */ export interface SubscriptionListResult extends Array { + /** + * The URL to get the next set of results. + */ nextLink: string; } /** - * @class - * Initializes a new instance of the TenantListResult class. - * @constructor * Tenant Ids information. - * - * @property {string} nextLink The URL to use for getting the next set of - * results. */ export interface TenantListResult extends Array { + /** + * The URL to use for getting the next set of results. + */ nextLink: string; } diff --git a/lib/services/subscriptionManagement2/lib/models/subscriptionCreationParameters.js b/lib/services/subscriptionManagement2/lib/models/subscriptionCreationParameters.js index 914f31ede3..1d5ab1fbf5 100644 --- a/lib/services/subscriptionManagement2/lib/models/subscriptionCreationParameters.js +++ b/lib/services/subscriptionManagement2/lib/models/subscriptionCreationParameters.js @@ -19,14 +19,11 @@ class SubscriptionCreationParameters { /** * Create a SubscriptionCreationParameters. * @property {string} [displayName] The display name of the subscription. - * @property {array} [owners] The list of principals that should be granted - * Owner access on the subscription. Principals should be of type User, - * Service Principal or Security Group. - * @property {string} [offerType] The offer type of the subscription. For - * example, MS-AZR-0017P (EnterpriseAgreement) and MS-AZR-0148P - * (EnterpriseAgreement devTest) are available. Only valid when creating a - * subscription in a enrollment account scope. Possible values include: - * 'MS-AZR-0017P', 'MS-AZR-0148P' + * @property {string} [billingProfileId] The ARM id of the billing profile. + * @property {string} [skuId] The commerce id of the sku. + * @property {string} [costCenter] optional customer cost center + * @property {object} [owner] rbac owner of the subscription + * @property {string} [owner.objectId] Object id of the Principal * @property {object} [additionalParameters] Additional, untyped parameters * to support custom subscription creation scenarios. */ @@ -54,28 +51,35 @@ class SubscriptionCreationParameters { name: 'String' } }, - owners: { + billingProfileId: { required: false, - serializedName: 'owners', + serializedName: 'billingProfileId', type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'AdPrincipalElementType', - type: { - name: 'Composite', - className: 'AdPrincipal' - } - } + name: 'String' + } + }, + skuId: { + required: false, + serializedName: 'skuId', + type: { + name: 'String' } }, - offerType: { + costCenter: { required: false, - serializedName: 'offerType', + serializedName: 'costCenter', type: { name: 'String' } }, + owner: { + required: false, + serializedName: 'owner', + type: { + name: 'Composite', + className: 'AdPrincipal' + } + }, additionalParameters: { required: false, serializedName: 'additionalParameters', diff --git a/lib/services/subscriptionManagement2/lib/operations/index.d.ts b/lib/services/subscriptionManagement2/lib/operations/index.d.ts index e2daaac724..db4d99f9aa 100644 --- a/lib/services/subscriptionManagement2/lib/operations/index.d.ts +++ b/lib/services/subscriptionManagement2/lib/operations/index.d.ts @@ -74,15 +74,18 @@ export interface Operations { /** * @class - * SubscriptionOperations + * SubscriptionOperationOperations * __NOTE__: An instance of this class is automatically created for an * instance of the SubscriptionClient. */ -export interface SubscriptionOperations { +export interface SubscriptionOperationOperations { /** - * Lists all of the available pending Microsoft.Subscription API operations. + * Get the status of the pending Microsoft.Subscription API operations. + * + * @param {string} operationId The operation ID, which can be found from the + * Location field in the generate recommendation response header. * * @param {object} [options] Optional Parameters. * @@ -91,14 +94,17 @@ export interface SubscriptionOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all of the available pending Microsoft.Subscription API operations. + * Get the status of the pending Microsoft.Subscription API operations. + * + * @param {string} operationId The operation ID, which can be found from the + * Location field in the generate recommendation response header. * * @param {object} [options] Optional Parameters. * @@ -112,7 +118,7 @@ export interface SubscriptionOperations { * * {Promise} A promise is returned. * - * @resolve {SubscriptionOperationListResult} - The deserialized result object. + * @resolve {SubscriptionCreationResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -120,17 +126,17 @@ export interface SubscriptionOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SubscriptionOperationListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SubscriptionOperationListResult} for more + * {SubscriptionCreationResult} [result] - The deserialized result object if an error did not occur. + * See {@link SubscriptionCreationResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(operationId: string, callback: ServiceCallback): void; + get(operationId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** @@ -145,22 +151,24 @@ export interface SubscriptionFactory { /** * Creates an Azure subscription * - * @param {string} enrollmentAccountName The name of the enrollment account to - * which the subscription will be billed. + * @param {string} billingAccountName The name of the commerce root billing + * account. + * + * @param {string} invoiceSectionName The name of the invoice section. * * @param {object} body The subscription creation parameters. * * @param {string} [body.displayName] The display name of the subscription. * - * @param {array} [body.owners] The list of principals that should be granted - * Owner access on the subscription. Principals should be of type User, Service - * Principal or Security Group. + * @param {string} [body.billingProfileId] The ARM id of the billing profile. + * + * @param {string} [body.skuId] The commerce id of the sku. + * + * @param {string} [body.costCenter] optional customer cost center * - * @param {string} [body.offerType] The offer type of the subscription. For - * example, MS-AZR-0017P (EnterpriseAgreement) and MS-AZR-0148P - * (EnterpriseAgreement devTest) are available. Only valid when creating a - * subscription in a enrollment account scope. Possible values include: - * 'MS-AZR-0017P', 'MS-AZR-0148P' + * @param {object} [body.owner] rbac owner of the subscription + * + * @param {string} body.owner.objectId Object id of the Principal * * @param {object} [body.additionalParameters] Additional, untyped parameters * to support custom subscription creation scenarios. @@ -176,27 +184,29 @@ export interface SubscriptionFactory { * * @reject {Error|ServiceError} - The error object. */ - createSubscriptionInEnrollmentAccountWithHttpOperationResponse(enrollmentAccountName: string, body: models.SubscriptionCreationParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createSubscriptionWithHttpOperationResponse(billingAccountName: string, invoiceSectionName: string, body: models.SubscriptionCreationParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Creates an Azure subscription * - * @param {string} enrollmentAccountName The name of the enrollment account to - * which the subscription will be billed. + * @param {string} billingAccountName The name of the commerce root billing + * account. + * + * @param {string} invoiceSectionName The name of the invoice section. * * @param {object} body The subscription creation parameters. * * @param {string} [body.displayName] The display name of the subscription. * - * @param {array} [body.owners] The list of principals that should be granted - * Owner access on the subscription. Principals should be of type User, Service - * Principal or Security Group. + * @param {string} [body.billingProfileId] The ARM id of the billing profile. * - * @param {string} [body.offerType] The offer type of the subscription. For - * example, MS-AZR-0017P (EnterpriseAgreement) and MS-AZR-0148P - * (EnterpriseAgreement devTest) are available. Only valid when creating a - * subscription in a enrollment account scope. Possible values include: - * 'MS-AZR-0017P', 'MS-AZR-0148P' + * @param {string} [body.skuId] The commerce id of the sku. + * + * @param {string} [body.costCenter] optional customer cost center + * + * @param {object} [body.owner] rbac owner of the subscription + * + * @param {string} body.owner.objectId Object id of the Principal * * @param {object} [body.additionalParameters] Additional, untyped parameters * to support custom subscription creation scenarios. @@ -229,30 +239,32 @@ export interface SubscriptionFactory { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createSubscriptionInEnrollmentAccount(enrollmentAccountName: string, body: models.SubscriptionCreationParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createSubscriptionInEnrollmentAccount(enrollmentAccountName: string, body: models.SubscriptionCreationParameters, callback: ServiceCallback): void; - createSubscriptionInEnrollmentAccount(enrollmentAccountName: string, body: models.SubscriptionCreationParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createSubscription(billingAccountName: string, invoiceSectionName: string, body: models.SubscriptionCreationParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createSubscription(billingAccountName: string, invoiceSectionName: string, body: models.SubscriptionCreationParameters, callback: ServiceCallback): void; + createSubscription(billingAccountName: string, invoiceSectionName: string, body: models.SubscriptionCreationParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Creates an Azure subscription * - * @param {string} enrollmentAccountName The name of the enrollment account to - * which the subscription will be billed. + * @param {string} billingAccountName The name of the commerce root billing + * account. + * + * @param {string} invoiceSectionName The name of the invoice section. * * @param {object} body The subscription creation parameters. * * @param {string} [body.displayName] The display name of the subscription. * - * @param {array} [body.owners] The list of principals that should be granted - * Owner access on the subscription. Principals should be of type User, Service - * Principal or Security Group. + * @param {string} [body.billingProfileId] The ARM id of the billing profile. + * + * @param {string} [body.skuId] The commerce id of the sku. + * + * @param {string} [body.costCenter] optional customer cost center * - * @param {string} [body.offerType] The offer type of the subscription. For - * example, MS-AZR-0017P (EnterpriseAgreement) and MS-AZR-0148P - * (EnterpriseAgreement devTest) are available. Only valid when creating a - * subscription in a enrollment account scope. Possible values include: - * 'MS-AZR-0017P', 'MS-AZR-0148P' + * @param {object} [body.owner] rbac owner of the subscription + * + * @param {string} body.owner.objectId Object id of the Principal * * @param {object} [body.additionalParameters] Additional, untyped parameters * to support custom subscription creation scenarios. @@ -268,27 +280,29 @@ export interface SubscriptionFactory { * * @reject {Error|ServiceError} - The error object. */ - beginCreateSubscriptionInEnrollmentAccountWithHttpOperationResponse(enrollmentAccountName: string, body: models.SubscriptionCreationParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateSubscriptionWithHttpOperationResponse(billingAccountName: string, invoiceSectionName: string, body: models.SubscriptionCreationParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Creates an Azure subscription * - * @param {string} enrollmentAccountName The name of the enrollment account to - * which the subscription will be billed. + * @param {string} billingAccountName The name of the commerce root billing + * account. + * + * @param {string} invoiceSectionName The name of the invoice section. * * @param {object} body The subscription creation parameters. * * @param {string} [body.displayName] The display name of the subscription. * - * @param {array} [body.owners] The list of principals that should be granted - * Owner access on the subscription. Principals should be of type User, Service - * Principal or Security Group. + * @param {string} [body.billingProfileId] The ARM id of the billing profile. + * + * @param {string} [body.skuId] The commerce id of the sku. + * + * @param {string} [body.costCenter] optional customer cost center + * + * @param {object} [body.owner] rbac owner of the subscription * - * @param {string} [body.offerType] The offer type of the subscription. For - * example, MS-AZR-0017P (EnterpriseAgreement) and MS-AZR-0148P - * (EnterpriseAgreement devTest) are available. Only valid when creating a - * subscription in a enrollment account scope. Possible values include: - * 'MS-AZR-0017P', 'MS-AZR-0148P' + * @param {string} body.owner.objectId Object id of the Principal * * @param {object} [body.additionalParameters] Additional, untyped parameters * to support custom subscription creation scenarios. @@ -321,9 +335,9 @@ export interface SubscriptionFactory { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateSubscriptionInEnrollmentAccount(enrollmentAccountName: string, body: models.SubscriptionCreationParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateSubscriptionInEnrollmentAccount(enrollmentAccountName: string, body: models.SubscriptionCreationParameters, callback: ServiceCallback): void; - beginCreateSubscriptionInEnrollmentAccount(enrollmentAccountName: string, body: models.SubscriptionCreationParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateSubscription(billingAccountName: string, invoiceSectionName: string, body: models.SubscriptionCreationParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateSubscription(billingAccountName: string, invoiceSectionName: string, body: models.SubscriptionCreationParameters, callback: ServiceCallback): void; + beginCreateSubscription(billingAccountName: string, invoiceSectionName: string, body: models.SubscriptionCreationParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** diff --git a/lib/services/subscriptionManagement2/lib/operations/index.js b/lib/services/subscriptionManagement2/lib/operations/index.js index f589f09da0..81724e2b7a 100644 --- a/lib/services/subscriptionManagement2/lib/operations/index.js +++ b/lib/services/subscriptionManagement2/lib/operations/index.js @@ -15,7 +15,7 @@ 'use strict'; exports.Operations = require('./operations'); -exports.SubscriptionOperations = require('./subscriptionOperations'); +exports.SubscriptionOperationOperations = require('./subscriptionOperationOperations'); exports.SubscriptionFactory = require('./subscriptionFactory'); exports.Subscriptions = require('./subscriptions'); exports.Tenants = require('./tenants'); diff --git a/lib/services/subscriptionManagement2/lib/operations/operations.js b/lib/services/subscriptionManagement2/lib/operations/operations.js index d9c9b1e68b..db7f695684 100644 --- a/lib/services/subscriptionManagement2/lib/operations/operations.js +++ b/lib/services/subscriptionManagement2/lib/operations/operations.js @@ -45,7 +45,7 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-03-01-preview'; + let apiVersion = '2018-11-01-preview'; // Validate try { if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { diff --git a/lib/services/subscriptionManagement2/lib/operations/subscriptionFactory.js b/lib/services/subscriptionManagement2/lib/operations/subscriptionFactory.js index ec6ffa7eda..bc53f1db39 100644 --- a/lib/services/subscriptionManagement2/lib/operations/subscriptionFactory.js +++ b/lib/services/subscriptionManagement2/lib/operations/subscriptionFactory.js @@ -18,22 +18,24 @@ const WebResource = msRest.WebResource; /** * Creates an Azure subscription * - * @param {string} enrollmentAccountName The name of the enrollment account to - * which the subscription will be billed. + * @param {string} billingAccountName The name of the commerce root billing + * account. + * + * @param {string} invoiceSectionName The name of the invoice section. * * @param {object} body The subscription creation parameters. * * @param {string} [body.displayName] The display name of the subscription. * - * @param {array} [body.owners] The list of principals that should be granted - * Owner access on the subscription. Principals should be of type User, Service - * Principal or Security Group. + * @param {string} [body.billingProfileId] The ARM id of the billing profile. + * + * @param {string} [body.skuId] The commerce id of the sku. + * + * @param {string} [body.costCenter] optional customer cost center + * + * @param {object} [body.owner] rbac owner of the subscription * - * @param {string} [body.offerType] The offer type of the subscription. For - * example, MS-AZR-0017P (EnterpriseAgreement) and MS-AZR-0148P - * (EnterpriseAgreement devTest) are available. Only valid when creating a - * subscription in a enrollment account scope. Possible values include: - * 'MS-AZR-0017P', 'MS-AZR-0148P' + * @param {string} body.owner.objectId Object id of the Principal * * @param {object} [body.additionalParameters] Additional, untyped parameters * to support custom subscription creation scenarios. @@ -57,7 +59,7 @@ const WebResource = msRest.WebResource; * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _createSubscriptionInEnrollmentAccount(enrollmentAccountName, body, options, callback) { +function _createSubscription(billingAccountName, invoiceSectionName, body, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -70,7 +72,7 @@ function _createSubscriptionInEnrollmentAccount(enrollmentAccountName, body, opt } // Send request - this.beginCreateSubscriptionInEnrollmentAccount(enrollmentAccountName, body, options, (err, parsedResult, httpRequest, response) => { + this.beginCreateSubscription(billingAccountName, invoiceSectionName, body, options, (err, parsedResult, httpRequest, response) => { if (err) return callback(err); let initialResult = new msRest.HttpOperationResponse(); @@ -112,22 +114,24 @@ function _createSubscriptionInEnrollmentAccount(enrollmentAccountName, body, opt /** * Creates an Azure subscription * - * @param {string} enrollmentAccountName The name of the enrollment account to - * which the subscription will be billed. + * @param {string} billingAccountName The name of the commerce root billing + * account. + * + * @param {string} invoiceSectionName The name of the invoice section. * * @param {object} body The subscription creation parameters. * * @param {string} [body.displayName] The display name of the subscription. * - * @param {array} [body.owners] The list of principals that should be granted - * Owner access on the subscription. Principals should be of type User, Service - * Principal or Security Group. + * @param {string} [body.billingProfileId] The ARM id of the billing profile. + * + * @param {string} [body.skuId] The commerce id of the sku. + * + * @param {string} [body.costCenter] optional customer cost center * - * @param {string} [body.offerType] The offer type of the subscription. For - * example, MS-AZR-0017P (EnterpriseAgreement) and MS-AZR-0148P - * (EnterpriseAgreement devTest) are available. Only valid when creating a - * subscription in a enrollment account scope. Possible values include: - * 'MS-AZR-0017P', 'MS-AZR-0148P' + * @param {object} [body.owner] rbac owner of the subscription + * + * @param {string} body.owner.objectId Object id of the Principal * * @param {object} [body.additionalParameters] Additional, untyped parameters * to support custom subscription creation scenarios. @@ -151,7 +155,7 @@ function _createSubscriptionInEnrollmentAccount(enrollmentAccountName, body, opt * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginCreateSubscriptionInEnrollmentAccount(enrollmentAccountName, body, options, callback) { +function _beginCreateSubscription(billingAccountName, invoiceSectionName, body, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -161,11 +165,14 @@ function _beginCreateSubscriptionInEnrollmentAccount(enrollmentAccountName, body if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-03-01-preview'; + let apiVersion = '2018-11-01-preview'; // Validate try { - if (enrollmentAccountName === null || enrollmentAccountName === undefined || typeof enrollmentAccountName.valueOf() !== 'string') { - throw new Error('enrollmentAccountName cannot be null or undefined and it must be of type string.'); + if (billingAccountName === null || billingAccountName === undefined || typeof billingAccountName.valueOf() !== 'string') { + throw new Error('billingAccountName cannot be null or undefined and it must be of type string.'); + } + if (invoiceSectionName === null || invoiceSectionName === undefined || typeof invoiceSectionName.valueOf() !== 'string') { + throw new Error('invoiceSectionName cannot be null or undefined and it must be of type string.'); } if (body === null || body === undefined) { throw new Error('body cannot be null or undefined.'); @@ -179,8 +186,9 @@ function _beginCreateSubscriptionInEnrollmentAccount(enrollmentAccountName, body // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountName}/providers/Microsoft.Subscription/createSubscription'; - requestUrl = requestUrl.replace('{enrollmentAccountName}', encodeURIComponent(enrollmentAccountName)); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Subscription/createSubscription'; + requestUrl = requestUrl.replace('{billingAccountName}', encodeURIComponent(billingAccountName)); + requestUrl = requestUrl.replace('{invoiceSectionName}', encodeURIComponent(invoiceSectionName)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { @@ -287,29 +295,31 @@ class SubscriptionFactory { */ constructor(client) { this.client = client; - this._createSubscriptionInEnrollmentAccount = _createSubscriptionInEnrollmentAccount; - this._beginCreateSubscriptionInEnrollmentAccount = _beginCreateSubscriptionInEnrollmentAccount; + this._createSubscription = _createSubscription; + this._beginCreateSubscription = _beginCreateSubscription; } /** * Creates an Azure subscription * - * @param {string} enrollmentAccountName The name of the enrollment account to - * which the subscription will be billed. + * @param {string} billingAccountName The name of the commerce root billing + * account. + * + * @param {string} invoiceSectionName The name of the invoice section. * * @param {object} body The subscription creation parameters. * * @param {string} [body.displayName] The display name of the subscription. * - * @param {array} [body.owners] The list of principals that should be granted - * Owner access on the subscription. Principals should be of type User, Service - * Principal or Security Group. + * @param {string} [body.billingProfileId] The ARM id of the billing profile. + * + * @param {string} [body.skuId] The commerce id of the sku. + * + * @param {string} [body.costCenter] optional customer cost center + * + * @param {object} [body.owner] rbac owner of the subscription * - * @param {string} [body.offerType] The offer type of the subscription. For - * example, MS-AZR-0017P (EnterpriseAgreement) and MS-AZR-0148P - * (EnterpriseAgreement devTest) are available. Only valid when creating a - * subscription in a enrollment account scope. Possible values include: - * 'MS-AZR-0017P', 'MS-AZR-0148P' + * @param {string} body.owner.objectId Object id of the Principal * * @param {object} [body.additionalParameters] Additional, untyped parameters * to support custom subscription creation scenarios. @@ -325,11 +335,11 @@ class SubscriptionFactory { * * @reject {Error} - The error object. */ - createSubscriptionInEnrollmentAccountWithHttpOperationResponse(enrollmentAccountName, body, options) { + createSubscriptionWithHttpOperationResponse(billingAccountName, invoiceSectionName, body, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._createSubscriptionInEnrollmentAccount(enrollmentAccountName, body, options, (err, result, request, response) => { + self._createSubscription(billingAccountName, invoiceSectionName, body, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -342,22 +352,24 @@ class SubscriptionFactory { /** * Creates an Azure subscription * - * @param {string} enrollmentAccountName The name of the enrollment account to - * which the subscription will be billed. + * @param {string} billingAccountName The name of the commerce root billing + * account. + * + * @param {string} invoiceSectionName The name of the invoice section. * * @param {object} body The subscription creation parameters. * * @param {string} [body.displayName] The display name of the subscription. * - * @param {array} [body.owners] The list of principals that should be granted - * Owner access on the subscription. Principals should be of type User, Service - * Principal or Security Group. + * @param {string} [body.billingProfileId] The ARM id of the billing profile. + * + * @param {string} [body.skuId] The commerce id of the sku. + * + * @param {string} [body.costCenter] optional customer cost center * - * @param {string} [body.offerType] The offer type of the subscription. For - * example, MS-AZR-0017P (EnterpriseAgreement) and MS-AZR-0148P - * (EnterpriseAgreement devTest) are available. Only valid when creating a - * subscription in a enrollment account scope. Possible values include: - * 'MS-AZR-0017P', 'MS-AZR-0148P' + * @param {object} [body.owner] rbac owner of the subscription + * + * @param {string} body.owner.objectId Object id of the Principal * * @param {object} [body.additionalParameters] Additional, untyped parameters * to support custom subscription creation scenarios. @@ -390,7 +402,7 @@ class SubscriptionFactory { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - createSubscriptionInEnrollmentAccount(enrollmentAccountName, body, options, optionalCallback) { + createSubscription(billingAccountName, invoiceSectionName, body, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -399,36 +411,38 @@ class SubscriptionFactory { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createSubscriptionInEnrollmentAccount(enrollmentAccountName, body, options, (err, result, request, response) => { + self._createSubscription(billingAccountName, invoiceSectionName, body, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._createSubscriptionInEnrollmentAccount(enrollmentAccountName, body, options, optionalCallback); + return self._createSubscription(billingAccountName, invoiceSectionName, body, options, optionalCallback); } } /** * Creates an Azure subscription * - * @param {string} enrollmentAccountName The name of the enrollment account to - * which the subscription will be billed. + * @param {string} billingAccountName The name of the commerce root billing + * account. + * + * @param {string} invoiceSectionName The name of the invoice section. * * @param {object} body The subscription creation parameters. * * @param {string} [body.displayName] The display name of the subscription. * - * @param {array} [body.owners] The list of principals that should be granted - * Owner access on the subscription. Principals should be of type User, Service - * Principal or Security Group. + * @param {string} [body.billingProfileId] The ARM id of the billing profile. + * + * @param {string} [body.skuId] The commerce id of the sku. * - * @param {string} [body.offerType] The offer type of the subscription. For - * example, MS-AZR-0017P (EnterpriseAgreement) and MS-AZR-0148P - * (EnterpriseAgreement devTest) are available. Only valid when creating a - * subscription in a enrollment account scope. Possible values include: - * 'MS-AZR-0017P', 'MS-AZR-0148P' + * @param {string} [body.costCenter] optional customer cost center + * + * @param {object} [body.owner] rbac owner of the subscription + * + * @param {string} body.owner.objectId Object id of the Principal * * @param {object} [body.additionalParameters] Additional, untyped parameters * to support custom subscription creation scenarios. @@ -444,11 +458,11 @@ class SubscriptionFactory { * * @reject {Error} - The error object. */ - beginCreateSubscriptionInEnrollmentAccountWithHttpOperationResponse(enrollmentAccountName, body, options) { + beginCreateSubscriptionWithHttpOperationResponse(billingAccountName, invoiceSectionName, body, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginCreateSubscriptionInEnrollmentAccount(enrollmentAccountName, body, options, (err, result, request, response) => { + self._beginCreateSubscription(billingAccountName, invoiceSectionName, body, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -461,22 +475,24 @@ class SubscriptionFactory { /** * Creates an Azure subscription * - * @param {string} enrollmentAccountName The name of the enrollment account to - * which the subscription will be billed. + * @param {string} billingAccountName The name of the commerce root billing + * account. + * + * @param {string} invoiceSectionName The name of the invoice section. * * @param {object} body The subscription creation parameters. * * @param {string} [body.displayName] The display name of the subscription. * - * @param {array} [body.owners] The list of principals that should be granted - * Owner access on the subscription. Principals should be of type User, Service - * Principal or Security Group. + * @param {string} [body.billingProfileId] The ARM id of the billing profile. + * + * @param {string} [body.skuId] The commerce id of the sku. + * + * @param {string} [body.costCenter] optional customer cost center + * + * @param {object} [body.owner] rbac owner of the subscription * - * @param {string} [body.offerType] The offer type of the subscription. For - * example, MS-AZR-0017P (EnterpriseAgreement) and MS-AZR-0148P - * (EnterpriseAgreement devTest) are available. Only valid when creating a - * subscription in a enrollment account scope. Possible values include: - * 'MS-AZR-0017P', 'MS-AZR-0148P' + * @param {string} body.owner.objectId Object id of the Principal * * @param {object} [body.additionalParameters] Additional, untyped parameters * to support custom subscription creation scenarios. @@ -509,7 +525,7 @@ class SubscriptionFactory { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateSubscriptionInEnrollmentAccount(enrollmentAccountName, body, options, optionalCallback) { + beginCreateSubscription(billingAccountName, invoiceSectionName, body, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -518,14 +534,14 @@ class SubscriptionFactory { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginCreateSubscriptionInEnrollmentAccount(enrollmentAccountName, body, options, (err, result, request, response) => { + self._beginCreateSubscription(billingAccountName, invoiceSectionName, body, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginCreateSubscriptionInEnrollmentAccount(enrollmentAccountName, body, options, optionalCallback); + return self._beginCreateSubscription(billingAccountName, invoiceSectionName, body, options, optionalCallback); } } diff --git a/lib/services/subscriptionManagement2/lib/operations/subscriptionOperationOperations.js b/lib/services/subscriptionManagement2/lib/operations/subscriptionOperationOperations.js new file mode 100644 index 0000000000..3deea4b134 --- /dev/null +++ b/lib/services/subscriptionManagement2/lib/operations/subscriptionOperationOperations.js @@ -0,0 +1,250 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Get the status of the pending Microsoft.Subscription API operations. + * + * @param {string} operationId The operation ID, which can be found from the + * Location field in the generate recommendation response header. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SubscriptionCreationResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(operationId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-11-01-preview'; + // Validate + try { + if (operationId === null || operationId === undefined || typeof operationId.valueOf() !== 'string') { + throw new Error('operationId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Subscription/subscriptionOperations/{operationId}'; + requestUrl = requestUrl.replace('{operationId}', encodeURIComponent(operationId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SubscriptionCreationResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a SubscriptionOperationOperations. */ +class SubscriptionOperationOperations { + /** + * Create a SubscriptionOperationOperations. + * @param {SubscriptionClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._get = _get; + } + + /** + * Get the status of the pending Microsoft.Subscription API operations. + * + * @param {string} operationId The operation ID, which can be found from the + * Location field in the generate recommendation response header. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(operationId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(operationId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Get the status of the pending Microsoft.Subscription API operations. + * + * @param {string} operationId The operation ID, which can be found from the + * Location field in the generate recommendation response header. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {SubscriptionCreationResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SubscriptionCreationResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(operationId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(operationId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(operationId, options, optionalCallback); + } + } + +} + +module.exports = SubscriptionOperationOperations; diff --git a/lib/services/subscriptionManagement2/lib/subscriptionClient.d.ts b/lib/services/subscriptionManagement2/lib/subscriptionClient.d.ts index 330fb5841b..00362a0393 100644 --- a/lib/services/subscriptionManagement2/lib/subscriptionClient.d.ts +++ b/lib/services/subscriptionManagement2/lib/subscriptionClient.d.ts @@ -51,7 +51,7 @@ export default class SubscriptionClient extends AzureServiceClient { // Operation groups operations: operations.Operations; - subscriptionOperations: operations.SubscriptionOperations; + subscriptionOperationOperations: operations.SubscriptionOperationOperations; subscriptionFactory: operations.SubscriptionFactory; subscriptions: operations.Subscriptions; tenants: operations.Tenants; diff --git a/lib/services/subscriptionManagement2/lib/subscriptionClient.js b/lib/services/subscriptionManagement2/lib/subscriptionClient.js index 07e10daff0..90e50766eb 100644 --- a/lib/services/subscriptionManagement2/lib/subscriptionClient.js +++ b/lib/services/subscriptionManagement2/lib/subscriptionClient.js @@ -67,7 +67,7 @@ class SubscriptionClient extends ServiceClient { this.generateClientRequestId = options.generateClientRequestId; } this.operations = new operations.Operations(this); - this.subscriptionOperations = new operations.SubscriptionOperations(this); + this.subscriptionOperationOperations = new operations.SubscriptionOperationOperations(this); this.subscriptionFactory = new operations.SubscriptionFactory(this); this.subscriptions = new operations.Subscriptions(this); this.tenants = new operations.Tenants(this);