From 5c58d8bb86127e3eddf82ebb62df06960adc4e59 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 8 Feb 2019 10:33:29 +0000 Subject: [PATCH 1/3] Generated from 5cea84d15ec15d6ac36f627700b139d4a0f56546 [DO NOT MERGE] Changes for introduction of transfer products API These are the API changes for the transfer products API for Azure modern billing platform infrastructure --- lib/services/billingManagement/LICENSE.txt | 2 +- .../lib/billingManagementClient.d.ts | 1 + .../lib/billingManagementClient.js | 3 +- .../billingManagement/lib/models/index.d.ts | 13 + .../billingManagement/lib/models/index.js | 1 + .../lib/models/transferProductProperties.js | 54 ++++ .../lib/operations/index.d.ts | 71 +++++ .../billingManagement/lib/operations/index.js | 1 + .../lib/operations/products.js | 271 ++++++++++++++++++ 9 files changed, 415 insertions(+), 2 deletions(-) create mode 100644 lib/services/billingManagement/lib/models/transferProductProperties.js create mode 100644 lib/services/billingManagement/lib/operations/products.js diff --git a/lib/services/billingManagement/LICENSE.txt b/lib/services/billingManagement/LICENSE.txt index 5431ba98b9..8f3d856145 100644 --- a/lib/services/billingManagement/LICENSE.txt +++ b/lib/services/billingManagement/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2018 Microsoft +Copyright (c) 2019 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/lib/services/billingManagement/lib/billingManagementClient.d.ts b/lib/services/billingManagement/lib/billingManagementClient.d.ts index 4699b6243c..a1f5b36dd1 100644 --- a/lib/services/billingManagement/lib/billingManagementClient.d.ts +++ b/lib/services/billingManagement/lib/billingManagementClient.d.ts @@ -59,6 +59,7 @@ export default class BillingManagementClient extends AzureServiceClient { enrollmentAccounts: operations.EnrollmentAccounts; billingPeriods: operations.BillingPeriods; invoices: operations.Invoices; + products: operations.Products; operations: operations.Operations; } diff --git a/lib/services/billingManagement/lib/billingManagementClient.js b/lib/services/billingManagement/lib/billingManagementClient.js index 0aa1ebef16..84f5c62494 100644 --- a/lib/services/billingManagement/lib/billingManagementClient.js +++ b/lib/services/billingManagement/lib/billingManagementClient.js @@ -50,7 +50,7 @@ class BillingManagementClient extends ServiceClient { super(credentials, options); - this.apiVersion = '2018-03-01-preview'; + this.apiVersion = '2018-11-01-preview'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.generateClientRequestId = true; @@ -75,6 +75,7 @@ class BillingManagementClient extends ServiceClient { this.enrollmentAccounts = new operations.EnrollmentAccounts(this); this.billingPeriods = new operations.BillingPeriods(this); this.invoices = new operations.Invoices(this); + this.products = new operations.Products(this); this.operations = new operations.Operations(this); this.models = models; msRest.addSerializationMixin(this); diff --git a/lib/services/billingManagement/lib/models/index.d.ts b/lib/services/billingManagement/lib/models/index.d.ts index 5520273f45..af25f68504 100644 --- a/lib/services/billingManagement/lib/models/index.d.ts +++ b/lib/services/billingManagement/lib/models/index.d.ts @@ -16,6 +16,19 @@ export { BaseResource } from 'ms-rest-azure'; export { CloudError } from 'ms-rest-azure'; +/** + * @class + * Initializes a new instance of the TransferProductProperties class. + * @constructor + * The properties of the product to initiate itansfer. + * + * @member {string} [destinationInvoiceSectionId] Destination invoice section + * id. + */ +export interface TransferProductProperties { + readonly destinationInvoiceSectionId?: string; +} + /** * @class * Initializes a new instance of the Resource class. diff --git a/lib/services/billingManagement/lib/models/index.js b/lib/services/billingManagement/lib/models/index.js index 046580e949..29708a21dc 100644 --- a/lib/services/billingManagement/lib/models/index.js +++ b/lib/services/billingManagement/lib/models/index.js @@ -18,6 +18,7 @@ var msRestAzure = require('ms-rest-azure'); exports.BaseResource = msRestAzure.BaseResource; exports.CloudError = msRestAzure.CloudError; +exports.TransferProductProperties = require('./transferProductProperties'); exports.Resource = require('./resource'); exports.EnrollmentAccount = require('./enrollmentAccount'); exports.BillingPeriod = require('./billingPeriod'); diff --git a/lib/services/billingManagement/lib/models/transferProductProperties.js b/lib/services/billingManagement/lib/models/transferProductProperties.js new file mode 100644 index 0000000000..11cda2fdd0 --- /dev/null +++ b/lib/services/billingManagement/lib/models/transferProductProperties.js @@ -0,0 +1,54 @@ +/* + * 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'; + +/** + * The properties of the product to initiate itansfer. + * + */ +class TransferProductProperties { + /** + * Create a TransferProductProperties. + * @member {string} [destinationInvoiceSectionId] Destination invoice section + * id. + */ + constructor() { + } + + /** + * Defines the metadata of TransferProductProperties + * + * @returns {object} metadata of TransferProductProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'TransferProductProperties', + type: { + name: 'Composite', + className: 'TransferProductProperties', + modelProperties: { + destinationInvoiceSectionId: { + required: false, + readOnly: true, + serializedName: 'destinationInvoiceSectionId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = TransferProductProperties; diff --git a/lib/services/billingManagement/lib/operations/index.d.ts b/lib/services/billingManagement/lib/operations/index.d.ts index 3131b77c2e..a03e1f148e 100644 --- a/lib/services/billingManagement/lib/operations/index.d.ts +++ b/lib/services/billingManagement/lib/operations/index.d.ts @@ -693,6 +693,77 @@ export interface Invoices { listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } +/** + * @class + * Products + * __NOTE__: An instance of this class is automatically created for an + * instance of the BillingManagementClient. + */ +export interface Products { + + + /** + * The operation to transfer a Product to another InvoiceSection. + * + * @param {string} billingAccountId billing Account Id. + * + * @param {string} invoiceSectionId Invoice Id. + * + * @param {string} productName Product Id. + * + * @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. + */ + transferWithHttpOperationResponse(billingAccountId: string, invoiceSectionId: string, productName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The operation to transfer a Product to another InvoiceSection. + * + * @param {string} billingAccountId billing Account Id. + * + * @param {string} invoiceSectionId Invoice Id. + * + * @param {string} productName Product Id. + * + * @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 {null} - 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. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {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. + */ + transfer(billingAccountId: string, invoiceSectionId: string, productName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + transfer(billingAccountId: string, invoiceSectionId: string, productName: string, callback: ServiceCallback): void; + transfer(billingAccountId: string, invoiceSectionId: string, productName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + /** * @class * Operations diff --git a/lib/services/billingManagement/lib/operations/index.js b/lib/services/billingManagement/lib/operations/index.js index ae2c2db552..0099628d7d 100644 --- a/lib/services/billingManagement/lib/operations/index.js +++ b/lib/services/billingManagement/lib/operations/index.js @@ -17,4 +17,5 @@ exports.EnrollmentAccounts = require('./enrollmentAccounts'); exports.BillingPeriods = require('./billingPeriods'); exports.Invoices = require('./invoices'); +exports.Products = require('./products'); exports.Operations = require('./operations'); diff --git a/lib/services/billingManagement/lib/operations/products.js b/lib/services/billingManagement/lib/operations/products.js new file mode 100644 index 0000000000..ffe60e2403 --- /dev/null +++ b/lib/services/billingManagement/lib/operations/products.js @@ -0,0 +1,271 @@ +/* + * 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; + +/** + * The operation to transfer a Product to another InvoiceSection. + * + * @param {string} billingAccountId billing Account Id. + * + * @param {string} invoiceSectionId Invoice Id. + * + * @param {string} productName Product Id. + * + * @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. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {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 _transfer(billingAccountId, invoiceSectionId, productName, 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 (billingAccountId === null || billingAccountId === undefined || typeof billingAccountId.valueOf() !== 'string') { + throw new Error('billingAccountId cannot be null or undefined and it must be of type string.'); + } + if (invoiceSectionId === null || invoiceSectionId === undefined || typeof invoiceSectionId.valueOf() !== 'string') { + throw new Error('invoiceSectionId cannot be null or undefined and it must be of type string.'); + } + if (productName === null || productName === undefined || typeof productName.valueOf() !== 'string') { + throw new Error('productName 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); + } + let parameters = new client.models['TransferProductProperties'](); + try { + if () + { + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}/products/{productName}/transfer'; + requestUrl = requestUrl.replace('{billingAccountId}', encodeURIComponent(billingAccountId)); + requestUrl = requestUrl.replace('{invoiceSectionId}', encodeURIComponent(invoiceSectionId)); + requestUrl = requestUrl.replace('{productName}', encodeURIComponent(productName)); + 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 = 'POST'; + 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]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['TransferProductProperties']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (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) { + 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; + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a Products. */ +class Products { + /** + * Create a Products. + * @param {BillingManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._transfer = _transfer; + } + + /** + * The operation to transfer a Product to another InvoiceSection. + * + * @param {string} billingAccountId billing Account Id. + * + * @param {string} invoiceSectionId Invoice Id. + * + * @param {string} productName Product Id. + * + * @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. + */ + transferWithHttpOperationResponse(billingAccountId, invoiceSectionId, productName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._transfer(billingAccountId, invoiceSectionId, productName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * The operation to transfer a Product to another InvoiceSection. + * + * @param {string} billingAccountId billing Account Id. + * + * @param {string} invoiceSectionId Invoice Id. + * + * @param {string} productName Product Id. + * + * @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 {null} - 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. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + transfer(billingAccountId, invoiceSectionId, productName, 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._transfer(billingAccountId, invoiceSectionId, productName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._transfer(billingAccountId, invoiceSectionId, productName, options, optionalCallback); + } + } + +} + +module.exports = Products; From b66e6a5b438e7b651aa8686ac8080db2d99922cf Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 8 Feb 2019 21:06:54 +0000 Subject: [PATCH 2/3] Generated from f7bd66f5b55d7d6f6baf55c50803c6ddb01f6cca Changes for the Microsoft Billing APIs --- lib/services/billingManagement/lib/models/index.d.ts | 2 +- .../billingManagement/lib/models/transferProductProperties.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/services/billingManagement/lib/models/index.d.ts b/lib/services/billingManagement/lib/models/index.d.ts index af25f68504..054e5f8ccb 100644 --- a/lib/services/billingManagement/lib/models/index.d.ts +++ b/lib/services/billingManagement/lib/models/index.d.ts @@ -20,7 +20,7 @@ export { CloudError } from 'ms-rest-azure'; * @class * Initializes a new instance of the TransferProductProperties class. * @constructor - * The properties of the product to initiate itansfer. + * The properties of the product to initiate a transfer. * * @member {string} [destinationInvoiceSectionId] Destination invoice section * id. diff --git a/lib/services/billingManagement/lib/models/transferProductProperties.js b/lib/services/billingManagement/lib/models/transferProductProperties.js index 11cda2fdd0..e81f510967 100644 --- a/lib/services/billingManagement/lib/models/transferProductProperties.js +++ b/lib/services/billingManagement/lib/models/transferProductProperties.js @@ -11,7 +11,7 @@ 'use strict'; /** - * The properties of the product to initiate itansfer. + * The properties of the product to initiate a transfer. * */ class TransferProductProperties { From 99732046a12550e9069858126a92a91faa3f2224 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Sat, 9 Feb 2019 00:14:01 +0000 Subject: [PATCH 3/3] Generated from 4ef0f1d9e16a4fb91b1c9232c28b136008422171 Swagger changes for Microsoft.Billing for GTM product transfers --- .../billingManagement/lib/models/index.d.ts | 2 +- .../lib/models/transferProductProperties.js | 1 - .../lib/operations/index.d.ts | 12 +++++++--- .../lib/operations/products.js | 24 +++++++++++++------ 4 files changed, 27 insertions(+), 12 deletions(-) diff --git a/lib/services/billingManagement/lib/models/index.d.ts b/lib/services/billingManagement/lib/models/index.d.ts index 054e5f8ccb..811fdc1004 100644 --- a/lib/services/billingManagement/lib/models/index.d.ts +++ b/lib/services/billingManagement/lib/models/index.d.ts @@ -26,7 +26,7 @@ export { CloudError } from 'ms-rest-azure'; * id. */ export interface TransferProductProperties { - readonly destinationInvoiceSectionId?: string; + destinationInvoiceSectionId?: string; } /** diff --git a/lib/services/billingManagement/lib/models/transferProductProperties.js b/lib/services/billingManagement/lib/models/transferProductProperties.js index e81f510967..8d96fbafef 100644 --- a/lib/services/billingManagement/lib/models/transferProductProperties.js +++ b/lib/services/billingManagement/lib/models/transferProductProperties.js @@ -39,7 +39,6 @@ class TransferProductProperties { modelProperties: { destinationInvoiceSectionId: { required: false, - readOnly: true, serializedName: 'destinationInvoiceSectionId', type: { name: 'String' diff --git a/lib/services/billingManagement/lib/operations/index.d.ts b/lib/services/billingManagement/lib/operations/index.d.ts index a03e1f148e..6e8726aa69 100644 --- a/lib/services/billingManagement/lib/operations/index.d.ts +++ b/lib/services/billingManagement/lib/operations/index.d.ts @@ -713,6 +713,9 @@ export interface Products { * * @param {object} [options] Optional Parameters. * + * @param {string} [options.destinationInvoiceSectionId] Destination invoice + * section id. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -722,7 +725,7 @@ export interface Products { * * @reject {Error|ServiceError} - The error object. */ - transferWithHttpOperationResponse(billingAccountId: string, invoiceSectionId: string, productName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + transferWithHttpOperationResponse(billingAccountId: string, invoiceSectionId: string, productName: string, options?: { destinationInvoiceSectionId? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * The operation to transfer a Product to another InvoiceSection. @@ -735,6 +738,9 @@ export interface Products { * * @param {object} [options] Optional Parameters. * + * @param {string} [options.destinationInvoiceSectionId] Destination invoice + * section id. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -759,9 +765,9 @@ export interface Products { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - transfer(billingAccountId: string, invoiceSectionId: string, productName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + transfer(billingAccountId: string, invoiceSectionId: string, productName: string, options?: { destinationInvoiceSectionId? : string, customHeaders? : { [headerName: string]: string; } }): Promise; transfer(billingAccountId: string, invoiceSectionId: string, productName: string, callback: ServiceCallback): void; - transfer(billingAccountId: string, invoiceSectionId: string, productName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + transfer(billingAccountId: string, invoiceSectionId: string, productName: string, options: { destinationInvoiceSectionId? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** diff --git a/lib/services/billingManagement/lib/operations/products.js b/lib/services/billingManagement/lib/operations/products.js index ffe60e2403..5d6ff3dc59 100644 --- a/lib/services/billingManagement/lib/operations/products.js +++ b/lib/services/billingManagement/lib/operations/products.js @@ -25,6 +25,9 @@ const WebResource = msRest.WebResource; * * @param {object} [options] Optional Parameters. * + * @param {string} [options.destinationInvoiceSectionId] Destination invoice + * section id. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -50,6 +53,7 @@ function _transfer(billingAccountId, invoiceSectionId, productName, options, cal if (!callback) { throw new Error('callback cannot be null.'); } + let destinationInvoiceSectionId = (options && options.destinationInvoiceSectionId !== undefined) ? options.destinationInvoiceSectionId : undefined; // Validate try { if (billingAccountId === null || billingAccountId === undefined || typeof billingAccountId.valueOf() !== 'string') { @@ -64,19 +68,19 @@ function _transfer(billingAccountId, invoiceSectionId, productName, options, cal 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 (destinationInvoiceSectionId !== null && destinationInvoiceSectionId !== undefined && typeof destinationInvoiceSectionId.valueOf() !== 'string') { + throw new Error('destinationInvoiceSectionId 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); } - let parameters = new client.models['TransferProductProperties'](); - try { - if () - { - } - } catch (error) { - return callback(error); + let parameters; + if (destinationInvoiceSectionId !== null && destinationInvoiceSectionId !== undefined) { + parameters = new client.models['TransferProductProperties'](); + parameters.destinationInvoiceSectionId = destinationInvoiceSectionId; } // Construct URL @@ -188,6 +192,9 @@ class Products { * * @param {object} [options] Optional Parameters. * + * @param {string} [options.destinationInvoiceSectionId] Destination invoice + * section id. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -222,6 +229,9 @@ class Products { * * @param {object} [options] Optional Parameters. * + * @param {string} [options.destinationInvoiceSectionId] Destination invoice + * section id. + * * @param {object} [options.customHeaders] Headers that will be added to the * request *