Skip to content

Commit

Permalink
chore: read accountSid from default in node
Browse files Browse the repository at this point in the history
  • Loading branch information
tiwarishubham635 committed Aug 12, 2024
1 parent 29b271a commit 1749980
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/resources/twilio-node/api-single.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export interface {{apiName}}ListInstance {
[inspect.custom](_depth: any, options: InspectOptions): any;
}

export function {{apiName}}ListInstance(version: {{apiVersionClass}}{{#listPathParams}}, {{paramName}}{{#vendorExtensions.x-is-account-sid}}?{{/vendorExtensions.x-is-account-sid}}: {{{dataType}}}{{/listPathParams}}): {{apiName}}ListInstance {
export function {{apiName}}ListInstance(version: {{apiVersionClass}}{{#listPathParams}}{{^vendorExtensions.x-is-account-sid}}, {{paramName}}: {{{dataType}}}{{/vendorExtensions.x-is-account-sid}}{{/listPathParams}}{{#listPathParams}}{{#vendorExtensions.x-is-account-sid}}, {{paramName}}?: {{{dataType}}}{{/vendorExtensions.x-is-account-sid}}{{/listPathParams}}): {{apiName}}ListInstance {
{{#listPathParams}}
{{#vendorExtensions.x-is-account-sid}}
accountSid = accountSid || version.domain.twilio.accountSid;
Expand All @@ -157,13 +157,15 @@ export function {{apiName}}ListInstance(version: {{apiVersionClass}}{{#listPathP
{{/listPathParams}}

{{#instancePath}}
{{^listPath}}
{{^listPathParams}}
{{#instancePathParams}}
{{#vendorExtensions.x-is-account-sid}}
const accountSid = version.domain.twilio.accountSid;
{{/vendorExtensions.x-is-account-sid}}
{{/instancePathParams}}
{{/listPathParams}}
{{/listPath}}
const instance = (({{#instancePathParams}}{{^vendorExtensions.x-is-parent-param}}{{paramName}}, {{/vendorExtensions.x-is-parent-param}}{{/instancePathParams}}) => instance.get({{#instancePathParams}}{{^vendorExtensions.x-is-parent-param}}{{paramName}}, {{/vendorExtensions.x-is-parent-param}}{{/instancePathParams}})) as {{apiName}}ListInstance;

instance.get = function get({{#instancePathParams}}{{^vendorExtensions.x-is-parent-param}}{{paramName}}, {{/vendorExtensions.x-is-parent-param}}{{/instancePathParams}}): {{apiName}}Context {
Expand Down

0 comments on commit 1749980

Please sign in to comment.