Skip to content

Commit

Permalink
orgs api changes for python
Browse files Browse the repository at this point in the history
  • Loading branch information
AsabuHere committed Dec 4, 2024
1 parent c19fe84 commit caec301
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions src/main/resources/twilio-python/listOperations.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,18 @@
'PageSize': page_size,
})

response = self._version.page(method='{{vendorExtensions.x-http-method}}', uri=self._uri, params=data)
headers = values.of({
{{#headerParams}}'{{{baseName}}}': {{paramName}},
{{/headerParams}}'Content-Type': 'application/x-www-form-urlencoded'
})
{{#consumes}}
headers["Content-Type"] = "{{{mediaType}}}"
{{/consumes}}
{{#produces}}
headers["Accept"] = "{{{mediaType}}}"
{{/produces}}

response = self._version.page(method='{{vendorExtensions.x-http-method}}', uri=self._uri, params=data, headers=headers)
return {{apiName}}Page(self._version, response{{#if listPathParams}}, self._solution{{/if}})

async def page_async(self, {{#allParams}}
Expand All @@ -381,7 +392,18 @@
'PageSize': page_size,
})

response = await self._version.page_async(method='{{vendorExtensions.x-http-method}}', uri=self._uri, params=data)
headers = values.of({
{{#headerParams}}'{{{baseName}}}': {{paramName}},
{{/headerParams}}'Content-Type': 'application/x-www-form-urlencoded'
})
{{#consumes}}
headers["Content-Type"] = "{{{mediaType}}}"
{{/consumes}}
{{#produces}}
headers["Accept"] = "{{{mediaType}}}"
{{/produces}}

response = await self._version.page_async(method='{{vendorExtensions.x-http-method}}', uri=self._uri, params=data, headers=headers)
return {{apiName}}Page(self._version, response{{#if listPathParams}}, self._solution{{/if}})

def get_page(self, target_url: str) -> {{apiName}}Page:
Expand Down

0 comments on commit caec301

Please sign in to comment.