Skip to content

Commit

Permalink
Fixing header parameter issues in twilio-python
Browse files Browse the repository at this point in the history
  • Loading branch information
AsabuHere committed Dec 3, 2024
1 parent f9896d9 commit 240484d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/resources/twilio-python/context.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ class {{apiName}}Context(InstanceContext):
data = values.of({ {{#allParams}}{{#isFormParam}}
'{{{baseName}}}': {{#if vendorExtensions.x-serialize}}{{vendorExtensions.x-serialize}}({{paramName}}{{#if isArray}}, lambda e: e){{else}}){{/if}}{{else}}{{paramName}}{{/if}},{{/isFormParam}}{{/allParams}}
})
{{#allParams}}{{^isFormParam}}headers = values.of({'{{{baseName}}}': {{paramName}}, }){{/isFormParam}}{{/allParams}}
{{#allParams}}{{#isHeaderParam}}headers = values.of({'{{{baseName}}}': {{paramName}}, }){{/isHeaderParam}}{{/allParams}}

payload = self._version.update(method='{{vendorExtensions.x-http-method}}', uri=self._uri, data=data,{{#allParams}}{{#if isFormParam}}{{else}} headers=headers{{/if}}{{/allParams}})
payload = self._version.update(method='{{vendorExtensions.x-http-method}}', uri=self._uri, data=data,{{#allParams}}{{#if isFormParam}}{{else}}{{#if isHeaderParam}} headers=headers{{/if}}{{/if}}{{/allParams}})

return {{instanceName}}(
self._version,
Expand All @@ -51,9 +51,9 @@ class {{apiName}}Context(InstanceContext):
data = values.of({ {{#allParams}}{{#isFormParam}}
'{{{baseName}}}': {{#if vendorExtensions.x-serialize}}{{vendorExtensions.x-serialize}}({{paramName}}{{#if isArray}}, lambda e: e){{else}}){{/if}}{{else}}{{paramName}}{{/if}},{{/isFormParam}}{{/allParams}}
})
{{#allParams}}{{^isFormParam}}headers = values.of({'{{{baseName}}}': {{paramName}}, }){{/isFormParam}}{{/allParams}}
{{#allParams}}{{#isHeaderParam}}headers = values.of({'{{{baseName}}}': {{paramName}}, }){{/isHeaderParam}}{{/allParams}}

payload = await self._version.update_async(method='{{vendorExtensions.x-http-method}}', uri=self._uri, data=data,{{#allParams}}{{#if isFormParam}}{{else}} headers=headers{{/if}}{{/allParams}})
payload = await self._version.update_async(method='{{vendorExtensions.x-http-method}}', uri=self._uri, data=data,{{#allParams}}{{#if isFormParam}}{{else}}{{#if isHeaderParam}} headers=headers{{/if}}{{/if}}{{/allParams}})

return {{instanceName}}(
self._version,
Expand Down

0 comments on commit 240484d

Please sign in to comment.