diff --git a/tests/holodeck.py b/tests/holodeck.py index 066125b89c..b0390a3064 100644 --- a/tests/holodeck.py +++ b/tests/holodeck.py @@ -1,6 +1,8 @@ from twilio.base.exceptions import TwilioRestException from twilio.http import HttpClient from twilio.http.request import Request +import platform +from twilio import __version__ class Hologram(object): @@ -24,9 +26,26 @@ def mock(self, response, request=None): def requests(self): return self._requests + def add_standard_headers(self, request): + standard_headers = { + 'User-Agent': 'twilio-python/{} (Python {})'.format( + __version__, + platform.python_version()), + 'X-Twilio-Client': 'python-{}'.format(__version__), + 'Accept': 'application/json', + 'Accept-Charset': 'utf-8' + } + + if request.method == 'POST' and 'Content-Type' not in standard_headers: + standard_headers['Content-Type'] = 'application/x-www-form-urlencoded' + + standard_headers.update(request.headers) + request.headers = standard_headers + return request + def assert_has_request(self, request): for req in self.requests: - if req == request: + if req == request or req == self.add_standard_headers(request): return message = '\nHolodeck never received a request matching: \n + {}\n'.format(request) diff --git a/tests/integration/authy/v1/service/entity/factor/test_challenge.py b/tests/integration/authy/v1/service/entity/factor/test_challenge.py index a35bdbadbe..1eeeaf5663 100644 --- a/tests/integration/authy/v1/service/entity/factor/test_challenge.py +++ b/tests/integration/authy/v1/service/entity/factor/test_challenge.py @@ -21,11 +21,13 @@ def test_create_request(self): self.client.authy.v1.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ .entities(identity="identity") \ .factors(sid="YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ - .challenges.create() + .challenges.create(twilio_authy_sandbox_mode="twilio_authy_sandbox_mode") + headers = {'Twilio-Authy-Sandbox-Mode': "twilio_authy_sandbox_mode", } self.holodeck.assert_has_request(Request( 'post', 'https://authy.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Entities/identity/Factors/YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Challenges', + headers=headers, )) def test_create_response(self): @@ -68,11 +70,13 @@ def test_delete_request(self): self.client.authy.v1.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ .entities(identity="identity") \ .factors(sid="YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ - .challenges(sid="sid").delete() + .challenges(sid="sid").delete(twilio_authy_sandbox_mode="twilio_authy_sandbox_mode") + headers = {'Twilio-Authy-Sandbox-Mode': "twilio_authy_sandbox_mode", } self.holodeck.assert_has_request(Request( 'delete', 'https://authy.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Entities/identity/Factors/YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Challenges/sid', + headers=headers, )) def test_delete_response(self): @@ -95,11 +99,13 @@ def test_fetch_request(self): self.client.authy.v1.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ .entities(identity="identity") \ .factors(sid="YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ - .challenges(sid="sid").fetch() + .challenges(sid="sid").fetch(twilio_authy_sandbox_mode="twilio_authy_sandbox_mode") + headers = {'Twilio-Authy-Sandbox-Mode': "twilio_authy_sandbox_mode", } self.holodeck.assert_has_request(Request( 'get', 'https://authy.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Entities/identity/Factors/YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Challenges/sid', + headers=headers, )) def test_fetch_sid_response(self): @@ -175,11 +181,13 @@ def test_update_request(self): self.client.authy.v1.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ .entities(identity="identity") \ .factors(sid="YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ - .challenges(sid="sid").update() + .challenges(sid="sid").update(twilio_authy_sandbox_mode="twilio_authy_sandbox_mode") + headers = {'Twilio-Authy-Sandbox-Mode': "twilio_authy_sandbox_mode", } self.holodeck.assert_has_request(Request( 'post', 'https://authy.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Entities/identity/Factors/YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Challenges/sid', + headers=headers, )) def test_verify_sid_response(self): diff --git a/tests/integration/authy/v1/service/entity/test_factor.py b/tests/integration/authy/v1/service/entity/test_factor.py index 9653bbae3c..22675f3136 100644 --- a/tests/integration/authy/v1/service/entity/test_factor.py +++ b/tests/integration/authy/v1/service/entity/test_factor.py @@ -20,10 +20,16 @@ def test_create_request(self): with self.assertRaises(TwilioException): self.client.authy.v1.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ .entities(identity="identity") \ - .factors.create(binding="binding", friendly_name="friendly_name", factor_type="app-push") + .factors.create(binding="binding", friendly_name="friendly_name", factor_type="app-push", twilio_authy_sandbox_mode="twilio_authy_sandbox_mode") values = {'Binding': "binding", 'FriendlyName': "friendly_name", 'FactorType': "app-push", } + headers = {'Twilio-Authy-Sandbox-Mode': "twilio_authy_sandbox_mode", } + self.holodeck.assert_has_request(Request( + 'post', + 'https://authy.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Entities/identity/Factors', + headers=headers, + )) self.holodeck.assert_has_request(Request( 'post', 'https://authy.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Entities/identity/Factors', @@ -66,11 +72,13 @@ def test_delete_request(self): with self.assertRaises(TwilioException): self.client.authy.v1.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ .entities(identity="identity") \ - .factors(sid="YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").delete() + .factors(sid="YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").delete(twilio_authy_sandbox_mode="twilio_authy_sandbox_mode") + headers = {'Twilio-Authy-Sandbox-Mode': "twilio_authy_sandbox_mode", } self.holodeck.assert_has_request(Request( 'delete', 'https://authy.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Entities/identity/Factors/YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + headers=headers, )) def test_delete_response(self): @@ -91,11 +99,13 @@ def test_fetch_request(self): with self.assertRaises(TwilioException): self.client.authy.v1.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ .entities(identity="identity") \ - .factors(sid="YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").fetch() + .factors(sid="YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").fetch(twilio_authy_sandbox_mode="twilio_authy_sandbox_mode") + headers = {'Twilio-Authy-Sandbox-Mode': "twilio_authy_sandbox_mode", } self.holodeck.assert_has_request(Request( 'get', 'https://authy.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Entities/identity/Factors/YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + headers=headers, )) def test_fetch_response(self): @@ -134,11 +144,13 @@ def test_list_request(self): with self.assertRaises(TwilioException): self.client.authy.v1.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ .entities(identity="identity") \ - .factors.list() + .factors.list(twilio_authy_sandbox_mode="twilio_authy_sandbox_mode") + headers = {'Twilio-Authy-Sandbox-Mode': "twilio_authy_sandbox_mode", } self.holodeck.assert_has_request(Request( 'get', 'https://authy.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Entities/identity/Factors', + headers=headers, )) def test_read_empty_response(self): @@ -215,11 +227,13 @@ def test_update_request(self): with self.assertRaises(TwilioException): self.client.authy.v1.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ .entities(identity="identity") \ - .factors(sid="YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").update() + .factors(sid="YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").update(twilio_authy_sandbox_mode="twilio_authy_sandbox_mode") + headers = {'Twilio-Authy-Sandbox-Mode': "twilio_authy_sandbox_mode", } self.holodeck.assert_has_request(Request( 'post', 'https://authy.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Entities/identity/Factors/YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + headers=headers, )) def test_verify_response(self): diff --git a/tests/integration/authy/v1/service/test_entity.py b/tests/integration/authy/v1/service/test_entity.py index d4f7a7e51f..1698224ad2 100644 --- a/tests/integration/authy/v1/service/test_entity.py +++ b/tests/integration/authy/v1/service/test_entity.py @@ -19,10 +19,16 @@ def test_create_request(self): with self.assertRaises(TwilioException): self.client.authy.v1.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ - .entities.create(identity="identity") + .entities.create(identity="identity", twilio_authy_sandbox_mode="twilio_authy_sandbox_mode") values = {'Identity': "identity", } + headers = {'Twilio-Authy-Sandbox-Mode': "twilio_authy_sandbox_mode", } + self.holodeck.assert_has_request(Request( + 'post', + 'https://authy.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Entities', + headers=headers, + )) self.holodeck.assert_has_request(Request( 'post', 'https://authy.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Entities', @@ -58,11 +64,13 @@ def test_delete_request(self): with self.assertRaises(TwilioException): self.client.authy.v1.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ - .entities(identity="identity").delete() + .entities(identity="identity").delete(twilio_authy_sandbox_mode="twilio_authy_sandbox_mode") + headers = {'Twilio-Authy-Sandbox-Mode': "twilio_authy_sandbox_mode", } self.holodeck.assert_has_request(Request( 'delete', 'https://authy.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Entities/identity', + headers=headers, )) def test_delete_response(self): @@ -81,11 +89,13 @@ def test_fetch_request(self): with self.assertRaises(TwilioException): self.client.authy.v1.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ - .entities(identity="identity").fetch() + .entities(identity="identity").fetch(twilio_authy_sandbox_mode="twilio_authy_sandbox_mode") + headers = {'Twilio-Authy-Sandbox-Mode': "twilio_authy_sandbox_mode", } self.holodeck.assert_has_request(Request( 'get', 'https://authy.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Entities/identity', + headers=headers, )) def test_fetch_response(self): @@ -117,11 +127,13 @@ def test_list_request(self): with self.assertRaises(TwilioException): self.client.authy.v1.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ - .entities.list() + .entities.list(twilio_authy_sandbox_mode="twilio_authy_sandbox_mode") + headers = {'Twilio-Authy-Sandbox-Mode': "twilio_authy_sandbox_mode", } self.holodeck.assert_has_request(Request( 'get', 'https://authy.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Entities', + headers=headers, )) def test_read_empty_response(self): diff --git a/tests/integration/authy/v1/test_service.py b/tests/integration/authy/v1/test_service.py index 7630df21ed..8e31cb292a 100644 --- a/tests/integration/authy/v1/test_service.py +++ b/tests/integration/authy/v1/test_service.py @@ -18,10 +18,16 @@ def test_create_request(self): self.holodeck.mock(Response(500, '')) with self.assertRaises(TwilioException): - self.client.authy.v1.services.create(friendly_name="friendly_name") + self.client.authy.v1.services.create(friendly_name="friendly_name", twilio_authy_sandbox_mode="twilio_authy_sandbox_mode") values = {'FriendlyName': "friendly_name", } + headers = {'Twilio-Authy-Sandbox-Mode': "twilio_authy_sandbox_mode", } + self.holodeck.assert_has_request(Request( + 'post', + 'https://authy.twilio.com/v1/Services', + headers=headers, + )) self.holodeck.assert_has_request(Request( 'post', 'https://authy.twilio.com/v1/Services', @@ -54,11 +60,13 @@ def test_delete_request(self): self.holodeck.mock(Response(500, '')) with self.assertRaises(TwilioException): - self.client.authy.v1.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").delete() + self.client.authy.v1.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").delete(twilio_authy_sandbox_mode="twilio_authy_sandbox_mode") + headers = {'Twilio-Authy-Sandbox-Mode': "twilio_authy_sandbox_mode", } self.holodeck.assert_has_request(Request( 'delete', 'https://authy.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + headers=headers, )) def test_delete_response(self): @@ -75,11 +83,13 @@ def test_fetch_request(self): self.holodeck.mock(Response(500, '')) with self.assertRaises(TwilioException): - self.client.authy.v1.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").fetch() + self.client.authy.v1.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").fetch(twilio_authy_sandbox_mode="twilio_authy_sandbox_mode") + headers = {'Twilio-Authy-Sandbox-Mode': "twilio_authy_sandbox_mode", } self.holodeck.assert_has_request(Request( 'get', 'https://authy.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + headers=headers, )) def test_fetch_response(self): @@ -108,11 +118,13 @@ def test_list_request(self): self.holodeck.mock(Response(500, '')) with self.assertRaises(TwilioException): - self.client.authy.v1.services.list() + self.client.authy.v1.services.list(twilio_authy_sandbox_mode="twilio_authy_sandbox_mode") + headers = {'Twilio-Authy-Sandbox-Mode': "twilio_authy_sandbox_mode", } self.holodeck.assert_has_request(Request( 'get', 'https://authy.twilio.com/v1/Services', + headers=headers, )) def test_read_empty_response(self): @@ -177,11 +189,13 @@ def test_update_request(self): self.holodeck.mock(Response(500, '')) with self.assertRaises(TwilioException): - self.client.authy.v1.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").update() + self.client.authy.v1.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").update(twilio_authy_sandbox_mode="twilio_authy_sandbox_mode") + headers = {'Twilio-Authy-Sandbox-Mode': "twilio_authy_sandbox_mode", } self.holodeck.assert_has_request(Request( 'post', 'https://authy.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + headers=headers, )) def test_update_response(self): diff --git a/tests/integration/chat/v2/service/channel/test_member.py b/tests/integration/chat/v2/service/channel/test_member.py index 6951024fec..f8e898b810 100644 --- a/tests/integration/chat/v2/service/channel/test_member.py +++ b/tests/integration/chat/v2/service/channel/test_member.py @@ -60,10 +60,16 @@ def test_create_request(self): with self.assertRaises(TwilioException): self.client.chat.v2.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ .channels(sid="CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ - .members.create(identity="identity") + .members.create(identity="identity", x_twilio_webhook_enabled="true") values = {'Identity': "identity", } + headers = {'X-Twilio-Webhook-Enabled': "true", } + self.holodeck.assert_has_request(Request( + 'post', + 'https://chat.twilio.com/v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Members', + headers=headers, + )) self.holodeck.assert_has_request(Request( 'post', 'https://chat.twilio.com/v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Members', @@ -181,11 +187,13 @@ def test_delete_request(self): with self.assertRaises(TwilioException): self.client.chat.v2.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ .channels(sid="CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ - .members(sid="MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").delete() + .members(sid="MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").delete(x_twilio_webhook_enabled="true") + headers = {'X-Twilio-Webhook-Enabled': "true", } self.holodeck.assert_has_request(Request( 'delete', 'https://chat.twilio.com/v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Members/MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + headers=headers, )) def test_delete_response(self): @@ -206,11 +214,13 @@ def test_update_request(self): with self.assertRaises(TwilioException): self.client.chat.v2.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ .channels(sid="CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ - .members(sid="MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").update() + .members(sid="MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").update(x_twilio_webhook_enabled="true") + headers = {'X-Twilio-Webhook-Enabled': "true", } self.holodeck.assert_has_request(Request( 'post', 'https://chat.twilio.com/v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Members/MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + headers=headers, )) def test_update_role_sid_response(self): diff --git a/tests/integration/chat/v2/service/channel/test_message.py b/tests/integration/chat/v2/service/channel/test_message.py index 4a8e84c95b..a3ccf36091 100644 --- a/tests/integration/chat/v2/service/channel/test_message.py +++ b/tests/integration/chat/v2/service/channel/test_message.py @@ -100,11 +100,13 @@ def test_create_request(self): with self.assertRaises(TwilioException): self.client.chat.v2.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ .channels(sid="CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ - .messages.create() + .messages.create(x_twilio_webhook_enabled="true") + headers = {'X-Twilio-Webhook-Enabled': "true", } self.holodeck.assert_has_request(Request( 'post', 'https://chat.twilio.com/v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Messages', + headers=headers, )) def test_create_response(self): @@ -316,11 +318,13 @@ def test_delete_request(self): with self.assertRaises(TwilioException): self.client.chat.v2.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ .channels(sid="CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ - .messages(sid="IMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").delete() + .messages(sid="IMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").delete(x_twilio_webhook_enabled="true") + headers = {'X-Twilio-Webhook-Enabled': "true", } self.holodeck.assert_has_request(Request( 'delete', 'https://chat.twilio.com/v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Messages/IMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + headers=headers, )) def test_delete_response(self): @@ -341,11 +345,13 @@ def test_update_request(self): with self.assertRaises(TwilioException): self.client.chat.v2.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ .channels(sid="CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ - .messages(sid="IMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").update() + .messages(sid="IMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").update(x_twilio_webhook_enabled="true") + headers = {'X-Twilio-Webhook-Enabled': "true", } self.holodeck.assert_has_request(Request( 'post', 'https://chat.twilio.com/v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Messages/IMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + headers=headers, )) def test_update_response(self): diff --git a/tests/integration/chat/v2/service/test_channel.py b/tests/integration/chat/v2/service/test_channel.py index 863460c20d..6c69bf061e 100644 --- a/tests/integration/chat/v2/service/test_channel.py +++ b/tests/integration/chat/v2/service/test_channel.py @@ -65,11 +65,13 @@ def test_delete_request(self): with self.assertRaises(TwilioException): self.client.chat.v2.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ - .channels(sid="CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").delete() + .channels(sid="CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").delete(x_twilio_webhook_enabled="true") + headers = {'X-Twilio-Webhook-Enabled': "true", } self.holodeck.assert_has_request(Request( 'delete', 'https://chat.twilio.com/v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + headers=headers, )) def test_delete_response(self): @@ -88,11 +90,13 @@ def test_create_request(self): with self.assertRaises(TwilioException): self.client.chat.v2.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ - .channels.create() + .channels.create(x_twilio_webhook_enabled="true") + headers = {'X-Twilio-Webhook-Enabled': "true", } self.holodeck.assert_has_request(Request( 'post', 'https://chat.twilio.com/v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels', + headers=headers, )) def test_create_response(self): @@ -217,11 +221,13 @@ def test_update_request(self): with self.assertRaises(TwilioException): self.client.chat.v2.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ - .channels(sid="CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").update() + .channels(sid="CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").update(x_twilio_webhook_enabled="true") + headers = {'X-Twilio-Webhook-Enabled': "true", } self.holodeck.assert_has_request(Request( 'post', 'https://chat.twilio.com/v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + headers=headers, )) def test_update_response(self): diff --git a/tests/integration/chat/v2/service/test_user.py b/tests/integration/chat/v2/service/test_user.py index 87ce21fd31..feb089fde4 100644 --- a/tests/integration/chat/v2/service/test_user.py +++ b/tests/integration/chat/v2/service/test_user.py @@ -85,10 +85,16 @@ def test_create_request(self): with self.assertRaises(TwilioException): self.client.chat.v2.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ - .users.create(identity="identity") + .users.create(identity="identity", x_twilio_webhook_enabled="true") values = {'Identity': "identity", } + headers = {'X-Twilio-Webhook-Enabled': "true", } + self.holodeck.assert_has_request(Request( + 'post', + 'https://chat.twilio.com/v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Users', + headers=headers, + )) self.holodeck.assert_has_request(Request( 'post', 'https://chat.twilio.com/v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Users', @@ -211,11 +217,13 @@ def test_update_request(self): with self.assertRaises(TwilioException): self.client.chat.v2.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ - .users(sid="USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").update() + .users(sid="USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").update(x_twilio_webhook_enabled="true") + headers = {'X-Twilio-Webhook-Enabled': "true", } self.holodeck.assert_has_request(Request( 'post', 'https://chat.twilio.com/v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Users/USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + headers=headers, )) def test_update_response(self): diff --git a/tests/integration/conversations/v1/conversation/test_message.py b/tests/integration/conversations/v1/conversation/test_message.py index 52dae96aa8..3bbf2779d9 100644 --- a/tests/integration/conversations/v1/conversation/test_message.py +++ b/tests/integration/conversations/v1/conversation/test_message.py @@ -19,11 +19,13 @@ def test_create_request(self): with self.assertRaises(TwilioException): self.client.conversations.v1.conversations(sid="CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ - .messages.create() + .messages.create(x_twilio_webhook_enabled="true") + headers = {'X-Twilio-Webhook-Enabled': "true", } self.holodeck.assert_has_request(Request( 'post', 'https://conversations.twilio.com/v1/Conversations/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Messages', + headers=headers, )) def test_create_response(self): @@ -88,11 +90,13 @@ def test_update_request(self): with self.assertRaises(TwilioException): self.client.conversations.v1.conversations(sid="CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ - .messages(sid="IMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").update() + .messages(sid="IMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").update(x_twilio_webhook_enabled="true") + headers = {'X-Twilio-Webhook-Enabled': "true", } self.holodeck.assert_has_request(Request( 'post', 'https://conversations.twilio.com/v1/Conversations/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Messages/IMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + headers=headers, )) def test_update_response(self): @@ -125,11 +129,13 @@ def test_delete_request(self): with self.assertRaises(TwilioException): self.client.conversations.v1.conversations(sid="CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ - .messages(sid="IMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").delete() + .messages(sid="IMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").delete(x_twilio_webhook_enabled="true") + headers = {'X-Twilio-Webhook-Enabled': "true", } self.holodeck.assert_has_request(Request( 'delete', 'https://conversations.twilio.com/v1/Conversations/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Messages/IMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + headers=headers, )) def test_delete_response(self): diff --git a/tests/integration/conversations/v1/conversation/test_participant.py b/tests/integration/conversations/v1/conversation/test_participant.py index 6df77b73ca..9975d60501 100644 --- a/tests/integration/conversations/v1/conversation/test_participant.py +++ b/tests/integration/conversations/v1/conversation/test_participant.py @@ -19,11 +19,13 @@ def test_create_request(self): with self.assertRaises(TwilioException): self.client.conversations.v1.conversations(sid="CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ - .participants.create() + .participants.create(x_twilio_webhook_enabled="true") + headers = {'X-Twilio-Webhook-Enabled': "true", } self.holodeck.assert_has_request(Request( 'post', 'https://conversations.twilio.com/v1/Conversations/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Participants', + headers=headers, )) def test_create_sms_response(self): @@ -107,11 +109,13 @@ def test_update_request(self): with self.assertRaises(TwilioException): self.client.conversations.v1.conversations(sid="CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ - .participants(sid="MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").update() + .participants(sid="MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").update(x_twilio_webhook_enabled="true") + headers = {'X-Twilio-Webhook-Enabled': "true", } self.holodeck.assert_has_request(Request( 'post', 'https://conversations.twilio.com/v1/Conversations/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Participants/MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + headers=headers, )) def test_update_response(self): @@ -146,11 +150,13 @@ def test_delete_request(self): with self.assertRaises(TwilioException): self.client.conversations.v1.conversations(sid="CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ - .participants(sid="MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").delete() + .participants(sid="MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").delete(x_twilio_webhook_enabled="true") + headers = {'X-Twilio-Webhook-Enabled': "true", } self.holodeck.assert_has_request(Request( 'delete', 'https://conversations.twilio.com/v1/Conversations/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Participants/MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + headers=headers, )) def test_delete_response(self): diff --git a/tests/integration/conversations/v1/test_conversation.py b/tests/integration/conversations/v1/test_conversation.py index a019b16321..d09a3f08b3 100644 --- a/tests/integration/conversations/v1/test_conversation.py +++ b/tests/integration/conversations/v1/test_conversation.py @@ -18,11 +18,13 @@ def test_create_request(self): self.holodeck.mock(Response(500, '')) with self.assertRaises(TwilioException): - self.client.conversations.v1.conversations.create() + self.client.conversations.v1.conversations.create(x_twilio_webhook_enabled="true") + headers = {'X-Twilio-Webhook-Enabled': "true", } self.holodeck.assert_has_request(Request( 'post', 'https://conversations.twilio.com/v1/Conversations', + headers=headers, )) def test_create_response(self): @@ -56,11 +58,13 @@ def test_update_request(self): self.holodeck.mock(Response(500, '')) with self.assertRaises(TwilioException): - self.client.conversations.v1.conversations(sid="CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").update() + self.client.conversations.v1.conversations(sid="CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").update(x_twilio_webhook_enabled="true") + headers = {'X-Twilio-Webhook-Enabled': "true", } self.holodeck.assert_has_request(Request( 'post', 'https://conversations.twilio.com/v1/Conversations/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + headers=headers, )) def test_update_response(self): @@ -94,11 +98,13 @@ def test_delete_request(self): self.holodeck.mock(Response(500, '')) with self.assertRaises(TwilioException): - self.client.conversations.v1.conversations(sid="CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").delete() + self.client.conversations.v1.conversations(sid="CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").delete(x_twilio_webhook_enabled="true") + headers = {'X-Twilio-Webhook-Enabled': "true", } self.holodeck.assert_has_request(Request( 'delete', 'https://conversations.twilio.com/v1/Conversations/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + headers=headers, )) def test_delete_response(self): diff --git a/tests/integration/ip_messaging/v2/service/channel/test_member.py b/tests/integration/ip_messaging/v2/service/channel/test_member.py index db7976e10f..e7d39e1f5c 100644 --- a/tests/integration/ip_messaging/v2/service/channel/test_member.py +++ b/tests/integration/ip_messaging/v2/service/channel/test_member.py @@ -60,10 +60,16 @@ def test_create_request(self): with self.assertRaises(TwilioException): self.client.ip_messaging.v2.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ .channels(sid="CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ - .members.create(identity="identity") + .members.create(identity="identity", x_twilio_webhook_enabled="true") values = {'Identity': "identity", } + headers = {'X-Twilio-Webhook-Enabled': "true", } + self.holodeck.assert_has_request(Request( + 'post', + 'https://chat.twilio.com/v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Members', + headers=headers, + )) self.holodeck.assert_has_request(Request( 'post', 'https://chat.twilio.com/v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Members', @@ -181,11 +187,13 @@ def test_delete_request(self): with self.assertRaises(TwilioException): self.client.ip_messaging.v2.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ .channels(sid="CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ - .members(sid="MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").delete() + .members(sid="MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").delete(x_twilio_webhook_enabled="true") + headers = {'X-Twilio-Webhook-Enabled': "true", } self.holodeck.assert_has_request(Request( 'delete', 'https://chat.twilio.com/v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Members/MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + headers=headers, )) def test_delete_response(self): @@ -206,11 +214,13 @@ def test_update_request(self): with self.assertRaises(TwilioException): self.client.ip_messaging.v2.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ .channels(sid="CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ - .members(sid="MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").update() + .members(sid="MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").update(x_twilio_webhook_enabled="true") + headers = {'X-Twilio-Webhook-Enabled': "true", } self.holodeck.assert_has_request(Request( 'post', 'https://chat.twilio.com/v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Members/MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + headers=headers, )) def test_update_role_sid_response(self): diff --git a/tests/integration/ip_messaging/v2/service/channel/test_message.py b/tests/integration/ip_messaging/v2/service/channel/test_message.py index 46fb977b07..bf1af77780 100644 --- a/tests/integration/ip_messaging/v2/service/channel/test_message.py +++ b/tests/integration/ip_messaging/v2/service/channel/test_message.py @@ -100,11 +100,13 @@ def test_create_request(self): with self.assertRaises(TwilioException): self.client.ip_messaging.v2.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ .channels(sid="CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ - .messages.create() + .messages.create(x_twilio_webhook_enabled="true") + headers = {'X-Twilio-Webhook-Enabled': "true", } self.holodeck.assert_has_request(Request( 'post', 'https://chat.twilio.com/v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Messages', + headers=headers, )) def test_create_response(self): @@ -316,11 +318,13 @@ def test_delete_request(self): with self.assertRaises(TwilioException): self.client.ip_messaging.v2.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ .channels(sid="CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ - .messages(sid="IMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").delete() + .messages(sid="IMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").delete(x_twilio_webhook_enabled="true") + headers = {'X-Twilio-Webhook-Enabled': "true", } self.holodeck.assert_has_request(Request( 'delete', 'https://chat.twilio.com/v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Messages/IMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + headers=headers, )) def test_delete_response(self): @@ -341,11 +345,13 @@ def test_update_request(self): with self.assertRaises(TwilioException): self.client.ip_messaging.v2.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ .channels(sid="CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ - .messages(sid="IMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").update() + .messages(sid="IMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").update(x_twilio_webhook_enabled="true") + headers = {'X-Twilio-Webhook-Enabled': "true", } self.holodeck.assert_has_request(Request( 'post', 'https://chat.twilio.com/v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Messages/IMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + headers=headers, )) def test_update_response(self): diff --git a/tests/integration/ip_messaging/v2/service/test_channel.py b/tests/integration/ip_messaging/v2/service/test_channel.py index bcd453a8df..67701d6a75 100644 --- a/tests/integration/ip_messaging/v2/service/test_channel.py +++ b/tests/integration/ip_messaging/v2/service/test_channel.py @@ -65,11 +65,13 @@ def test_delete_request(self): with self.assertRaises(TwilioException): self.client.ip_messaging.v2.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ - .channels(sid="CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").delete() + .channels(sid="CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").delete(x_twilio_webhook_enabled="true") + headers = {'X-Twilio-Webhook-Enabled': "true", } self.holodeck.assert_has_request(Request( 'delete', 'https://chat.twilio.com/v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + headers=headers, )) def test_delete_response(self): @@ -88,11 +90,13 @@ def test_create_request(self): with self.assertRaises(TwilioException): self.client.ip_messaging.v2.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ - .channels.create() + .channels.create(x_twilio_webhook_enabled="true") + headers = {'X-Twilio-Webhook-Enabled': "true", } self.holodeck.assert_has_request(Request( 'post', 'https://chat.twilio.com/v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels', + headers=headers, )) def test_create_response(self): @@ -217,11 +221,13 @@ def test_update_request(self): with self.assertRaises(TwilioException): self.client.ip_messaging.v2.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ - .channels(sid="CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").update() + .channels(sid="CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").update(x_twilio_webhook_enabled="true") + headers = {'X-Twilio-Webhook-Enabled': "true", } self.holodeck.assert_has_request(Request( 'post', 'https://chat.twilio.com/v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + headers=headers, )) def test_update_response(self): diff --git a/tests/integration/ip_messaging/v2/service/test_user.py b/tests/integration/ip_messaging/v2/service/test_user.py index 18a4dd739a..e5b107b8c6 100644 --- a/tests/integration/ip_messaging/v2/service/test_user.py +++ b/tests/integration/ip_messaging/v2/service/test_user.py @@ -85,10 +85,16 @@ def test_create_request(self): with self.assertRaises(TwilioException): self.client.ip_messaging.v2.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ - .users.create(identity="identity") + .users.create(identity="identity", x_twilio_webhook_enabled="true") values = {'Identity': "identity", } + headers = {'X-Twilio-Webhook-Enabled': "true", } + self.holodeck.assert_has_request(Request( + 'post', + 'https://chat.twilio.com/v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Users', + headers=headers, + )) self.holodeck.assert_has_request(Request( 'post', 'https://chat.twilio.com/v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Users', @@ -211,11 +217,13 @@ def test_update_request(self): with self.assertRaises(TwilioException): self.client.ip_messaging.v2.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ - .users(sid="USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").update() + .users(sid="USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").update(x_twilio_webhook_enabled="true") + headers = {'X-Twilio-Webhook-Enabled': "true", } self.holodeck.assert_has_request(Request( 'post', 'https://chat.twilio.com/v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Users/USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + headers=headers, )) def test_update_response(self): diff --git a/tests/integration/preview/sync/service/sync_list/test_sync_list_item.py b/tests/integration/preview/sync/service/sync_list/test_sync_list_item.py index 5ebb704ca7..9b3c95bacb 100644 --- a/tests/integration/preview/sync/service/sync_list/test_sync_list_item.py +++ b/tests/integration/preview/sync/service/sync_list/test_sync_list_item.py @@ -59,11 +59,13 @@ def test_delete_request(self): with self.assertRaises(TwilioException): self.client.preview.sync.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ .sync_lists(sid="ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ - .sync_list_items(index=1).delete() + .sync_list_items(index=1).delete(if_match="if_match") + headers = {'If-Match': "if_match", } self.holodeck.assert_has_request(Request( 'delete', 'https://preview.twilio.com/Sync/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Lists/ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Items/1', + headers=headers, )) def test_delete_response(self): @@ -201,10 +203,16 @@ def test_update_request(self): with self.assertRaises(TwilioException): self.client.preview.sync.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ .sync_lists(sid="ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ - .sync_list_items(index=1).update(data={}) + .sync_list_items(index=1).update(data={}, if_match="if_match") values = {'Data': serialize.object({}), } + headers = {'If-Match': "if_match", } + self.holodeck.assert_has_request(Request( + 'post', + 'https://preview.twilio.com/Sync/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Lists/ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Items/1', + headers=headers, + )) self.holodeck.assert_has_request(Request( 'post', 'https://preview.twilio.com/Sync/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Lists/ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Items/1', diff --git a/tests/integration/preview/sync/service/sync_map/test_sync_map_item.py b/tests/integration/preview/sync/service/sync_map/test_sync_map_item.py index 42022ebf1d..d31b7df5ab 100644 --- a/tests/integration/preview/sync/service/sync_map/test_sync_map_item.py +++ b/tests/integration/preview/sync/service/sync_map/test_sync_map_item.py @@ -59,11 +59,13 @@ def test_delete_request(self): with self.assertRaises(TwilioException): self.client.preview.sync.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ .sync_maps(sid="MPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ - .sync_map_items(key="key").delete() + .sync_map_items(key="key").delete(if_match="if_match") + headers = {'If-Match': "if_match", } self.holodeck.assert_has_request(Request( 'delete', 'https://preview.twilio.com/Sync/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Maps/MPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Items/key', + headers=headers, )) def test_delete_response(self): @@ -201,10 +203,16 @@ def test_update_request(self): with self.assertRaises(TwilioException): self.client.preview.sync.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ .sync_maps(sid="MPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ - .sync_map_items(key="key").update(data={}) + .sync_map_items(key="key").update(data={}, if_match="if_match") values = {'Data': serialize.object({}), } + headers = {'If-Match': "if_match", } + self.holodeck.assert_has_request(Request( + 'post', + 'https://preview.twilio.com/Sync/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Maps/MPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Items/key', + headers=headers, + )) self.holodeck.assert_has_request(Request( 'post', 'https://preview.twilio.com/Sync/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Maps/MPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Items/key', diff --git a/tests/integration/preview/sync/service/test_document.py b/tests/integration/preview/sync/service/test_document.py index e601f21903..d94bcbd7d2 100644 --- a/tests/integration/preview/sync/service/test_document.py +++ b/tests/integration/preview/sync/service/test_document.py @@ -59,11 +59,13 @@ def test_delete_request(self): with self.assertRaises(TwilioException): self.client.preview.sync.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ - .documents(sid="ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").delete() + .documents(sid="ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").delete(if_match="if_match") + headers = {'If-Match': "if_match", } self.holodeck.assert_has_request(Request( 'delete', 'https://preview.twilio.com/Sync/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Documents/ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + headers=headers, )) def test_delete_response(self): @@ -197,10 +199,16 @@ def test_update_request(self): with self.assertRaises(TwilioException): self.client.preview.sync.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ - .documents(sid="ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").update(data={}) + .documents(sid="ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").update(data={}, if_match="if_match") values = {'Data': serialize.object({}), } + headers = {'If-Match': "if_match", } + self.holodeck.assert_has_request(Request( + 'post', + 'https://preview.twilio.com/Sync/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Documents/ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + headers=headers, + )) self.holodeck.assert_has_request(Request( 'post', 'https://preview.twilio.com/Sync/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Documents/ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', diff --git a/tests/integration/preview/trusted_comms/test_branded_call.py b/tests/integration/preview/trusted_comms/test_branded_call.py index 24ada8d72e..f1bcd7b54a 100644 --- a/tests/integration/preview/trusted_comms/test_branded_call.py +++ b/tests/integration/preview/trusted_comms/test_branded_call.py @@ -18,10 +18,16 @@ def test_create_request(self): self.holodeck.mock(Response(500, '')) with self.assertRaises(TwilioException): - self.client.preview.trusted_comms.branded_calls.create(from_="from", to="to", reason="reason") + self.client.preview.trusted_comms.branded_calls.create(from_="from", to="to", reason="reason", twilio_sandbox_mode="twilio_sandbox_mode") values = {'From': "from", 'To': "to", 'Reason': "reason", } + headers = {'Twilio-Sandbox-Mode': "twilio_sandbox_mode", } + self.holodeck.assert_has_request(Request( + 'post', + 'https://preview.twilio.com/TrustedComms/Business/BrandedCalls', + headers=headers, + )) self.holodeck.assert_has_request(Request( 'post', 'https://preview.twilio.com/TrustedComms/Business/BrandedCalls', diff --git a/tests/integration/preview/trusted_comms/test_cps.py b/tests/integration/preview/trusted_comms/test_cps.py index 3188193b12..277cec1d3d 100644 --- a/tests/integration/preview/trusted_comms/test_cps.py +++ b/tests/integration/preview/trusted_comms/test_cps.py @@ -18,11 +18,16 @@ def test_fetch_request(self): self.holodeck.mock(Response(500, '')) with self.assertRaises(TwilioException): - self.client.preview.trusted_comms.cps().fetch() + self.client.preview.trusted_comms.cps().fetch(twilio_sandbox_mode="twilio_sandbox_mode", x_xcnam_sensitive_phone_number="x_xcnam_sensitive_phone_number") + headers = { + 'Twilio-Sandbox-Mode': "twilio_sandbox_mode", + 'X-Xcnam-Sensitive-Phone-Number': "x_xcnam_sensitive_phone_number", + } self.holodeck.assert_has_request(Request( 'get', 'https://preview.twilio.com/TrustedComms/CPS', + headers=headers, )) def test_fetch_response(self): diff --git a/tests/integration/preview/trusted_comms/test_current_call.py b/tests/integration/preview/trusted_comms/test_current_call.py index f25a817171..c82d53275c 100644 --- a/tests/integration/preview/trusted_comms/test_current_call.py +++ b/tests/integration/preview/trusted_comms/test_current_call.py @@ -18,11 +18,17 @@ def test_fetch_request(self): self.holodeck.mock(Response(500, '')) with self.assertRaises(TwilioException): - self.client.preview.trusted_comms.current_calls().fetch() + self.client.preview.trusted_comms.current_calls().fetch(twilio_sandbox_mode="twilio_sandbox_mode", x_xcnam_sensitive_phone_number_from="x_xcnam_sensitive_phone_number_from", x_xcnam_sensitive_phone_number_to="x_xcnam_sensitive_phone_number_to") + headers = { + 'Twilio-Sandbox-Mode': "twilio_sandbox_mode", + 'X-Xcnam-Sensitive-Phone-Number-From': "x_xcnam_sensitive_phone_number_from", + 'X-Xcnam-Sensitive-Phone-Number-To': "x_xcnam_sensitive_phone_number_to", + } self.holodeck.assert_has_request(Request( 'get', 'https://preview.twilio.com/TrustedComms/CurrentCall', + headers=headers, )) def test_read_found_response(self): diff --git a/tests/integration/preview/trusted_comms/test_device.py b/tests/integration/preview/trusted_comms/test_device.py index 66a5866b82..bc0253aa09 100644 --- a/tests/integration/preview/trusted_comms/test_device.py +++ b/tests/integration/preview/trusted_comms/test_device.py @@ -18,10 +18,16 @@ def test_create_request(self): self.holodeck.mock(Response(500, '')) with self.assertRaises(TwilioException): - self.client.preview.trusted_comms.devices.create(phone_number="phone_number", push_token="push_token") + self.client.preview.trusted_comms.devices.create(phone_number="phone_number", push_token="push_token", twilio_sandbox_mode="twilio_sandbox_mode") values = {'PhoneNumber': "phone_number", 'PushToken': "push_token", } + headers = {'Twilio-Sandbox-Mode': "twilio_sandbox_mode", } + self.holodeck.assert_has_request(Request( + 'post', + 'https://preview.twilio.com/TrustedComms/Devices', + headers=headers, + )) self.holodeck.assert_has_request(Request( 'post', 'https://preview.twilio.com/TrustedComms/Devices', diff --git a/tests/integration/preview/trusted_comms/test_phone_call.py b/tests/integration/preview/trusted_comms/test_phone_call.py index 0f2cbe29a6..90bfd27aa9 100644 --- a/tests/integration/preview/trusted_comms/test_phone_call.py +++ b/tests/integration/preview/trusted_comms/test_phone_call.py @@ -18,10 +18,16 @@ def test_create_request(self): self.holodeck.mock(Response(500, '')) with self.assertRaises(TwilioException): - self.client.preview.trusted_comms.phone_calls.create(from_="from", to="to") + self.client.preview.trusted_comms.phone_calls.create(from_="from", to="to", twilio_sandbox_mode="twilio_sandbox_mode") values = {'From': "from", 'To': "to", } + headers = {'Twilio-Sandbox-Mode': "twilio_sandbox_mode", } + self.holodeck.assert_has_request(Request( + 'post', + 'https://preview.twilio.com/TrustedComms/Business/PhoneCalls', + headers=headers, + )) self.holodeck.assert_has_request(Request( 'post', 'https://preview.twilio.com/TrustedComms/Business/PhoneCalls', diff --git a/tests/integration/sync/v1/service/sync_list/test_sync_list_item.py b/tests/integration/sync/v1/service/sync_list/test_sync_list_item.py index 2aecbfa56c..bfac19b532 100644 --- a/tests/integration/sync/v1/service/sync_list/test_sync_list_item.py +++ b/tests/integration/sync/v1/service/sync_list/test_sync_list_item.py @@ -60,11 +60,13 @@ def test_delete_request(self): with self.assertRaises(TwilioException): self.client.sync.v1.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ .sync_lists(sid="ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ - .sync_list_items(index=1).delete() + .sync_list_items(index=1).delete(if_match="if_match") + headers = {'If-Match': "if_match", } self.holodeck.assert_has_request(Request( 'delete', 'https://sync.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Lists/ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Items/1', + headers=headers, )) def test_delete_response(self): @@ -204,11 +206,13 @@ def test_update_request(self): with self.assertRaises(TwilioException): self.client.sync.v1.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ .sync_lists(sid="ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ - .sync_list_items(index=1).update() + .sync_list_items(index=1).update(if_match="if_match") + headers = {'If-Match': "if_match", } self.holodeck.assert_has_request(Request( 'post', 'https://sync.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Lists/ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Items/1', + headers=headers, )) def test_update_response(self): diff --git a/tests/integration/sync/v1/service/sync_map/test_sync_map_item.py b/tests/integration/sync/v1/service/sync_map/test_sync_map_item.py index 9fb0c2e855..e04979c4df 100644 --- a/tests/integration/sync/v1/service/sync_map/test_sync_map_item.py +++ b/tests/integration/sync/v1/service/sync_map/test_sync_map_item.py @@ -60,11 +60,13 @@ def test_delete_request(self): with self.assertRaises(TwilioException): self.client.sync.v1.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ .sync_maps(sid="MPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ - .sync_map_items(key="key").delete() + .sync_map_items(key="key").delete(if_match="if_match") + headers = {'If-Match': "if_match", } self.holodeck.assert_has_request(Request( 'delete', 'https://sync.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Maps/MPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Items/key', + headers=headers, )) def test_delete_response(self): @@ -204,11 +206,13 @@ def test_update_request(self): with self.assertRaises(TwilioException): self.client.sync.v1.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ .sync_maps(sid="MPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ - .sync_map_items(key="key").update() + .sync_map_items(key="key").update(if_match="if_match") + headers = {'If-Match': "if_match", } self.holodeck.assert_has_request(Request( 'post', 'https://sync.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Maps/MPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Items/key', + headers=headers, )) def test_update_response(self): diff --git a/tests/integration/sync/v1/service/test_document.py b/tests/integration/sync/v1/service/test_document.py index 562c87c74c..06953f3f9b 100644 --- a/tests/integration/sync/v1/service/test_document.py +++ b/tests/integration/sync/v1/service/test_document.py @@ -59,11 +59,13 @@ def test_delete_request(self): with self.assertRaises(TwilioException): self.client.sync.v1.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ - .documents(sid="ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").delete() + .documents(sid="ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").delete(if_match="if_match") + headers = {'If-Match': "if_match", } self.holodeck.assert_has_request(Request( 'delete', 'https://sync.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Documents/ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + headers=headers, )) def test_delete_response(self): @@ -199,11 +201,13 @@ def test_update_request(self): with self.assertRaises(TwilioException): self.client.sync.v1.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ - .documents(sid="ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").update() + .documents(sid="ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").update(if_match="if_match") + headers = {'If-Match': "if_match", } self.holodeck.assert_has_request(Request( 'post', 'https://sync.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Documents/ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + headers=headers, )) def test_update_response(self): diff --git a/twilio/rest/authy/v1/service/__init__.py b/twilio/rest/authy/v1/service/__init__.py index 36194c7220..4884e167ec 100644 --- a/twilio/rest/authy/v1/service/__init__.py +++ b/twilio/rest/authy/v1/service/__init__.py @@ -35,28 +35,32 @@ def __init__(self, version): self._solution = {} self._uri = '/Services'.format(**self._solution) - def create(self, friendly_name): + def create(self, friendly_name, twilio_authy_sandbox_mode=values.unset): """ Create the ServiceInstance :param unicode friendly_name: A human readable description of this resource. + :param unicode twilio_authy_sandbox_mode: The Twilio-Authy-Sandbox-Mode HTTP request header :returns: The created ServiceInstance :rtype: twilio.rest.authy.v1.service.ServiceInstance """ data = values.of({'FriendlyName': friendly_name, }) + headers = values.of({'Twilio-Authy-Sandbox-Mode': twilio_authy_sandbox_mode, }) - payload = self._version.create(method='POST', uri=self._uri, data=data, ) + payload = self._version.create(method='POST', uri=self._uri, data=data, headers=headers, ) return ServiceInstance(self._version, payload, ) - def stream(self, limit=None, page_size=None): + def stream(self, twilio_authy_sandbox_mode=values.unset, limit=None, + page_size=None): """ Streams ServiceInstance records from the API as a generator stream. This operation lazily loads records as efficiently as possible until the limit is reached. The results are returned as a generator, so this operation is memory efficient. + :param unicode twilio_authy_sandbox_mode: The Twilio-Authy-Sandbox-Mode HTTP request header :param int limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param int page_size: Number of records to fetch per request, when not set will use @@ -69,16 +73,18 @@ def stream(self, limit=None, page_size=None): """ limits = self._version.read_limits(limit, page_size) - page = self.page(page_size=limits['page_size'], ) + page = self.page(twilio_authy_sandbox_mode=twilio_authy_sandbox_mode, page_size=limits['page_size'], ) return self._version.stream(page, limits['limit'], limits['page_limit']) - def list(self, limit=None, page_size=None): + def list(self, twilio_authy_sandbox_mode=values.unset, limit=None, + page_size=None): """ Lists ServiceInstance records from the API as a list. Unlike stream(), this operation is eager and will load `limit` records into memory before returning. + :param unicode twilio_authy_sandbox_mode: The Twilio-Authy-Sandbox-Mode HTTP request header :param int limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param int page_size: Number of records to fetch per request, when not set will use @@ -89,14 +95,19 @@ def list(self, limit=None, page_size=None): :returns: Generator that will yield up to limit results :rtype: list[twilio.rest.authy.v1.service.ServiceInstance] """ - return list(self.stream(limit=limit, page_size=page_size, )) + return list(self.stream( + twilio_authy_sandbox_mode=twilio_authy_sandbox_mode, + limit=limit, + page_size=page_size, + )) - def page(self, page_token=values.unset, page_number=values.unset, - page_size=values.unset): + def page(self, twilio_authy_sandbox_mode=values.unset, page_token=values.unset, + page_number=values.unset, page_size=values.unset): """ Retrieve a single page of ServiceInstance records from the API. Request is executed immediately + :param unicode twilio_authy_sandbox_mode: The Twilio-Authy-Sandbox-Mode HTTP request header :param str page_token: PageToken provided by the API :param int page_number: Page Number, this value is simply for client state :param int page_size: Number of records to return, defaults to 50 @@ -105,8 +116,9 @@ def page(self, page_token=values.unset, page_number=values.unset, :rtype: twilio.rest.authy.v1.service.ServicePage """ data = values.of({'PageToken': page_token, 'Page': page_number, 'PageSize': page_size, }) + headers = values.of({'Twilio-Authy-Sandbox-Mode': twilio_authy_sandbox_mode, }) - response = self._version.page(method='GET', uri=self._uri, params=data, ) + response = self._version.page(method='GET', uri=self._uri, params=data, headers=headers, ) return ServicePage(self._version, response, self._solution) @@ -224,38 +236,49 @@ def __init__(self, version, sid): # Dependents self._entities = None - def delete(self): + def delete(self, twilio_authy_sandbox_mode=values.unset): """ Deletes the ServiceInstance + :param unicode twilio_authy_sandbox_mode: The Twilio-Authy-Sandbox-Mode HTTP request header + :returns: True if delete succeeds, False otherwise :rtype: bool """ - return self._version.delete(method='DELETE', uri=self._uri, ) + headers = values.of({'Twilio-Authy-Sandbox-Mode': twilio_authy_sandbox_mode, }) + + return self._version.delete(method='DELETE', uri=self._uri, headers=headers, ) - def fetch(self): + def fetch(self, twilio_authy_sandbox_mode=values.unset): """ Fetch the ServiceInstance + :param unicode twilio_authy_sandbox_mode: The Twilio-Authy-Sandbox-Mode HTTP request header + :returns: The fetched ServiceInstance :rtype: twilio.rest.authy.v1.service.ServiceInstance """ - payload = self._version.fetch(method='GET', uri=self._uri, ) + headers = values.of({'Twilio-Authy-Sandbox-Mode': twilio_authy_sandbox_mode, }) + + payload = self._version.fetch(method='GET', uri=self._uri, headers=headers, ) return ServiceInstance(self._version, payload, sid=self._solution['sid'], ) - def update(self, friendly_name=values.unset): + def update(self, friendly_name=values.unset, + twilio_authy_sandbox_mode=values.unset): """ Update the ServiceInstance :param unicode friendly_name: A human readable description of this resource. + :param unicode twilio_authy_sandbox_mode: The Twilio-Authy-Sandbox-Mode HTTP request header :returns: The updated ServiceInstance :rtype: twilio.rest.authy.v1.service.ServiceInstance """ data = values.of({'FriendlyName': friendly_name, }) + headers = values.of({'Twilio-Authy-Sandbox-Mode': twilio_authy_sandbox_mode, }) - payload = self._version.update(method='POST', uri=self._uri, data=data, ) + payload = self._version.update(method='POST', uri=self._uri, data=data, headers=headers, ) return ServiceInstance(self._version, payload, sid=self._solution['sid'], ) @@ -380,34 +403,43 @@ def links(self): """ return self._properties['links'] - def delete(self): + def delete(self, twilio_authy_sandbox_mode=values.unset): """ Deletes the ServiceInstance + :param unicode twilio_authy_sandbox_mode: The Twilio-Authy-Sandbox-Mode HTTP request header + :returns: True if delete succeeds, False otherwise :rtype: bool """ - return self._proxy.delete() + return self._proxy.delete(twilio_authy_sandbox_mode=twilio_authy_sandbox_mode, ) - def fetch(self): + def fetch(self, twilio_authy_sandbox_mode=values.unset): """ Fetch the ServiceInstance + :param unicode twilio_authy_sandbox_mode: The Twilio-Authy-Sandbox-Mode HTTP request header + :returns: The fetched ServiceInstance :rtype: twilio.rest.authy.v1.service.ServiceInstance """ - return self._proxy.fetch() + return self._proxy.fetch(twilio_authy_sandbox_mode=twilio_authy_sandbox_mode, ) - def update(self, friendly_name=values.unset): + def update(self, friendly_name=values.unset, + twilio_authy_sandbox_mode=values.unset): """ Update the ServiceInstance :param unicode friendly_name: A human readable description of this resource. + :param unicode twilio_authy_sandbox_mode: The Twilio-Authy-Sandbox-Mode HTTP request header :returns: The updated ServiceInstance :rtype: twilio.rest.authy.v1.service.ServiceInstance """ - return self._proxy.update(friendly_name=friendly_name, ) + return self._proxy.update( + friendly_name=friendly_name, + twilio_authy_sandbox_mode=twilio_authy_sandbox_mode, + ) @property def entities(self): diff --git a/twilio/rest/authy/v1/service/entity/__init__.py b/twilio/rest/authy/v1/service/entity/__init__.py index 8bd66dfba2..7d49868f76 100644 --- a/twilio/rest/authy/v1/service/entity/__init__.py +++ b/twilio/rest/authy/v1/service/entity/__init__.py @@ -36,28 +36,32 @@ def __init__(self, version, service_sid): self._solution = {'service_sid': service_sid, } self._uri = '/Services/{service_sid}/Entities'.format(**self._solution) - def create(self, identity): + def create(self, identity, twilio_authy_sandbox_mode=values.unset): """ Create the EntityInstance :param unicode identity: Unique identity of the Entity + :param unicode twilio_authy_sandbox_mode: The Twilio-Authy-Sandbox-Mode HTTP request header :returns: The created EntityInstance :rtype: twilio.rest.authy.v1.service.entity.EntityInstance """ data = values.of({'Identity': identity, }) + headers = values.of({'Twilio-Authy-Sandbox-Mode': twilio_authy_sandbox_mode, }) - payload = self._version.create(method='POST', uri=self._uri, data=data, ) + payload = self._version.create(method='POST', uri=self._uri, data=data, headers=headers, ) return EntityInstance(self._version, payload, service_sid=self._solution['service_sid'], ) - def stream(self, limit=None, page_size=None): + def stream(self, twilio_authy_sandbox_mode=values.unset, limit=None, + page_size=None): """ Streams EntityInstance records from the API as a generator stream. This operation lazily loads records as efficiently as possible until the limit is reached. The results are returned as a generator, so this operation is memory efficient. + :param unicode twilio_authy_sandbox_mode: The Twilio-Authy-Sandbox-Mode HTTP request header :param int limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param int page_size: Number of records to fetch per request, when not set will use @@ -70,16 +74,18 @@ def stream(self, limit=None, page_size=None): """ limits = self._version.read_limits(limit, page_size) - page = self.page(page_size=limits['page_size'], ) + page = self.page(twilio_authy_sandbox_mode=twilio_authy_sandbox_mode, page_size=limits['page_size'], ) return self._version.stream(page, limits['limit'], limits['page_limit']) - def list(self, limit=None, page_size=None): + def list(self, twilio_authy_sandbox_mode=values.unset, limit=None, + page_size=None): """ Lists EntityInstance records from the API as a list. Unlike stream(), this operation is eager and will load `limit` records into memory before returning. + :param unicode twilio_authy_sandbox_mode: The Twilio-Authy-Sandbox-Mode HTTP request header :param int limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param int page_size: Number of records to fetch per request, when not set will use @@ -90,14 +96,19 @@ def list(self, limit=None, page_size=None): :returns: Generator that will yield up to limit results :rtype: list[twilio.rest.authy.v1.service.entity.EntityInstance] """ - return list(self.stream(limit=limit, page_size=page_size, )) + return list(self.stream( + twilio_authy_sandbox_mode=twilio_authy_sandbox_mode, + limit=limit, + page_size=page_size, + )) - def page(self, page_token=values.unset, page_number=values.unset, - page_size=values.unset): + def page(self, twilio_authy_sandbox_mode=values.unset, page_token=values.unset, + page_number=values.unset, page_size=values.unset): """ Retrieve a single page of EntityInstance records from the API. Request is executed immediately + :param unicode twilio_authy_sandbox_mode: The Twilio-Authy-Sandbox-Mode HTTP request header :param str page_token: PageToken provided by the API :param int page_number: Page Number, this value is simply for client state :param int page_size: Number of records to return, defaults to 50 @@ -106,8 +117,9 @@ def page(self, page_token=values.unset, page_number=values.unset, :rtype: twilio.rest.authy.v1.service.entity.EntityPage """ data = values.of({'PageToken': page_token, 'Page': page_number, 'PageSize': page_size, }) + headers = values.of({'Twilio-Authy-Sandbox-Mode': twilio_authy_sandbox_mode, }) - response = self._version.page(method='GET', uri=self._uri, params=data, ) + response = self._version.page(method='GET', uri=self._uri, params=data, headers=headers, ) return EntityPage(self._version, response, self._solution) @@ -227,23 +239,31 @@ def __init__(self, version, service_sid, identity): # Dependents self._factors = None - def delete(self): + def delete(self, twilio_authy_sandbox_mode=values.unset): """ Deletes the EntityInstance + :param unicode twilio_authy_sandbox_mode: The Twilio-Authy-Sandbox-Mode HTTP request header + :returns: True if delete succeeds, False otherwise :rtype: bool """ - return self._version.delete(method='DELETE', uri=self._uri, ) + headers = values.of({'Twilio-Authy-Sandbox-Mode': twilio_authy_sandbox_mode, }) + + return self._version.delete(method='DELETE', uri=self._uri, headers=headers, ) - def fetch(self): + def fetch(self, twilio_authy_sandbox_mode=values.unset): """ Fetch the EntityInstance + :param unicode twilio_authy_sandbox_mode: The Twilio-Authy-Sandbox-Mode HTTP request header + :returns: The fetched EntityInstance :rtype: twilio.rest.authy.v1.service.entity.EntityInstance """ - payload = self._version.fetch(method='GET', uri=self._uri, ) + headers = values.of({'Twilio-Authy-Sandbox-Mode': twilio_authy_sandbox_mode, }) + + payload = self._version.fetch(method='GET', uri=self._uri, headers=headers, ) return EntityInstance( self._version, @@ -390,23 +410,27 @@ def links(self): """ return self._properties['links'] - def delete(self): + def delete(self, twilio_authy_sandbox_mode=values.unset): """ Deletes the EntityInstance + :param unicode twilio_authy_sandbox_mode: The Twilio-Authy-Sandbox-Mode HTTP request header + :returns: True if delete succeeds, False otherwise :rtype: bool """ - return self._proxy.delete() + return self._proxy.delete(twilio_authy_sandbox_mode=twilio_authy_sandbox_mode, ) - def fetch(self): + def fetch(self, twilio_authy_sandbox_mode=values.unset): """ Fetch the EntityInstance + :param unicode twilio_authy_sandbox_mode: The Twilio-Authy-Sandbox-Mode HTTP request header + :returns: The fetched EntityInstance :rtype: twilio.rest.authy.v1.service.entity.EntityInstance """ - return self._proxy.fetch() + return self._proxy.fetch(twilio_authy_sandbox_mode=twilio_authy_sandbox_mode, ) @property def factors(self): diff --git a/twilio/rest/authy/v1/service/entity/factor/__init__.py b/twilio/rest/authy/v1/service/entity/factor/__init__.py index 395a2c2153..f8e86a9718 100644 --- a/twilio/rest/authy/v1/service/entity/factor/__init__.py +++ b/twilio/rest/authy/v1/service/entity/factor/__init__.py @@ -37,20 +37,23 @@ def __init__(self, version, service_sid, identity): self._solution = {'service_sid': service_sid, 'identity': identity, } self._uri = '/Services/{service_sid}/Entities/{identity}/Factors'.format(**self._solution) - def create(self, binding, friendly_name, factor_type): + def create(self, binding, friendly_name, factor_type, + twilio_authy_sandbox_mode=values.unset): """ Create the FactorInstance :param unicode binding: A unique binding for this Factor :param unicode friendly_name: The friendly name of this Factor :param FactorInstance.FactorTypes factor_type: The Type of this Factor + :param unicode twilio_authy_sandbox_mode: The Twilio-Authy-Sandbox-Mode HTTP request header :returns: The created FactorInstance :rtype: twilio.rest.authy.v1.service.entity.factor.FactorInstance """ data = values.of({'Binding': binding, 'FriendlyName': friendly_name, 'FactorType': factor_type, }) + headers = values.of({'Twilio-Authy-Sandbox-Mode': twilio_authy_sandbox_mode, }) - payload = self._version.create(method='POST', uri=self._uri, data=data, ) + payload = self._version.create(method='POST', uri=self._uri, data=data, headers=headers, ) return FactorInstance( self._version, @@ -59,13 +62,15 @@ def create(self, binding, friendly_name, factor_type): identity=self._solution['identity'], ) - def stream(self, limit=None, page_size=None): + def stream(self, twilio_authy_sandbox_mode=values.unset, limit=None, + page_size=None): """ Streams FactorInstance records from the API as a generator stream. This operation lazily loads records as efficiently as possible until the limit is reached. The results are returned as a generator, so this operation is memory efficient. + :param unicode twilio_authy_sandbox_mode: The Twilio-Authy-Sandbox-Mode HTTP request header :param int limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param int page_size: Number of records to fetch per request, when not set will use @@ -78,16 +83,18 @@ def stream(self, limit=None, page_size=None): """ limits = self._version.read_limits(limit, page_size) - page = self.page(page_size=limits['page_size'], ) + page = self.page(twilio_authy_sandbox_mode=twilio_authy_sandbox_mode, page_size=limits['page_size'], ) return self._version.stream(page, limits['limit'], limits['page_limit']) - def list(self, limit=None, page_size=None): + def list(self, twilio_authy_sandbox_mode=values.unset, limit=None, + page_size=None): """ Lists FactorInstance records from the API as a list. Unlike stream(), this operation is eager and will load `limit` records into memory before returning. + :param unicode twilio_authy_sandbox_mode: The Twilio-Authy-Sandbox-Mode HTTP request header :param int limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param int page_size: Number of records to fetch per request, when not set will use @@ -98,14 +105,19 @@ def list(self, limit=None, page_size=None): :returns: Generator that will yield up to limit results :rtype: list[twilio.rest.authy.v1.service.entity.factor.FactorInstance] """ - return list(self.stream(limit=limit, page_size=page_size, )) + return list(self.stream( + twilio_authy_sandbox_mode=twilio_authy_sandbox_mode, + limit=limit, + page_size=page_size, + )) - def page(self, page_token=values.unset, page_number=values.unset, - page_size=values.unset): + def page(self, twilio_authy_sandbox_mode=values.unset, page_token=values.unset, + page_number=values.unset, page_size=values.unset): """ Retrieve a single page of FactorInstance records from the API. Request is executed immediately + :param unicode twilio_authy_sandbox_mode: The Twilio-Authy-Sandbox-Mode HTTP request header :param str page_token: PageToken provided by the API :param int page_number: Page Number, this value is simply for client state :param int page_size: Number of records to return, defaults to 50 @@ -114,8 +126,9 @@ def page(self, page_token=values.unset, page_number=values.unset, :rtype: twilio.rest.authy.v1.service.entity.factor.FactorPage """ data = values.of({'PageToken': page_token, 'Page': page_number, 'PageSize': page_size, }) + headers = values.of({'Twilio-Authy-Sandbox-Mode': twilio_authy_sandbox_mode, }) - response = self._version.page(method='GET', uri=self._uri, params=data, ) + response = self._version.page(method='GET', uri=self._uri, params=data, headers=headers, ) return FactorPage(self._version, response, self._solution) @@ -252,23 +265,31 @@ def __init__(self, version, service_sid, identity, sid): # Dependents self._challenges = None - def delete(self): + def delete(self, twilio_authy_sandbox_mode=values.unset): """ Deletes the FactorInstance + :param unicode twilio_authy_sandbox_mode: The Twilio-Authy-Sandbox-Mode HTTP request header + :returns: True if delete succeeds, False otherwise :rtype: bool """ - return self._version.delete(method='DELETE', uri=self._uri, ) + headers = values.of({'Twilio-Authy-Sandbox-Mode': twilio_authy_sandbox_mode, }) + + return self._version.delete(method='DELETE', uri=self._uri, headers=headers, ) - def fetch(self): + def fetch(self, twilio_authy_sandbox_mode=values.unset): """ Fetch the FactorInstance + :param unicode twilio_authy_sandbox_mode: The Twilio-Authy-Sandbox-Mode HTTP request header + :returns: The fetched FactorInstance :rtype: twilio.rest.authy.v1.service.entity.factor.FactorInstance """ - payload = self._version.fetch(method='GET', uri=self._uri, ) + headers = values.of({'Twilio-Authy-Sandbox-Mode': twilio_authy_sandbox_mode, }) + + payload = self._version.fetch(method='GET', uri=self._uri, headers=headers, ) return FactorInstance( self._version, @@ -278,18 +299,21 @@ def fetch(self): sid=self._solution['sid'], ) - def update(self, auth_payload=values.unset): + def update(self, auth_payload=values.unset, + twilio_authy_sandbox_mode=values.unset): """ Update the FactorInstance :param unicode auth_payload: Optional payload to verify the Factor for the first time + :param unicode twilio_authy_sandbox_mode: The Twilio-Authy-Sandbox-Mode HTTP request header :returns: The updated FactorInstance :rtype: twilio.rest.authy.v1.service.entity.factor.FactorInstance """ data = values.of({'AuthPayload': auth_payload, }) + headers = values.of({'Twilio-Authy-Sandbox-Mode': twilio_authy_sandbox_mode, }) - payload = self._version.update(method='POST', uri=self._uri, data=data, ) + payload = self._version.update(method='POST', uri=self._uri, data=data, headers=headers, ) return FactorInstance( self._version, @@ -505,34 +529,43 @@ def links(self): """ return self._properties['links'] - def delete(self): + def delete(self, twilio_authy_sandbox_mode=values.unset): """ Deletes the FactorInstance + :param unicode twilio_authy_sandbox_mode: The Twilio-Authy-Sandbox-Mode HTTP request header + :returns: True if delete succeeds, False otherwise :rtype: bool """ - return self._proxy.delete() + return self._proxy.delete(twilio_authy_sandbox_mode=twilio_authy_sandbox_mode, ) - def fetch(self): + def fetch(self, twilio_authy_sandbox_mode=values.unset): """ Fetch the FactorInstance + :param unicode twilio_authy_sandbox_mode: The Twilio-Authy-Sandbox-Mode HTTP request header + :returns: The fetched FactorInstance :rtype: twilio.rest.authy.v1.service.entity.factor.FactorInstance """ - return self._proxy.fetch() + return self._proxy.fetch(twilio_authy_sandbox_mode=twilio_authy_sandbox_mode, ) - def update(self, auth_payload=values.unset): + def update(self, auth_payload=values.unset, + twilio_authy_sandbox_mode=values.unset): """ Update the FactorInstance :param unicode auth_payload: Optional payload to verify the Factor for the first time + :param unicode twilio_authy_sandbox_mode: The Twilio-Authy-Sandbox-Mode HTTP request header :returns: The updated FactorInstance :rtype: twilio.rest.authy.v1.service.entity.factor.FactorInstance """ - return self._proxy.update(auth_payload=auth_payload, ) + return self._proxy.update( + auth_payload=auth_payload, + twilio_authy_sandbox_mode=twilio_authy_sandbox_mode, + ) @property def challenges(self): diff --git a/twilio/rest/authy/v1/service/entity/factor/challenge.py b/twilio/rest/authy/v1/service/entity/factor/challenge.py index adf0724ed3..8855a74f01 100644 --- a/twilio/rest/authy/v1/service/entity/factor/challenge.py +++ b/twilio/rest/authy/v1/service/entity/factor/challenge.py @@ -39,13 +39,14 @@ def __init__(self, version, service_sid, identity, factor_sid): self._uri = '/Services/{service_sid}/Entities/{identity}/Factors/{factor_sid}/Challenges'.format(**self._solution) def create(self, expiration_date=values.unset, details=values.unset, - hidden_details=values.unset): + hidden_details=values.unset, twilio_authy_sandbox_mode=values.unset): """ Create the ChallengeInstance :param datetime expiration_date: The future date in which this Challenge will expire :param unicode details: Public details provided to contextualize the Challenge :param unicode hidden_details: Hidden details provided to contextualize the Challenge + :param unicode twilio_authy_sandbox_mode: The Twilio-Authy-Sandbox-Mode HTTP request header :returns: The created ChallengeInstance :rtype: twilio.rest.authy.v1.service.entity.factor.challenge.ChallengeInstance @@ -55,8 +56,9 @@ def create(self, expiration_date=values.unset, details=values.unset, 'Details': details, 'HiddenDetails': hidden_details, }) + headers = values.of({'Twilio-Authy-Sandbox-Mode': twilio_authy_sandbox_mode, }) - payload = self._version.create(method='POST', uri=self._uri, data=data, ) + payload = self._version.create(method='POST', uri=self._uri, data=data, headers=headers, ) return ChallengeInstance( self._version, @@ -189,23 +191,31 @@ def __init__(self, version, service_sid, identity, factor_sid, sid): } self._uri = '/Services/{service_sid}/Entities/{identity}/Factors/{factor_sid}/Challenges/{sid}'.format(**self._solution) - def delete(self): + def delete(self, twilio_authy_sandbox_mode=values.unset): """ Deletes the ChallengeInstance + :param unicode twilio_authy_sandbox_mode: The Twilio-Authy-Sandbox-Mode HTTP request header + :returns: True if delete succeeds, False otherwise :rtype: bool """ - return self._version.delete(method='DELETE', uri=self._uri, ) + headers = values.of({'Twilio-Authy-Sandbox-Mode': twilio_authy_sandbox_mode, }) + + return self._version.delete(method='DELETE', uri=self._uri, headers=headers, ) - def fetch(self): + def fetch(self, twilio_authy_sandbox_mode=values.unset): """ Fetch the ChallengeInstance + :param unicode twilio_authy_sandbox_mode: The Twilio-Authy-Sandbox-Mode HTTP request header + :returns: The fetched ChallengeInstance :rtype: twilio.rest.authy.v1.service.entity.factor.challenge.ChallengeInstance """ - payload = self._version.fetch(method='GET', uri=self._uri, ) + headers = values.of({'Twilio-Authy-Sandbox-Mode': twilio_authy_sandbox_mode, }) + + payload = self._version.fetch(method='GET', uri=self._uri, headers=headers, ) return ChallengeInstance( self._version, @@ -216,18 +226,21 @@ def fetch(self): sid=self._solution['sid'], ) - def update(self, auth_payload=values.unset): + def update(self, auth_payload=values.unset, + twilio_authy_sandbox_mode=values.unset): """ Update the ChallengeInstance :param unicode auth_payload: Optional payload to verify the Challenge + :param unicode twilio_authy_sandbox_mode: The Twilio-Authy-Sandbox-Mode HTTP request header :returns: The updated ChallengeInstance :rtype: twilio.rest.authy.v1.service.entity.factor.challenge.ChallengeInstance """ data = values.of({'AuthPayload': auth_payload, }) + headers = values.of({'Twilio-Authy-Sandbox-Mode': twilio_authy_sandbox_mode, }) - payload = self._version.update(method='POST', uri=self._uri, data=data, ) + payload = self._version.update(method='POST', uri=self._uri, data=data, headers=headers, ) return ChallengeInstance( self._version, @@ -473,34 +486,43 @@ def url(self): """ return self._properties['url'] - def delete(self): + def delete(self, twilio_authy_sandbox_mode=values.unset): """ Deletes the ChallengeInstance + :param unicode twilio_authy_sandbox_mode: The Twilio-Authy-Sandbox-Mode HTTP request header + :returns: True if delete succeeds, False otherwise :rtype: bool """ - return self._proxy.delete() + return self._proxy.delete(twilio_authy_sandbox_mode=twilio_authy_sandbox_mode, ) - def fetch(self): + def fetch(self, twilio_authy_sandbox_mode=values.unset): """ Fetch the ChallengeInstance + :param unicode twilio_authy_sandbox_mode: The Twilio-Authy-Sandbox-Mode HTTP request header + :returns: The fetched ChallengeInstance :rtype: twilio.rest.authy.v1.service.entity.factor.challenge.ChallengeInstance """ - return self._proxy.fetch() + return self._proxy.fetch(twilio_authy_sandbox_mode=twilio_authy_sandbox_mode, ) - def update(self, auth_payload=values.unset): + def update(self, auth_payload=values.unset, + twilio_authy_sandbox_mode=values.unset): """ Update the ChallengeInstance :param unicode auth_payload: Optional payload to verify the Challenge + :param unicode twilio_authy_sandbox_mode: The Twilio-Authy-Sandbox-Mode HTTP request header :returns: The updated ChallengeInstance :rtype: twilio.rest.authy.v1.service.entity.factor.challenge.ChallengeInstance """ - return self._proxy.update(auth_payload=auth_payload, ) + return self._proxy.update( + auth_payload=auth_payload, + twilio_authy_sandbox_mode=twilio_authy_sandbox_mode, + ) def __repr__(self): """ diff --git a/twilio/rest/chat/v2/service/channel/__init__.py b/twilio/rest/chat/v2/service/channel/__init__.py index f1ef06df03..358abc09b5 100644 --- a/twilio/rest/chat/v2/service/channel/__init__.py +++ b/twilio/rest/chat/v2/service/channel/__init__.py @@ -41,7 +41,7 @@ def __init__(self, version, service_sid): def create(self, friendly_name=values.unset, unique_name=values.unset, attributes=values.unset, type=values.unset, date_created=values.unset, date_updated=values.unset, - created_by=values.unset): + created_by=values.unset, x_twilio_webhook_enabled=values.unset): """ Create the ChannelInstance @@ -52,6 +52,7 @@ def create(self, friendly_name=values.unset, unique_name=values.unset, :param datetime date_created: The ISO 8601 date and time in GMT when the resource was created :param datetime date_updated: The ISO 8601 date and time in GMT when the resource was updated :param unicode created_by: The identity of the User that created the Channel + :param ChannelInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header :returns: The created ChannelInstance :rtype: twilio.rest.chat.v2.service.channel.ChannelInstance @@ -65,8 +66,9 @@ def create(self, friendly_name=values.unset, unique_name=values.unset, 'DateUpdated': serialize.iso8601_datetime(date_updated), 'CreatedBy': created_by, }) + headers = values.of({'X-Twilio-Webhook-Enabled': x_twilio_webhook_enabled, }) - payload = self._version.create(method='POST', uri=self._uri, data=data, ) + payload = self._version.create(method='POST', uri=self._uri, data=data, headers=headers, ) return ChannelInstance(self._version, payload, service_sid=self._solution['service_sid'], ) @@ -269,18 +271,23 @@ def fetch(self): sid=self._solution['sid'], ) - def delete(self): + def delete(self, x_twilio_webhook_enabled=values.unset): """ Deletes the ChannelInstance + :param ChannelInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header + :returns: True if delete succeeds, False otherwise :rtype: bool """ - return self._version.delete(method='DELETE', uri=self._uri, ) + headers = values.of({'X-Twilio-Webhook-Enabled': x_twilio_webhook_enabled, }) + + return self._version.delete(method='DELETE', uri=self._uri, headers=headers, ) def update(self, friendly_name=values.unset, unique_name=values.unset, attributes=values.unset, date_created=values.unset, - date_updated=values.unset, created_by=values.unset): + date_updated=values.unset, created_by=values.unset, + x_twilio_webhook_enabled=values.unset): """ Update the ChannelInstance @@ -290,6 +297,7 @@ def update(self, friendly_name=values.unset, unique_name=values.unset, :param datetime date_created: The ISO 8601 date and time in GMT when the resource was created :param datetime date_updated: The ISO 8601 date and time in GMT when the resource was updated :param unicode created_by: The identity of the User that created the Channel + :param ChannelInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header :returns: The updated ChannelInstance :rtype: twilio.rest.chat.v2.service.channel.ChannelInstance @@ -302,8 +310,9 @@ def update(self, friendly_name=values.unset, unique_name=values.unset, 'DateUpdated': serialize.iso8601_datetime(date_updated), 'CreatedBy': created_by, }) + headers = values.of({'X-Twilio-Webhook-Enabled': x_twilio_webhook_enabled, }) - payload = self._version.update(method='POST', uri=self._uri, data=data, ) + payload = self._version.update(method='POST', uri=self._uri, data=data, headers=headers, ) return ChannelInstance( self._version, @@ -567,18 +576,21 @@ def fetch(self): """ return self._proxy.fetch() - def delete(self): + def delete(self, x_twilio_webhook_enabled=values.unset): """ Deletes the ChannelInstance + :param ChannelInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header + :returns: True if delete succeeds, False otherwise :rtype: bool """ - return self._proxy.delete() + return self._proxy.delete(x_twilio_webhook_enabled=x_twilio_webhook_enabled, ) def update(self, friendly_name=values.unset, unique_name=values.unset, attributes=values.unset, date_created=values.unset, - date_updated=values.unset, created_by=values.unset): + date_updated=values.unset, created_by=values.unset, + x_twilio_webhook_enabled=values.unset): """ Update the ChannelInstance @@ -588,6 +600,7 @@ def update(self, friendly_name=values.unset, unique_name=values.unset, :param datetime date_created: The ISO 8601 date and time in GMT when the resource was created :param datetime date_updated: The ISO 8601 date and time in GMT when the resource was updated :param unicode created_by: The identity of the User that created the Channel + :param ChannelInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header :returns: The updated ChannelInstance :rtype: twilio.rest.chat.v2.service.channel.ChannelInstance @@ -599,6 +612,7 @@ def update(self, friendly_name=values.unset, unique_name=values.unset, date_created=date_created, date_updated=date_updated, created_by=created_by, + x_twilio_webhook_enabled=x_twilio_webhook_enabled, ) @property diff --git a/twilio/rest/chat/v2/service/channel/member.py b/twilio/rest/chat/v2/service/channel/member.py index 52a90c879c..5679d008ac 100644 --- a/twilio/rest/chat/v2/service/channel/member.py +++ b/twilio/rest/chat/v2/service/channel/member.py @@ -38,7 +38,8 @@ def __init__(self, version, service_sid, channel_sid): def create(self, identity, role_sid=values.unset, last_consumed_message_index=values.unset, last_consumption_timestamp=values.unset, date_created=values.unset, - date_updated=values.unset, attributes=values.unset): + date_updated=values.unset, attributes=values.unset, + x_twilio_webhook_enabled=values.unset): """ Create the MemberInstance @@ -49,6 +50,7 @@ def create(self, identity, role_sid=values.unset, :param datetime date_created: The ISO 8601 date and time in GMT when the resource was created :param datetime date_updated: The ISO 8601 date and time in GMT when the resource was updated :param unicode attributes: A valid JSON string that contains application-specific data + :param MemberInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header :returns: The created MemberInstance :rtype: twilio.rest.chat.v2.service.channel.member.MemberInstance @@ -62,8 +64,9 @@ def create(self, identity, role_sid=values.unset, 'DateUpdated': serialize.iso8601_datetime(date_updated), 'Attributes': attributes, }) + headers = values.of({'X-Twilio-Webhook-Enabled': x_twilio_webhook_enabled, }) - payload = self._version.create(method='POST', uri=self._uri, data=data, ) + payload = self._version.create(method='POST', uri=self._uri, data=data, headers=headers, ) return MemberInstance( self._version, @@ -283,19 +286,24 @@ def fetch(self): sid=self._solution['sid'], ) - def delete(self): + def delete(self, x_twilio_webhook_enabled=values.unset): """ Deletes the MemberInstance + :param MemberInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header + :returns: True if delete succeeds, False otherwise :rtype: bool """ - return self._version.delete(method='DELETE', uri=self._uri, ) + headers = values.of({'X-Twilio-Webhook-Enabled': x_twilio_webhook_enabled, }) + + return self._version.delete(method='DELETE', uri=self._uri, headers=headers, ) def update(self, role_sid=values.unset, last_consumed_message_index=values.unset, last_consumption_timestamp=values.unset, date_created=values.unset, - date_updated=values.unset, attributes=values.unset): + date_updated=values.unset, attributes=values.unset, + x_twilio_webhook_enabled=values.unset): """ Update the MemberInstance @@ -305,6 +313,7 @@ def update(self, role_sid=values.unset, :param datetime date_created: The ISO 8601 date and time in GMT when the resource was created :param datetime date_updated: The ISO 8601 date and time in GMT when the resource was updated :param unicode attributes: A valid JSON string that contains application-specific data + :param MemberInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header :returns: The updated MemberInstance :rtype: twilio.rest.chat.v2.service.channel.member.MemberInstance @@ -317,8 +326,9 @@ def update(self, role_sid=values.unset, 'DateUpdated': serialize.iso8601_datetime(date_updated), 'Attributes': attributes, }) + headers = values.of({'X-Twilio-Webhook-Enabled': x_twilio_webhook_enabled, }) - payload = self._version.update(method='POST', uri=self._uri, data=data, ) + payload = self._version.update(method='POST', uri=self._uri, data=data, headers=headers, ) return MemberInstance( self._version, @@ -502,19 +512,22 @@ def fetch(self): """ return self._proxy.fetch() - def delete(self): + def delete(self, x_twilio_webhook_enabled=values.unset): """ Deletes the MemberInstance + :param MemberInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header + :returns: True if delete succeeds, False otherwise :rtype: bool """ - return self._proxy.delete() + return self._proxy.delete(x_twilio_webhook_enabled=x_twilio_webhook_enabled, ) def update(self, role_sid=values.unset, last_consumed_message_index=values.unset, last_consumption_timestamp=values.unset, date_created=values.unset, - date_updated=values.unset, attributes=values.unset): + date_updated=values.unset, attributes=values.unset, + x_twilio_webhook_enabled=values.unset): """ Update the MemberInstance @@ -524,6 +537,7 @@ def update(self, role_sid=values.unset, :param datetime date_created: The ISO 8601 date and time in GMT when the resource was created :param datetime date_updated: The ISO 8601 date and time in GMT when the resource was updated :param unicode attributes: A valid JSON string that contains application-specific data + :param MemberInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header :returns: The updated MemberInstance :rtype: twilio.rest.chat.v2.service.channel.member.MemberInstance @@ -535,6 +549,7 @@ def update(self, role_sid=values.unset, date_created=date_created, date_updated=date_updated, attributes=attributes, + x_twilio_webhook_enabled=x_twilio_webhook_enabled, ) def __repr__(self): diff --git a/twilio/rest/chat/v2/service/channel/message.py b/twilio/rest/chat/v2/service/channel/message.py index e631c79c35..13a62309c3 100644 --- a/twilio/rest/chat/v2/service/channel/message.py +++ b/twilio/rest/chat/v2/service/channel/message.py @@ -38,7 +38,7 @@ def __init__(self, version, service_sid, channel_sid): def create(self, from_=values.unset, attributes=values.unset, date_created=values.unset, date_updated=values.unset, last_updated_by=values.unset, body=values.unset, - media_sid=values.unset): + media_sid=values.unset, x_twilio_webhook_enabled=values.unset): """ Create the MessageInstance @@ -49,6 +49,7 @@ def create(self, from_=values.unset, attributes=values.unset, :param unicode last_updated_by: The Identity of the User who last updated the Message :param unicode body: The message to send to the channel :param unicode media_sid: The Media Sid to be attached to the new Message + :param MessageInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header :returns: The created MessageInstance :rtype: twilio.rest.chat.v2.service.channel.message.MessageInstance @@ -62,8 +63,9 @@ def create(self, from_=values.unset, attributes=values.unset, 'Body': body, 'MediaSid': media_sid, }) + headers = values.of({'X-Twilio-Webhook-Enabled': x_twilio_webhook_enabled, }) - payload = self._version.create(method='POST', uri=self._uri, data=data, ) + payload = self._version.create(method='POST', uri=self._uri, data=data, headers=headers, ) return MessageInstance( self._version, @@ -283,18 +285,23 @@ def fetch(self): sid=self._solution['sid'], ) - def delete(self): + def delete(self, x_twilio_webhook_enabled=values.unset): """ Deletes the MessageInstance + :param MessageInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header + :returns: True if delete succeeds, False otherwise :rtype: bool """ - return self._version.delete(method='DELETE', uri=self._uri, ) + headers = values.of({'X-Twilio-Webhook-Enabled': x_twilio_webhook_enabled, }) + + return self._version.delete(method='DELETE', uri=self._uri, headers=headers, ) def update(self, body=values.unset, attributes=values.unset, date_created=values.unset, date_updated=values.unset, - last_updated_by=values.unset, from_=values.unset): + last_updated_by=values.unset, from_=values.unset, + x_twilio_webhook_enabled=values.unset): """ Update the MessageInstance @@ -304,6 +311,7 @@ def update(self, body=values.unset, attributes=values.unset, :param datetime date_updated: The ISO 8601 date and time in GMT when the resource was updated :param unicode last_updated_by: The Identity of the User who last updated the Message, if applicable :param unicode from_: The Identity of the message's author + :param MessageInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header :returns: The updated MessageInstance :rtype: twilio.rest.chat.v2.service.channel.message.MessageInstance @@ -316,8 +324,9 @@ def update(self, body=values.unset, attributes=values.unset, 'LastUpdatedBy': last_updated_by, 'From': from_, }) + headers = values.of({'X-Twilio-Webhook-Enabled': x_twilio_webhook_enabled, }) - payload = self._version.update(method='POST', uri=self._uri, data=data, ) + payload = self._version.update(method='POST', uri=self._uri, data=data, headers=headers, ) return MessageInstance( self._version, @@ -541,18 +550,21 @@ def fetch(self): """ return self._proxy.fetch() - def delete(self): + def delete(self, x_twilio_webhook_enabled=values.unset): """ Deletes the MessageInstance + :param MessageInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header + :returns: True if delete succeeds, False otherwise :rtype: bool """ - return self._proxy.delete() + return self._proxy.delete(x_twilio_webhook_enabled=x_twilio_webhook_enabled, ) def update(self, body=values.unset, attributes=values.unset, date_created=values.unset, date_updated=values.unset, - last_updated_by=values.unset, from_=values.unset): + last_updated_by=values.unset, from_=values.unset, + x_twilio_webhook_enabled=values.unset): """ Update the MessageInstance @@ -562,6 +574,7 @@ def update(self, body=values.unset, attributes=values.unset, :param datetime date_updated: The ISO 8601 date and time in GMT when the resource was updated :param unicode last_updated_by: The Identity of the User who last updated the Message, if applicable :param unicode from_: The Identity of the message's author + :param MessageInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header :returns: The updated MessageInstance :rtype: twilio.rest.chat.v2.service.channel.message.MessageInstance @@ -573,6 +586,7 @@ def update(self, body=values.unset, attributes=values.unset, date_updated=date_updated, last_updated_by=last_updated_by, from_=from_, + x_twilio_webhook_enabled=x_twilio_webhook_enabled, ) def __repr__(self): diff --git a/twilio/rest/chat/v2/service/user/__init__.py b/twilio/rest/chat/v2/service/user/__init__.py index 0486123ff0..5e40bf83f2 100644 --- a/twilio/rest/chat/v2/service/user/__init__.py +++ b/twilio/rest/chat/v2/service/user/__init__.py @@ -36,7 +36,7 @@ def __init__(self, version, service_sid): self._uri = '/Services/{service_sid}/Users'.format(**self._solution) def create(self, identity, role_sid=values.unset, attributes=values.unset, - friendly_name=values.unset): + friendly_name=values.unset, x_twilio_webhook_enabled=values.unset): """ Create the UserInstance @@ -44,6 +44,7 @@ def create(self, identity, role_sid=values.unset, attributes=values.unset, :param unicode role_sid: The SID of the Role assigned to this user :param unicode attributes: A valid JSON string that contains application-specific data :param unicode friendly_name: A string to describe the new resource + :param UserInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header :returns: The created UserInstance :rtype: twilio.rest.chat.v2.service.user.UserInstance @@ -54,8 +55,9 @@ def create(self, identity, role_sid=values.unset, attributes=values.unset, 'Attributes': attributes, 'FriendlyName': friendly_name, }) + headers = values.of({'X-Twilio-Webhook-Enabled': x_twilio_webhook_enabled, }) - payload = self._version.create(method='POST', uri=self._uri, data=data, ) + payload = self._version.create(method='POST', uri=self._uri, data=data, headers=headers, ) return UserInstance(self._version, payload, service_sid=self._solution['service_sid'], ) @@ -258,20 +260,22 @@ def delete(self): return self._version.delete(method='DELETE', uri=self._uri, ) def update(self, role_sid=values.unset, attributes=values.unset, - friendly_name=values.unset): + friendly_name=values.unset, x_twilio_webhook_enabled=values.unset): """ Update the UserInstance :param unicode role_sid: The SID id of the Role assigned to this user :param unicode attributes: A valid JSON string that contains application-specific data :param unicode friendly_name: A string to describe the resource + :param UserInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header :returns: The updated UserInstance :rtype: twilio.rest.chat.v2.service.user.UserInstance """ data = values.of({'RoleSid': role_sid, 'Attributes': attributes, 'FriendlyName': friendly_name, }) + headers = values.of({'X-Twilio-Webhook-Enabled': x_twilio_webhook_enabled, }) - payload = self._version.update(method='POST', uri=self._uri, data=data, ) + payload = self._version.update(method='POST', uri=self._uri, data=data, headers=headers, ) return UserInstance( self._version, @@ -509,18 +513,24 @@ def delete(self): return self._proxy.delete() def update(self, role_sid=values.unset, attributes=values.unset, - friendly_name=values.unset): + friendly_name=values.unset, x_twilio_webhook_enabled=values.unset): """ Update the UserInstance :param unicode role_sid: The SID id of the Role assigned to this user :param unicode attributes: A valid JSON string that contains application-specific data :param unicode friendly_name: A string to describe the resource + :param UserInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header :returns: The updated UserInstance :rtype: twilio.rest.chat.v2.service.user.UserInstance """ - return self._proxy.update(role_sid=role_sid, attributes=attributes, friendly_name=friendly_name, ) + return self._proxy.update( + role_sid=role_sid, + attributes=attributes, + friendly_name=friendly_name, + x_twilio_webhook_enabled=x_twilio_webhook_enabled, + ) @property def user_channels(self): diff --git a/twilio/rest/conversations/v1/conversation/__init__.py b/twilio/rest/conversations/v1/conversation/__init__.py index 74173c57d8..fcbf93bfb6 100644 --- a/twilio/rest/conversations/v1/conversation/__init__.py +++ b/twilio/rest/conversations/v1/conversation/__init__.py @@ -39,7 +39,7 @@ def __init__(self, version): def create(self, friendly_name=values.unset, date_created=values.unset, date_updated=values.unset, messaging_service_sid=values.unset, - attributes=values.unset): + attributes=values.unset, x_twilio_webhook_enabled=values.unset): """ Create the ConversationInstance @@ -48,6 +48,7 @@ def create(self, friendly_name=values.unset, date_created=values.unset, :param datetime date_updated: The date that this resource was last updated. :param unicode messaging_service_sid: The unique id of the SMS Service this conversation belongs to. :param unicode attributes: An optional string metadata field you can use to store any data you wish. + :param ConversationInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header :returns: The created ConversationInstance :rtype: twilio.rest.conversations.v1.conversation.ConversationInstance @@ -59,8 +60,9 @@ def create(self, friendly_name=values.unset, date_created=values.unset, 'MessagingServiceSid': messaging_service_sid, 'Attributes': attributes, }) + headers = values.of({'X-Twilio-Webhook-Enabled': x_twilio_webhook_enabled, }) - payload = self._version.create(method='POST', uri=self._uri, data=data, ) + payload = self._version.create(method='POST', uri=self._uri, data=data, headers=headers, ) return ConversationInstance(self._version, payload, ) @@ -239,7 +241,8 @@ def __init__(self, version, sid): self._webhooks = None def update(self, friendly_name=values.unset, date_created=values.unset, - date_updated=values.unset, attributes=values.unset): + date_updated=values.unset, attributes=values.unset, + x_twilio_webhook_enabled=values.unset): """ Update the ConversationInstance @@ -247,6 +250,7 @@ def update(self, friendly_name=values.unset, date_created=values.unset, :param datetime date_created: The date that this resource was created. :param datetime date_updated: The date that this resource was last updated. :param unicode attributes: An optional string metadata field you can use to store any data you wish. + :param ConversationInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header :returns: The updated ConversationInstance :rtype: twilio.rest.conversations.v1.conversation.ConversationInstance @@ -257,19 +261,24 @@ def update(self, friendly_name=values.unset, date_created=values.unset, 'DateUpdated': serialize.iso8601_datetime(date_updated), 'Attributes': attributes, }) + headers = values.of({'X-Twilio-Webhook-Enabled': x_twilio_webhook_enabled, }) - payload = self._version.update(method='POST', uri=self._uri, data=data, ) + payload = self._version.update(method='POST', uri=self._uri, data=data, headers=headers, ) return ConversationInstance(self._version, payload, sid=self._solution['sid'], ) - def delete(self): + def delete(self, x_twilio_webhook_enabled=values.unset): """ Deletes the ConversationInstance + :param ConversationInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header + :returns: True if delete succeeds, False otherwise :rtype: bool """ - return self._version.delete(method='DELETE', uri=self._uri, ) + headers = values.of({'X-Twilio-Webhook-Enabled': x_twilio_webhook_enabled, }) + + return self._version.delete(method='DELETE', uri=self._uri, headers=headers, ) def fetch(self): """ @@ -458,7 +467,8 @@ def links(self): return self._properties['links'] def update(self, friendly_name=values.unset, date_created=values.unset, - date_updated=values.unset, attributes=values.unset): + date_updated=values.unset, attributes=values.unset, + x_twilio_webhook_enabled=values.unset): """ Update the ConversationInstance @@ -466,6 +476,7 @@ def update(self, friendly_name=values.unset, date_created=values.unset, :param datetime date_created: The date that this resource was created. :param datetime date_updated: The date that this resource was last updated. :param unicode attributes: An optional string metadata field you can use to store any data you wish. + :param ConversationInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header :returns: The updated ConversationInstance :rtype: twilio.rest.conversations.v1.conversation.ConversationInstance @@ -475,16 +486,19 @@ def update(self, friendly_name=values.unset, date_created=values.unset, date_created=date_created, date_updated=date_updated, attributes=attributes, + x_twilio_webhook_enabled=x_twilio_webhook_enabled, ) - def delete(self): + def delete(self, x_twilio_webhook_enabled=values.unset): """ Deletes the ConversationInstance + :param ConversationInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header + :returns: True if delete succeeds, False otherwise :rtype: bool """ - return self._proxy.delete() + return self._proxy.delete(x_twilio_webhook_enabled=x_twilio_webhook_enabled, ) def fetch(self): """ diff --git a/twilio/rest/conversations/v1/conversation/message.py b/twilio/rest/conversations/v1/conversation/message.py index dd83af9c14..0aba7454be 100644 --- a/twilio/rest/conversations/v1/conversation/message.py +++ b/twilio/rest/conversations/v1/conversation/message.py @@ -37,7 +37,8 @@ def __init__(self, version, conversation_sid): def create(self, author=values.unset, body=values.unset, date_created=values.unset, date_updated=values.unset, - attributes=values.unset, media_sid=values.unset): + attributes=values.unset, media_sid=values.unset, + x_twilio_webhook_enabled=values.unset): """ Create the MessageInstance @@ -47,6 +48,7 @@ def create(self, author=values.unset, body=values.unset, :param datetime date_updated: The date that this resource was last updated. :param unicode attributes: A string metadata field you can use to store any data you wish. :param unicode media_sid: The Media Sid to be attached to the new Message. + :param MessageInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header :returns: The created MessageInstance :rtype: twilio.rest.conversations.v1.conversation.message.MessageInstance @@ -59,8 +61,9 @@ def create(self, author=values.unset, body=values.unset, 'Attributes': attributes, 'MediaSid': media_sid, }) + headers = values.of({'X-Twilio-Webhook-Enabled': x_twilio_webhook_enabled, }) - payload = self._version.create(method='POST', uri=self._uri, data=data, ) + payload = self._version.create(method='POST', uri=self._uri, data=data, headers=headers, ) return MessageInstance(self._version, payload, conversation_sid=self._solution['conversation_sid'], ) @@ -237,7 +240,7 @@ def __init__(self, version, conversation_sid, sid): def update(self, author=values.unset, body=values.unset, date_created=values.unset, date_updated=values.unset, - attributes=values.unset): + attributes=values.unset, x_twilio_webhook_enabled=values.unset): """ Update the MessageInstance @@ -246,6 +249,7 @@ def update(self, author=values.unset, body=values.unset, :param datetime date_created: The date that this resource was created. :param datetime date_updated: The date that this resource was last updated. :param unicode attributes: A string metadata field you can use to store any data you wish. + :param MessageInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header :returns: The updated MessageInstance :rtype: twilio.rest.conversations.v1.conversation.message.MessageInstance @@ -257,8 +261,9 @@ def update(self, author=values.unset, body=values.unset, 'DateUpdated': serialize.iso8601_datetime(date_updated), 'Attributes': attributes, }) + headers = values.of({'X-Twilio-Webhook-Enabled': x_twilio_webhook_enabled, }) - payload = self._version.update(method='POST', uri=self._uri, data=data, ) + payload = self._version.update(method='POST', uri=self._uri, data=data, headers=headers, ) return MessageInstance( self._version, @@ -267,14 +272,18 @@ def update(self, author=values.unset, body=values.unset, sid=self._solution['sid'], ) - def delete(self): + def delete(self, x_twilio_webhook_enabled=values.unset): """ Deletes the MessageInstance + :param MessageInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header + :returns: True if delete succeeds, False otherwise :rtype: bool """ - return self._version.delete(method='DELETE', uri=self._uri, ) + headers = values.of({'X-Twilio-Webhook-Enabled': x_twilio_webhook_enabled, }) + + return self._version.delete(method='DELETE', uri=self._uri, headers=headers, ) def fetch(self): """ @@ -446,7 +455,7 @@ def url(self): def update(self, author=values.unset, body=values.unset, date_created=values.unset, date_updated=values.unset, - attributes=values.unset): + attributes=values.unset, x_twilio_webhook_enabled=values.unset): """ Update the MessageInstance @@ -455,6 +464,7 @@ def update(self, author=values.unset, body=values.unset, :param datetime date_created: The date that this resource was created. :param datetime date_updated: The date that this resource was last updated. :param unicode attributes: A string metadata field you can use to store any data you wish. + :param MessageInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header :returns: The updated MessageInstance :rtype: twilio.rest.conversations.v1.conversation.message.MessageInstance @@ -465,16 +475,19 @@ def update(self, author=values.unset, body=values.unset, date_created=date_created, date_updated=date_updated, attributes=attributes, + x_twilio_webhook_enabled=x_twilio_webhook_enabled, ) - def delete(self): + def delete(self, x_twilio_webhook_enabled=values.unset): """ Deletes the MessageInstance + :param MessageInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header + :returns: True if delete succeeds, False otherwise :rtype: bool """ - return self._proxy.delete() + return self._proxy.delete(x_twilio_webhook_enabled=x_twilio_webhook_enabled, ) def fetch(self): """ diff --git a/twilio/rest/conversations/v1/conversation/participant.py b/twilio/rest/conversations/v1/conversation/participant.py index 59ad639c8e..a150893431 100644 --- a/twilio/rest/conversations/v1/conversation/participant.py +++ b/twilio/rest/conversations/v1/conversation/participant.py @@ -39,7 +39,8 @@ def create(self, identity=values.unset, messaging_binding_address=values.unset, messaging_binding_proxy_address=values.unset, date_created=values.unset, date_updated=values.unset, attributes=values.unset, - messaging_binding_projected_address=values.unset): + messaging_binding_projected_address=values.unset, + x_twilio_webhook_enabled=values.unset): """ Create the ParticipantInstance @@ -50,6 +51,7 @@ def create(self, identity=values.unset, messaging_binding_address=values.unset, :param datetime date_updated: The date that this resource was last updated. :param unicode attributes: An optional string metadata field you can use to store any data you wish. :param unicode messaging_binding_projected_address: The address of the Twilio phone number that is used in Group MMS. + :param ParticipantInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header :returns: The created ParticipantInstance :rtype: twilio.rest.conversations.v1.conversation.participant.ParticipantInstance @@ -63,8 +65,9 @@ def create(self, identity=values.unset, messaging_binding_address=values.unset, 'Attributes': attributes, 'MessagingBinding.ProjectedAddress': messaging_binding_projected_address, }) + headers = values.of({'X-Twilio-Webhook-Enabled': x_twilio_webhook_enabled, }) - payload = self._version.create(method='POST', uri=self._uri, data=data, ) + payload = self._version.create(method='POST', uri=self._uri, data=data, headers=headers, ) return ParticipantInstance( self._version, @@ -256,13 +259,14 @@ def __init__(self, version, conversation_sid, sid): self._uri = '/Conversations/{conversation_sid}/Participants/{sid}'.format(**self._solution) def update(self, date_created=values.unset, date_updated=values.unset, - attributes=values.unset): + attributes=values.unset, x_twilio_webhook_enabled=values.unset): """ Update the ParticipantInstance :param datetime date_created: The date that this resource was created. :param datetime date_updated: The date that this resource was last updated. :param unicode attributes: An optional string metadata field you can use to store any data you wish. + :param ParticipantInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header :returns: The updated ParticipantInstance :rtype: twilio.rest.conversations.v1.conversation.participant.ParticipantInstance @@ -272,8 +276,9 @@ def update(self, date_created=values.unset, date_updated=values.unset, 'DateUpdated': serialize.iso8601_datetime(date_updated), 'Attributes': attributes, }) + headers = values.of({'X-Twilio-Webhook-Enabled': x_twilio_webhook_enabled, }) - payload = self._version.update(method='POST', uri=self._uri, data=data, ) + payload = self._version.update(method='POST', uri=self._uri, data=data, headers=headers, ) return ParticipantInstance( self._version, @@ -282,14 +287,18 @@ def update(self, date_created=values.unset, date_updated=values.unset, sid=self._solution['sid'], ) - def delete(self): + def delete(self, x_twilio_webhook_enabled=values.unset): """ Deletes the ParticipantInstance + :param ParticipantInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header + :returns: True if delete succeeds, False otherwise :rtype: bool """ - return self._version.delete(method='DELETE', uri=self._uri, ) + headers = values.of({'X-Twilio-Webhook-Enabled': x_twilio_webhook_enabled, }) + + return self._version.delete(method='DELETE', uri=self._uri, headers=headers, ) def fetch(self): """ @@ -442,13 +451,14 @@ def url(self): return self._properties['url'] def update(self, date_created=values.unset, date_updated=values.unset, - attributes=values.unset): + attributes=values.unset, x_twilio_webhook_enabled=values.unset): """ Update the ParticipantInstance :param datetime date_created: The date that this resource was created. :param datetime date_updated: The date that this resource was last updated. :param unicode attributes: An optional string metadata field you can use to store any data you wish. + :param ParticipantInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header :returns: The updated ParticipantInstance :rtype: twilio.rest.conversations.v1.conversation.participant.ParticipantInstance @@ -457,16 +467,19 @@ def update(self, date_created=values.unset, date_updated=values.unset, date_created=date_created, date_updated=date_updated, attributes=attributes, + x_twilio_webhook_enabled=x_twilio_webhook_enabled, ) - def delete(self): + def delete(self, x_twilio_webhook_enabled=values.unset): """ Deletes the ParticipantInstance + :param ParticipantInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header + :returns: True if delete succeeds, False otherwise :rtype: bool """ - return self._proxy.delete() + return self._proxy.delete(x_twilio_webhook_enabled=x_twilio_webhook_enabled, ) def fetch(self): """ diff --git a/twilio/rest/ip_messaging/v2/service/channel/__init__.py b/twilio/rest/ip_messaging/v2/service/channel/__init__.py index e32b76c530..afb9b41d54 100644 --- a/twilio/rest/ip_messaging/v2/service/channel/__init__.py +++ b/twilio/rest/ip_messaging/v2/service/channel/__init__.py @@ -41,7 +41,7 @@ def __init__(self, version, service_sid): def create(self, friendly_name=values.unset, unique_name=values.unset, attributes=values.unset, type=values.unset, date_created=values.unset, date_updated=values.unset, - created_by=values.unset): + created_by=values.unset, x_twilio_webhook_enabled=values.unset): """ Create the ChannelInstance @@ -52,6 +52,7 @@ def create(self, friendly_name=values.unset, unique_name=values.unset, :param datetime date_created: The ISO 8601 date and time in GMT when the resource was created :param datetime date_updated: The ISO 8601 date and time in GMT when the resource was updated :param unicode created_by: The identity of the User that created the Channel + :param ChannelInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header :returns: The created ChannelInstance :rtype: twilio.rest.chat.v2.service.channel.ChannelInstance @@ -65,8 +66,9 @@ def create(self, friendly_name=values.unset, unique_name=values.unset, 'DateUpdated': serialize.iso8601_datetime(date_updated), 'CreatedBy': created_by, }) + headers = values.of({'X-Twilio-Webhook-Enabled': x_twilio_webhook_enabled, }) - payload = self._version.create(method='POST', uri=self._uri, data=data, ) + payload = self._version.create(method='POST', uri=self._uri, data=data, headers=headers, ) return ChannelInstance(self._version, payload, service_sid=self._solution['service_sid'], ) @@ -269,18 +271,23 @@ def fetch(self): sid=self._solution['sid'], ) - def delete(self): + def delete(self, x_twilio_webhook_enabled=values.unset): """ Deletes the ChannelInstance + :param ChannelInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header + :returns: True if delete succeeds, False otherwise :rtype: bool """ - return self._version.delete(method='DELETE', uri=self._uri, ) + headers = values.of({'X-Twilio-Webhook-Enabled': x_twilio_webhook_enabled, }) + + return self._version.delete(method='DELETE', uri=self._uri, headers=headers, ) def update(self, friendly_name=values.unset, unique_name=values.unset, attributes=values.unset, date_created=values.unset, - date_updated=values.unset, created_by=values.unset): + date_updated=values.unset, created_by=values.unset, + x_twilio_webhook_enabled=values.unset): """ Update the ChannelInstance @@ -290,6 +297,7 @@ def update(self, friendly_name=values.unset, unique_name=values.unset, :param datetime date_created: The ISO 8601 date and time in GMT when the resource was created :param datetime date_updated: The ISO 8601 date and time in GMT when the resource was updated :param unicode created_by: The identity of the User that created the Channel + :param ChannelInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header :returns: The updated ChannelInstance :rtype: twilio.rest.chat.v2.service.channel.ChannelInstance @@ -302,8 +310,9 @@ def update(self, friendly_name=values.unset, unique_name=values.unset, 'DateUpdated': serialize.iso8601_datetime(date_updated), 'CreatedBy': created_by, }) + headers = values.of({'X-Twilio-Webhook-Enabled': x_twilio_webhook_enabled, }) - payload = self._version.update(method='POST', uri=self._uri, data=data, ) + payload = self._version.update(method='POST', uri=self._uri, data=data, headers=headers, ) return ChannelInstance( self._version, @@ -567,18 +576,21 @@ def fetch(self): """ return self._proxy.fetch() - def delete(self): + def delete(self, x_twilio_webhook_enabled=values.unset): """ Deletes the ChannelInstance + :param ChannelInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header + :returns: True if delete succeeds, False otherwise :rtype: bool """ - return self._proxy.delete() + return self._proxy.delete(x_twilio_webhook_enabled=x_twilio_webhook_enabled, ) def update(self, friendly_name=values.unset, unique_name=values.unset, attributes=values.unset, date_created=values.unset, - date_updated=values.unset, created_by=values.unset): + date_updated=values.unset, created_by=values.unset, + x_twilio_webhook_enabled=values.unset): """ Update the ChannelInstance @@ -588,6 +600,7 @@ def update(self, friendly_name=values.unset, unique_name=values.unset, :param datetime date_created: The ISO 8601 date and time in GMT when the resource was created :param datetime date_updated: The ISO 8601 date and time in GMT when the resource was updated :param unicode created_by: The identity of the User that created the Channel + :param ChannelInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header :returns: The updated ChannelInstance :rtype: twilio.rest.chat.v2.service.channel.ChannelInstance @@ -599,6 +612,7 @@ def update(self, friendly_name=values.unset, unique_name=values.unset, date_created=date_created, date_updated=date_updated, created_by=created_by, + x_twilio_webhook_enabled=x_twilio_webhook_enabled, ) @property diff --git a/twilio/rest/ip_messaging/v2/service/channel/member.py b/twilio/rest/ip_messaging/v2/service/channel/member.py index fc502883d4..907cff7e37 100644 --- a/twilio/rest/ip_messaging/v2/service/channel/member.py +++ b/twilio/rest/ip_messaging/v2/service/channel/member.py @@ -38,7 +38,8 @@ def __init__(self, version, service_sid, channel_sid): def create(self, identity, role_sid=values.unset, last_consumed_message_index=values.unset, last_consumption_timestamp=values.unset, date_created=values.unset, - date_updated=values.unset, attributes=values.unset): + date_updated=values.unset, attributes=values.unset, + x_twilio_webhook_enabled=values.unset): """ Create the MemberInstance @@ -49,6 +50,7 @@ def create(self, identity, role_sid=values.unset, :param datetime date_created: The ISO 8601 date and time in GMT when the resource was created :param datetime date_updated: The ISO 8601 date and time in GMT when the resource was updated :param unicode attributes: A valid JSON string that contains application-specific data + :param MemberInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header :returns: The created MemberInstance :rtype: twilio.rest.chat.v2.service.channel.member.MemberInstance @@ -62,8 +64,9 @@ def create(self, identity, role_sid=values.unset, 'DateUpdated': serialize.iso8601_datetime(date_updated), 'Attributes': attributes, }) + headers = values.of({'X-Twilio-Webhook-Enabled': x_twilio_webhook_enabled, }) - payload = self._version.create(method='POST', uri=self._uri, data=data, ) + payload = self._version.create(method='POST', uri=self._uri, data=data, headers=headers, ) return MemberInstance( self._version, @@ -283,19 +286,24 @@ def fetch(self): sid=self._solution['sid'], ) - def delete(self): + def delete(self, x_twilio_webhook_enabled=values.unset): """ Deletes the MemberInstance + :param MemberInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header + :returns: True if delete succeeds, False otherwise :rtype: bool """ - return self._version.delete(method='DELETE', uri=self._uri, ) + headers = values.of({'X-Twilio-Webhook-Enabled': x_twilio_webhook_enabled, }) + + return self._version.delete(method='DELETE', uri=self._uri, headers=headers, ) def update(self, role_sid=values.unset, last_consumed_message_index=values.unset, last_consumption_timestamp=values.unset, date_created=values.unset, - date_updated=values.unset, attributes=values.unset): + date_updated=values.unset, attributes=values.unset, + x_twilio_webhook_enabled=values.unset): """ Update the MemberInstance @@ -305,6 +313,7 @@ def update(self, role_sid=values.unset, :param datetime date_created: The ISO 8601 date and time in GMT when the resource was created :param datetime date_updated: The ISO 8601 date and time in GMT when the resource was updated :param unicode attributes: A valid JSON string that contains application-specific data + :param MemberInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header :returns: The updated MemberInstance :rtype: twilio.rest.chat.v2.service.channel.member.MemberInstance @@ -317,8 +326,9 @@ def update(self, role_sid=values.unset, 'DateUpdated': serialize.iso8601_datetime(date_updated), 'Attributes': attributes, }) + headers = values.of({'X-Twilio-Webhook-Enabled': x_twilio_webhook_enabled, }) - payload = self._version.update(method='POST', uri=self._uri, data=data, ) + payload = self._version.update(method='POST', uri=self._uri, data=data, headers=headers, ) return MemberInstance( self._version, @@ -502,19 +512,22 @@ def fetch(self): """ return self._proxy.fetch() - def delete(self): + def delete(self, x_twilio_webhook_enabled=values.unset): """ Deletes the MemberInstance + :param MemberInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header + :returns: True if delete succeeds, False otherwise :rtype: bool """ - return self._proxy.delete() + return self._proxy.delete(x_twilio_webhook_enabled=x_twilio_webhook_enabled, ) def update(self, role_sid=values.unset, last_consumed_message_index=values.unset, last_consumption_timestamp=values.unset, date_created=values.unset, - date_updated=values.unset, attributes=values.unset): + date_updated=values.unset, attributes=values.unset, + x_twilio_webhook_enabled=values.unset): """ Update the MemberInstance @@ -524,6 +537,7 @@ def update(self, role_sid=values.unset, :param datetime date_created: The ISO 8601 date and time in GMT when the resource was created :param datetime date_updated: The ISO 8601 date and time in GMT when the resource was updated :param unicode attributes: A valid JSON string that contains application-specific data + :param MemberInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header :returns: The updated MemberInstance :rtype: twilio.rest.chat.v2.service.channel.member.MemberInstance @@ -535,6 +549,7 @@ def update(self, role_sid=values.unset, date_created=date_created, date_updated=date_updated, attributes=attributes, + x_twilio_webhook_enabled=x_twilio_webhook_enabled, ) def __repr__(self): diff --git a/twilio/rest/ip_messaging/v2/service/channel/message.py b/twilio/rest/ip_messaging/v2/service/channel/message.py index 8d29f20bbb..df9803e228 100644 --- a/twilio/rest/ip_messaging/v2/service/channel/message.py +++ b/twilio/rest/ip_messaging/v2/service/channel/message.py @@ -38,7 +38,7 @@ def __init__(self, version, service_sid, channel_sid): def create(self, from_=values.unset, attributes=values.unset, date_created=values.unset, date_updated=values.unset, last_updated_by=values.unset, body=values.unset, - media_sid=values.unset): + media_sid=values.unset, x_twilio_webhook_enabled=values.unset): """ Create the MessageInstance @@ -49,6 +49,7 @@ def create(self, from_=values.unset, attributes=values.unset, :param unicode last_updated_by: The Identity of the User who last updated the Message :param unicode body: The message to send to the channel :param unicode media_sid: The Media Sid to be attached to the new Message + :param MessageInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header :returns: The created MessageInstance :rtype: twilio.rest.chat.v2.service.channel.message.MessageInstance @@ -62,8 +63,9 @@ def create(self, from_=values.unset, attributes=values.unset, 'Body': body, 'MediaSid': media_sid, }) + headers = values.of({'X-Twilio-Webhook-Enabled': x_twilio_webhook_enabled, }) - payload = self._version.create(method='POST', uri=self._uri, data=data, ) + payload = self._version.create(method='POST', uri=self._uri, data=data, headers=headers, ) return MessageInstance( self._version, @@ -283,18 +285,23 @@ def fetch(self): sid=self._solution['sid'], ) - def delete(self): + def delete(self, x_twilio_webhook_enabled=values.unset): """ Deletes the MessageInstance + :param MessageInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header + :returns: True if delete succeeds, False otherwise :rtype: bool """ - return self._version.delete(method='DELETE', uri=self._uri, ) + headers = values.of({'X-Twilio-Webhook-Enabled': x_twilio_webhook_enabled, }) + + return self._version.delete(method='DELETE', uri=self._uri, headers=headers, ) def update(self, body=values.unset, attributes=values.unset, date_created=values.unset, date_updated=values.unset, - last_updated_by=values.unset, from_=values.unset): + last_updated_by=values.unset, from_=values.unset, + x_twilio_webhook_enabled=values.unset): """ Update the MessageInstance @@ -304,6 +311,7 @@ def update(self, body=values.unset, attributes=values.unset, :param datetime date_updated: The ISO 8601 date and time in GMT when the resource was updated :param unicode last_updated_by: The Identity of the User who last updated the Message, if applicable :param unicode from_: The Identity of the message's author + :param MessageInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header :returns: The updated MessageInstance :rtype: twilio.rest.chat.v2.service.channel.message.MessageInstance @@ -316,8 +324,9 @@ def update(self, body=values.unset, attributes=values.unset, 'LastUpdatedBy': last_updated_by, 'From': from_, }) + headers = values.of({'X-Twilio-Webhook-Enabled': x_twilio_webhook_enabled, }) - payload = self._version.update(method='POST', uri=self._uri, data=data, ) + payload = self._version.update(method='POST', uri=self._uri, data=data, headers=headers, ) return MessageInstance( self._version, @@ -541,18 +550,21 @@ def fetch(self): """ return self._proxy.fetch() - def delete(self): + def delete(self, x_twilio_webhook_enabled=values.unset): """ Deletes the MessageInstance + :param MessageInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header + :returns: True if delete succeeds, False otherwise :rtype: bool """ - return self._proxy.delete() + return self._proxy.delete(x_twilio_webhook_enabled=x_twilio_webhook_enabled, ) def update(self, body=values.unset, attributes=values.unset, date_created=values.unset, date_updated=values.unset, - last_updated_by=values.unset, from_=values.unset): + last_updated_by=values.unset, from_=values.unset, + x_twilio_webhook_enabled=values.unset): """ Update the MessageInstance @@ -562,6 +574,7 @@ def update(self, body=values.unset, attributes=values.unset, :param datetime date_updated: The ISO 8601 date and time in GMT when the resource was updated :param unicode last_updated_by: The Identity of the User who last updated the Message, if applicable :param unicode from_: The Identity of the message's author + :param MessageInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header :returns: The updated MessageInstance :rtype: twilio.rest.chat.v2.service.channel.message.MessageInstance @@ -573,6 +586,7 @@ def update(self, body=values.unset, attributes=values.unset, date_updated=date_updated, last_updated_by=last_updated_by, from_=from_, + x_twilio_webhook_enabled=x_twilio_webhook_enabled, ) def __repr__(self): diff --git a/twilio/rest/ip_messaging/v2/service/user/__init__.py b/twilio/rest/ip_messaging/v2/service/user/__init__.py index 45f4a47649..20e8c3706c 100644 --- a/twilio/rest/ip_messaging/v2/service/user/__init__.py +++ b/twilio/rest/ip_messaging/v2/service/user/__init__.py @@ -36,7 +36,7 @@ def __init__(self, version, service_sid): self._uri = '/Services/{service_sid}/Users'.format(**self._solution) def create(self, identity, role_sid=values.unset, attributes=values.unset, - friendly_name=values.unset): + friendly_name=values.unset, x_twilio_webhook_enabled=values.unset): """ Create the UserInstance @@ -44,6 +44,7 @@ def create(self, identity, role_sid=values.unset, attributes=values.unset, :param unicode role_sid: The SID of the Role assigned to this user :param unicode attributes: A valid JSON string that contains application-specific data :param unicode friendly_name: A string to describe the new resource + :param UserInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header :returns: The created UserInstance :rtype: twilio.rest.chat.v2.service.user.UserInstance @@ -54,8 +55,9 @@ def create(self, identity, role_sid=values.unset, attributes=values.unset, 'Attributes': attributes, 'FriendlyName': friendly_name, }) + headers = values.of({'X-Twilio-Webhook-Enabled': x_twilio_webhook_enabled, }) - payload = self._version.create(method='POST', uri=self._uri, data=data, ) + payload = self._version.create(method='POST', uri=self._uri, data=data, headers=headers, ) return UserInstance(self._version, payload, service_sid=self._solution['service_sid'], ) @@ -258,20 +260,22 @@ def delete(self): return self._version.delete(method='DELETE', uri=self._uri, ) def update(self, role_sid=values.unset, attributes=values.unset, - friendly_name=values.unset): + friendly_name=values.unset, x_twilio_webhook_enabled=values.unset): """ Update the UserInstance :param unicode role_sid: The SID id of the Role assigned to this user :param unicode attributes: A valid JSON string that contains application-specific data :param unicode friendly_name: A string to describe the resource + :param UserInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header :returns: The updated UserInstance :rtype: twilio.rest.chat.v2.service.user.UserInstance """ data = values.of({'RoleSid': role_sid, 'Attributes': attributes, 'FriendlyName': friendly_name, }) + headers = values.of({'X-Twilio-Webhook-Enabled': x_twilio_webhook_enabled, }) - payload = self._version.update(method='POST', uri=self._uri, data=data, ) + payload = self._version.update(method='POST', uri=self._uri, data=data, headers=headers, ) return UserInstance( self._version, @@ -509,18 +513,24 @@ def delete(self): return self._proxy.delete() def update(self, role_sid=values.unset, attributes=values.unset, - friendly_name=values.unset): + friendly_name=values.unset, x_twilio_webhook_enabled=values.unset): """ Update the UserInstance :param unicode role_sid: The SID id of the Role assigned to this user :param unicode attributes: A valid JSON string that contains application-specific data :param unicode friendly_name: A string to describe the resource + :param UserInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header :returns: The updated UserInstance :rtype: twilio.rest.chat.v2.service.user.UserInstance """ - return self._proxy.update(role_sid=role_sid, attributes=attributes, friendly_name=friendly_name, ) + return self._proxy.update( + role_sid=role_sid, + attributes=attributes, + friendly_name=friendly_name, + x_twilio_webhook_enabled=x_twilio_webhook_enabled, + ) @property def user_channels(self): diff --git a/twilio/rest/preview/sync/service/document/__init__.py b/twilio/rest/preview/sync/service/document/__init__.py index ffcd609874..ad7f64de66 100644 --- a/twilio/rest/preview/sync/service/document/__init__.py +++ b/twilio/rest/preview/sync/service/document/__init__.py @@ -245,27 +245,33 @@ def fetch(self): sid=self._solution['sid'], ) - def delete(self): + def delete(self, if_match=values.unset): """ Deletes the DocumentInstance + :param unicode if_match: The If-Match HTTP request header + :returns: True if delete succeeds, False otherwise :rtype: bool """ - return self._version.delete(method='DELETE', uri=self._uri, ) + headers = values.of({'If-Match': if_match, }) + + return self._version.delete(method='DELETE', uri=self._uri, headers=headers, ) - def update(self, data): + def update(self, data, if_match=values.unset): """ Update the DocumentInstance :param dict data: The data + :param unicode if_match: The If-Match HTTP request header :returns: The updated DocumentInstance :rtype: twilio.rest.preview.sync.service.document.DocumentInstance """ data = values.of({'Data': serialize.object(data), }) + headers = values.of({'If-Match': if_match, }) - payload = self._version.update(method='POST', uri=self._uri, data=data, ) + payload = self._version.update(method='POST', uri=self._uri, data=data, headers=headers, ) return DocumentInstance( self._version, @@ -448,25 +454,28 @@ def fetch(self): """ return self._proxy.fetch() - def delete(self): + def delete(self, if_match=values.unset): """ Deletes the DocumentInstance + :param unicode if_match: The If-Match HTTP request header + :returns: True if delete succeeds, False otherwise :rtype: bool """ - return self._proxy.delete() + return self._proxy.delete(if_match=if_match, ) - def update(self, data): + def update(self, data, if_match=values.unset): """ Update the DocumentInstance :param dict data: The data + :param unicode if_match: The If-Match HTTP request header :returns: The updated DocumentInstance :rtype: twilio.rest.preview.sync.service.document.DocumentInstance """ - return self._proxy.update(data, ) + return self._proxy.update(data, if_match=if_match, ) @property def document_permissions(self): diff --git a/twilio/rest/preview/sync/service/sync_list/sync_list_item.py b/twilio/rest/preview/sync/service/sync_list/sync_list_item.py index 343a0f7202..a54e131f77 100644 --- a/twilio/rest/preview/sync/service/sync_list/sync_list_item.py +++ b/twilio/rest/preview/sync/service/sync_list/sync_list_item.py @@ -283,27 +283,33 @@ def fetch(self): index=self._solution['index'], ) - def delete(self): + def delete(self, if_match=values.unset): """ Deletes the SyncListItemInstance + :param unicode if_match: The If-Match HTTP request header + :returns: True if delete succeeds, False otherwise :rtype: bool """ - return self._version.delete(method='DELETE', uri=self._uri, ) + headers = values.of({'If-Match': if_match, }) + + return self._version.delete(method='DELETE', uri=self._uri, headers=headers, ) - def update(self, data): + def update(self, data, if_match=values.unset): """ Update the SyncListItemInstance :param dict data: The data + :param unicode if_match: The If-Match HTTP request header :returns: The updated SyncListItemInstance :rtype: twilio.rest.preview.sync.service.sync_list.sync_list_item.SyncListItemInstance """ data = values.of({'Data': serialize.object(data), }) + headers = values.of({'If-Match': if_match, }) - payload = self._version.update(method='POST', uri=self._uri, data=data, ) + payload = self._version.update(method='POST', uri=self._uri, data=data, headers=headers, ) return SyncListItemInstance( self._version, @@ -475,25 +481,28 @@ def fetch(self): """ return self._proxy.fetch() - def delete(self): + def delete(self, if_match=values.unset): """ Deletes the SyncListItemInstance + :param unicode if_match: The If-Match HTTP request header + :returns: True if delete succeeds, False otherwise :rtype: bool """ - return self._proxy.delete() + return self._proxy.delete(if_match=if_match, ) - def update(self, data): + def update(self, data, if_match=values.unset): """ Update the SyncListItemInstance :param dict data: The data + :param unicode if_match: The If-Match HTTP request header :returns: The updated SyncListItemInstance :rtype: twilio.rest.preview.sync.service.sync_list.sync_list_item.SyncListItemInstance """ - return self._proxy.update(data, ) + return self._proxy.update(data, if_match=if_match, ) def __repr__(self): """ diff --git a/twilio/rest/preview/sync/service/sync_map/sync_map_item.py b/twilio/rest/preview/sync/service/sync_map/sync_map_item.py index 7685ef2969..229d631c88 100644 --- a/twilio/rest/preview/sync/service/sync_map/sync_map_item.py +++ b/twilio/rest/preview/sync/service/sync_map/sync_map_item.py @@ -284,27 +284,33 @@ def fetch(self): key=self._solution['key'], ) - def delete(self): + def delete(self, if_match=values.unset): """ Deletes the SyncMapItemInstance + :param unicode if_match: The If-Match HTTP request header + :returns: True if delete succeeds, False otherwise :rtype: bool """ - return self._version.delete(method='DELETE', uri=self._uri, ) + headers = values.of({'If-Match': if_match, }) + + return self._version.delete(method='DELETE', uri=self._uri, headers=headers, ) - def update(self, data): + def update(self, data, if_match=values.unset): """ Update the SyncMapItemInstance :param dict data: The data + :param unicode if_match: The If-Match HTTP request header :returns: The updated SyncMapItemInstance :rtype: twilio.rest.preview.sync.service.sync_map.sync_map_item.SyncMapItemInstance """ data = values.of({'Data': serialize.object(data), }) + headers = values.of({'If-Match': if_match, }) - payload = self._version.update(method='POST', uri=self._uri, data=data, ) + payload = self._version.update(method='POST', uri=self._uri, data=data, headers=headers, ) return SyncMapItemInstance( self._version, @@ -476,25 +482,28 @@ def fetch(self): """ return self._proxy.fetch() - def delete(self): + def delete(self, if_match=values.unset): """ Deletes the SyncMapItemInstance + :param unicode if_match: The If-Match HTTP request header + :returns: True if delete succeeds, False otherwise :rtype: bool """ - return self._proxy.delete() + return self._proxy.delete(if_match=if_match, ) - def update(self, data): + def update(self, data, if_match=values.unset): """ Update the SyncMapItemInstance :param dict data: The data + :param unicode if_match: The If-Match HTTP request header :returns: The updated SyncMapItemInstance :rtype: twilio.rest.preview.sync.service.sync_map.sync_map_item.SyncMapItemInstance """ - return self._proxy.update(data, ) + return self._proxy.update(data, if_match=if_match, ) def __repr__(self): """ diff --git a/twilio/rest/preview/trusted_comms/branded_call.py b/twilio/rest/preview/trusted_comms/branded_call.py index ba1461c081..67bf3c229c 100644 --- a/twilio/rest/preview/trusted_comms/branded_call.py +++ b/twilio/rest/preview/trusted_comms/branded_call.py @@ -33,7 +33,8 @@ def __init__(self, version): self._solution = {} self._uri = '/Business/BrandedCalls'.format(**self._solution) - def create(self, from_, to, reason, call_sid=values.unset): + def create(self, from_, to, reason, call_sid=values.unset, + twilio_sandbox_mode=values.unset): """ Create the BrandedCallInstance @@ -41,13 +42,15 @@ def create(self, from_, to, reason, call_sid=values.unset): :param unicode to: The terminating Phone Number :param unicode reason: The business reason for this phone call :param unicode call_sid: The Call sid this Branded Call should link to + :param unicode twilio_sandbox_mode: Optional header to mock all voice dependencies :returns: The created BrandedCallInstance :rtype: twilio.rest.preview.trusted_comms.branded_call.BrandedCallInstance """ data = values.of({'From': from_, 'To': to, 'Reason': reason, 'CallSid': call_sid, }) + headers = values.of({'Twilio-Sandbox-Mode': twilio_sandbox_mode, }) - payload = self._version.create(method='POST', uri=self._uri, data=data, ) + payload = self._version.create(method='POST', uri=self._uri, data=data, headers=headers, ) return BrandedCallInstance(self._version, payload, ) diff --git a/twilio/rest/preview/trusted_comms/cps.py b/twilio/rest/preview/trusted_comms/cps.py index 9dcdc72de2..0cd62c8428 100644 --- a/twilio/rest/preview/trusted_comms/cps.py +++ b/twilio/rest/preview/trusted_comms/cps.py @@ -121,14 +121,23 @@ def __init__(self, version): self._solution = {} self._uri = '/CPS'.format(**self._solution) - def fetch(self): + def fetch(self, twilio_sandbox_mode=values.unset, + x_xcnam_sensitive_phone_number=values.unset): """ Fetch the CpsInstance + :param unicode twilio_sandbox_mode: Optional header to mock all voice dependencies. + :param unicode x_xcnam_sensitive_phone_number: Phone number to retrieve CPS. + :returns: The fetched CpsInstance :rtype: twilio.rest.preview.trusted_comms.cps.CpsInstance """ - payload = self._version.fetch(method='GET', uri=self._uri, ) + headers = values.of({ + 'Twilio-Sandbox-Mode': twilio_sandbox_mode, + 'X-Xcnam-Sensitive-Phone-Number': x_xcnam_sensitive_phone_number, + }) + + payload = self._version.fetch(method='GET', uri=self._uri, headers=headers, ) return CpsInstance(self._version, payload, ) @@ -205,14 +214,21 @@ def url(self): """ return self._properties['url'] - def fetch(self): + def fetch(self, twilio_sandbox_mode=values.unset, + x_xcnam_sensitive_phone_number=values.unset): """ Fetch the CpsInstance + :param unicode twilio_sandbox_mode: Optional header to mock all voice dependencies. + :param unicode x_xcnam_sensitive_phone_number: Phone number to retrieve CPS. + :returns: The fetched CpsInstance :rtype: twilio.rest.preview.trusted_comms.cps.CpsInstance """ - return self._proxy.fetch() + return self._proxy.fetch( + twilio_sandbox_mode=twilio_sandbox_mode, + x_xcnam_sensitive_phone_number=x_xcnam_sensitive_phone_number, + ) def __repr__(self): """ diff --git a/twilio/rest/preview/trusted_comms/current_call.py b/twilio/rest/preview/trusted_comms/current_call.py index 2135db2c5b..dbd525a708 100644 --- a/twilio/rest/preview/trusted_comms/current_call.py +++ b/twilio/rest/preview/trusted_comms/current_call.py @@ -122,14 +122,26 @@ def __init__(self, version): self._solution = {} self._uri = '/CurrentCall'.format(**self._solution) - def fetch(self): + def fetch(self, twilio_sandbox_mode=values.unset, + x_xcnam_sensitive_phone_number_from=values.unset, + x_xcnam_sensitive_phone_number_to=values.unset): """ Fetch the CurrentCallInstance + :param unicode twilio_sandbox_mode: Optional header to mock all voice dependencies + :param unicode x_xcnam_sensitive_phone_number_from: The originating Phone Number + :param unicode x_xcnam_sensitive_phone_number_to: The terminating Phone Number + :returns: The fetched CurrentCallInstance :rtype: twilio.rest.preview.trusted_comms.current_call.CurrentCallInstance """ - payload = self._version.fetch(method='GET', uri=self._uri, ) + headers = values.of({ + 'Twilio-Sandbox-Mode': twilio_sandbox_mode, + 'X-Xcnam-Sensitive-Phone-Number-From': x_xcnam_sensitive_phone_number_from, + 'X-Xcnam-Sensitive-Phone-Number-To': x_xcnam_sensitive_phone_number_to, + }) + + payload = self._version.fetch(method='GET', uri=self._uri, headers=headers, ) return CurrentCallInstance(self._version, payload, ) @@ -305,14 +317,24 @@ def use_case(self): """ return self._properties['use_case'] - def fetch(self): + def fetch(self, twilio_sandbox_mode=values.unset, + x_xcnam_sensitive_phone_number_from=values.unset, + x_xcnam_sensitive_phone_number_to=values.unset): """ Fetch the CurrentCallInstance + :param unicode twilio_sandbox_mode: Optional header to mock all voice dependencies + :param unicode x_xcnam_sensitive_phone_number_from: The originating Phone Number + :param unicode x_xcnam_sensitive_phone_number_to: The terminating Phone Number + :returns: The fetched CurrentCallInstance :rtype: twilio.rest.preview.trusted_comms.current_call.CurrentCallInstance """ - return self._proxy.fetch() + return self._proxy.fetch( + twilio_sandbox_mode=twilio_sandbox_mode, + x_xcnam_sensitive_phone_number_from=x_xcnam_sensitive_phone_number_from, + x_xcnam_sensitive_phone_number_to=x_xcnam_sensitive_phone_number_to, + ) def __repr__(self): """ diff --git a/twilio/rest/preview/trusted_comms/device.py b/twilio/rest/preview/trusted_comms/device.py index 3e85e0221f..7180865184 100644 --- a/twilio/rest/preview/trusted_comms/device.py +++ b/twilio/rest/preview/trusted_comms/device.py @@ -32,19 +32,21 @@ def __init__(self, version): self._solution = {} self._uri = '/Devices'.format(**self._solution) - def create(self, phone_number, push_token): + def create(self, phone_number, push_token, twilio_sandbox_mode=values.unset): """ Create the DeviceInstance :param unicode phone_number: The end user Phone Number :param unicode push_token: The Push Token for this Phone Number + :param unicode twilio_sandbox_mode: Optional header to mock all voice dependencies :returns: The created DeviceInstance :rtype: twilio.rest.preview.trusted_comms.device.DeviceInstance """ data = values.of({'PhoneNumber': phone_number, 'PushToken': push_token, }) + headers = values.of({'Twilio-Sandbox-Mode': twilio_sandbox_mode, }) - payload = self._version.create(method='POST', uri=self._uri, data=data, ) + payload = self._version.create(method='POST', uri=self._uri, data=data, headers=headers, ) return DeviceInstance(self._version, payload, ) diff --git a/twilio/rest/preview/trusted_comms/phone_call.py b/twilio/rest/preview/trusted_comms/phone_call.py index ec4057eb56..e590dc534b 100644 --- a/twilio/rest/preview/trusted_comms/phone_call.py +++ b/twilio/rest/preview/trusted_comms/phone_call.py @@ -49,7 +49,8 @@ def create(self, from_, to, reason=values.unset, application_sid=values.unset, sip_auth_username=values.unset, status_callback=values.unset, status_callback_event=values.unset, status_callback_method=values.unset, timeout=values.unset, - trim=values.unset, url=values.unset): + trim=values.unset, url=values.unset, + twilio_sandbox_mode=values.unset): """ Create the PhoneCallInstance @@ -80,6 +81,7 @@ def create(self, from_, to, reason=values.unset, application_sid=values.unset, :param unicode timeout: Refers to the Voice API Initiate Call parameter :param unicode trim: Refers to the Voice API Initiate Call parameter :param unicode url: Refers to the Voice API Initiate Call parameter + :param unicode twilio_sandbox_mode: Optional header to mock all voice dependencies :returns: The created PhoneCallInstance :rtype: twilio.rest.preview.trusted_comms.phone_call.PhoneCallInstance @@ -113,8 +115,9 @@ def create(self, from_, to, reason=values.unset, application_sid=values.unset, 'Trim': trim, 'Url': url, }) + headers = values.of({'Twilio-Sandbox-Mode': twilio_sandbox_mode, }) - payload = self._version.create(method='POST', uri=self._uri, data=data, ) + payload = self._version.create(method='POST', uri=self._uri, data=data, headers=headers, ) return PhoneCallInstance(self._version, payload, ) diff --git a/twilio/rest/sync/v1/service/document/__init__.py b/twilio/rest/sync/v1/service/document/__init__.py index 1077297395..1dd6401dda 100644 --- a/twilio/rest/sync/v1/service/document/__init__.py +++ b/twilio/rest/sync/v1/service/document/__init__.py @@ -243,28 +243,34 @@ def fetch(self): sid=self._solution['sid'], ) - def delete(self): + def delete(self, if_match=values.unset): """ Deletes the DocumentInstance + :param unicode if_match: The If-Match HTTP request header + :returns: True if delete succeeds, False otherwise :rtype: bool """ - return self._version.delete(method='DELETE', uri=self._uri, ) + headers = values.of({'If-Match': if_match, }) + + return self._version.delete(method='DELETE', uri=self._uri, headers=headers, ) - def update(self, data=values.unset, ttl=values.unset): + def update(self, data=values.unset, ttl=values.unset, if_match=values.unset): """ Update the DocumentInstance :param dict data: A JSON string that represents an arbitrary, schema-less object that the Sync Document stores :param unicode ttl: How long, in seconds, before the Document resource expires and is deleted + :param unicode if_match: The If-Match HTTP request header :returns: The updated DocumentInstance :rtype: twilio.rest.sync.v1.service.document.DocumentInstance """ data = values.of({'Data': serialize.object(data), 'Ttl': ttl, }) + headers = values.of({'If-Match': if_match, }) - payload = self._version.update(method='POST', uri=self._uri, data=data, ) + payload = self._version.update(method='POST', uri=self._uri, data=data, headers=headers, ) return DocumentInstance( self._version, @@ -455,26 +461,29 @@ def fetch(self): """ return self._proxy.fetch() - def delete(self): + def delete(self, if_match=values.unset): """ Deletes the DocumentInstance + :param unicode if_match: The If-Match HTTP request header + :returns: True if delete succeeds, False otherwise :rtype: bool """ - return self._proxy.delete() + return self._proxy.delete(if_match=if_match, ) - def update(self, data=values.unset, ttl=values.unset): + def update(self, data=values.unset, ttl=values.unset, if_match=values.unset): """ Update the DocumentInstance :param dict data: A JSON string that represents an arbitrary, schema-less object that the Sync Document stores :param unicode ttl: How long, in seconds, before the Document resource expires and is deleted + :param unicode if_match: The If-Match HTTP request header :returns: The updated DocumentInstance :rtype: twilio.rest.sync.v1.service.document.DocumentInstance """ - return self._proxy.update(data=data, ttl=ttl, ) + return self._proxy.update(data=data, ttl=ttl, if_match=if_match, ) @property def document_permissions(self): diff --git a/twilio/rest/sync/v1/service/sync_list/sync_list_item.py b/twilio/rest/sync/v1/service/sync_list/sync_list_item.py index f065aa5444..34d1770ff8 100644 --- a/twilio/rest/sync/v1/service/sync_list/sync_list_item.py +++ b/twilio/rest/sync/v1/service/sync_list/sync_list_item.py @@ -289,17 +289,21 @@ def fetch(self): index=self._solution['index'], ) - def delete(self): + def delete(self, if_match=values.unset): """ Deletes the SyncListItemInstance + :param unicode if_match: The If-Match HTTP request header + :returns: True if delete succeeds, False otherwise :rtype: bool """ - return self._version.delete(method='DELETE', uri=self._uri, ) + headers = values.of({'If-Match': if_match, }) + + return self._version.delete(method='DELETE', uri=self._uri, headers=headers, ) def update(self, data=values.unset, ttl=values.unset, item_ttl=values.unset, - collection_ttl=values.unset): + collection_ttl=values.unset, if_match=values.unset): """ Update the SyncListItemInstance @@ -307,6 +311,7 @@ def update(self, data=values.unset, ttl=values.unset, item_ttl=values.unset, :param unicode ttl: An alias for item_ttl :param unicode item_ttl: How long, in seconds, before the List Item expires :param unicode collection_ttl: How long, in seconds, before the List Item's parent Sync List expires + :param unicode if_match: The If-Match HTTP request header :returns: The updated SyncListItemInstance :rtype: twilio.rest.sync.v1.service.sync_list.sync_list_item.SyncListItemInstance @@ -317,8 +322,9 @@ def update(self, data=values.unset, ttl=values.unset, item_ttl=values.unset, 'ItemTtl': item_ttl, 'CollectionTtl': collection_ttl, }) + headers = values.of({'If-Match': if_match, }) - payload = self._version.update(method='POST', uri=self._uri, data=data, ) + payload = self._version.update(method='POST', uri=self._uri, data=data, headers=headers, ) return SyncListItemInstance( self._version, @@ -498,17 +504,19 @@ def fetch(self): """ return self._proxy.fetch() - def delete(self): + def delete(self, if_match=values.unset): """ Deletes the SyncListItemInstance + :param unicode if_match: The If-Match HTTP request header + :returns: True if delete succeeds, False otherwise :rtype: bool """ - return self._proxy.delete() + return self._proxy.delete(if_match=if_match, ) def update(self, data=values.unset, ttl=values.unset, item_ttl=values.unset, - collection_ttl=values.unset): + collection_ttl=values.unset, if_match=values.unset): """ Update the SyncListItemInstance @@ -516,11 +524,18 @@ def update(self, data=values.unset, ttl=values.unset, item_ttl=values.unset, :param unicode ttl: An alias for item_ttl :param unicode item_ttl: How long, in seconds, before the List Item expires :param unicode collection_ttl: How long, in seconds, before the List Item's parent Sync List expires + :param unicode if_match: The If-Match HTTP request header :returns: The updated SyncListItemInstance :rtype: twilio.rest.sync.v1.service.sync_list.sync_list_item.SyncListItemInstance """ - return self._proxy.update(data=data, ttl=ttl, item_ttl=item_ttl, collection_ttl=collection_ttl, ) + return self._proxy.update( + data=data, + ttl=ttl, + item_ttl=item_ttl, + collection_ttl=collection_ttl, + if_match=if_match, + ) def __repr__(self): """ diff --git a/twilio/rest/sync/v1/service/sync_map/sync_map_item.py b/twilio/rest/sync/v1/service/sync_map/sync_map_item.py index fc2ea171fb..cffb0bef19 100644 --- a/twilio/rest/sync/v1/service/sync_map/sync_map_item.py +++ b/twilio/rest/sync/v1/service/sync_map/sync_map_item.py @@ -291,17 +291,21 @@ def fetch(self): key=self._solution['key'], ) - def delete(self): + def delete(self, if_match=values.unset): """ Deletes the SyncMapItemInstance + :param unicode if_match: The If-Match HTTP request header + :returns: True if delete succeeds, False otherwise :rtype: bool """ - return self._version.delete(method='DELETE', uri=self._uri, ) + headers = values.of({'If-Match': if_match, }) + + return self._version.delete(method='DELETE', uri=self._uri, headers=headers, ) def update(self, data=values.unset, ttl=values.unset, item_ttl=values.unset, - collection_ttl=values.unset): + collection_ttl=values.unset, if_match=values.unset): """ Update the SyncMapItemInstance @@ -309,6 +313,7 @@ def update(self, data=values.unset, ttl=values.unset, item_ttl=values.unset, :param unicode ttl: An alias for item_ttl :param unicode item_ttl: How long, in seconds, before the Map Item expires :param unicode collection_ttl: How long, in seconds, before the Map Item's parent Sync Map expires and is deleted + :param unicode if_match: The If-Match HTTP request header :returns: The updated SyncMapItemInstance :rtype: twilio.rest.sync.v1.service.sync_map.sync_map_item.SyncMapItemInstance @@ -319,8 +324,9 @@ def update(self, data=values.unset, ttl=values.unset, item_ttl=values.unset, 'ItemTtl': item_ttl, 'CollectionTtl': collection_ttl, }) + headers = values.of({'If-Match': if_match, }) - payload = self._version.update(method='POST', uri=self._uri, data=data, ) + payload = self._version.update(method='POST', uri=self._uri, data=data, headers=headers, ) return SyncMapItemInstance( self._version, @@ -500,17 +506,19 @@ def fetch(self): """ return self._proxy.fetch() - def delete(self): + def delete(self, if_match=values.unset): """ Deletes the SyncMapItemInstance + :param unicode if_match: The If-Match HTTP request header + :returns: True if delete succeeds, False otherwise :rtype: bool """ - return self._proxy.delete() + return self._proxy.delete(if_match=if_match, ) def update(self, data=values.unset, ttl=values.unset, item_ttl=values.unset, - collection_ttl=values.unset): + collection_ttl=values.unset, if_match=values.unset): """ Update the SyncMapItemInstance @@ -518,11 +526,18 @@ def update(self, data=values.unset, ttl=values.unset, item_ttl=values.unset, :param unicode ttl: An alias for item_ttl :param unicode item_ttl: How long, in seconds, before the Map Item expires :param unicode collection_ttl: How long, in seconds, before the Map Item's parent Sync Map expires and is deleted + :param unicode if_match: The If-Match HTTP request header :returns: The updated SyncMapItemInstance :rtype: twilio.rest.sync.v1.service.sync_map.sync_map_item.SyncMapItemInstance """ - return self._proxy.update(data=data, ttl=ttl, item_ttl=item_ttl, collection_ttl=collection_ttl, ) + return self._proxy.update( + data=data, + ttl=ttl, + item_ttl=item_ttl, + collection_ttl=collection_ttl, + if_match=if_match, + ) def __repr__(self): """