8000 add custom HTTP header support · twilio/twilio-python@e09be9c · GitHub
[go: up one dir, main page]

Skip to content

Commit e09be9c

Browse files
committed
add custom HTTP header support
1 parent dd8a2d0 commit e09be9c

File tree

316 files changed

+3602
-7185
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

316 files changed

+3602
-7185
lines changed

twilio/rest/accounts/v1/credential/aws.py

Lines changed: 14 additions & 32 deletions
-
'GET',
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,9 @@ def page(self, page_token=values.unset, page_number=values.unset,
8686
:returns: Page of AwsInstance
8787
:rtype: twilio.rest.accounts.v1.credential.aws.AwsPage
8888
"""
89-
params = values.of({'PageToken': page_token, 'Page': page_number, 'PageSize': page_size, })
89+
data = values.of({'PageToken': page_token, 'Page': page_number, 'PageSize': page_size, })
9090

91-
response = self._version.page(
92
93-
self._uri,
94-
params=params,
95-
)
91+
response = self._version.page(method='GET', uri=self._uri, params=data, )
9692

9793
return AwsPage(self._version, response, self._solution)
9894

@@ -116,13 +112,13 @@ def get_page(self, target_url):
116112
def create(self, credentials, friendly_name=values.unset,
117113
account_sid=values.unset):
118114
"""
119-
Create a new AwsInstance
115+
Create the AwsInstance
120116
121117
:param unicode credentials: A string that contains the AWS access credentials in the format <AWS_ACCESS_KEY_ID>:<AWS_SECRET_ACCESS_KEY>
122118
:param unicode friendly_name: A string to describe the resource
123119
:param unicode account_sid: The Subaccount this Credential should be associated with.
124120
125-
:returns: Newly created AwsInstance
121+
:returns: The created AwsInstance
126122
:rtype: twilio.rest.accounts.v1.credential.aws.AwsInstance
127123
"""
128124
data = values.of({
@@ -131,11 +127,7 @@ def create(self, credentials, friendly_name=values.unset,
131127
'AccountSid': account_sid,
132128
})
133129

134-
payload = self._version.create(
135-
'POST',
136-
self._uri,
137-
data=data,
138-
)
130+
payload = self._version.create(method='POST', uri=self._uri, data=data, )
139131

140132
return AwsInstance(self._version, payload, )
141133

@@ -231,18 +223,12 @@ def __init__(self, version, sid):
231223

232224
def fetch(self):
233225
"""
234-
Fetch a AwsInstance
226+
Fetch the AwsInstance
235227
236-
:returns: Fetched AwsInstance
228+
:returns: The fetched AwsInstance
237229
:rtype: twilio.rest.accounts.v1.credential.aws.AwsInstance
238230
"""
239-
params = values.of({})
240-
241-
payload = self._version.fetch(
242-
'GET',
243-
self._uri,
244-
params=params,
245-
)
231+
payload = self._version.fetch(method='GET', uri=self._uri, )
246232

247233
return AwsInstance(self._version, payload, sid=self._solution['sid'], )
248234

@@ -252,16 +238,12 @@ def update(self, friendly_name=values.unset):
252238
253239
:param unicode friendly_name: A string to describe the resource
254240
255-
:returns: Updated AwsInstance
241+
:returns: The updated AwsInstance
256242
:rtype: twilio.rest.accounts.v1.credential.aws.AwsInstance
257243
"""
258244
data = values.of({'FriendlyName': friendly_name, })
259245

260-
payload = self._version.update(
261-
'POST',
262-
self._uri,
263-
data=data,
264-
)
246+
payload = self._version.update(method='POST', uri=self._uri, data=data, )
265247

266248
return AwsInstance(self._version, payload, sid=self._solution['sid'], )
267249

@@ -272,7 +254,7 @@ def delete(self):
272254
:returns: True if delete succeeds, False otherwise
273255
:rtype: bool
274256
"""
275-
return self._version.delete('delete', self._uri)
257+
return self._version.delete(method='DELETE', uri=self._uri, )
276258

277259
def __repr__(self):
278260
"""
@@ -374,9 +356,9 @@ def url(self):
374356

375357
def fetch(self):
376358
"""
377-
Fetch a AwsInstance
359+
Fetch the AwsInstance
378360
379-
:returns: Fetched AwsInstance
361+
:returns: The fetched AwsInstance
380362
:rtype: twilio.rest.accounts.v1.credential.aws.AwsInstance
381363
"""
382364
return self._proxy.fetch()
@@ -387,7 +369,7 @@ def update(self, friendly_name=values.unset):
387369
388370
:param unicode friendly_name: A string to describe the resource
389371
390-
:returns: Updated AwsInstance
372+
:returns: The updated AwsInstance
391373
:rtype: twilio.rest.accounts.v1.credential.aws.AwsInstance
392374
"""
393375
return self._proxy.update(friendly_name=friendly_name, )

twilio/rest/accounts/v1/credential/public_key.py

Lines changed: 14 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,9 @@ def page(self, page_token=values.unset, page_number=values.unset,
8686
:returns: Page of PublicKeyInstance
8787
:rtype: twilio.rest.accounts.v1.credential.public_key.PublicKeyPage
8888
"""
89-
params = values.of({'PageToken': page_token, 'Page': page_number, 'PageSize': page_size, })
89+
data = values.of({'PageToken': page_token, 'Page': page_number, 'PageSize': page_size, })
9090

91-
response = self._version.page(
92-
'GET',
93-
self._uri,
94-
params=params,
95-
)
91+
response = self._version.page(method='GET', uri=self._uri, params=data, )
9692

9793
return PublicKeyPage(self._version, response, self._solution)
9894

@@ -116,13 +112,13 @@ def get_page(self, target_url):
116112
def create(self, public_key, friendly_name=values.unset,
117113
account_sid=values.unset):
118114
"""
119-
Create a new PublicKeyInstance
115+
Create the PublicKeyInstance
120116
121117
:param unicode public_key: A URL encoded representation of the public key
122118
:param unicode friendly_name: A string to describe the resource
123119
:param unicode account_sid: The Subaccount this Credential should be associated with.
124120
125-
:returns: Newly created PublicKeyInstance
121+
:returns: The created PublicKeyInstance
126122
:rtype: twilio.rest.accounts.v1.credential.public_key.PublicKeyInstance
127123
"""
128124
data = values.of({
@@ -131,11 +127,7 @@ def create(self, public_key, friendly_name=values.unset,
131127
'AccountSid': account_sid,
132128
})
133129

134-
payload = self._version.create(
135-
'POST',
136-
self._uri,
137-
data=data,
138-
)
130+
payload = self._version.create(method='POST', uri=self._uri, data=data, )
139131

140132
return PublicKeyInstance(self._version, payload, )
141133

@@ -231,18 +223,12 @@ def __init__(self, version, sid):
231223

232224
def fetch(self):
233225
"""
234-
Fetch a PublicKeyInstance
226+
Fetch the PublicKeyInstance
235227
236-
:returns: Fetched PublicKeyInstance
228+
:returns: The fetched PublicKeyInstance
237229
:rtype: twilio.rest.accounts.v1.credential.public_key.PublicKeyInstance
238230
"""
239-
params = values.of({})
240-
241-
payload = self._version.fetch(
242-
'GET',
243-
self._uri,
244-
params=params,
245-
)
231+
payload = self._version.fetch(method='GET', uri=self._uri, )
246232

247233
return PublicKeyInstance(self._version, payload, sid=self._solution['sid'], )
248234

@@ -252,16 +238,12 @@ def update(self, friendly_name=values.unset):
252238
253239
:param unicode friendly_name: A string to describe the resource
254240
255-
:returns: Updated PublicKeyInstance
241+
:returns: The updated PublicKeyInstance
256242
:rtype: twilio.rest.accounts.v1.credential.public_key.PublicKeyInstance
257243
"""
258244
data = values.of({'FriendlyName': friendly_name, })
259245

260-
payload = self._version.update(
261-
'POST',
262-
self._uri,
263-
data=data,
264-
)
246+
payload = self._version.update(method='POST', uri=self._uri, data=data, )
265247

266248
return PublicKeyInstance(self._version, payload, sid=self._solution['sid'], )
267249

@@ -272,7 +254,7 @@ def delete(self):
272254
:returns: True if delete succeeds, False otherwise
273255
:rtype: bool
274256
"""
275-
return self._version.delete('delete', self._uri)
257+
return self._version.delete(method='DELETE', uri=self._uri, )
276258

277259
def __repr__(self):
278260
"""
@@ -374,9 +356,9 @@ def url(self):
374356

375357
def fetch(self):
376358
"""
377-
Fetch a PublicKeyInstance
359+
Fetch the PublicKeyInstance
378360
379-
:returns: Fetched PublicKeyInstance
361+
:returns: The fetched PublicKeyInstance
380362
:rtype: twilio.rest.accounts.v1.credential.public_key.PublicKeyInstance
381363
"""
382364
return self._proxy.fetch()
@@ -387,7 +369,7 @@ def update(self, friendly_name=values.unset):
387369
388370
:param unicode friendly_name: A string to describe the resource
389371
390-
:returns: Updated PublicKeyInstance
372+
:returns: The updated PublicKeyInstance
391373
:rtype: twilio.rest.accounts.v1.credential.public_key.PublicKeyInstance
392374
"""
393375
return self._proxy.update(friendly_name=friendly_name, )

twilio/rest/api/v2010/account/__init__.py

Lines changed: 13 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,16 @@ def __init__(self, version):
5858

5959
def create(self, friendly_name=values.unset):
6060
"""
61-
Create a new AccountInstance
61+
Create the AccountInstance
6262
6363
:param unicode friendly_name: A human readable description of the account
6464
65-
:returns: Newly created AccountInstance
65+
:returns: The created AccountInstance
6666
:rtype: twilio.rest.api.v2010.account.AccountInstance
6767
"""
6868
data = values.of({'FriendlyName': friendly_name, })
6969

70-
payload = self._version.create(
71-
'POST',
72-
self._uri,
73-
data=data,
74-
)
70+
payload = self._version.create(method='POST', uri=self._uri, data=data, )
7571

7672
return AccountInstance(self._version, payload, )
7773

@@ -143,19 +139,15 @@ def page(self, friendly_name=values.unset, status=values.unset,
143139
:returns: Page of AccountInstance
144140
:rtype: twilio.rest.api.v2010.account.AccountPage
145141
"""
146-
params = values.of({
142+
data = values.of({
147143
'FriendlyName': friendly_name,
148144
'Status': status,
149145
'PageToken': page_token,
150146
'Page': page_number,
151147
'PageSize': page_size,
152148
})
153149

154-
response = self._version.page(
155-
'GET',
156-
self._uri,
157-
params=params,
158-
)
150+
response = self._version.page(method='GET', uri=self._uri, params=data, )
159151

160152
return AccountPage(self._version, response, self._solution)
161153

@@ -294,18 +286,12 @@ def __init__(self, version, sid):
294286

295287
def fetch(self):
296288
"""
297-
Fetch a AccountInstance
289+
Fetch the AccountInstance
298290
299-
:returns: Fetched AccountInstance
291+
:returns: The fetched AccountInstance
300292
:rtype: twilio.rest.api.v2010.account.AccountInstance
301293
"""
302-
params = values.of({})
303-
304-
payload = self._version.fetch(
305-
'GET',
306-
self._uri,
307-
params=params,
308-
)
294+
payload = self._version.fetch(method='GET', uri=self._uri, )
309295

310296
return AccountInstance(self._version, payload, sid=self._solution['sid'], )
311297

@@ -316,16 +302,12 @@ def update(self, friendly_name=values.unset, status=values.unset):
316302
:param unicode friendly_name: FriendlyName to update
317303
:param AccountInstance.Status status: Status to update the Account with
318304
319-
:returns: Updated AccountInstance
305+
:returns: The updated AccountInstance
320306
:rtype: twilio.rest.api.v2010.account.AccountInstance
321307
"""
322308
data = values.of({'FriendlyName': friendly_name, 'Status': status, })
323309

324-
payload = self._version.update(
325-
'POST',
326-
self._uri,
327-
data=data,
328-
)
310+
payload = self._version.update(method='POST', uri=self._uri, data=data, )
329311

330312
return AccountInstance(self._version, payload, sid=self._solution['sid'], )
331313

@@ -771,9 +753,9 @@ def uri(self):
771753

772754
def fetch(self):
773755
"""
774-
Fetch a AccountInstance
756+
Fetch the AccountInstance
775757
776-
:returns: Fetched AccountInstance
758+
:returns: The fetched AccountInstance
777759
:rtype: twilio.rest.api.v2010.account.AccountInstance
778760
"""
779761
return self._proxy.fetch()
@@ -785,7 +767,7 @@ def update(self, friendly_name=values.unset, status=values.unset):
785767
:param unicode friendly_name: FriendlyName to update
786768
:param AccountInstance.Status status: Status to update the Account with
787769
788-
:returns: Updated AccountInstance
770+
:returns: The updated AccountInstance
789771
:rtype: twilio.rest.api.v2010.account.AccountInstance
790772
"""
791773
return self._proxy.update(friendly_name=friendly_name, status=status, )

0 commit comments

Comments
 (0)
0