diff --git a/examples/node/spec/integration/apiIntegration.spec.ts b/examples/node/spec/integration/apiIntegration.spec.ts index 9e2888944..159f620bf 100644 --- a/examples/node/spec/integration/apiIntegration.spec.ts +++ b/examples/node/spec/integration/apiIntegration.spec.ts @@ -51,7 +51,7 @@ describe("Integration tests", () => { .calls.feedbackCallSummary("CR12345678123456781234567812345678") .update(params); expect(result.testArrayOfObjects[0].description).toEqual( - "issue description" + "issue description", ); expect(result.testArrayOfObjects[0].count).toEqual(4); }); diff --git a/examples/node/spec/unit/account.spec.ts b/examples/node/spec/unit/account.spec.ts index e4956655e..60be507c5 100644 --- a/examples/node/spec/unit/account.spec.ts +++ b/examples/node/spec/unit/account.spec.ts @@ -118,7 +118,7 @@ describe("account", () => { .page(params) .then((accountPage) => { expect(accountPage.getNextPageUrl()).toEqual( - "http://api.twilio.com/2010-04-01/Accounts.json?FriendlyName=friendly_name&Status=active&PageSize=50&Page=50" + "http://api.twilio.com/2010-04-01/Accounts.json?FriendlyName=friendly_name&Status=active&PageSize=50&Page=50", ); expect(accountPage.instances[0].testObject.mms).toEqual(true); expect(accountPage.instances[0].testObject.sms).toEqual(false); diff --git a/examples/node/src/rest/api/v2010/account.ts b/examples/node/src/rest/api/v2010/account.ts index ac4ed2471..c00f6bcab 100644 --- a/examples/node/src/rest/api/v2010/account.ts +++ b/examples/node/src/rest/api/v2010/account.ts @@ -130,7 +130,7 @@ export interface AccountContext { * @returns Resolves to processed boolean */ remove( - callback?: (error: Error | null, item?: boolean) => any + callback?: (error: Error | null, item?: boolean) => any, ): Promise; /** @@ -141,7 +141,7 @@ export interface AccountContext { * @returns Resolves to processed AccountInstance */ fetch( - callback?: (error: Error | null, item?: AccountInstance) => any + callback?: (error: Error | null, item?: AccountInstance) => any, ): Promise; /** @@ -154,7 +154,7 @@ export interface AccountContext { */ update( params: AccountContextUpdateOptions, - callback?: (error: Error | null, item?: AccountInstance) => any + callback?: (error: Error | null, item?: AccountInstance) => any, ): Promise; /** @@ -174,7 +174,10 @@ export class AccountContextImpl implements AccountContext { protected _calls?: CallListInstance; - constructor(protected _version: V2010, sid: string) { + constructor( + protected _version: V2010, + sid: string, + ) { if (!isValidPathParam(sid)) { throw new Error("Parameter 'sid' is not valid."); } @@ -190,7 +193,7 @@ export class AccountContextImpl implements AccountContext { } remove( - callback?: (error: Error | null, item?: boolean) => any + callback?: (error: Error | null, item?: boolean) => any, ): Promise { const instance = this; let operationVersion = instance._version, @@ -201,13 +204,13 @@ export class AccountContextImpl implements AccountContext { operationPromise = instance._version.setPromiseCallback( operationPromise, - callback + callback, ); return operationPromise; } fetch( - callback?: (error: Error | null, item?: AccountInstance) => any + callback?: (error: Error | null, item?: AccountInstance) => any, ): Promise { const instance = this; let operationVersion = instance._version, @@ -218,19 +221,19 @@ export class AccountContextImpl implements AccountContext { operationPromise = operationPromise.then( (payload) => - new AccountInstance(operationVersion, payload, instance._solution.sid) + new AccountInstance(operationVersion, payload, instance._solution.sid), ); operationPromise = instance._version.setPromiseCallback( operationPromise, - callback + callback, ); return operationPromise; } update( params: AccountContextUpdateOptions, - callback?: (error: Error | null, item?: AccountInstance) => any + callback?: (error: Error | null, item?: AccountInstance) => any, ): Promise { if (params === null || params === undefined) { throw new Error('Required parameter "params" missing.'); @@ -261,12 +264,12 @@ export class AccountContextImpl implements AccountContext { operationPromise = operationPromise.then( (payload) => - new AccountInstance(operationVersion, payload, instance._solution.sid) + new AccountInstance(operationVersion, payload, instance._solution.sid), ); operationPromise = instance._version.setPromiseCallback( operationPromise, - callback + callback, ); return operationPromise; } @@ -316,7 +319,7 @@ export class AccountInstance { constructor( protected _version: V2010, payload: AccountResource, - sid?: string + sid?: string, ) { this.accountSid = payload.account_sid; this.sid = payload.sid; @@ -378,7 +381,7 @@ export class AccountInstance { * @returns Resolves to processed boolean */ remove( - callback?: (error: Error | null, item?: boolean) => any + callback?: (error: Error | null, item?: boolean) => any, ): Promise { return this._proxy.remove(callback); } @@ -391,7 +394,7 @@ export class AccountInstance { * @returns Resolves to processed AccountInstance */ fetch( - callback?: (error: Error | null, item?: AccountInstance) => any + callback?: (error: Error | null, item?: AccountInstance) => any, ): Promise { return this._proxy.fetch(callback); } @@ -406,12 +409,12 @@ export class AccountInstance { */ update( params: AccountContextUpdateOptions, - callback?: (error: Error | null, item?: AccountInstance) => any + callback?: (error: Error | null, item?: AccountInstance) => any, ): Promise; update( params?: any, - callback?: (error: Error | null, item?: AccountInstance) => any + callback?: (error: Error | null, item?: AccountInstance) => any, ): Promise { return this._proxy.update(params, callback); } @@ -473,7 +476,7 @@ export interface AccountListInstance { * @returns Resolves to processed AccountInstance */ create( - callback?: (error: Error | null, item?: AccountInstance) => any + callback?: (error: Error | null, item?: AccountInstance) => any, ): Promise; /** * Create a AccountInstance @@ -485,7 +488,7 @@ export interface AccountListInstance { */ create( params: AccountListInstanceCreateOptions, - callback?: (error: Error | null, item?: AccountInstance) => any + callback?: (error: Error | null, item?: AccountInstance) => any, ): Promise; /** @@ -504,11 +507,11 @@ export interface AccountListInstance { * @param { function } [callback] - Function to process each record */ each( - callback?: (item: AccountInstance, done: (err?: Error) => void) => void + callback?: (item: AccountInstance, done: (err?: Error) => void) => void, ): void; each( params: AccountListInstanceEachOptions, - callback?: (item: AccountInstance, done: (err?: Error) => void) => void + callback?: (item: AccountInstance, done: (err?: Error) => void) => void, ): void; /** * Retrieve a single target page of AccountInstance records from the API. @@ -520,7 +523,7 @@ export interface AccountListInstance { */ getPage( targetUrl: string, - callback?: (error: Error | null, items: AccountPage) => any + callback?: (error: Error | null, items: AccountPage) => any, ): Promise; /** * Lists AccountInstance records from the API as a list. @@ -532,11 +535,11 @@ export interface AccountListInstance { * @param { function } [callback] - Callback to handle list of records */ list( - callback?: (error: Error | null, items: AccountInstance[]) => any + callback?: (error: Error | null, items: AccountInstance[]) => any, ): Promise; list( params: AccountListInstanceOptions, - callback?: (error: Error | null, items: AccountInstance[]) => any + callback?: (error: Error | null, items: AccountInstance[]) => any, ): Promise; /** * Retrieve a single page of AccountInstance records from the API. @@ -550,11 +553,11 @@ export interface AccountListInstance { * @param { function } [callback] - Callback to handle list of records */ page( - callback?: (error: Error | null, items: AccountPage) => any + callback?: (error: Error | null, items: AccountPage) => any, ): Promise; page( params: AccountListInstancePageOptions, - callback?: (error: Error | null, items: AccountPage) => any + callback?: (error: Error | null, items: AccountPage) => any, ): Promise; /** @@ -579,7 +582,7 @@ export function AccountListInstance(version: V2010): AccountListInstance { params?: | AccountListInstanceCreateOptions | ((error: Error | null, items: AccountInstance) => any), - callback?: (error: Error | null, items: AccountInstance) => any + callback?: (error: Error | null, items: AccountInstance) => any, ): Promise { if (params instanceof Function) { callback = params; @@ -595,7 +598,7 @@ export function AccountListInstance(version: V2010): AccountListInstance { if (params["recordingStatusCallbackEvent"] !== undefined) data["RecordingStatusCallbackEvent"] = serialize.map( params["recordingStatusCallbackEvent"], - (e: string) => e + (e: string) => e, ); if (params["twiml"] !== undefined) data["Twiml"] = serialize.twiml(params["twiml"]); @@ -614,12 +617,12 @@ export function AccountListInstance(version: V2010): AccountListInstance { }); operationPromise = operationPromise.then( - (payload) => new AccountInstance(operationVersion, payload) + (payload) => new AccountInstance(operationVersion, payload), ); operationPromise = instance._version.setPromiseCallback( operationPromise, - callback + callback, ); return operationPromise; }; @@ -628,7 +631,7 @@ export function AccountListInstance(version: V2010): AccountListInstance { params?: | AccountListInstancePageOptions | ((error: Error | null, items: AccountPage) => any), - callback?: (error: Error | null, items: AccountPage) => any + callback?: (error: Error | null, items: AccountPage) => any, ): Promise { if (params instanceof Function) { callback = params; @@ -645,11 +648,11 @@ export function AccountListInstance(version: V2010): AccountListInstance { data["Date.Test"] = serialize.iso8601Date(params["date.test"]); if (params["dateCreatedBefore"] !== undefined) data["DateCreated<"] = serialize.iso8601DateTime( - params["dateCreatedBefore"] + params["dateCreatedBefore"], ); if (params["dateCreatedAfter"] !== undefined) data["DateCreated>"] = serialize.iso8601DateTime( - params["dateCreatedAfter"] + params["dateCreatedAfter"], ); if (params["pageSize"] !== undefined) data["PageSize"] = params["pageSize"]; @@ -668,12 +671,12 @@ export function AccountListInstance(version: V2010): AccountListInstance { operationPromise = operationPromise.then( (payload) => - new AccountPage(operationVersion, payload, instance._solution) + new AccountPage(operationVersion, payload, instance._solution), ); operationPromise = instance._version.setPromiseCallback( operationPromise, - callback + callback, ); return operationPromise; }; @@ -682,7 +685,7 @@ export function AccountListInstance(version: V2010): AccountListInstance { instance.getPage = function getPage( targetUrl: string, - callback?: (error: Error | null, items: AccountPage) => any + callback?: (error: Error | null, items: AccountPage) => any, ): Promise { const operationPromise = instance._version._domain.twilio.request({ method: "get", @@ -691,7 +694,7 @@ export function AccountListInstance(version: V2010): AccountListInstance { let pagePromise = operationPromise.then( (payload) => - new AccountPage(instance._version, payload, instance._solution) + new AccountPage(instance._version, payload, instance._solution), ); pagePromise = instance._version.setPromiseCallback(pagePromise, callback); return pagePromise; @@ -703,7 +706,7 @@ export function AccountListInstance(version: V2010): AccountListInstance { instance[inspect.custom] = function inspectImpl( _depth: any, - options: InspectOptions + options: InspectOptions, ) { return inspect(instance.toJSON(), options); }; @@ -727,7 +730,7 @@ export class AccountPage extends Page< constructor( version: V2010, response: Response, - solution: AccountSolution + solution: AccountSolution, ) { super(version, response, solution); } diff --git a/examples/node/src/rest/api/v2010/account/call.ts b/examples/node/src/rest/api/v2010/account/call.ts index 104465870..08edabcb0 100644 --- a/examples/node/src/rest/api/v2010/account/call.ts +++ b/examples/node/src/rest/api/v2010/account/call.ts @@ -56,7 +56,7 @@ export interface CallContext { * @returns Resolves to processed boolean */ remove( - callback?: (error: Error | null, item?: boolean) => any + callback?: (error: Error | null, item?: boolean) => any, ): Promise; /** @@ -67,7 +67,7 @@ export interface CallContext { * @returns Resolves to processed CallInstance */ fetch( - callback?: (error: Error | null, item?: CallInstance) => any + callback?: (error: Error | null, item?: CallInstance) => any, ): Promise; /** @@ -89,7 +89,7 @@ export class CallContextImpl implements CallContext { constructor( protected _version: V2010, accountSid: string, - testInteger: number + testInteger: number, ) { if (!isValidPathParam(accountSid)) { throw new Error("Parameter 'accountSid' is not valid."); @@ -104,7 +104,7 @@ export class CallContextImpl implements CallContext { } remove( - callback?: (error: Error | null, item?: boolean) => any + callback?: (error: Error | null, item?: boolean) => any, ): Promise { const instance = this; let operationVersion = instance._version, @@ -115,13 +115,13 @@ export class CallContextImpl implements CallContext { operationPromise = instance._version.setPromiseCallback( operationPromise, - callback + callback, ); return operationPromise; } fetch( - callback?: (error: Error | null, item?: CallInstance) => any + callback?: (error: Error | null, item?: CallInstance) => any, ): Promise { const instance = this; let operationVersion = instance._version, @@ -136,13 +136,13 @@ export class CallContextImpl implements CallContext { operationVersion, payload, instance._solution.accountSid, - instance._solution.testInteger - ) + instance._solution.testInteger, + ), ); operationPromise = instance._version.setPromiseCallback( operationPromise, - callback + callback, ); return operationPromise; } @@ -191,7 +191,7 @@ export class CallInstance { protected _version: V2010, payload: CallResource, accountSid: string, - testInteger?: number + testInteger?: number, ) { this.accountSid = payload.account_sid; this.sid = payload.sid; @@ -247,7 +247,7 @@ export class CallInstance { new CallContextImpl( this._version, this._solution.accountSid, - this._solution.testInteger + this._solution.testInteger, ); return this._context; } @@ -260,7 +260,7 @@ export class CallInstance { * @returns Resolves to processed boolean */ remove( - callback?: (error: Error | null, item?: boolean) => any + callback?: (error: Error | null, item?: boolean) => any, ): Promise { return this._proxy.remove(callback); } @@ -273,7 +273,7 @@ export class CallInstance { * @returns Resolves to processed CallInstance */ fetch( - callback?: (error: Error | null, item?: CallInstance) => any + callback?: (error: Error | null, item?: CallInstance) => any, ): Promise { return this._proxy.fetch(callback); } @@ -335,7 +335,7 @@ export interface CallListInstance { */ create( params: CallListInstanceCreateOptions, - callback?: (error: Error | null, item?: CallInstance) => any + callback?: (error: Error | null, item?: CallInstance) => any, ): Promise; /** @@ -347,7 +347,7 @@ export interface CallListInstance { export function CallListInstance( version: V2010, - accountSid: string + accountSid: string, ): CallListInstance { if (!isValidPathParam(accountSid)) { throw new Error("Parameter 'accountSid' is not valid."); @@ -369,7 +369,7 @@ export function CallListInstance( if (!instance._feedbackCallSummary) { instance._feedbackCallSummary = FeedbackCallSummaryListInstance( instance._version, - instance._solution.accountSid + instance._solution.accountSid, ); } return instance._feedbackCallSummary; @@ -378,7 +378,7 @@ export function CallListInstance( instance.create = function create( params: CallListInstanceCreateOptions, - callback?: (error: Error | null, items: CallInstance) => any + callback?: (error: Error | null, items: CallInstance) => any, ): Promise { if (params === null || params === undefined) { throw new Error('Required parameter "params" missing.'); @@ -389,7 +389,7 @@ export function CallListInstance( params["requiredStringProperty"] === undefined ) { throw new Error( - "Required parameter \"params['requiredStringProperty']\" missing." + "Required parameter \"params['requiredStringProperty']\" missing.", ); } @@ -403,12 +403,12 @@ export function CallListInstance( if (params["testArrayOfStrings"] !== undefined) data["TestArrayOfStrings"] = serialize.map( params["testArrayOfStrings"], - (e: string) => e + (e: string) => e, ); if (params["testArrayOfUri"] !== undefined) data["TestArrayOfUri"] = serialize.map( params["testArrayOfUri"], - (e: string) => e + (e: string) => e, ); data["TestMethod"] = params["testMethod"]; @@ -429,13 +429,13 @@ export function CallListInstance( new CallInstance( operationVersion, payload, - instance._solution.accountSid - ) + instance._solution.accountSid, + ), ); operationPromise = instance._version.setPromiseCallback( operationPromise, - callback + callback, ); return operationPromise; }; @@ -446,7 +446,7 @@ export function CallListInstance( instance[inspect.custom] = function inspectImpl( _depth: any, - options: InspectOptions + options: InspectOptions, ) { return inspect(instance.toJSON(), options); }; diff --git a/examples/node/src/rest/api/v2010/account/call/feedbackCallSummary.ts b/examples/node/src/rest/api/v2010/account/call/feedbackCallSummary.ts index d61eb1877..f1edee7dc 100644 --- a/examples/node/src/rest/api/v2010/account/call/feedbackCallSummary.ts +++ b/examples/node/src/rest/api/v2010/account/call/feedbackCallSummary.ts @@ -55,7 +55,7 @@ export interface FeedbackCallSummaryContext { */ update( params: FeedbackCallSummaryContextUpdateOptions, - callback?: (error: Error | null, item?: FeedbackCallSummaryInstance) => any + callback?: (error: Error | null, item?: FeedbackCallSummaryInstance) => any, ): Promise; /** @@ -76,7 +76,11 @@ export class FeedbackCallSummaryContextImpl protected _solution: FeedbackCallSummaryContextSolution; protected _uri: string; - constructor(protected _version: V2010, accountSid: string, sid: string) { + constructor( + protected _version: V2010, + accountSid: string, + sid: string, + ) { if (!isValidPathParam(accountSid)) { throw new Error("Parameter 'accountSid' is not valid."); } @@ -91,7 +95,7 @@ export class FeedbackCallSummaryContextImpl update( params: FeedbackCallSummaryContextUpdateOptions, - callback?: (error: Error | null, item?: FeedbackCallSummaryInstance) => any + callback?: (error: Error | null, item?: FeedbackCallSummaryInstance) => any, ): Promise { if (params === null || params === undefined) { throw new Error('Required parameter "params" missing.'); @@ -132,13 +136,13 @@ export class FeedbackCallSummaryContextImpl operationVersion, payload, instance._solution.accountSid, - instance._solution.sid - ) + instance._solution.sid, + ), ); operationPromise = instance._version.setPromiseCallback( operationPromise, - callback + callback, ); return operationPromise; } @@ -187,7 +191,7 @@ export class FeedbackCallSummaryInstance { protected _version: V2010, payload: FeedbackCallSummaryResource, accountSid: string, - sid?: string + sid?: string, ) { this.accountSid = payload.account_sid; this.sid = payload.sid; @@ -240,7 +244,7 @@ export class FeedbackCallSummaryInstance { new FeedbackCallSummaryContextImpl( this._version, this._solution.accountSid, - this._solution.sid + this._solution.sid, ); return this._context; } @@ -255,12 +259,12 @@ export class FeedbackCallSummaryInstance { */ update( params: FeedbackCallSummaryContextUpdateOptions, - callback?: (error: Error | null, item?: FeedbackCallSummaryInstance) => any + callback?: (error: Error | null, item?: FeedbackCallSummaryInstance) => any, ): Promise; update( params?: any, - callback?: (error: Error | null, item?: FeedbackCallSummaryInstance) => any + callback?: (error: Error | null, item?: FeedbackCallSummaryInstance) => any, ): Promise { return this._proxy.update(params, callback); } @@ -318,7 +322,7 @@ export interface FeedbackCallSummaryListInstance { export function FeedbackCallSummaryListInstance( version: V2010, - accountSid: string + accountSid: string, ): FeedbackCallSummaryListInstance { if (!isValidPathParam(accountSid)) { throw new Error("Parameter 'accountSid' is not valid."); @@ -341,7 +345,7 @@ export function FeedbackCallSummaryListInstance( instance[inspect.custom] = function inspectImpl( _depth: any, - options: InspectOptions + options: InspectOptions, ) { return inspect(instance.toJSON(), options); }; diff --git a/examples/node/src/rest/flexApi/v1/call.ts b/examples/node/src/rest/flexApi/v1/call.ts index ff02d0fe6..578b2d70c 100644 --- a/examples/node/src/rest/flexApi/v1/call.ts +++ b/examples/node/src/rest/flexApi/v1/call.ts @@ -27,7 +27,7 @@ export interface CallContext { * @returns Resolves to processed CallInstance */ update( - callback?: (error: Error | null, item?: CallInstance) => any + callback?: (error: Error | null, item?: CallInstance) => any, ): Promise; /** @@ -45,7 +45,10 @@ export class CallContextImpl implements CallContext { protected _solution: CallContextSolution; protected _uri: string; - constructor(protected _version: V1, sid: string) { + constructor( + protected _version: V1, + sid: string, + ) { if (!isValidPathParam(sid)) { throw new Error("Parameter 'sid' is not valid."); } @@ -55,7 +58,7 @@ export class CallContextImpl implements CallContext { } update( - callback?: (error: Error | null, item?: CallInstance) => any + callback?: (error: Error | null, item?: CallInstance) => any, ): Promise { const instance = this; let operationVersion = instance._version, @@ -66,12 +69,12 @@ export class CallContextImpl implements CallContext { operationPromise = operationPromise.then( (payload) => - new CallInstance(operationVersion, payload, instance._solution.sid) + new CallInstance(operationVersion, payload, instance._solution.sid), ); operationPromise = instance._version.setPromiseCallback( operationPromise, - callback + callback, ); return operationPromise; } @@ -100,7 +103,11 @@ export class CallInstance { protected _solution: CallContextSolution; protected _context?: CallContext; - constructor(protected _version: V1, payload: CallResource, sid?: string) { + constructor( + protected _version: V1, + payload: CallResource, + sid?: string, + ) { this.sid = deserialize.integer(payload.sid); this._solution = { sid: sid || this.sid.toString() }; @@ -125,7 +132,7 @@ export class CallInstance { * @returns Resolves to processed CallInstance */ update( - callback?: (error: Error | null, item?: CallInstance) => any + callback?: (error: Error | null, item?: CallInstance) => any, ): Promise { return this._proxy.update(callback); } @@ -180,7 +187,7 @@ export function CallListInstance(version: V1): CallListInstance { instance[inspect.custom] = function inspectImpl( _depth: any, - options: InspectOptions + options: InspectOptions, ) { return inspect(instance.toJSON(), options); }; diff --git a/examples/node/src/rest/flexApi/v1/credential.ts b/examples/node/src/rest/flexApi/v1/credential.ts index 880619ae2..7cf3bf7a3 100644 --- a/examples/node/src/rest/flexApi/v1/credential.ts +++ b/examples/node/src/rest/flexApi/v1/credential.ts @@ -59,7 +59,7 @@ export function CredentialListInstance(version: V1): CredentialListInstance { get: function newCredentials() { if (!instance._newCredentials) { instance._newCredentials = NewCredentialsListInstance( - instance._version + instance._version, ); } return instance._newCredentials; @@ -72,7 +72,7 @@ export function CredentialListInstance(version: V1): CredentialListInstance { instance[inspect.custom] = function inspectImpl( _depth: any, - options: InspectOptions + options: InspectOptions, ) { return inspect(instance.toJSON(), options); }; diff --git a/examples/node/src/rest/flexApi/v1/credential/aws.ts b/examples/node/src/rest/flexApi/v1/credential/aws.ts index 9396f98f0..343e72270 100644 --- a/examples/node/src/rest/flexApi/v1/credential/aws.ts +++ b/examples/node/src/rest/flexApi/v1/credential/aws.ts @@ -77,7 +77,7 @@ export interface AwsContext { * @returns Resolves to processed boolean */ remove( - callback?: (error: Error | null, item?: boolean) => any + callback?: (error: Error | null, item?: boolean) => any, ): Promise; /** @@ -88,7 +88,7 @@ export interface AwsContext { * @returns Resolves to processed AwsInstance */ fetch( - callback?: (error: Error | null, item?: AwsInstance) => any + callback?: (error: Error | null, item?: AwsInstance) => any, ): Promise; /** @@ -99,7 +99,7 @@ export interface AwsContext { * @returns Resolves to processed AwsInstance */ update( - callback?: (error: Error | null, item?: AwsInstance) => any + callback?: (error: Error | null, item?: AwsInstance) => any, ): Promise; /** * Update a AwsInstance @@ -111,7 +111,7 @@ export interface AwsContext { */ update( params: AwsContextUpdateOptions, - callback?: (error: Error | null, item?: AwsInstance) => any + callback?: (error: Error | null, item?: AwsInstance) => any, ): Promise; /** @@ -131,7 +131,10 @@ export class AwsContextImpl implements AwsContext { protected _history?: HistoryListInstance; - constructor(protected _version: V1, sid: string) { + constructor( + protected _version: V1, + sid: string, + ) { if (!isValidPathParam(sid)) { throw new Error("Parameter 'sid' is not valid."); } @@ -147,7 +150,7 @@ export class AwsContextImpl implements AwsContext { } remove( - callback?: (error: Error | null, item?: boolean) => any + callback?: (error: Error | null, item?: boolean) => any, ): Promise { const instance = this; let operationVersion = instance._version, @@ -158,13 +161,13 @@ export class AwsContextImpl implements AwsContext { operationPromise = instance._version.setPromiseCallback( operationPromise, - callback + callback, ); return operationPromise; } fetch( - callback?: (error: Error | null, item?: AwsInstance) => any + callback?: (error: Error | null, item?: AwsInstance) => any, ): Promise { const instance = this; let operationVersion = instance._version, @@ -175,12 +178,12 @@ export class AwsContextImpl implements AwsContext { operationPromise = operationPromise.then( (payload) => - new AwsInstance(operationVersion, payload, instance._solution.sid) + new AwsInstance(operationVersion, payload, instance._solution.sid), ); operationPromise = instance._version.setPromiseCallback( operationPromise, - callback + callback, ); return operationPromise; } @@ -189,7 +192,7 @@ export class AwsContextImpl implements AwsContext { params?: | AwsContextUpdateOptions | ((error: Error | null, item?: AwsInstance) => any), - callback?: (error: Error | null, item?: AwsInstance) => any + callback?: (error: Error | null, item?: AwsInstance) => any, ): Promise { if (params instanceof Function) { callback = params; @@ -219,12 +222,12 @@ export class AwsContextImpl implements AwsContext { operationPromise = operationPromise.then( (payload) => - new AwsInstance(operationVersion, payload, instance._solution.sid) + new AwsInstance(operationVersion, payload, instance._solution.sid), ); operationPromise = instance._version.setPromiseCallback( operationPromise, - callback + callback, ); return operationPromise; } @@ -258,7 +261,11 @@ export class AwsInstance { protected _solution: AwsContextSolution; protected _context?: AwsContext; - constructor(protected _version: V1, payload: AwsResource, sid?: string) { + constructor( + protected _version: V1, + payload: AwsResource, + sid?: string, + ) { this.accountSid = payload.account_sid; this.sid = payload.sid; this.testString = payload.test_string; @@ -286,7 +293,7 @@ export class AwsInstance { * @returns Resolves to processed boolean */ remove( - callback?: (error: Error | null, item?: boolean) => any + callback?: (error: Error | null, item?: boolean) => any, ): Promise { return this._proxy.remove(callback); } @@ -299,7 +306,7 @@ export class AwsInstance { * @returns Resolves to processed AwsInstance */ fetch( - callback?: (error: Error | null, item?: AwsInstance) => any + callback?: (error: Error | null, item?: AwsInstance) => any, ): Promise { return this._proxy.fetch(callback); } @@ -312,7 +319,7 @@ export class AwsInstance { * @returns Resolves to processed AwsInstance */ update( - callback?: (error: Error | null, item?: AwsInstance) => any + callback?: (error: Error | null, item?: AwsInstance) => any, ): Promise; /** * Update a AwsInstance @@ -324,12 +331,12 @@ export class AwsInstance { */ update( params: AwsContextUpdateOptions, - callback?: (error: Error | null, item?: AwsInstance) => any + callback?: (error: Error | null, item?: AwsInstance) => any, ): Promise; update( params?: any, - callback?: (error: Error | null, item?: AwsInstance) => any + callback?: (error: Error | null, item?: AwsInstance) => any, ): Promise { return this._proxy.update(params, callback); } @@ -386,11 +393,11 @@ export interface AwsListInstance { * @param { function } [callback] - Function to process each record */ each( - callback?: (item: AwsInstance, done: (err?: Error) => void) => void + callback?: (item: AwsInstance, done: (err?: Error) => void) => void, ): void; each( params: AwsListInstanceEachOptions, - callback?: (item: AwsInstance, done: (err?: Error) => void) => void + callback?: (item: AwsInstance, done: (err?: Error) => void) => void, ): void; /** * Retrieve a single target page of AwsInstance records from the API. @@ -402,7 +409,7 @@ export interface AwsListInstance { */ getPage( targetUrl: string, - callback?: (error: Error | null, items: AwsPage) => any + callback?: (error: Error | null, items: AwsPage) => any, ): Promise; /** * Lists AwsInstance records from the API as a list. @@ -414,11 +421,11 @@ export interface AwsListInstance { * @param { function } [callback] - Callback to handle list of records */ list( - callback?: (error: Error | null, items: AwsInstance[]) => any + callback?: (error: Error | null, items: AwsInstance[]) => any, ): Promise; list( params: AwsListInstanceOptions, - callback?: (error: Error | null, items: AwsInstance[]) => any + callback?: (error: Error | null, items: AwsInstance[]) => any, ): Promise; /** * Retrieve a single page of AwsInstance records from the API. @@ -432,11 +439,11 @@ export interface AwsListInstance { * @param { function } [callback] - Callback to handle list of records */ page( - callback?: (error: Error | null, items: AwsPage) => any + callback?: (error: Error | null, items: AwsPage) => any, ): Promise; page( params: AwsListInstancePageOptions, - callback?: (error: Error | null, items: AwsPage) => any + callback?: (error: Error | null, items: AwsPage) => any, ): Promise; /** @@ -461,7 +468,7 @@ export function AwsListInstance(version: V1): AwsListInstance { params?: | AwsListInstancePageOptions | ((error: Error | null, items: AwsPage) => any), - callback?: (error: Error | null, items: AwsPage) => any + callback?: (error: Error | null, items: AwsPage) => any, ): Promise { if (params instanceof Function) { callback = params; @@ -488,12 +495,12 @@ export function AwsListInstance(version: V1): AwsListInstance { }); operationPromise = operationPromise.then( - (payload) => new AwsPage(operationVersion, payload, instance._solution) + (payload) => new AwsPage(operationVersion, payload, instance._solution), ); operationPromise = instance._version.setPromiseCallback( operationPromise, - callback + callback, ); return operationPromise; }; @@ -502,7 +509,7 @@ export function AwsListInstance(version: V1): AwsListInstance { instance.getPage = function getPage( targetUrl: string, - callback?: (error: Error | null, items: AwsPage) => any + callback?: (error: Error | null, items: AwsPage) => any, ): Promise { const operationPromise = instance._version._domain.twilio.request({ method: "get", @@ -510,7 +517,7 @@ export function AwsListInstance(version: V1): AwsListInstance { }); let pagePromise = operationPromise.then( - (payload) => new AwsPage(instance._version, payload, instance._solution) + (payload) => new AwsPage(instance._version, payload, instance._solution), ); pagePromise = instance._version.setPromiseCallback(pagePromise, callback); return pagePromise; @@ -522,7 +529,7 @@ export function AwsListInstance(version: V1): AwsListInstance { instance[inspect.custom] = function inspectImpl( _depth: any, - options: InspectOptions + options: InspectOptions, ) { return inspect(instance.toJSON(), options); }; diff --git a/examples/node/src/rest/flexApi/v1/credential/aws/history.ts b/examples/node/src/rest/flexApi/v1/credential/aws/history.ts index e6caf2e86..5905ba494 100644 --- a/examples/node/src/rest/flexApi/v1/credential/aws/history.ts +++ b/examples/node/src/rest/flexApi/v1/credential/aws/history.ts @@ -35,7 +35,7 @@ export interface HistoryContext { * @returns Resolves to processed HistoryInstance */ fetch( - callback?: (error: Error | null, item?: HistoryInstance) => any + callback?: (error: Error | null, item?: HistoryInstance) => any, ): Promise; /** * Fetch a HistoryInstance @@ -47,7 +47,7 @@ export interface HistoryContext { */ fetch( params: HistoryContextFetchOptions, - callback?: (error: Error | null, item?: HistoryInstance) => any + callback?: (error: Error | null, item?: HistoryInstance) => any, ): Promise; /** @@ -65,7 +65,10 @@ export class HistoryContextImpl implements HistoryContext { protected _solution: HistoryContextSolution; protected _uri: string; - constructor(protected _version: V1, sid: string) { + constructor( + protected _version: V1, + sid: string, + ) { if (!isValidPathParam(sid)) { throw new Error("Parameter 'sid' is not valid."); } @@ -78,7 +81,7 @@ export class HistoryContextImpl implements HistoryContext { params?: | HistoryContextFetchOptions | ((error: Error | null, item?: HistoryInstance) => any), - callback?: (error: Error | null, item?: HistoryInstance) => any + callback?: (error: Error | null, item?: HistoryInstance) => any, ): Promise { if (params instanceof Function) { callback = params; @@ -108,12 +111,12 @@ export class HistoryContextImpl implements HistoryContext { operationPromise = operationPromise.then( (payload) => - new HistoryInstance(operationVersion, payload, instance._solution.sid) + new HistoryInstance(operationVersion, payload, instance._solution.sid), ); operationPromise = instance._version.setPromiseCallback( operationPromise, - callback + callback, ); return operationPromise; } @@ -145,7 +148,11 @@ export class HistoryInstance { protected _solution: HistoryContextSolution; protected _context?: HistoryContext; - constructor(protected _version: V1, payload: HistoryResource, sid: string) { + constructor( + protected _version: V1, + payload: HistoryResource, + sid: string, + ) { this.accountSid = payload.account_sid; this.sid = payload.sid; this.testString = payload.test_string; @@ -174,7 +181,7 @@ export class HistoryInstance { * @returns Resolves to processed HistoryInstance */ fetch( - callback?: (error: Error | null, item?: HistoryInstance) => any + callback?: (error: Error | null, item?: HistoryInstance) => any, ): Promise; /** * Fetch a HistoryInstance @@ -186,12 +193,12 @@ export class HistoryInstance { */ fetch( params: HistoryContextFetchOptions, - callback?: (error: Error | null, item?: HistoryInstance) => any + callback?: (error: Error | null, item?: HistoryInstance) => any, ): Promise; fetch( params?: any, - callback?: (error: Error | null, item?: HistoryInstance) => any + callback?: (error: Error | null, item?: HistoryInstance) => any, ): Promise { return this._proxy.fetch(params, callback); } @@ -236,7 +243,7 @@ export interface HistoryListInstance { export function HistoryListInstance( version: V1, - sid: string + sid: string, ): HistoryListInstance { if (!isValidPathParam(sid)) { throw new Error("Parameter 'sid' is not valid."); @@ -258,7 +265,7 @@ export function HistoryListInstance( instance[inspect.custom] = function inspectImpl( _depth: any, - options: InspectOptions + options: InspectOptions, ) { return inspect(instance.toJSON(), options); }; diff --git a/examples/node/src/rest/flexApi/v1/credential/newCredentials.ts b/examples/node/src/rest/flexApi/v1/credential/newCredentials.ts index 179992879..0c662fd68 100644 --- a/examples/node/src/rest/flexApi/v1/credential/newCredentials.ts +++ b/examples/node/src/rest/flexApi/v1/credential/newCredentials.ts @@ -83,7 +83,7 @@ export interface NewCredentialsListInstance { */ create( params: NewCredentialsListInstanceCreateOptions, - callback?: (error: Error | null, item?: NewCredentialsInstance) => any + callback?: (error: Error | null, item?: NewCredentialsInstance) => any, ): Promise; /** @@ -94,7 +94,7 @@ export interface NewCredentialsListInstance { } export function NewCredentialsListInstance( - version: V1 + version: V1, ): NewCredentialsListInstance { const instance = {} as NewCredentialsListInstance; @@ -104,7 +104,7 @@ export function NewCredentialsListInstance( instance.create = function create( params: NewCredentialsListInstanceCreateOptions, - callback?: (error: Error | null, items: NewCredentialsInstance) => any + callback?: (error: Error | null, items: NewCredentialsInstance) => any, ): Promise { if (params === null || params === undefined) { throw new Error('Required parameter "params" missing.'); @@ -141,18 +141,18 @@ export function NewCredentialsListInstance( if (params["testObjectArray"] !== undefined) data["TestObjectArray"] = serialize.map( params["testObjectArray"], - (e: object) => e + (e: object) => e, ); if (params["testAnyType"] !== undefined) data["TestAnyType"] = serialize.object(params["testAnyType"]); if (params["testAnyArray"] !== undefined) data["TestAnyArray"] = serialize.map(params["testAnyArray"], (e: any) => - serialize.object(e) + serialize.object(e), ); if (params["permissions"] !== undefined) data["Permissions"] = serialize.map( params["permissions"], - (e: string) => e + (e: string) => e, ); if (params["someA2PThing"] !== undefined) data["SomeA2PThing"] = params["someA2PThing"]; @@ -169,12 +169,12 @@ export function NewCredentialsListInstance( }); operationPromise = operationPromise.then( - (payload) => new NewCredentialsInstance(operationVersion, payload) + (payload) => new NewCredentialsInstance(operationVersion, payload), ); operationPromise = instance._version.setPromiseCallback( operationPromise, - callback + callback, ); return operationPromise; }; @@ -185,7 +185,7 @@ export function NewCredentialsListInstance( instance[inspect.custom] = function inspectImpl( _depth: any, - options: InspectOptions + options: InspectOptions, ) { return inspect(instance.toJSON(), options); }; @@ -203,7 +203,10 @@ interface NewCredentialsResource { } export class NewCredentialsInstance { - constructor(protected _version: V1, payload: NewCredentialsResource) { + constructor( + protected _version: V1, + payload: NewCredentialsResource, + ) { this.accountSid = payload.account_sid; this.sid = payload.sid; this.testString = payload.test_string; diff --git a/examples/node/src/rest/versionless/deployed_devices/fleet.ts b/examples/node/src/rest/versionless/deployed_devices/fleet.ts index 209d81dcd..637f88887 100644 --- a/examples/node/src/rest/versionless/deployed_devices/fleet.ts +++ b/examples/node/src/rest/versionless/deployed_devices/fleet.ts @@ -35,7 +35,7 @@ export interface FleetContext { * @returns Resolves to processed FleetInstance */ fetch( - callback?: (error: Error | null, item?: FleetInstance) => any + callback?: (error: Error | null, item?: FleetInstance) => any, ): Promise; /** @@ -53,7 +53,10 @@ export class FleetContextImpl implements FleetContext { protected _solution: FleetContextSolution; protected _uri: string; - constructor(protected _version: DeployedDevices, sid: string) { + constructor( + protected _version: DeployedDevices, + sid: string, + ) { if (!isValidPathParam(sid)) { throw new Error("Parameter 'sid' is not valid."); } @@ -63,7 +66,7 @@ export class FleetContextImpl implements FleetContext { } fetch( - callback?: (error: Error | null, item?: FleetInstance) => any + callback?: (error: Error | null, item?: FleetInstance) => any, ): Promise { const instance = this; let operationVersion = instance._version, @@ -74,12 +77,12 @@ export class FleetContextImpl implements FleetContext { operationPromise = operationPromise.then( (payload) => - new FleetInstance(operationVersion, payload, instance._solution.sid) + new FleetInstance(operationVersion, payload, instance._solution.sid), ); operationPromise = instance._version.setPromiseCallback( operationPromise, - callback + callback, ); return operationPromise; } @@ -113,7 +116,7 @@ export class FleetInstance { constructor( protected _version: DeployedDevices, payload: FleetResource, - sid?: string + sid?: string, ) { this.name = payload.name; this.sid = payload.sid; @@ -146,7 +149,7 @@ export class FleetInstance { * @returns Resolves to processed FleetInstance */ fetch( - callback?: (error: Error | null, item?: FleetInstance) => any + callback?: (error: Error | null, item?: FleetInstance) => any, ): Promise { return this._proxy.fetch(callback); } @@ -187,7 +190,7 @@ export interface FleetListInstance { * @returns Resolves to processed FleetInstance */ create( - callback?: (error: Error | null, item?: FleetInstance) => any + callback?: (error: Error | null, item?: FleetInstance) => any, ): Promise; /** * Create a FleetInstance @@ -199,7 +202,7 @@ export interface FleetListInstance { */ create( params: FleetListInstanceCreateOptions, - callback?: (error: Error | null, item?: FleetInstance) => any + callback?: (error: Error | null, item?: FleetInstance) => any, ): Promise; /** @@ -224,7 +227,7 @@ export function FleetListInstance(version: DeployedDevices): FleetListInstance { params?: | FleetListInstanceCreateOptions | ((error: Error | null, items: FleetInstance) => any), - callback?: (error: Error | null, items: FleetInstance) => any + callback?: (error: Error | null, items: FleetInstance) => any, ): Promise { if (params instanceof Function) { callback = params; @@ -249,12 +252,12 @@ export function FleetListInstance(version: DeployedDevices): FleetListInstance { }); operationPromise = operationPromise.then( - (payload) => new FleetInstance(operationVersion, payload) + (payload) => new FleetInstance(operationVersion, payload), ); operationPromise = instance._version.setPromiseCallback( operationPromise, - callback + callback, ); return operationPromise; }; @@ -265,7 +268,7 @@ export function FleetListInstance(version: DeployedDevices): FleetListInstance { instance[inspect.custom] = function inspectImpl( _depth: any, - options: InspectOptions + options: InspectOptions, ) { return inspect(instance.toJSON(), options); }; diff --git a/examples/node/src/rest/versionless/understand/assistant.ts b/examples/node/src/rest/versionless/understand/assistant.ts index 930e247fe..45da858c5 100644 --- a/examples/node/src/rest/versionless/understand/assistant.ts +++ b/examples/node/src/rest/versionless/understand/assistant.ts @@ -79,11 +79,11 @@ export interface AssistantListInstance { * @param { function } [callback] - Function to process each record */ each( - callback?: (item: AssistantInstance, done: (err?: Error) => void) => void + callback?: (item: AssistantInstance, done: (err?: Error) => void) => void, ): void; each( params: AssistantListInstanceEachOptions, - callback?: (item: AssistantInstance, done: (err?: Error) => void) => void + callback?: (item: AssistantInstance, done: (err?: Error) => void) => void, ): void; /** * Retrieve a single target page of AssistantInstance records from the API. @@ -95,7 +95,7 @@ export interface AssistantListInstance { */ getPage( targetUrl: string, - callback?: (error: Error | null, items: AssistantPage) => any + callback?: (error: Error | null, items: AssistantPage) => any, ): Promise; /** * Lists AssistantInstance records from the API as a list. @@ -107,11 +107,11 @@ export interface AssistantListInstance { * @param { function } [callback] - Callback to handle list of records */ list( - callback?: (error: Error | null, items: AssistantInstance[]) => any + callback?: (error: Error | null, items: AssistantInstance[]) => any, ): Promise; list( params: AssistantListInstanceOptions, - callback?: (error: Error | null, items: AssistantInstance[]) => any + callback?: (error: Error | null, items: AssistantInstance[]) => any, ): Promise; /** * Retrieve a single page of AssistantInstance records from the API. @@ -125,11 +125,11 @@ export interface AssistantListInstance { * @param { function } [callback] - Callback to handle list of records */ page( - callback?: (error: Error | null, items: AssistantPage) => any + callback?: (error: Error | null, items: AssistantPage) => any, ): Promise; page( params: AssistantListInstancePageOptions, - callback?: (error: Error | null, items: AssistantPage) => any + callback?: (error: Error | null, items: AssistantPage) => any, ): Promise; /** @@ -140,7 +140,7 @@ export interface AssistantListInstance { } export function AssistantListInstance( - version: Understand + version: Understand, ): AssistantListInstance { const instance = {} as AssistantListInstance; @@ -152,7 +152,7 @@ export function AssistantListInstance( params?: | AssistantListInstancePageOptions | ((error: Error | null, items: AssistantPage) => any), - callback?: (error: Error | null, items: AssistantPage) => any + callback?: (error: Error | null, items: AssistantPage) => any, ): Promise { if (params instanceof Function) { callback = params; @@ -180,12 +180,12 @@ export function AssistantListInstance( operationPromise = operationPromise.then( (payload) => - new AssistantPage(operationVersion, payload, instance._solution) + new AssistantPage(operationVersion, payload, instance._solution), ); operationPromise = instance._version.setPromiseCallback( operationPromise, - callback + callback, ); return operationPromise; }; @@ -194,7 +194,7 @@ export function AssistantListInstance( instance.getPage = function getPage( targetUrl: string, - callback?: (error: Error | null, items: AssistantPage) => any + callback?: (error: Error | null, items: AssistantPage) => any, ): Promise { const operationPromise = instance._version._domain.twilio.request({ method: "get", @@ -203,7 +203,7 @@ export function AssistantListInstance( let pagePromise = operationPromise.then( (payload) => - new AssistantPage(instance._version, payload, instance._solution) + new AssistantPage(instance._version, payload, instance._solution), ); pagePromise = instance._version.setPromiseCallback(pagePromise, callback); return pagePromise; @@ -215,7 +215,7 @@ export function AssistantListInstance( instance[inspect.custom] = function inspectImpl( _depth: any, - options: InspectOptions + options: InspectOptions, ) { return inspect(instance.toJSON(), options); }; @@ -233,7 +233,10 @@ interface AssistantResource { } export class AssistantInstance { - constructor(protected _version: Understand, payload: AssistantResource) { + constructor( + protected _version: Understand, + payload: AssistantResource, + ) { this.sid = payload.sid; this.friendlyName = payload.friendly_name; } @@ -280,7 +283,7 @@ export class AssistantPage extends Page< constructor( version: Understand, response: Response, - solution: AssistantSolution + solution: AssistantSolution, ) { super(version, response, solution); } diff --git a/examples/ruby/lib/twilio-ruby/rest/api/v2010/account.rb b/examples/ruby/lib/twilio-ruby/rest/api/v2010/account.rb index 54b988d8f..011e1c849 100644 --- a/examples/ruby/lib/twilio-ruby/rest/api/v2010/account.rb +++ b/examples/ruby/lib/twilio-ruby/rest/api/v2010/account.rb @@ -143,15 +143,10 @@ def each def page(date_created: :unset, date_test: :unset, date_created_before: :unset, date_created_after: :unset, page_token: :unset, page_number: :unset, page_size: :unset) params = Twilio::Values.of({ - 'DateCreated' => Twilio.serialize_iso8601_datetime(date_created), - 'Date.Test' => Twilio.serialize_iso8601_date(date_test), - 'DateCreated<' => Twilio.serialize_iso8601_datetime(date_created_before), - 'DateCreated>' => Twilio.serialize_iso8601_datetime(date_created_after), - 'PageToken' => page_token, 'Page' => page_number, 'PageSize' => page_size, diff --git a/examples/ruby/lib/twilio-ruby/rest/flex_api/v1/credential/aws.rb b/examples/ruby/lib/twilio-ruby/rest/flex_api/v1/credential/aws.rb index 2acdbf143..c02d7120b 100644 --- a/examples/ruby/lib/twilio-ruby/rest/flex_api/v1/credential/aws.rb +++ b/examples/ruby/lib/twilio-ruby/rest/flex_api/v1/credential/aws.rb @@ -91,7 +91,6 @@ def each # @return [Page] Page of AwsInstance def page(page_token: :unset, page_number: :unset, page_size: :unset) params = Twilio::Values.of({ - 'PageToken' => page_token, 'Page' => page_number, 'PageSize' => page_size, diff --git a/examples/ruby/lib/twilio-ruby/rest/versionless/understand/assistant.rb b/examples/ruby/lib/twilio-ruby/rest/versionless/understand/assistant.rb index 997f18541..279b9a648 100644 --- a/examples/ruby/lib/twilio-ruby/rest/versionless/understand/assistant.rb +++ b/examples/ruby/lib/twilio-ruby/rest/versionless/understand/assistant.rb @@ -90,7 +90,6 @@ def each # @return [Page] Page of AssistantInstance def page(page_token: :unset, page_number: :unset, page_size: :unset) params = Twilio::Values.of({ - 'PageToken' => page_token, 'Page' => page_number, 'PageSize' => page_size, diff --git a/src/main/java/com/twilio/oai/common/ApplicationConstants.java b/src/main/java/com/twilio/oai/common/ApplicationConstants.java index b4af490f3..f01446327 100644 --- a/src/main/java/com/twilio/oai/common/ApplicationConstants.java +++ b/src/main/java/com/twilio/oai/common/ApplicationConstants.java @@ -41,6 +41,7 @@ public class ApplicationConstants { public static final String PROMOTION_EXTENSION_NAME = "x-promotions"; public static final String VENDOR_PREFIX = "x-"; public static final String SERIALIZE_VEND_EXT = "x-serialize"; + public static final String IS_SERIALIZE_LIST_EXT = "isList"; public static final String DESERIALIZE_VEND_EXT = "x-deserialize"; public static final String ENUM = "Enum"; public static final String RESOURCE = "Resource"; diff --git a/src/main/java/com/twilio/oai/resolver/ruby/RubyParameterResolver.java b/src/main/java/com/twilio/oai/resolver/ruby/RubyParameterResolver.java index 1bba6f73d..983e4fe86 100644 --- a/src/main/java/com/twilio/oai/resolver/ruby/RubyParameterResolver.java +++ b/src/main/java/com/twilio/oai/resolver/ruby/RubyParameterResolver.java @@ -9,6 +9,7 @@ import java.util.List; import static com.twilio.oai.common.ApplicationConstants.SERIALIZE_VEND_EXT; +import static com.twilio.oai.common.ApplicationConstants.IS_SERIALIZE_LIST_EXT; public class RubyParameterResolver extends LanguageParamResolver { public static final String ARRAY_OF_OBJECT = "Array[Object]"; @@ -25,6 +26,7 @@ public CodegenParameter resolve(final CodegenParameter codegenParameter, ApiReso codegenParameter.dataType = codegenParameter.dataType.replaceAll("<", "["); codegenParameter.dataType = codegenParameter.dataType.replaceAll(">", "]"); codegenParameter.vendorExtensions.put(SERIALIZE_VEND_EXT, "Twilio.serialize_list"); + codegenParameter.vendorExtensions.put(IS_SERIALIZE_LIST_EXT, "true"); } if (codegenParameter.dataType.equals("Time")) { codegenParameter.vendorExtensions.put(SERIALIZE_VEND_EXT, "Twilio.serialize_iso8601_datetime"); diff --git a/src/main/resources/twilio-ruby/list.mustache b/src/main/resources/twilio-ruby/list.mustache index b8524c81e..6a1ebafc5 100644 --- a/src/main/resources/twilio-ruby/list.mustache +++ b/src/main/resources/twilio-ruby/list.mustache @@ -101,12 +101,10 @@ # @return [Page] Page of {{apiName}}Instance def page({{#readParams.0}}{{#readParams}}{{>params}}{{/readParams}}, {{/readParams.0}}page_token: :unset, page_number: :unset, page_size: :unset) params = Twilio::Values.of({ - {{#readParams}}{{^vendorExtensions.x-serialize}} - '{{{baseName}}}' => {{paramName}}, - {{/vendorExtensions.x-serialize}}{{#vendorExtensions.x-serialize}} - '{{{baseName}}}' => {{vendorExtensions.x-serialize}}({{paramName}}), - {{/vendorExtensions.x-serialize}}{{/readParams}} - 'PageToken' => page_token, + {{#readParams}}{{^vendorExtensions.x-serialize}}'{{{baseName}}}' => {{paramName}}, + {{/vendorExtensions.x-serialize}}{{#vendorExtensions.x-serialize}}{{^vendorExtensions.isList}}'{{{baseName}}}' => {{vendorExtensions.x-serialize}}({{paramName}}),{{/vendorExtensions.isList}} + {{#vendorExtensions.isList}}'{{{baseName}}}' => {{vendorExtensions.x-serialize}}({{paramName}}) { |e| e }, + {{/vendorExtensions.isList}}{{/vendorExtensions.x-serialize}}{{/readParams}}'PageToken' => page_token, 'Page' => page_number, 'PageSize' => page_size, })