From ada59c26a7ac13e247326792166e5cdce11a67ac Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 16 Nov 2018 22:56:39 +0000 Subject: [PATCH] Generated from 00929e5f098aa4815bb216071aa6f22d5bc0e170 [Microsoft.Billing]: Updating swagger with rename changes required. --- lib/services/billingManagement/LICENSE.txt | 42 +- .../lib/billingManagementClient.d.ts | 12 +- .../lib/billingManagementClient.js | 12 +- .../lib/models/enrollmentAccount.js | 81 +++ .../lib/models/enrollmentAccountListResult.js | 69 ++ .../lib/models/errorResponse.js | 2 - .../billingManagement/lib/models/index.d.ts | 24 + .../billingManagement/lib/models/index.js | 2 + .../billingManagement/lib/models/operation.js | 2 - .../lib/operations/billingPeriods.js | 36 +- .../lib/operations/enrollmentAccounts.js | 674 ++++++++++++++++++ .../lib/operations/index.d.ts | 234 +++++- .../billingManagement/lib/operations/index.js | 1 + .../lib/operations/invoices.js | 54 +- lib/services/billingManagement/package.json | 29 +- 15 files changed, 1186 insertions(+), 88 deletions(-) create mode 100644 lib/services/billingManagement/lib/models/enrollmentAccount.js create mode 100644 lib/services/billingManagement/lib/models/enrollmentAccountListResult.js create mode 100644 lib/services/billingManagement/lib/operations/enrollmentAccounts.js diff --git a/lib/services/billingManagement/LICENSE.txt b/lib/services/billingManagement/LICENSE.txt index 0313a903d7..5431ba98b9 100644 --- a/lib/services/billingManagement/LICENSE.txt +++ b/lib/services/billingManagement/LICENSE.txt @@ -1,21 +1,21 @@ -The MIT License (MIT) - -Copyright (c) 2017 Microsoft - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file +The MIT License (MIT) + +Copyright (c) 2018 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/lib/services/billingManagement/lib/billingManagementClient.d.ts b/lib/services/billingManagement/lib/billingManagementClient.d.ts index d8d09366b4..4699b6243c 100644 --- a/lib/services/billingManagement/lib/billingManagementClient.d.ts +++ b/lib/services/billingManagement/lib/billingManagementClient.d.ts @@ -10,9 +10,10 @@ import { ServiceClientCredentials } from 'ms-rest'; import { AzureServiceClient, AzureServiceClientOptions } from 'ms-rest-azure'; +import * as models from "./models"; import * as operations from "./operations"; -declare class BillingManagementClient extends AzureServiceClient { +export default class BillingManagementClient extends AzureServiceClient { /** * Initializes a new instance of the BillingManagementClient class. * @constructor @@ -33,11 +34,11 @@ declare class BillingManagementClient extends AzureServiceClient { * * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy * - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. + * @param {string} [options.acceptLanguage] - The preferred language for the response. * - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. * - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. * */ constructor(credentials: ServiceClientCredentials, subscriptionId: string, baseUri?: string, options?: AzureServiceClientOptions); @@ -55,9 +56,10 @@ declare class BillingManagementClient extends AzureServiceClient { generateClientRequestId: boolean; // Operation groups + enrollmentAccounts: operations.EnrollmentAccounts; billingPeriods: operations.BillingPeriods; invoices: operations.Invoices; operations: operations.Operations; } -export = BillingManagementClient; +export { BillingManagementClient, models as BillingManagementModels }; diff --git a/lib/services/billingManagement/lib/billingManagementClient.js b/lib/services/billingManagement/lib/billingManagementClient.js index 3b23632ad2..0aa1ebef16 100644 --- a/lib/services/billingManagement/lib/billingManagementClient.js +++ b/lib/services/billingManagement/lib/billingManagementClient.js @@ -34,9 +34,9 @@ class BillingManagementClient extends ServiceClient { * @param {object} [options.requestOptions] - Options for the underlying request object * {@link https://github.com/request/request#requestoptions-callback Options doc} * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {string} [options.acceptLanguage] - The preferred language for the response. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ constructor(credentials, subscriptionId, baseUri, options) { if (credentials === null || credentials === undefined) { @@ -50,7 +50,7 @@ class BillingManagementClient extends ServiceClient { super(credentials, options); - this.apiVersion = '2017-04-24-preview'; + this.apiVersion = '2018-03-01-preview'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.generateClientRequestId = true; @@ -72,6 +72,7 @@ class BillingManagementClient extends ServiceClient { if(options.generateClientRequestId !== null && options.generateClientRequestId !== undefined) { this.generateClientRequestId = options.generateClientRequestId; } + this.enrollmentAccounts = new operations.EnrollmentAccounts(this); this.billingPeriods = new operations.BillingPeriods(this); this.invoices = new operations.Invoices(this); this.operations = new operations.Operations(this); @@ -82,3 +83,6 @@ class BillingManagementClient extends ServiceClient { } module.exports = BillingManagementClient; +module.exports['default'] = BillingManagementClient; +module.exports.BillingManagementClient = BillingManagementClient; +module.exports.BillingManagementModels = models; diff --git a/lib/services/billingManagement/lib/models/enrollmentAccount.js b/lib/services/billingManagement/lib/models/enrollmentAccount.js new file mode 100644 index 0000000000..e4587b9894 --- /dev/null +++ b/lib/services/billingManagement/lib/models/enrollmentAccount.js @@ -0,0 +1,81 @@ +/* + * 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 models = require('./index'); + +/** + * An enrollment account resource. + * + * @extends models['Resource'] + */ +class EnrollmentAccount extends models['Resource'] { + /** + * Create a EnrollmentAccount. + * @member {string} [principalName] The account owner's principal name. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of EnrollmentAccount + * + * @returns {object} metadata of EnrollmentAccount + * + */ + mapper() { + return { + required: false, + serializedName: 'EnrollmentAccount', + type: { + name: 'Composite', + className: 'EnrollmentAccount', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + principalName: { + required: false, + readOnly: true, + serializedName: 'properties.principalName', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = EnrollmentAccount; diff --git a/lib/services/billingManagement/lib/models/enrollmentAccountListResult.js b/lib/services/billingManagement/lib/models/enrollmentAccountListResult.js new file mode 100644 index 0000000000..d84e7e4399 --- /dev/null +++ b/lib/services/billingManagement/lib/models/enrollmentAccountListResult.js @@ -0,0 +1,69 @@ +/* + * 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'; + +/** + * Result of listing enrollment accounts. + */ +class EnrollmentAccountListResult extends Array { + /** + * Create a EnrollmentAccountListResult. + * @member {string} [nextLink] The link (url) to the next page of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of EnrollmentAccountListResult + * + * @returns {object} metadata of EnrollmentAccountListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'EnrollmentAccountListResult', + type: { + name: 'Composite', + className: 'EnrollmentAccountListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'EnrollmentAccountElementType', + type: { + name: 'Composite', + className: 'EnrollmentAccount' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = EnrollmentAccountListResult; diff --git a/lib/services/billingManagement/lib/models/errorResponse.js b/lib/services/billingManagement/lib/models/errorResponse.js index 5dfae6f5d3..7b47102438 100644 --- a/lib/services/billingManagement/lib/models/errorResponse.js +++ b/lib/services/billingManagement/lib/models/errorResponse.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Error response indicates that the service is not able to process the * incoming request. The reason is provided in the error message. diff --git a/lib/services/billingManagement/lib/models/index.d.ts b/lib/services/billingManagement/lib/models/index.d.ts index 939938cf05..31c9232006 100644 --- a/lib/services/billingManagement/lib/models/index.d.ts +++ b/lib/services/billingManagement/lib/models/index.d.ts @@ -32,6 +32,18 @@ export interface Resource extends BaseResource { readonly type?: string; } +/** + * @class + * Initializes a new instance of the EnrollmentAccount class. + * @constructor + * An enrollment account resource. + * + * @member {string} [principalName] The account owner's principal name. + */ +export interface EnrollmentAccount extends Resource { + readonly principalName?: string; +} + /** * @class * Initializes a new instance of the BillingPeriod class. @@ -162,6 +174,18 @@ export interface Operation { } +/** + * @class + * Initializes a new instance of the EnrollmentAccountListResult class. + * @constructor + * Result of listing enrollment accounts. + * + * @member {string} [nextLink] The link (url) to the next page of results. + */ +export interface EnrollmentAccountListResult extends Array { + readonly nextLink?: string; +} + /** * @class * Initializes a new instance of the BillingPeriodsListResult class. diff --git a/lib/services/billingManagement/lib/models/index.js b/lib/services/billingManagement/lib/models/index.js index cd5e9e23da..046580e949 100644 --- a/lib/services/billingManagement/lib/models/index.js +++ b/lib/services/billingManagement/lib/models/index.js @@ -19,6 +19,7 @@ var msRestAzure = require('ms-rest-azure'); exports.BaseResource = msRestAzure.BaseResource; exports.CloudError = msRestAzure.CloudError; exports.Resource = require('./resource'); +exports.EnrollmentAccount = require('./enrollmentAccount'); exports.BillingPeriod = require('./billingPeriod'); exports.DownloadUrl = require('./downloadUrl'); exports.ErrorDetails = require('./errorDetails'); @@ -26,6 +27,7 @@ exports.ErrorResponse = require('./errorResponse'); exports.Invoice = require('./invoice'); exports.OperationDisplay = require('./operationDisplay'); exports.Operation = require('./operation'); +exports.EnrollmentAccountListResult = require('./enrollmentAccountListResult'); exports.BillingPeriodsListResult = require('./billingPeriodsListResult'); exports.InvoicesListResult = require('./invoicesListResult'); exports.OperationListResult = require('./operationListResult'); diff --git a/lib/services/billingManagement/lib/models/operation.js b/lib/services/billingManagement/lib/models/operation.js index 1129eb5181..07036df0b6 100644 --- a/lib/services/billingManagement/lib/models/operation.js +++ b/lib/services/billingManagement/lib/models/operation.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * A Billing REST API operation. * diff --git a/lib/services/billingManagement/lib/operations/billingPeriods.js b/lib/services/billingManagement/lib/operations/billingPeriods.js index 2e4251c8f5..158b264cad 100644 --- a/lib/services/billingManagement/lib/operations/billingPeriods.js +++ b/lib/services/billingManagement/lib/operations/billingPeriods.js @@ -16,7 +16,9 @@ const WebResource = msRest.WebResource; /** * Lists the available billing periods for a subscription in reverse - * chronological order. + * chronological order. This is only supported for Azure Web-Direct + * subscriptions. Other subscription types which were not purchased directly + * through the Azure web portal are not supported through this preview API. * * @param {object} [options] Optional Parameters. * @@ -194,7 +196,9 @@ function _list(options, callback) { } /** - * Gets a named billing period. + * Gets a named billing period. This is only supported for Azure Web-Direct + * subscriptions. Other subscription types which were not purchased directly + * through the Azure web portal are not supported through this preview API. * * @param {string} billingPeriodName The name of a BillingPeriod resource. * @@ -335,7 +339,9 @@ function _get(billingPeriodName, options, callback) { /** * Lists the available billing periods for a subscription in reverse - * chronological order. + * chronological order. This is only supported for Azure Web-Direct + * subscriptions. Other subscription types which were not purchased directly + * through the Azure web portal are not supported through this preview API. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -478,7 +484,9 @@ class BillingPeriods { /** * Lists the available billing periods for a subscription in reverse - * chronological order. + * chronological order. This is only supported for Azure Web-Direct + * subscriptions. Other subscription types which were not purchased directly + * through the Azure web portal are not supported through this preview API. * * @param {object} [options] Optional Parameters. * @@ -519,7 +527,9 @@ class BillingPeriods { /** * Lists the available billing periods for a subscription in reverse - * chronological order. + * chronological order. This is only supported for Azure Web-Direct + * subscriptions. Other subscription types which were not purchased directly + * through the Azure web portal are not supported through this preview API. * * @param {object} [options] Optional Parameters. * @@ -582,7 +592,9 @@ class BillingPeriods { } /** - * Gets a named billing period. + * Gets a named billing period. This is only supported for Azure Web-Direct + * subscriptions. Other subscription types which were not purchased directly + * through the Azure web portal are not supported through this preview API. * * @param {string} billingPeriodName The name of a BillingPeriod resource. * @@ -612,7 +624,9 @@ class BillingPeriods { } /** - * Gets a named billing period. + * Gets a named billing period. This is only supported for Azure Web-Direct + * subscriptions. Other subscription types which were not purchased directly + * through the Azure web portal are not supported through this preview API. * * @param {string} billingPeriodName The name of a BillingPeriod resource. * @@ -665,7 +679,9 @@ class BillingPeriods { /** * Lists the available billing periods for a subscription in reverse - * chronological order. + * chronological order. This is only supported for Azure Web-Direct + * subscriptions. Other subscription types which were not purchased directly + * through the Azure web portal are not supported through this preview API. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -697,7 +713,9 @@ class BillingPeriods { /** * Lists the available billing periods for a subscription in reverse - * chronological order. + * chronological order. This is only supported for Azure Web-Direct + * subscriptions. Other subscription types which were not purchased directly + * through the Azure web portal are not supported through this preview API. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. diff --git a/lib/services/billingManagement/lib/operations/enrollmentAccounts.js b/lib/services/billingManagement/lib/operations/enrollmentAccounts.js new file mode 100644 index 0000000000..d616f11d45 --- /dev/null +++ b/lib/services/billingManagement/lib/operations/enrollmentAccounts.js @@ -0,0 +1,674 @@ +/* + * 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; + +/** + * Lists the enrollment accounts the caller has access to. + * + * @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 EnrollmentAccountListResult} 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 _list(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.'); + } + // Validate + try { + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion 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.Billing/enrollmentAccounts'; + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.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) { + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().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['EnrollmentAccountListResult']().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); + }); +} + +/** + * Gets a enrollment account by name. + * + * @param {string} name Enrollment Account name. + * + * @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 EnrollmentAccount} 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(name, 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.'); + } + // Validate + try { + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion 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.Billing/enrollmentAccounts/{name}'; + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.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) { + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().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['EnrollmentAccount']().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); + }); +} + +/** + * Lists the enrollment accounts the caller has access to. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @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 EnrollmentAccountListResult} 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 _listNext(nextPageLink, 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.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink 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 requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // 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) { + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().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['EnrollmentAccountListResult']().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 EnrollmentAccounts. */ +class EnrollmentAccounts { + /** + * Create a EnrollmentAccounts. + * @param {BillingManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._get = _get; + this._listNext = _listNext; + } + + /** + * Lists the enrollment accounts the caller has access to. + * + * @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. + */ + listWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists the enrollment accounts the caller has access to. + * + * @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 {EnrollmentAccountListResult} - 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 EnrollmentAccountListResult} 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. + */ + list(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._list(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(options, optionalCallback); + } + } + + /** + * Gets a enrollment account by name. + * + * @param {string} name Enrollment Account name. + * + * @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(name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a enrollment account by name. + * + * @param {string} name Enrollment Account name. + * + * @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 {EnrollmentAccount} - 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 EnrollmentAccount} 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(name, 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(name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(name, options, optionalCallback); + } + } + + /** + * Lists the enrollment accounts the caller has access to. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @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. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists the enrollment accounts the caller has access to. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @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 {EnrollmentAccountListResult} - 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 EnrollmentAccountListResult} 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. + */ + listNext(nextPageLink, 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._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = EnrollmentAccounts; diff --git a/lib/services/billingManagement/lib/operations/index.d.ts b/lib/services/billingManagement/lib/operations/index.d.ts index d0607acf3f..3131b77c2e 100644 --- a/lib/services/billingManagement/lib/operations/index.d.ts +++ b/lib/services/billingManagement/lib/operations/index.d.ts @@ -12,6 +12,180 @@ import { ServiceClientOptions, RequestOptions, ServiceCallback, HttpOperationRes import * as models from '../models'; +/** + * @class + * EnrollmentAccounts + * __NOTE__: An instance of this class is automatically created for an + * instance of the BillingManagementClient. + */ +export interface EnrollmentAccounts { + + + /** + * Lists the enrollment accounts the caller has access to. + * + * @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|ServiceError} - The error object. + */ + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists the enrollment accounts the caller has access to. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|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 {EnrollmentAccountListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {EnrollmentAccountListResult} [result] - The deserialized result object if an error did not occur. + * See {@link EnrollmentAccountListResult} 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; + + + /** + * Gets a enrollment account by name. + * + * @param {string} name Enrollment Account name. + * + * @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|ServiceError} - The error object. + */ + getWithHttpOperationResponse(name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a enrollment account by name. + * + * @param {string} name Enrollment Account name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|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 {EnrollmentAccount} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {EnrollmentAccount} [result] - The deserialized result object if an error did not occur. + * See {@link EnrollmentAccount} 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. + */ + get(name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(name: string, callback: ServiceCallback): void; + get(name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists the enrollment accounts the caller has access to. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @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|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists the enrollment accounts the caller has access to. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|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 {EnrollmentAccountListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {EnrollmentAccountListResult} [result] - The deserialized result object if an error did not occur. + * See {@link EnrollmentAccountListResult} 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. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + /** * @class * BillingPeriods @@ -23,7 +197,9 @@ export interface BillingPeriods { /** * Lists the available billing periods for a subscription in reverse - * chronological order. + * chronological order. This is only supported for Azure Web-Direct + * subscriptions. Other subscription types which were not purchased directly + * through the Azure web portal are not supported through this preview API. * * @param {object} [options] Optional Parameters. * @@ -52,7 +228,9 @@ export interface BillingPeriods { /** * Lists the available billing periods for a subscription in reverse - * chronological order. + * chronological order. This is only supported for Azure Web-Direct + * subscriptions. Other subscription types which were not purchased directly + * through the Azure web portal are not supported through this preview API. * * @param {object} [options] Optional Parameters. * @@ -100,7 +278,9 @@ export interface BillingPeriods { /** - * Gets a named billing period. + * Gets a named billing period. This is only supported for Azure Web-Direct + * subscriptions. Other subscription types which were not purchased directly + * through the Azure web portal are not supported through this preview API. * * @param {string} billingPeriodName The name of a BillingPeriod resource. * @@ -118,7 +298,9 @@ export interface BillingPeriods { getWithHttpOperationResponse(billingPeriodName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a named billing period. + * Gets a named billing period. This is only supported for Azure Web-Direct + * subscriptions. Other subscription types which were not purchased directly + * through the Azure web portal are not supported through this preview API. * * @param {string} billingPeriodName The name of a BillingPeriod resource. * @@ -156,7 +338,9 @@ export interface BillingPeriods { /** * Lists the available billing periods for a subscription in reverse - * chronological order. + * chronological order. This is only supported for Azure Web-Direct + * subscriptions. Other subscription types which were not purchased directly + * through the Azure web portal are not supported through this preview API. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -176,7 +360,9 @@ export interface BillingPeriods { /** * Lists the available billing periods for a subscription in reverse - * chronological order. + * chronological order. This is only supported for Azure Web-Direct + * subscriptions. Other subscription types which were not purchased directly + * through the Azure web portal are not supported through this preview API. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -227,7 +413,9 @@ export interface Invoices { * Lists the available invoices for a subscription in reverse chronological * order beginning with the most recent invoice. In preview, invoices are * available via this API only for invoice periods which end December 1, 2016 - * or later. + * or later. This is only supported for Azure Web-Direct subscriptions. Other + * subscription types which were not purchased directly through the Azure web + * portal are not supported through this preview API. * * @param {object} [options] Optional Parameters. * @@ -263,7 +451,9 @@ export interface Invoices { * Lists the available invoices for a subscription in reverse chronological * order beginning with the most recent invoice. In preview, invoices are * available via this API only for invoice periods which end December 1, 2016 - * or later. + * or later. This is only supported for Azure Web-Direct subscriptions. Other + * subscription types which were not purchased directly through the Azure web + * portal are not supported through this preview API. * * @param {object} [options] Optional Parameters. * @@ -316,7 +506,10 @@ export interface Invoices { /** * Gets a named invoice resource. When getting a single invoice, the - * downloadUrl property is expanded automatically. + * downloadUrl property is expanded automatically. This is only supported for + * Azure Web-Direct subscriptions. Other subscription types which were not + * purchased directly through the Azure web portal are not supported through + * this preview API. * * @param {string} invoiceName The name of an invoice resource. * @@ -335,7 +528,10 @@ export interface Invoices { /** * Gets a named invoice resource. When getting a single invoice, the - * downloadUrl property is expanded automatically. + * downloadUrl property is expanded automatically. This is only supported for + * Azure Web-Direct subscriptions. Other subscription types which were not + * purchased directly through the Azure web portal are not supported through + * this preview API. * * @param {string} invoiceName The name of an invoice resource. * @@ -373,7 +569,10 @@ export interface Invoices { /** * Gets the most recent invoice. When getting a single invoice, the downloadUrl - * property is expanded automatically. + * property is expanded automatically. This is only supported for Azure + * Web-Direct subscriptions. Other subscription types which were not purchased + * directly through the Azure web portal are not supported through this preview + * API. * * @param {object} [options] Optional Parameters. * @@ -390,7 +589,10 @@ export interface Invoices { /** * Gets the most recent invoice. When getting a single invoice, the downloadUrl - * property is expanded automatically. + * property is expanded automatically. This is only supported for Azure + * Web-Direct subscriptions. Other subscription types which were not purchased + * directly through the Azure web portal are not supported through this preview + * API. * * @param {object} [options] Optional Parameters. * @@ -428,7 +630,9 @@ export interface Invoices { * Lists the available invoices for a subscription in reverse chronological * order beginning with the most recent invoice. In preview, invoices are * available via this API only for invoice periods which end December 1, 2016 - * or later. + * or later. This is only supported for Azure Web-Direct subscriptions. Other + * subscription types which were not purchased directly through the Azure web + * portal are not supported through this preview API. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -450,7 +654,9 @@ export interface Invoices { * Lists the available invoices for a subscription in reverse chronological * order beginning with the most recent invoice. In preview, invoices are * available via this API only for invoice periods which end December 1, 2016 - * or later. + * or later. This is only supported for Azure Web-Direct subscriptions. Other + * subscription types which were not purchased directly through the Azure web + * portal are not supported through this preview API. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. diff --git a/lib/services/billingManagement/lib/operations/index.js b/lib/services/billingManagement/lib/operations/index.js index a55f84f6b6..ae2c2db552 100644 --- a/lib/services/billingManagement/lib/operations/index.js +++ b/lib/services/billingManagement/lib/operations/index.js @@ -14,6 +14,7 @@ 'use strict'; +exports.EnrollmentAccounts = require('./enrollmentAccounts'); exports.BillingPeriods = require('./billingPeriods'); exports.Invoices = require('./invoices'); exports.Operations = require('./operations'); diff --git a/lib/services/billingManagement/lib/operations/invoices.js b/lib/services/billingManagement/lib/operations/invoices.js index e114d42aef..577cc186fb 100644 --- a/lib/services/billingManagement/lib/operations/invoices.js +++ b/lib/services/billingManagement/lib/operations/invoices.js @@ -18,7 +18,9 @@ const WebResource = msRest.WebResource; * Lists the available invoices for a subscription in reverse chronological * order beginning with the most recent invoice. In preview, invoices are * available via this API only for invoice periods which end December 1, 2016 - * or later. + * or later. This is only supported for Azure Web-Direct subscriptions. Other + * subscription types which were not purchased directly through the Azure web + * portal are not supported through this preview API. * * @param {object} [options] Optional Parameters. * @@ -208,7 +210,10 @@ function _list(options, callback) { /** * Gets a named invoice resource. When getting a single invoice, the - * downloadUrl property is expanded automatically. + * downloadUrl property is expanded automatically. This is only supported for + * Azure Web-Direct subscriptions. Other subscription types which were not + * purchased directly through the Azure web portal are not supported through + * this preview API. * * @param {string} invoiceName The name of an invoice resource. * @@ -349,7 +354,10 @@ function _get(invoiceName, options, callback) { /** * Gets the most recent invoice. When getting a single invoice, the downloadUrl - * property is expanded automatically. + * property is expanded automatically. This is only supported for Azure + * Web-Direct subscriptions. Other subscription types which were not purchased + * directly through the Azure web portal are not supported through this preview + * API. * * @param {object} [options] Optional Parameters. * @@ -486,7 +494,9 @@ function _getLatest(options, callback) { * Lists the available invoices for a subscription in reverse chronological * order beginning with the most recent invoice. In preview, invoices are * available via this API only for invoice periods which end December 1, 2016 - * or later. + * or later. This is only supported for Azure Web-Direct subscriptions. Other + * subscription types which were not purchased directly through the Azure web + * portal are not supported through this preview API. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -631,7 +641,9 @@ class Invoices { * Lists the available invoices for a subscription in reverse chronological * order beginning with the most recent invoice. In preview, invoices are * available via this API only for invoice periods which end December 1, 2016 - * or later. + * or later. This is only supported for Azure Web-Direct subscriptions. Other + * subscription types which were not purchased directly through the Azure web + * portal are not supported through this preview API. * * @param {object} [options] Optional Parameters. * @@ -679,7 +691,9 @@ class Invoices { * Lists the available invoices for a subscription in reverse chronological * order beginning with the most recent invoice. In preview, invoices are * available via this API only for invoice periods which end December 1, 2016 - * or later. + * or later. This is only supported for Azure Web-Direct subscriptions. Other + * subscription types which were not purchased directly through the Azure web + * portal are not supported through this preview API. * * @param {object} [options] Optional Parameters. * @@ -747,7 +761,10 @@ class Invoices { /** * Gets a named invoice resource. When getting a single invoice, the - * downloadUrl property is expanded automatically. + * downloadUrl property is expanded automatically. This is only supported for + * Azure Web-Direct subscriptions. Other subscription types which were not + * purchased directly through the Azure web portal are not supported through + * this preview API. * * @param {string} invoiceName The name of an invoice resource. * @@ -778,7 +795,10 @@ class Invoices { /** * Gets a named invoice resource. When getting a single invoice, the - * downloadUrl property is expanded automatically. + * downloadUrl property is expanded automatically. This is only supported for + * Azure Web-Direct subscriptions. Other subscription types which were not + * purchased directly through the Azure web portal are not supported through + * this preview API. * * @param {string} invoiceName The name of an invoice resource. * @@ -831,7 +851,10 @@ class Invoices { /** * Gets the most recent invoice. When getting a single invoice, the downloadUrl - * property is expanded automatically. + * property is expanded automatically. This is only supported for Azure + * Web-Direct subscriptions. Other subscription types which were not purchased + * directly through the Azure web portal are not supported through this preview + * API. * * @param {object} [options] Optional Parameters. * @@ -860,7 +883,10 @@ class Invoices { /** * Gets the most recent invoice. When getting a single invoice, the downloadUrl - * property is expanded automatically. + * property is expanded automatically. This is only supported for Azure + * Web-Direct subscriptions. Other subscription types which were not purchased + * directly through the Azure web portal are not supported through this preview + * API. * * @param {object} [options] Optional Parameters. * @@ -913,7 +939,9 @@ class Invoices { * Lists the available invoices for a subscription in reverse chronological * order beginning with the most recent invoice. In preview, invoices are * available via this API only for invoice periods which end December 1, 2016 - * or later. + * or later. This is only supported for Azure Web-Direct subscriptions. Other + * subscription types which were not purchased directly through the Azure web + * portal are not supported through this preview API. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -947,7 +975,9 @@ class Invoices { * Lists the available invoices for a subscription in reverse chronological * order beginning with the most recent invoice. In preview, invoices are * available via this API only for invoice periods which end December 1, 2016 - * or later. + * or later. This is only supported for Azure Web-Direct subscriptions. Other + * subscription types which were not purchased directly through the Azure web + * portal are not supported through this preview API. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. diff --git a/lib/services/billingManagement/package.json b/lib/services/billingManagement/package.json index a45f584de2..b799c1d148 100644 --- a/lib/services/billingManagement/package.json +++ b/lib/services/billingManagement/package.json @@ -1,34 +1,25 @@ { "name": "azure-arm-billing", "author": "Microsoft Corporation", - "contributors": [ - "Lian, John ", - "Krishnan, Balaji ", - "Zavery, Amar