From a3038ce005346715919d5fd5a4439b27e323fc74 Mon Sep 17 00:00:00 2001 From: childish-sambino Date: Wed, 16 Oct 2019 08:24:06 -0500 Subject: [PATCH] Update instance property marshaling to allow missing properties (#483) --- twilio/rest/accounts/v1/credential/aws.py | 12 ++-- .../rest/accounts/v1/credential/public_key.py | 12 ++-- twilio/rest/api/v2010/account/__init__.py | 20 +++--- .../api/v2010/account/address/__init__.py | 30 ++++---- .../account/address/dependent_phone_number.py | 52 +++++++------- twilio/rest/api/v2010/account/application.py | 40 +++++------ .../v2010/account/authorized_connect_app.py | 20 +++--- .../available_phone_number/__init__.py | 10 +-- .../account/available_phone_number/local.py | 26 +++---- .../machine_to_machine.py | 26 +++---- .../account/available_phone_number/mobile.py | 26 +++---- .../available_phone_number/national.py | 26 +++---- .../available_phone_number/shared_cost.py | 26 +++---- .../available_phone_number/toll_free.py | 26 +++---- .../account/available_phone_number/voip.py | 26 +++---- twilio/rest/api/v2010/account/balance.py | 6 +- .../rest/api/v2010/account/call/__init__.py | 50 ++++++------- .../rest/api/v2010/account/call/feedback.py | 12 ++-- .../v2010/account/call/feedback_summary.py | 28 ++++---- .../api/v2010/account/call/notification.py | 28 ++++---- .../rest/api/v2010/account/call/recording.py | 34 ++++----- .../api/v2010/account/conference/__init__.py | 20 +++--- .../v2010/account/conference/participant.py | 26 +++---- .../api/v2010/account/conference/recording.py | 34 ++++----- twilio/rest/api/v2010/account/connect_app.py | 22 +++--- .../account/incoming_phone_number/__init__.py | 60 ++++++++-------- .../assigned_add_on/__init__.py | 22 +++--- .../assigned_add_on_extension.py | 18 ++--- .../account/incoming_phone_number/local.py | 56 +++++++-------- .../account/incoming_phone_number/mobile.py | 56 +++++++-------- .../incoming_phone_number/toll_free.py | 56 +++++++-------- twilio/rest/api/v2010/account/key.py | 8 +-- .../api/v2010/account/message/__init__.py | 40 +++++------ .../api/v2010/account/message/feedback.py | 12 ++-- .../rest/api/v2010/account/message/media.py | 14 ++-- twilio/rest/api/v2010/account/new_key.py | 10 +-- .../rest/api/v2010/account/new_signing_key.py | 10 +-- twilio/rest/api/v2010/account/notification.py | 28 ++++---- .../api/v2010/account/outgoing_caller_id.py | 14 ++-- .../rest/api/v2010/account/queue/__init__.py | 18 ++--- twilio/rest/api/v2010/account/queue/member.py | 12 ++-- .../api/v2010/account/recording/__init__.py | 36 +++++----- .../recording/add_on_result/__init__.py | 20 +++--- .../add_on_result/payload/__init__.py | 22 +++--- .../v2010/account/recording/transcription.py | 26 +++---- twilio/rest/api/v2010/account/short_code.py | 24 +++---- twilio/rest/api/v2010/account/signing_key.py | 8 +-- .../account/sip/credential_list/__init__.py | 14 ++-- .../account/sip/credential_list/credential.py | 14 ++-- .../api/v2010/account/sip/domain/__init__.py | 34 ++++----- .../auth_calls_credential_list_mapping.py | 10 +-- ...th_calls_ip_access_control_list_mapping.py | 10 +-- ...h_registrations_credential_list_mapping.py | 10 +-- .../sip/domain/credential_list_mapping.py | 14 ++-- .../domain/ip_access_control_list_mapping.py | 14 ++-- .../sip/ip_access_control_list/__init__.py | 14 ++-- .../sip/ip_access_control_list/ip_address.py | 18 ++--- twilio/rest/api/v2010/account/token.py | 14 ++-- .../rest/api/v2010/account/transcription.py | 26 +++---- .../v2010/account/usage/record/__init__.py | 30 ++++---- .../v2010/account/usage/record/all_time.py | 30 ++++---- .../api/v2010/account/usage/record/daily.py | 30 ++++---- .../v2010/account/usage/record/last_month.py | 30 ++++---- .../api/v2010/account/usage/record/monthly.py | 30 ++++---- .../v2010/account/usage/record/this_month.py | 30 ++++---- .../api/v2010/account/usage/record/today.py | 30 ++++---- .../api/v2010/account/usage/record/yearly.py | 30 ++++---- .../v2010/account/usage/record/yesterday.py | 30 ++++---- .../rest/api/v2010/account/usage/trigger.py | 32 ++++----- .../api/v2010/account/validation_request.py | 10 +-- twilio/rest/authy/v1/form.py | 8 +-- twilio/rest/authy/v1/service/__init__.py | 14 ++-- .../rest/authy/v1/service/entity/__init__.py | 16 ++--- .../v1/service/entity/factor/__init__.py | 26 +++---- .../v1/service/entity/factor/challenge.py | 34 ++++----- .../rest/autopilot/v1/assistant/__init__.py | 28 ++++---- .../rest/autopilot/v1/assistant/defaults.py | 8 +-- .../rest/autopilot/v1/assistant/dialogue.py | 10 +-- .../v1/assistant/field_type/__init__.py | 18 ++--- .../v1/assistant/field_type/field_value.py | 20 +++--- .../autopilot/v1/assistant/model_build.py | 20 +++--- twilio/rest/autopilot/v1/assistant/query.py | 26 +++---- .../autopilot/v1/assistant/style_sheet.py | 8 +-- .../autopilot/v1/assistant/task/__init__.py | 20 +++--- .../rest/autopilot/v1/assistant/task/field.py | 18 ++--- .../autopilot/v1/assistant/task/sample.py | 20 +++--- .../v1/assistant/task/task_actions.py | 10 +-- .../v1/assistant/task/task_statistics.py | 12 ++-- twilio/rest/autopilot/v1/assistant/webhook.py | 20 +++--- twilio/rest/chat/v1/credential.py | 16 ++--- twilio/rest/chat/v1/service/__init__.py | 42 +++++------ .../rest/chat/v1/service/channel/__init__.py | 28 ++++---- twilio/rest/chat/v1/service/channel/invite.py | 20 +++--- twilio/rest/chat/v1/service/channel/member.py | 22 +++--- .../rest/chat/v1/service/channel/message.py | 26 +++---- twilio/rest/chat/v1/service/role.py | 18 ++--- twilio/rest/chat/v1/service/user/__init__.py | 28 ++++---- .../rest/chat/v1/service/user/user_channel.py | 16 ++--- twilio/rest/chat/v2/credential.py | 16 ++--- twilio/rest/chat/v2/service/__init__.py | 46 ++++++------ twilio/rest/chat/v2/service/binding.py | 24 +++---- .../rest/chat/v2/service/channel/__init__.py | 28 ++++---- twilio/rest/chat/v2/service/channel/invite.py | 20 +++--- twilio/rest/chat/v2/service/channel/member.py | 24 +++---- .../rest/chat/v2/service/channel/message.py | 32 ++++----- .../rest/chat/v2/service/channel/webhook.py | 18 ++--- twilio/rest/chat/v2/service/role.py | 18 ++--- twilio/rest/chat/v2/service/user/__init__.py | 28 ++++---- .../rest/chat/v2/service/user/user_binding.py | 24 +++---- .../rest/chat/v2/service/user/user_channel.py | 22 +++--- .../conversations/v1/conversation/__init__.py | 20 +++--- .../conversations/v1/conversation/message.py | 22 +++--- .../v1/conversation/participant.py | 18 ++--- .../conversations/v1/conversation/webhook.py | 16 ++--- twilio/rest/conversations/v1/webhook.py | 14 ++-- twilio/rest/fax/v1/fax/__init__.py | 36 +++++----- twilio/rest/fax/v1/fax/fax_media.py | 14 ++-- twilio/rest/flex_api/v1/channel.py | 16 ++--- twilio/rest/flex_api/v1/configuration.py | 70 +++++++++---------- twilio/rest/flex_api/v1/flex_flow.py | 26 +++---- twilio/rest/flex_api/v1/web_channel.py | 12 ++-- twilio/rest/insights/v1/summary.py | 38 +++++----- twilio/rest/ip_messaging/v1/credential.py | 16 ++--- .../rest/ip_messaging/v1/service/__init__.py | 42 +++++------ .../v1/service/channel/__init__.py | 28 ++++---- .../ip_messaging/v1/service/channel/invite.py | 20 +++--- .../ip_messaging/v1/service/channel/member.py | 22 +++--- .../v1/service/channel/message.py | 26 +++---- twilio/rest/ip_messaging/v1/service/role.py | 18 ++--- .../ip_messaging/v1/service/user/__init__.py | 28 ++++---- .../v1/service/user/user_channel.py | 16 ++--- twilio/rest/ip_messaging/v2/credential.py | 16 ++--- .../rest/ip_messaging/v2/service/__init__.py | 46 ++++++------ .../rest/ip_messaging/v2/service/binding.py | 24 +++---- .../v2/service/channel/__init__.py | 28 ++++---- .../ip_messaging/v2/service/channel/invite.py | 20 +++--- .../ip_messaging/v2/service/channel/member.py | 24 +++---- .../v2/service/channel/message.py | 32 ++++----- .../v2/service/channel/webhook.py | 18 ++--- twilio/rest/ip_messaging/v2/service/role.py | 18 ++--- .../ip_messaging/v2/service/user/__init__.py | 28 ++++---- .../v2/service/user/user_binding.py | 24 +++---- .../v2/service/user/user_channel.py | 22 +++--- twilio/rest/lookups/v1/phone_number.py | 16 ++--- twilio/rest/messaging/v1/service/__init__.py | 40 +++++------ .../rest/messaging/v1/service/alpha_sender.py | 16 ++--- .../rest/messaging/v1/service/phone_number.py | 18 ++--- .../rest/messaging/v1/service/short_code.py | 18 ++--- twilio/rest/messaging/v1/session/__init__.py | 22 +++--- twilio/rest/messaging/v1/session/message.py | 24 +++---- .../rest/messaging/v1/session/participant.py | 26 +++---- twilio/rest/messaging/v1/session/webhook.py | 16 ++--- twilio/rest/messaging/v1/webhook.py | 20 +++--- twilio/rest/monitor/v1/alert.py | 30 ++++---- twilio/rest/monitor/v1/event.py | 28 ++++---- twilio/rest/notify/v1/credential.py | 16 ++--- twilio/rest/notify/v1/service/__init__.py | 36 +++++----- twilio/rest/notify/v1/service/binding.py | 28 ++++---- twilio/rest/notify/v1/service/notification.py | 40 +++++------ .../preview/acc_security/service/__init__.py | 16 ++--- .../acc_security/service/verification.py | 18 ++--- .../service/verification_check.py | 18 ++--- .../preview/bulk_exports/export/__init__.py | 6 +- .../bulk_exports/export_configuration.py | 10 +-- .../deployed_devices/fleet/__init__.py | 18 ++--- .../deployed_devices/fleet/certificate.py | 18 ++--- .../deployed_devices/fleet/deployment.py | 16 ++--- .../preview/deployed_devices/fleet/device.py | 24 +++---- .../preview/deployed_devices/fleet/key.py | 18 ++--- .../authorization_document/__init__.py | 18 ++--- .../dependent_hosted_number_order.py | 44 ++++++------ .../hosted_numbers/hosted_number_order.py | 46 ++++++------ .../marketplace/available_add_on/__init__.py | 14 ++-- .../available_add_on_extension.py | 12 ++-- .../marketplace/installed_add_on/__init__.py | 20 +++--- .../installed_add_on_extension.py | 14 ++-- twilio/rest/preview/sync/service/__init__.py | 20 +++--- .../preview/sync/service/document/__init__.py | 22 +++--- .../service/document/document_permission.py | 16 ++--- .../sync/service/sync_list/__init__.py | 20 +++--- .../sync/service/sync_list/sync_list_item.py | 20 +++--- .../service/sync_list/sync_list_permission.py | 16 ++--- .../preview/sync/service/sync_map/__init__.py | 20 +++--- .../sync/service/sync_map/sync_map_item.py | 20 +++--- .../service/sync_map/sync_map_permission.py | 16 ++--- .../preview/trusted_comms/branded_call.py | 26 +++---- twilio/rest/preview/trusted_comms/cps.py | 6 +- .../preview/trusted_comms/current_call.py | 28 ++++---- twilio/rest/preview/trusted_comms/device.py | 8 +-- .../rest/preview/trusted_comms/phone_call.py | 14 ++-- .../preview/understand/assistant/__init__.py | 24 +++---- .../assistant/assistant_fallback_actions.py | 8 +-- .../assistant/assistant_initiation_actions.py | 8 +-- .../preview/understand/assistant/dialogue.py | 10 +-- .../assistant/field_type/__init__.py | 18 ++--- .../assistant/field_type/field_value.py | 20 +++--- .../understand/assistant/model_build.py | 20 +++--- .../preview/understand/assistant/query.py | 26 +++---- .../understand/assistant/style_sheet.py | 8 +-- .../understand/assistant/task/__init__.py | 20 +++--- .../understand/assistant/task/field.py | 18 ++--- .../understand/assistant/task/sample.py | 20 +++--- .../understand/assistant/task/task_actions.py | 10 +-- .../assistant/task/task_statistics.py | 12 ++-- twilio/rest/preview/wireless/command.py | 22 +++--- twilio/rest/preview/wireless/rate_plan.py | 28 ++++---- twilio/rest/preview/wireless/sim/__init__.py | 44 ++++++------ twilio/rest/preview/wireless/sim/usage.py | 18 ++--- twilio/rest/pricing/v1/messaging/__init__.py | 6 +- twilio/rest/pricing/v1/messaging/country.py | 6 +- .../rest/pricing/v1/phone_number/__init__.py | 6 +- .../rest/pricing/v1/phone_number/country.py | 6 +- twilio/rest/pricing/v1/voice/__init__.py | 6 +- twilio/rest/pricing/v1/voice/country.py | 6 +- twilio/rest/pricing/v1/voice/number.py | 14 ++-- twilio/rest/pricing/v2/voice/__init__.py | 6 +- twilio/rest/pricing/v2/voice/country.py | 6 +- twilio/rest/pricing/v2/voice/number.py | 16 ++--- twilio/rest/proxy/v1/service/__init__.py | 28 ++++---- twilio/rest/proxy/v1/service/phone_number.py | 24 +++---- .../rest/proxy/v1/service/session/__init__.py | 32 ++++----- .../proxy/v1/service/session/interaction.py | 38 +++++----- .../service/session/participant/__init__.py | 26 +++---- .../participant/message_interaction.py | 40 +++++------ twilio/rest/proxy/v1/service/short_code.py | 20 +++--- twilio/rest/serverless/v1/service/__init__.py | 18 ++--- .../serverless/v1/service/asset/__init__.py | 16 ++--- .../v1/service/asset/asset_version.py | 16 ++--- twilio/rest/serverless/v1/service/build.py | 20 +++--- .../v1/service/environment/__init__.py | 22 +++--- .../v1/service/environment/deployment.py | 16 ++--- .../serverless/v1/service/environment/log.py | 22 +++--- .../v1/service/environment/variable.py | 18 ++--- .../v1/service/function/__init__.py | 16 ++--- .../v1/service/function/function_version.py | 16 ++--- twilio/rest/studio/v1/flow/__init__.py | 18 ++--- .../studio/v1/flow/engagement/__init__.py | 22 +++--- .../v1/flow/engagement/engagement_context.py | 10 +-- .../v1/flow/engagement/step/__init__.py | 24 +++---- .../v1/flow/engagement/step/step_context.py | 12 ++-- .../rest/studio/v1/flow/execution/__init__.py | 22 +++--- .../v1/flow/execution/execution_context.py | 10 +-- .../flow/execution/execution_step/__init__.py | 24 +++---- .../execution_step/execution_step_context.py | 12 ++-- twilio/rest/sync/v1/service/__init__.py | 28 ++++---- .../rest/sync/v1/service/document/__init__.py | 24 +++---- .../service/document/document_permission.py | 16 ++--- .../sync/v1/service/sync_list/__init__.py | 22 +++--- .../v1/service/sync_list/sync_list_item.py | 22 +++--- .../service/sync_list/sync_list_permission.py | 16 ++--- .../rest/sync/v1/service/sync_map/__init__.py | 22 +++--- .../sync/v1/service/sync_map/sync_map_item.py | 22 +++--- .../service/sync_map/sync_map_permission.py | 16 ++--- .../sync/v1/service/sync_stream/__init__.py | 20 +++--- .../v1/service/sync_stream/stream_message.py | 2 +- .../rest/taskrouter/v1/workspace/__init__.py | 30 ++++---- .../rest/taskrouter/v1/workspace/activity.py | 16 ++--- twilio/rest/taskrouter/v1/workspace/event.py | 34 ++++----- .../taskrouter/v1/workspace/task/__init__.py | 40 +++++------ .../v1/workspace/task/reservation.py | 22 +++--- .../taskrouter/v1/workspace/task_channel.py | 20 +++--- .../v1/workspace/task_queue/__init__.py | 30 ++++---- .../task_queue_cumulative_statistics.py | 42 +++++------ .../task_queue_real_time_statistics.py | 24 +++---- .../task_queue/task_queue_statistics.py | 12 ++-- .../task_queue/task_queues_statistics.py | 10 +-- .../v1/workspace/worker/__init__.py | 26 +++---- .../v1/workspace/worker/reservation.py | 22 +++--- .../v1/workspace/worker/worker_channel.py | 26 +++---- .../v1/workspace/worker/worker_statistics.py | 10 +-- .../worker/workers_cumulative_statistics.py | 24 +++---- .../worker/workers_real_time_statistics.py | 10 +-- .../v1/workspace/worker/workers_statistics.py | 10 +-- .../v1/workspace/workflow/__init__.py | 26 +++---- .../workflow_cumulative_statistics.py | 44 ++++++------ .../workflow/workflow_real_time_statistics.py | 18 ++--- .../workspace/workflow/workflow_statistics.py | 12 ++-- .../workspace_cumulative_statistics.py | 42 +++++------ .../workspace_real_time_statistics.py | 20 +++--- .../v1/workspace/workspace_statistics.py | 10 +-- twilio/rest/trunking/v1/trunk/__init__.py | 30 ++++---- .../rest/trunking/v1/trunk/credential_list.py | 14 ++-- .../v1/trunk/ip_access_control_list.py | 14 ++-- .../rest/trunking/v1/trunk/origination_url.py | 22 +++--- twilio/rest/trunking/v1/trunk/phone_number.py | 52 +++++++------- .../v1/trunk/terminating_sip_domain.py | 36 +++++----- twilio/rest/verify/v2/service/__init__.py | 26 +++---- .../v2/service/messaging_configuration.py | 14 ++-- .../verify/v2/service/rate_limit/__init__.py | 18 ++--- .../verify/v2/service/rate_limit/bucket.py | 18 ++--- twilio/rest/verify/v2/service/verification.py | 26 +++---- .../verify/v2/service/verification_check.py | 22 +++--- twilio/rest/video/v1/composition/__init__.py | 36 +++++----- twilio/rest/video/v1/composition_hook.py | 30 ++++---- twilio/rest/video/v1/composition_settings.py | 16 ++--- twilio/rest/video/v1/recording/__init__.py | 30 ++++---- twilio/rest/video/v1/recording_settings.py | 16 ++--- twilio/rest/video/v1/room/__init__.py | 36 +++++----- .../rest/video/v1/room/recording/__init__.py | 32 ++++----- .../v1/room/room_participant/__init__.py | 24 +++---- .../room_participant_published_track.py | 18 ++--- .../room_participant_subscribe_rule.py | 10 +-- .../room_participant_subscribed_track.py | 20 +++--- .../bulk_country_update.py | 4 +- .../dialing_permissions/country/__init__.py | 18 ++--- .../country/highrisk_special_prefix.py | 2 +- .../voice/v1/dialing_permissions/settings.py | 4 +- twilio/rest/wireless/v1/command.py | 24 +++---- twilio/rest/wireless/v1/rate_plan.py | 32 ++++----- twilio/rest/wireless/v1/sim/__init__.py | 48 ++++++------- twilio/rest/wireless/v1/sim/data_session.py | 32 ++++----- twilio/rest/wireless/v1/sim/usage_record.py | 10 +-- twilio/rest/wireless/v1/usage_record.py | 8 +-- 313 files changed, 3430 insertions(+), 3414 deletions(-) diff --git a/twilio/rest/accounts/v1/credential/aws.py b/twilio/rest/accounts/v1/credential/aws.py index 5da3698d07..78bba5dc9c 100644 --- a/twilio/rest/accounts/v1/credential/aws.py +++ b/twilio/rest/accounts/v1/credential/aws.py @@ -299,12 +299,12 @@ def __init__(self, version, payload, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'friendly_name': payload['friendly_name'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'friendly_name': payload.get('friendly_name'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/accounts/v1/credential/public_key.py b/twilio/rest/accounts/v1/credential/public_key.py index f332f94903..8d6369462a 100644 --- a/twilio/rest/accounts/v1/credential/public_key.py +++ b/twilio/rest/accounts/v1/credential/public_key.py @@ -299,12 +299,12 @@ def __init__(self, version, payload, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'friendly_name': payload['friendly_name'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'friendly_name': payload.get('friendly_name'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/api/v2010/account/__init__.py b/twilio/rest/api/v2010/account/__init__.py index a746136582..b8bf9097f7 100644 --- a/twilio/rest/api/v2010/account/__init__.py +++ b/twilio/rest/api/v2010/account/__init__.py @@ -660,16 +660,16 @@ def __init__(self, version, payload, sid=None): # Marshaled Properties self._properties = { - 'auth_token': payload['auth_token'], - 'date_created': deserialize.rfc2822_datetime(payload['date_created']), - 'date_updated': deserialize.rfc2822_datetime(payload['date_updated']), - 'friendly_name': payload['friendly_name'], - 'owner_account_sid': payload['owner_account_sid'], - 'sid': payload['sid'], - 'status': payload['status'], - 'subresource_uris': payload['subresource_uris'], - 'type': payload['type'], - 'uri': payload['uri'], + 'auth_token': payload.get('auth_token'), + 'date_created': deserialize.rfc2822_datetime(payload.get('date_created')), + 'date_updated': deserialize.rfc2822_datetime(payload.get('date_updated')), + 'friendly_name': payload.get('friendly_name'), + 'owner_account_sid': payload.get('owner_account_sid'), + 'sid': payload.get('sid'), + 'status': payload.get('status'), + 'subresource_uris': payload.get('subresource_uris'), + 'type': payload.get('type'), + 'uri': payload.get('uri'), } # Context diff --git a/twilio/rest/api/v2010/account/address/__init__.py b/twilio/rest/api/v2010/account/address/__init__.py index a0a4caa623..fc2c7f1cc5 100644 --- a/twilio/rest/api/v2010/account/address/__init__.py +++ b/twilio/rest/api/v2010/account/address/__init__.py @@ -394,21 +394,21 @@ def __init__(self, version, payload, account_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'city': payload['city'], - 'customer_name': payload['customer_name'], - 'date_created': deserialize.rfc2822_datetime(payload['date_created']), - 'date_updated': deserialize.rfc2822_datetime(payload['date_updated']), - 'friendly_name': payload['friendly_name'], - 'iso_country': payload['iso_country'], - 'postal_code': payload['postal_code'], - 'region': payload['region'], - 'sid': payload['sid'], - 'street': payload['street'], - 'uri': payload['uri'], - 'emergency_enabled': payload['emergency_enabled'], - 'validated': payload['validated'], - 'verified': payload['verified'], + 'account_sid': payload.get('account_sid'), + 'city': payload.get('city'), + 'customer_name': payload.get('customer_name'), + 'date_created': deserialize.rfc2822_datetime(payload.get('date_created')), + 'date_updated': deserialize.rfc2822_datetime(payload.get('date_updated')), + 'friendly_name': payload.get('friendly_name'), + 'iso_country': payload.get('iso_country'), + 'postal_code': payload.get('postal_code'), + 'region': payload.get('region'), + 'sid': payload.get('sid'), + 'street': payload.get('street'), + 'uri': payload.get('uri'), + 'emergency_enabled': payload.get('emergency_enabled'), + 'validated': payload.get('validated'), + 'verified': payload.get('verified'), } # Context diff --git a/twilio/rest/api/v2010/account/address/dependent_phone_number.py b/twilio/rest/api/v2010/account/address/dependent_phone_number.py index d19fff854a..b10812150c 100644 --- a/twilio/rest/api/v2010/account/address/dependent_phone_number.py +++ b/twilio/rest/api/v2010/account/address/dependent_phone_number.py @@ -194,32 +194,32 @@ def __init__(self, version, payload, account_sid, address_sid): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'friendly_name': payload['friendly_name'], - 'phone_number': payload['phone_number'], - 'voice_url': payload['voice_url'], - 'voice_method': payload['voice_method'], - 'voice_fallback_method': payload['voice_fallback_method'], - 'voice_fallback_url': payload['voice_fallback_url'], - 'voice_caller_id_lookup': payload['voice_caller_id_lookup'], - 'date_created': deserialize.rfc2822_datetime(payload['date_created']), - 'date_updated': deserialize.rfc2822_datetime(payload['date_updated']), - 'sms_fallback_method': payload['sms_fallback_method'], - 'sms_fallback_url': payload['sms_fallback_url'], - 'sms_method': payload['sms_method'], - 'sms_url': payload['sms_url'], - 'address_requirements': payload['address_requirements'], - 'capabilities': payload['capabilities'], - 'status_callback': payload['status_callback'], - 'status_callback_method': payload['status_callback_method'], - 'api_version': payload['api_version'], - 'sms_application_sid': payload['sms_application_sid'], - 'voice_application_sid': payload['voice_application_sid'], - 'trunk_sid': payload['trunk_sid'], - 'emergency_status': payload['emergency_status'], - 'emergency_address_sid': payload['emergency_address_sid'], - 'uri': payload['uri'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'friendly_name': payload.get('friendly_name'), + 'phone_number': payload.get('phone_number'), + 'voice_url': payload.get('voice_url'), + 'voice_method': payload.get('voice_method'), + 'voice_fallback_method': payload.get('voice_fallback_method'), + 'voice_fallback_url': payload.get('voice_fallback_url'), + 'voice_caller_id_lookup': payload.get('voice_caller_id_lookup'), + 'date_created': deserialize.rfc2822_datetime(payload.get('date_created')), + 'date_updated': deserialize.rfc2822_datetime(payload.get('date_updated')), + 'sms_fallback_method': payload.get('sms_fallback_method'), + 'sms_fallback_url': payload.get('sms_fallback_url'), + 'sms_method': payload.get('sms_method'), + 'sms_url': payload.get('sms_url'), + 'address_requirements': payload.get('address_requirements'), + 'capabilities': payload.get('capabilities'), + 'status_callback': payload.get('status_callback'), + 'status_callback_method': payload.get('status_callback_method'), + 'api_version': payload.get('api_version'), + 'sms_application_sid': payload.get('sms_application_sid'), + 'voice_application_sid': payload.get('voice_application_sid'), + 'trunk_sid': payload.get('trunk_sid'), + 'emergency_status': payload.get('emergency_status'), + 'emergency_address_sid': payload.get('emergency_address_sid'), + 'uri': payload.get('uri'), } # Context diff --git a/twilio/rest/api/v2010/account/application.py b/twilio/rest/api/v2010/account/application.py index 5e491cdd08..ae7c57e9ed 100644 --- a/twilio/rest/api/v2010/account/application.py +++ b/twilio/rest/api/v2010/account/application.py @@ -387,26 +387,26 @@ def __init__(self, version, payload, account_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'api_version': payload['api_version'], - 'date_created': deserialize.rfc2822_datetime(payload['date_created']), - 'date_updated': deserialize.rfc2822_datetime(payload['date_updated']), - 'friendly_name': payload['friendly_name'], - 'message_status_callback': payload['message_status_callback'], - 'sid': payload['sid'], - 'sms_fallback_method': payload['sms_fallback_method'], - 'sms_fallback_url': payload['sms_fallback_url'], - 'sms_method': payload['sms_method'], - 'sms_status_callback': payload['sms_status_callback'], - 'sms_url': payload['sms_url'], - 'status_callback': payload['status_callback'], - 'status_callback_method': payload['status_callback_method'], - 'uri': payload['uri'], - 'voice_caller_id_lookup': payload['voice_caller_id_lookup'], - 'voice_fallback_method': payload['voice_fallback_method'], - 'voice_fallback_url': payload['voice_fallback_url'], - 'voice_method': payload['voice_method'], - 'voice_url': payload['voice_url'], + 'account_sid': payload.get('account_sid'), + 'api_version': payload.get('api_version'), + 'date_created': deserialize.rfc2822_datetime(payload.get('date_created')), + 'date_updated': deserialize.rfc2822_datetime(payload.get('date_updated')), + 'friendly_name': payload.get('friendly_name'), + 'message_status_callback': payload.get('message_status_callback'), + 'sid': payload.get('sid'), + 'sms_fallback_method': payload.get('sms_fallback_method'), + 'sms_fallback_url': payload.get('sms_fallback_url'), + 'sms_method': payload.get('sms_method'), + 'sms_status_callback': payload.get('sms_status_callback'), + 'sms_url': payload.get('sms_url'), + 'status_callback': payload.get('status_callback'), + 'status_callback_method': payload.get('status_callback_method'), + 'uri': payload.get('uri'), + 'voice_caller_id_lookup': payload.get('voice_caller_id_lookup'), + 'voice_fallback_method': payload.get('voice_fallback_method'), + 'voice_fallback_url': payload.get('voice_fallback_url'), + 'voice_method': payload.get('voice_method'), + 'voice_url': payload.get('voice_url'), } # Context diff --git a/twilio/rest/api/v2010/account/authorized_connect_app.py b/twilio/rest/api/v2010/account/authorized_connect_app.py index 925d9e73b4..1b2da3c2dc 100644 --- a/twilio/rest/api/v2010/account/authorized_connect_app.py +++ b/twilio/rest/api/v2010/account/authorized_connect_app.py @@ -269,16 +269,16 @@ def __init__(self, version, payload, account_sid, connect_app_sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'connect_app_company_name': payload['connect_app_company_name'], - 'connect_app_description': payload['connect_app_description'], - 'connect_app_friendly_name': payload['connect_app_friendly_name'], - 'connect_app_homepage_url': payload['connect_app_homepage_url'], - 'connect_app_sid': payload['connect_app_sid'], - 'date_created': deserialize.rfc2822_datetime(payload['date_created']), - 'date_updated': deserialize.rfc2822_datetime(payload['date_updated']), - 'permissions': payload['permissions'], - 'uri': payload['uri'], + 'account_sid': payload.get('account_sid'), + 'connect_app_company_name': payload.get('connect_app_company_name'), + 'connect_app_description': payload.get('connect_app_description'), + 'connect_app_friendly_name': payload.get('connect_app_friendly_name'), + 'connect_app_homepage_url': payload.get('connect_app_homepage_url'), + 'connect_app_sid': payload.get('connect_app_sid'), + 'date_created': deserialize.rfc2822_datetime(payload.get('date_created')), + 'date_updated': deserialize.rfc2822_datetime(payload.get('date_updated')), + 'permissions': payload.get('permissions'), + 'uri': payload.get('uri'), } # Context diff --git a/twilio/rest/api/v2010/account/available_phone_number/__init__.py b/twilio/rest/api/v2010/account/available_phone_number/__init__.py index bdcaca21fa..c8e59d85a8 100644 --- a/twilio/rest/api/v2010/account/available_phone_number/__init__.py +++ b/twilio/rest/api/v2010/account/available_phone_number/__init__.py @@ -392,11 +392,11 @@ def __init__(self, version, payload, account_sid, country_code=None): # Marshaled Properties self._properties = { - 'country_code': payload['country_code'], - 'country': payload['country'], - 'uri': payload['uri'], - 'beta': payload['beta'], - 'subresource_uris': payload['subresource_uris'], + 'country_code': payload.get('country_code'), + 'country': payload.get('country'), + 'uri': payload.get('uri'), + 'beta': payload.get('beta'), + 'subresource_uris': payload.get('subresource_uris'), } # Context diff --git a/twilio/rest/api/v2010/account/available_phone_number/local.py b/twilio/rest/api/v2010/account/available_phone_number/local.py index c995d7c610..65e4d50e2e 100644 --- a/twilio/rest/api/v2010/account/available_phone_number/local.py +++ b/twilio/rest/api/v2010/account/available_phone_number/local.py @@ -329,19 +329,19 @@ def __init__(self, version, payload, account_sid, country_code): # Marshaled Properties self._properties = { - 'friendly_name': payload['friendly_name'], - 'phone_number': payload['phone_number'], - 'lata': payload['lata'], - 'locality': payload['locality'], - 'rate_center': payload['rate_center'], - 'latitude': deserialize.decimal(payload['latitude']), - 'longitude': deserialize.decimal(payload['longitude']), - 'region': payload['region'], - 'postal_code': payload['postal_code'], - 'iso_country': payload['iso_country'], - 'address_requirements': payload['address_requirements'], - 'beta': payload['beta'], - 'capabilities': payload['capabilities'], + 'friendly_name': payload.get('friendly_name'), + 'phone_number': payload.get('phone_number'), + 'lata': payload.get('lata'), + 'locality': payload.get('locality'), + 'rate_center': payload.get('rate_center'), + 'latitude': deserialize.decimal(payload.get('latitude')), + 'longitude': deserialize.decimal(payload.get('longitude')), + 'region': payload.get('region'), + 'postal_code': payload.get('postal_code'), + 'iso_country': payload.get('iso_country'), + 'address_requirements': payload.get('address_requirements'), + 'beta': payload.get('beta'), + 'capabilities': payload.get('capabilities'), } # Context diff --git a/twilio/rest/api/v2010/account/available_phone_number/machine_to_machine.py b/twilio/rest/api/v2010/account/available_phone_number/machine_to_machine.py index 3c9f082884..6dc615fda2 100644 --- a/twilio/rest/api/v2010/account/available_phone_number/machine_to_machine.py +++ b/twilio/rest/api/v2010/account/available_phone_number/machine_to_machine.py @@ -329,19 +329,19 @@ def __init__(self, version, payload, account_sid, country_code): # Marshaled Properties self._properties = { - 'friendly_name': payload['friendly_name'], - 'phone_number': payload['phone_number'], - 'lata': payload['lata'], - 'locality': payload['locality'], - 'rate_center': payload['rate_center'], - 'latitude': deserialize.decimal(payload['latitude']), - 'longitude': deserialize.decimal(payload['longitude']), - 'region': payload['region'], - 'postal_code': payload['postal_code'], - 'iso_country': payload['iso_country'], - 'address_requirements': payload['address_requirements'], - 'beta': payload['beta'], - 'capabilities': payload['capabilities'], + 'friendly_name': payload.get('friendly_name'), + 'phone_number': payload.get('phone_number'), + 'lata': payload.get('lata'), + 'locality': payload.get('locality'), + 'rate_center': payload.get('rate_center'), + 'latitude': deserialize.decimal(payload.get('latitude')), + 'longitude': deserialize.decimal(payload.get('longitude')), + 'region': payload.get('region'), + 'postal_code': payload.get('postal_code'), + 'iso_country': payload.get('iso_country'), + 'address_requirements': payload.get('address_requirements'), + 'beta': payload.get('beta'), + 'capabilities': payload.get('capabilities'), } # Context diff --git a/twilio/rest/api/v2010/account/available_phone_number/mobile.py b/twilio/rest/api/v2010/account/available_phone_number/mobile.py index 948af1e5c8..50eed4edf3 100644 --- a/twilio/rest/api/v2010/account/available_phone_number/mobile.py +++ b/twilio/rest/api/v2010/account/available_phone_number/mobile.py @@ -329,19 +329,19 @@ def __init__(self, version, payload, account_sid, country_code): # Marshaled Properties self._properties = { - 'friendly_name': payload['friendly_name'], - 'phone_number': payload['phone_number'], - 'lata': payload['lata'], - 'locality': payload['locality'], - 'rate_center': payload['rate_center'], - 'latitude': deserialize.decimal(payload['latitude']), - 'longitude': deserialize.decimal(payload['longitude']), - 'region': payload['region'], - 'postal_code': payload['postal_code'], - 'iso_country': payload['iso_country'], - 'address_requirements': payload['address_requirements'], - 'beta': payload['beta'], - 'capabilities': payload['capabilities'], + 'friendly_name': payload.get('friendly_name'), + 'phone_number': payload.get('phone_number'), + 'lata': payload.get('lata'), + 'locality': payload.get('locality'), + 'rate_center': payload.get('rate_center'), + 'latitude': deserialize.decimal(payload.get('latitude')), + 'longitude': deserialize.decimal(payload.get('longitude')), + 'region': payload.get('region'), + 'postal_code': payload.get('postal_code'), + 'iso_country': payload.get('iso_country'), + 'address_requirements': payload.get('address_requirements'), + 'beta': payload.get('beta'), + 'capabilities': payload.get('capabilities'), } # Context diff --git a/twilio/rest/api/v2010/account/available_phone_number/national.py b/twilio/rest/api/v2010/account/available_phone_number/national.py index 2e625a6fc4..a0f00930d5 100644 --- a/twilio/rest/api/v2010/account/available_phone_number/national.py +++ b/twilio/rest/api/v2010/account/available_phone_number/national.py @@ -329,19 +329,19 @@ def __init__(self, version, payload, account_sid, country_code): # Marshaled Properties self._properties = { - 'friendly_name': payload['friendly_name'], - 'phone_number': payload['phone_number'], - 'lata': payload['lata'], - 'locality': payload['locality'], - 'rate_center': payload['rate_center'], - 'latitude': deserialize.decimal(payload['latitude']), - 'longitude': deserialize.decimal(payload['longitude']), - 'region': payload['region'], - 'postal_code': payload['postal_code'], - 'iso_country': payload['iso_country'], - 'address_requirements': payload['address_requirements'], - 'beta': payload['beta'], - 'capabilities': payload['capabilities'], + 'friendly_name': payload.get('friendly_name'), + 'phone_number': payload.get('phone_number'), + 'lata': payload.get('lata'), + 'locality': payload.get('locality'), + 'rate_center': payload.get('rate_center'), + 'latitude': deserialize.decimal(payload.get('latitude')), + 'longitude': deserialize.decimal(payload.get('longitude')), + 'region': payload.get('region'), + 'postal_code': payload.get('postal_code'), + 'iso_country': payload.get('iso_country'), + 'address_requirements': payload.get('address_requirements'), + 'beta': payload.get('beta'), + 'capabilities': payload.get('capabilities'), } # Context diff --git a/twilio/rest/api/v2010/account/available_phone_number/shared_cost.py b/twilio/rest/api/v2010/account/available_phone_number/shared_cost.py index cacbb3d446..9ca37a65a5 100644 --- a/twilio/rest/api/v2010/account/available_phone_number/shared_cost.py +++ b/twilio/rest/api/v2010/account/available_phone_number/shared_cost.py @@ -329,19 +329,19 @@ def __init__(self, version, payload, account_sid, country_code): # Marshaled Properties self._properties = { - 'friendly_name': payload['friendly_name'], - 'phone_number': payload['phone_number'], - 'lata': payload['lata'], - 'locality': payload['locality'], - 'rate_center': payload['rate_center'], - 'latitude': deserialize.decimal(payload['latitude']), - 'longitude': deserialize.decimal(payload['longitude']), - 'region': payload['region'], - 'postal_code': payload['postal_code'], - 'iso_country': payload['iso_country'], - 'address_requirements': payload['address_requirements'], - 'beta': payload['beta'], - 'capabilities': payload['capabilities'], + 'friendly_name': payload.get('friendly_name'), + 'phone_number': payload.get('phone_number'), + 'lata': payload.get('lata'), + 'locality': payload.get('locality'), + 'rate_center': payload.get('rate_center'), + 'latitude': deserialize.decimal(payload.get('latitude')), + 'longitude': deserialize.decimal(payload.get('longitude')), + 'region': payload.get('region'), + 'postal_code': payload.get('postal_code'), + 'iso_country': payload.get('iso_country'), + 'address_requirements': payload.get('address_requirements'), + 'beta': payload.get('beta'), + 'capabilities': payload.get('capabilities'), } # Context diff --git a/twilio/rest/api/v2010/account/available_phone_number/toll_free.py b/twilio/rest/api/v2010/account/available_phone_number/toll_free.py index 84d49223c4..118ca689be 100644 --- a/twilio/rest/api/v2010/account/available_phone_number/toll_free.py +++ b/twilio/rest/api/v2010/account/available_phone_number/toll_free.py @@ -329,19 +329,19 @@ def __init__(self, version, payload, account_sid, country_code): # Marshaled Properties self._properties = { - 'friendly_name': payload['friendly_name'], - 'phone_number': payload['phone_number'], - 'lata': payload['lata'], - 'locality': payload['locality'], - 'rate_center': payload['rate_center'], - 'latitude': deserialize.decimal(payload['latitude']), - 'longitude': deserialize.decimal(payload['longitude']), - 'region': payload['region'], - 'postal_code': payload['postal_code'], - 'iso_country': payload['iso_country'], - 'address_requirements': payload['address_requirements'], - 'beta': payload['beta'], - 'capabilities': payload['capabilities'], + 'friendly_name': payload.get('friendly_name'), + 'phone_number': payload.get('phone_number'), + 'lata': payload.get('lata'), + 'locality': payload.get('locality'), + 'rate_center': payload.get('rate_center'), + 'latitude': deserialize.decimal(payload.get('latitude')), + 'longitude': deserialize.decimal(payload.get('longitude')), + 'region': payload.get('region'), + 'postal_code': payload.get('postal_code'), + 'iso_country': payload.get('iso_country'), + 'address_requirements': payload.get('address_requirements'), + 'beta': payload.get('beta'), + 'capabilities': payload.get('capabilities'), } # Context diff --git a/twilio/rest/api/v2010/account/available_phone_number/voip.py b/twilio/rest/api/v2010/account/available_phone_number/voip.py index e50eaca128..8650d860be 100644 --- a/twilio/rest/api/v2010/account/available_phone_number/voip.py +++ b/twilio/rest/api/v2010/account/available_phone_number/voip.py @@ -329,19 +329,19 @@ def __init__(self, version, payload, account_sid, country_code): # Marshaled Properties self._properties = { - 'friendly_name': payload['friendly_name'], - 'phone_number': payload['phone_number'], - 'lata': payload['lata'], - 'locality': payload['locality'], - 'rate_center': payload['rate_center'], - 'latitude': deserialize.decimal(payload['latitude']), - 'longitude': deserialize.decimal(payload['longitude']), - 'region': payload['region'], - 'postal_code': payload['postal_code'], - 'iso_country': payload['iso_country'], - 'address_requirements': payload['address_requirements'], - 'beta': payload['beta'], - 'capabilities': payload['capabilities'], + 'friendly_name': payload.get('friendly_name'), + 'phone_number': payload.get('phone_number'), + 'lata': payload.get('lata'), + 'locality': payload.get('locality'), + 'rate_center': payload.get('rate_center'), + 'latitude': deserialize.decimal(payload.get('latitude')), + 'longitude': deserialize.decimal(payload.get('longitude')), + 'region': payload.get('region'), + 'postal_code': payload.get('postal_code'), + 'iso_country': payload.get('iso_country'), + 'address_requirements': payload.get('address_requirements'), + 'beta': payload.get('beta'), + 'capabilities': payload.get('capabilities'), } # Context diff --git a/twilio/rest/api/v2010/account/balance.py b/twilio/rest/api/v2010/account/balance.py index 2966bdf483..278d592ecd 100644 --- a/twilio/rest/api/v2010/account/balance.py +++ b/twilio/rest/api/v2010/account/balance.py @@ -112,9 +112,9 @@ def __init__(self, version, payload, account_sid): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'balance': payload['balance'], - 'currency': payload['currency'], + 'account_sid': payload.get('account_sid'), + 'balance': payload.get('balance'), + 'currency': payload.get('currency'), } # Context diff --git a/twilio/rest/api/v2010/account/call/__init__.py b/twilio/rest/api/v2010/account/call/__init__.py index 54d60970d5..27f04392f3 100644 --- a/twilio/rest/api/v2010/account/call/__init__.py +++ b/twilio/rest/api/v2010/account/call/__init__.py @@ -572,31 +572,31 @@ def __init__(self, version, payload, account_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'annotation': payload['annotation'], - 'answered_by': payload['answered_by'], - 'api_version': payload['api_version'], - 'caller_name': payload['caller_name'], - 'date_created': deserialize.rfc2822_datetime(payload['date_created']), - 'date_updated': deserialize.rfc2822_datetime(payload['date_updated']), - 'direction': payload['direction'], - 'duration': payload['duration'], - 'end_time': deserialize.rfc2822_datetime(payload['end_time']), - 'forwarded_from': payload['forwarded_from'], - 'from_': payload['from'], - 'from_formatted': payload['from_formatted'], - 'group_sid': payload['group_sid'], - 'parent_call_sid': payload['parent_call_sid'], - 'phone_number_sid': payload['phone_number_sid'], - 'price': deserialize.decimal(payload['price']), - 'price_unit': payload['price_unit'], - 'sid': payload['sid'], - 'start_time': deserialize.rfc2822_datetime(payload['start_time']), - 'status': payload['status'], - 'subresource_uris': payload['subresource_uris'], - 'to': payload['to'], - 'to_formatted': payload['to_formatted'], - 'uri': payload['uri'], + 'account_sid': payload.get('account_sid'), + 'annotation': payload.get('annotation'), + 'answered_by': payload.get('answered_by'), + 'api_version': payload.get('api_version'), + 'caller_name': payload.get('caller_name'), + 'date_created': deserialize.rfc2822_datetime(payload.get('date_created')), + 'date_updated': deserialize.rfc2822_datetime(payload.get('date_updated')), + 'direction': payload.get('direction'), + 'duration': payload.get('duration'), + 'end_time': deserialize.rfc2822_datetime(payload.get('end_time')), + 'forwarded_from': payload.get('forwarded_from'), + 'from_': payload.get('from'), + 'from_formatted': payload.get('from_formatted'), + 'group_sid': payload.get('group_sid'), + 'parent_call_sid': payload.get('parent_call_sid'), + 'phone_number_sid': payload.get('phone_number_sid'), + 'price': deserialize.decimal(payload.get('price')), + 'price_unit': payload.get('price_unit'), + 'sid': payload.get('sid'), + 'start_time': deserialize.rfc2822_datetime(payload.get('start_time')), + 'status': payload.get('status'), + 'subresource_uris': payload.get('subresource_uris'), + 'to': payload.get('to'), + 'to_formatted': payload.get('to_formatted'), + 'uri': payload.get('uri'), } # Context diff --git a/twilio/rest/api/v2010/account/call/feedback.py b/twilio/rest/api/v2010/account/call/feedback.py index 23e95ba0aa..94ab71055a 100644 --- a/twilio/rest/api/v2010/account/call/feedback.py +++ b/twilio/rest/api/v2010/account/call/feedback.py @@ -243,12 +243,12 @@ def __init__(self, version, payload, account_sid, call_sid): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'date_created': deserialize.rfc2822_datetime(payload['date_created']), - 'date_updated': deserialize.rfc2822_datetime(payload['date_updated']), - 'issues': payload['issues'], - 'quality_score': deserialize.integer(payload['quality_score']), - 'sid': payload['sid'], + 'account_sid': payload.get('account_sid'), + 'date_created': deserialize.rfc2822_datetime(payload.get('date_created')), + 'date_updated': deserialize.rfc2822_datetime(payload.get('date_updated')), + 'issues': payload.get('issues'), + 'quality_score': deserialize.integer(payload.get('quality_score')), + 'sid': payload.get('sid'), } # Context diff --git a/twilio/rest/api/v2010/account/call/feedback_summary.py b/twilio/rest/api/v2010/account/call/feedback_summary.py index 5131e8f10d..e040d06c13 100644 --- a/twilio/rest/api/v2010/account/call/feedback_summary.py +++ b/twilio/rest/api/v2010/account/call/feedback_summary.py @@ -218,20 +218,20 @@ def __init__(self, version, payload, account_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'call_count': deserialize.integer(payload['call_count']), - 'call_feedback_count': deserialize.integer(payload['call_feedback_count']), - 'date_created': deserialize.rfc2822_datetime(payload['date_created']), - 'date_updated': deserialize.rfc2822_datetime(payload['date_updated']), - 'end_date': deserialize.iso8601_datetime(payload['end_date']), - 'include_subaccounts': payload['include_subaccounts'], - 'issues': payload['issues'], - 'quality_score_average': deserialize.decimal(payload['quality_score_average']), - 'quality_score_median': deserialize.decimal(payload['quality_score_median']), - 'quality_score_standard_deviation': deserialize.decimal(payload['quality_score_standard_deviation']), - 'sid': payload['sid'], - 'start_date': deserialize.iso8601_datetime(payload['start_date']), - 'status': payload['status'], + 'account_sid': payload.get('account_sid'), + 'call_count': deserialize.integer(payload.get('call_count')), + 'call_feedback_count': deserialize.integer(payload.get('call_feedback_count')), + 'date_created': deserialize.rfc2822_datetime(payload.get('date_created')), + 'date_updated': deserialize.rfc2822_datetime(payload.get('date_updated')), + 'end_date': deserialize.iso8601_datetime(payload.get('end_date')), + 'include_subaccounts': payload.get('include_subaccounts'), + 'issues': payload.get('issues'), + 'quality_score_average': deserialize.decimal(payload.get('quality_score_average')), + 'quality_score_median': deserialize.decimal(payload.get('quality_score_median')), + 'quality_score_standard_deviation': deserialize.decimal(payload.get('quality_score_standard_deviation')), + 'sid': payload.get('sid'), + 'start_date': deserialize.iso8601_datetime(payload.get('start_date')), + 'status': payload.get('status'), } # Context diff --git a/twilio/rest/api/v2010/account/call/notification.py b/twilio/rest/api/v2010/account/call/notification.py index b184b0f130..f2b9157ad9 100644 --- a/twilio/rest/api/v2010/account/call/notification.py +++ b/twilio/rest/api/v2010/account/call/notification.py @@ -321,23 +321,23 @@ def __init__(self, version, payload, account_sid, call_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'api_version': payload['api_version'], - 'call_sid': payload['call_sid'], - 'date_created': deserialize.rfc2822_datetime(payload['date_created']), - 'date_updated': deserialize.rfc2822_datetime(payload['date_updated']), - 'error_code': payload['error_code'], - 'log': payload['log'], - 'message_date': deserialize.rfc2822_datetime(payload['message_date']), - 'message_text': payload['message_text'], - 'more_info': payload['more_info'], - 'request_method': payload['request_method'], - 'request_url': payload['request_url'], - 'sid': payload['sid'], - 'uri': payload['uri'], + 'account_sid': payload.get('account_sid'), + 'api_version': payload.get('api_version'), + 'call_sid': payload.get('call_sid'), + 'date_created': deserialize.rfc2822_datetime(payload.get('date_created')), + 'date_updated': deserialize.rfc2822_datetime(payload.get('date_updated')), + 'error_code': payload.get('error_code'), + 'log': payload.get('log'), + 'message_date': deserialize.rfc2822_datetime(payload.get('message_date')), + 'message_text': payload.get('message_text'), + 'more_info': payload.get('more_info'), + 'request_method': payload.get('request_method'), + 'request_url': payload.get('request_url'), 'request_variables': payload.get('request_variables'), 'response_body': payload.get('response_body'), 'response_headers': payload.get('response_headers'), + 'sid': payload.get('sid'), + 'uri': payload.get('uri'), } # Context diff --git a/twilio/rest/api/v2010/account/call/recording.py b/twilio/rest/api/v2010/account/call/recording.py index e652dd62e4..d99a536348 100644 --- a/twilio/rest/api/v2010/account/call/recording.py +++ b/twilio/rest/api/v2010/account/call/recording.py @@ -392,23 +392,23 @@ def __init__(self, version, payload, account_sid, call_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'api_version': payload['api_version'], - 'call_sid': payload['call_sid'], - 'conference_sid': payload['conference_sid'], - 'date_created': deserialize.rfc2822_datetime(payload['date_created']), - 'date_updated': deserialize.rfc2822_datetime(payload['date_updated']), - 'start_time': deserialize.rfc2822_datetime(payload['start_time']), - 'duration': payload['duration'], - 'sid': payload['sid'], - 'price': deserialize.decimal(payload['price']), - 'uri': payload['uri'], - 'encryption_details': payload['encryption_details'], - 'price_unit': payload['price_unit'], - 'status': payload['status'], - 'channels': deserialize.integer(payload['channels']), - 'source': payload['source'], - 'error_code': deserialize.integer(payload['error_code']), + 'account_sid': payload.get('account_sid'), + 'api_version': payload.get('api_version'), + 'call_sid': payload.get('call_sid'), + 'conference_sid': payload.get('conference_sid'), + 'date_created': deserialize.rfc2822_datetime(payload.get('date_created')), + 'date_updated': deserialize.rfc2822_datetime(payload.get('date_updated')), + 'start_time': deserialize.rfc2822_datetime(payload.get('start_time')), + 'duration': payload.get('duration'), + 'sid': payload.get('sid'), + 'price': deserialize.decimal(payload.get('price')), + 'uri': payload.get('uri'), + 'encryption_details': payload.get('encryption_details'), + 'price_unit': payload.get('price_unit'), + 'status': payload.get('status'), + 'channels': deserialize.integer(payload.get('channels')), + 'source': payload.get('source'), + 'error_code': deserialize.integer(payload.get('error_code')), } # Context diff --git a/twilio/rest/api/v2010/account/conference/__init__.py b/twilio/rest/api/v2010/account/conference/__init__.py index d11822756c..cc656e39cb 100644 --- a/twilio/rest/api/v2010/account/conference/__init__.py +++ b/twilio/rest/api/v2010/account/conference/__init__.py @@ -396,16 +396,16 @@ def __init__(self, version, payload, account_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'date_created': deserialize.rfc2822_datetime(payload['date_created']), - 'date_updated': deserialize.rfc2822_datetime(payload['date_updated']), - 'api_version': payload['api_version'], - 'friendly_name': payload['friendly_name'], - 'region': payload['region'], - 'sid': payload['sid'], - 'status': payload['status'], - 'uri': payload['uri'], - 'subresource_uris': payload['subresource_uris'], + 'account_sid': payload.get('account_sid'), + 'date_created': deserialize.rfc2822_datetime(payload.get('date_created')), + 'date_updated': deserialize.rfc2822_datetime(payload.get('date_updated')), + 'api_version': payload.get('api_version'), + 'friendly_name': payload.get('friendly_name'), + 'region': payload.get('region'), + 'sid': payload.get('sid'), + 'status': payload.get('status'), + 'uri': payload.get('uri'), + 'subresource_uris': payload.get('subresource_uris'), } # Context diff --git a/twilio/rest/api/v2010/account/conference/participant.py b/twilio/rest/api/v2010/account/conference/participant.py index 1ce9d224a9..6f94568a4b 100644 --- a/twilio/rest/api/v2010/account/conference/participant.py +++ b/twilio/rest/api/v2010/account/conference/participant.py @@ -483,19 +483,19 @@ def __init__(self, version, payload, account_sid, conference_sid, # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'call_sid': payload['call_sid'], - 'call_sid_to_coach': payload['call_sid_to_coach'], - 'coaching': payload['coaching'], - 'conference_sid': payload['conference_sid'], - 'date_created': deserialize.rfc2822_datetime(payload['date_created']), - 'date_updated': deserialize.rfc2822_datetime(payload['date_updated']), - 'end_conference_on_exit': payload['end_conference_on_exit'], - 'muted': payload['muted'], - 'hold': payload['hold'], - 'start_conference_on_enter': payload['start_conference_on_enter'], - 'status': payload['status'], - 'uri': payload['uri'], + 'account_sid': payload.get('account_sid'), + 'call_sid': payload.get('call_sid'), + 'call_sid_to_coach': payload.get('call_sid_to_coach'), + 'coaching': payload.get('coaching'), + 'conference_sid': payload.get('conference_sid'), + 'date_created': deserialize.rfc2822_datetime(payload.get('date_created')), + 'date_updated': deserialize.rfc2822_datetime(payload.get('date_updated')), + 'end_conference_on_exit': payload.get('end_conference_on_exit'), + 'muted': payload.get('muted'), + 'hold': payload.get('hold'), + 'start_conference_on_enter': payload.get('start_conference_on_enter'), + 'status': payload.get('status'), + 'uri': payload.get('uri'), } # Context diff --git a/twilio/rest/api/v2010/account/conference/recording.py b/twilio/rest/api/v2010/account/conference/recording.py index 871bc10dc9..e50f2ff6af 100644 --- a/twilio/rest/api/v2010/account/conference/recording.py +++ b/twilio/rest/api/v2010/account/conference/recording.py @@ -355,23 +355,23 @@ def __init__(self, version, payload, account_sid, conference_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'api_version': payload['api_version'], - 'call_sid': payload['call_sid'], - 'conference_sid': payload['conference_sid'], - 'date_created': deserialize.rfc2822_datetime(payload['date_created']), - 'date_updated': deserialize.rfc2822_datetime(payload['date_updated']), - 'start_time': deserialize.rfc2822_datetime(payload['start_time']), - 'duration': payload['duration'], - 'sid': payload['sid'], - 'price': deserialize.decimal(payload['price']), - 'price_unit': payload['price_unit'], - 'status': payload['status'], - 'channels': deserialize.integer(payload['channels']), - 'source': payload['source'], - 'error_code': deserialize.integer(payload['error_code']), - 'encryption_details': payload['encryption_details'], - 'uri': payload['uri'], + 'account_sid': payload.get('account_sid'), + 'api_version': payload.get('api_version'), + 'call_sid': payload.get('call_sid'), + 'conference_sid': payload.get('conference_sid'), + 'date_created': deserialize.rfc2822_datetime(payload.get('date_created')), + 'date_updated': deserialize.rfc2822_datetime(payload.get('date_updated')), + 'start_time': deserialize.rfc2822_datetime(payload.get('start_time')), + 'duration': payload.get('duration'), + 'sid': payload.get('sid'), + 'price': deserialize.decimal(payload.get('price')), + 'price_unit': payload.get('price_unit'), + 'status': payload.get('status'), + 'channels': deserialize.integer(payload.get('channels')), + 'source': payload.get('source'), + 'error_code': deserialize.integer(payload.get('error_code')), + 'encryption_details': payload.get('encryption_details'), + 'uri': payload.get('uri'), } # Context diff --git a/twilio/rest/api/v2010/account/connect_app.py b/twilio/rest/api/v2010/account/connect_app.py index 8d7e5d4bfb..5a8136fc07 100644 --- a/twilio/rest/api/v2010/account/connect_app.py +++ b/twilio/rest/api/v2010/account/connect_app.py @@ -310,17 +310,17 @@ def __init__(self, version, payload, account_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'authorize_redirect_url': payload['authorize_redirect_url'], - 'company_name': payload['company_name'], - 'deauthorize_callback_method': payload['deauthorize_callback_method'], - 'deauthorize_callback_url': payload['deauthorize_callback_url'], - 'description': payload['description'], - 'friendly_name': payload['friendly_name'], - 'homepage_url': payload['homepage_url'], - 'permissions': payload['permissions'], - 'sid': payload['sid'], - 'uri': payload['uri'], + 'account_sid': payload.get('account_sid'), + 'authorize_redirect_url': payload.get('authorize_redirect_url'), + 'company_name': payload.get('company_name'), + 'deauthorize_callback_method': payload.get('deauthorize_callback_method'), + 'deauthorize_callback_url': payload.get('deauthorize_callback_url'), + 'description': payload.get('description'), + 'friendly_name': payload.get('friendly_name'), + 'homepage_url': payload.get('homepage_url'), + 'permissions': payload.get('permissions'), + 'sid': payload.get('sid'), + 'uri': payload.get('uri'), } # Context diff --git a/twilio/rest/api/v2010/account/incoming_phone_number/__init__.py b/twilio/rest/api/v2010/account/incoming_phone_number/__init__.py index 407161cb25..54c2867678 100644 --- a/twilio/rest/api/v2010/account/incoming_phone_number/__init__.py +++ b/twilio/rest/api/v2010/account/incoming_phone_number/__init__.py @@ -543,36 +543,36 @@ def __init__(self, version, payload, account_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'address_sid': payload['address_sid'], - 'address_requirements': payload['address_requirements'], - 'api_version': payload['api_version'], - 'beta': payload['beta'], - 'capabilities': payload['capabilities'], - 'date_created': deserialize.rfc2822_datetime(payload['date_created']), - 'date_updated': deserialize.rfc2822_datetime(payload['date_updated']), - 'friendly_name': payload['friendly_name'], - 'identity_sid': payload['identity_sid'], - 'phone_number': payload['phone_number'], - 'origin': payload['origin'], - 'sid': payload['sid'], - 'sms_application_sid': payload['sms_application_sid'], - 'sms_fallback_method': payload['sms_fallback_method'], - 'sms_fallback_url': payload['sms_fallback_url'], - 'sms_method': payload['sms_method'], - 'sms_url': payload['sms_url'], - 'status_callback': payload['status_callback'], - 'status_callback_method': payload['status_callback_method'], - 'trunk_sid': payload['trunk_sid'], - 'uri': payload['uri'], - 'voice_application_sid': payload['voice_application_sid'], - 'voice_caller_id_lookup': payload['voice_caller_id_lookup'], - 'voice_fallback_method': payload['voice_fallback_method'], - 'voice_fallback_url': payload['voice_fallback_url'], - 'voice_method': payload['voice_method'], - 'voice_url': payload['voice_url'], - 'emergency_status': payload['emergency_status'], - 'emergency_address_sid': payload['emergency_address_sid'], + 'account_sid': payload.get('account_sid'), + 'address_sid': payload.get('address_sid'), + 'address_requirements': payload.get('address_requirements'), + 'api_version': payload.get('api_version'), + 'beta': payload.get('beta'), + 'capabilities': payload.get('capabilities'), + 'date_created': deserialize.rfc2822_datetime(payload.get('date_created')), + 'date_updated': deserialize.rfc2822_datetime(payload.get('date_updated')), + 'friendly_name': payload.get('friendly_name'), + 'identity_sid': payload.get('identity_sid'), + 'phone_number': payload.get('phone_number'), + 'origin': payload.get('origin'), + 'sid': payload.get('sid'), + 'sms_application_sid': payload.get('sms_application_sid'), + 'sms_fallback_method': payload.get('sms_fallback_method'), + 'sms_fallback_url': payload.get('sms_fallback_url'), + 'sms_method': payload.get('sms_method'), + 'sms_url': payload.get('sms_url'), + 'status_callback': payload.get('status_callback'), + 'status_callback_method': payload.get('status_callback_method'), + 'trunk_sid': payload.get('trunk_sid'), + 'uri': payload.get('uri'), + 'voice_application_sid': payload.get('voice_application_sid'), + 'voice_caller_id_lookup': payload.get('voice_caller_id_lookup'), + 'voice_fallback_method': payload.get('voice_fallback_method'), + 'voice_fallback_url': payload.get('voice_fallback_url'), + 'voice_method': payload.get('voice_method'), + 'voice_url': payload.get('voice_url'), + 'emergency_status': payload.get('emergency_status'), + 'emergency_address_sid': payload.get('emergency_address_sid'), } # Context diff --git a/twilio/rest/api/v2010/account/incoming_phone_number/assigned_add_on/__init__.py b/twilio/rest/api/v2010/account/incoming_phone_number/assigned_add_on/__init__.py index 547abd26a8..876bc6ccee 100644 --- a/twilio/rest/api/v2010/account/incoming_phone_number/assigned_add_on/__init__.py +++ b/twilio/rest/api/v2010/account/incoming_phone_number/assigned_add_on/__init__.py @@ -330,17 +330,17 @@ def __init__(self, version, payload, account_sid, resource_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'resource_sid': payload['resource_sid'], - 'friendly_name': payload['friendly_name'], - 'description': payload['description'], - 'configuration': payload['configuration'], - 'unique_name': payload['unique_name'], - 'date_created': deserialize.rfc2822_datetime(payload['date_created']), - 'date_updated': deserialize.rfc2822_datetime(payload['date_updated']), - 'uri': payload['uri'], - 'subresource_uris': payload['subresource_uris'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'resource_sid': payload.get('resource_sid'), + 'friendly_name': payload.get('friendly_name'), + 'description': payload.get('description'), + 'configuration': payload.get('configuration'), + 'unique_name': payload.get('unique_name'), + 'date_created': deserialize.rfc2822_datetime(payload.get('date_created')), + 'date_updated': deserialize.rfc2822_datetime(payload.get('date_updated')), + 'uri': payload.get('uri'), + 'subresource_uris': payload.get('subresource_uris'), } # Context diff --git a/twilio/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.py b/twilio/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.py index 6eb92c14b6..2158e9d534 100644 --- a/twilio/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.py +++ b/twilio/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.py @@ -293,15 +293,15 @@ def __init__(self, version, payload, account_sid, resource_sid, # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'resource_sid': payload['resource_sid'], - 'assigned_add_on_sid': payload['assigned_add_on_sid'], - 'friendly_name': payload['friendly_name'], - 'product_name': payload['product_name'], - 'unique_name': payload['unique_name'], - 'uri': payload['uri'], - 'enabled': payload['enabled'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'resource_sid': payload.get('resource_sid'), + 'assigned_add_on_sid': payload.get('assigned_add_on_sid'), + 'friendly_name': payload.get('friendly_name'), + 'product_name': payload.get('product_name'), + 'unique_name': payload.get('unique_name'), + 'uri': payload.get('uri'), + 'enabled': payload.get('enabled'), } # Context diff --git a/twilio/rest/api/v2010/account/incoming_phone_number/local.py b/twilio/rest/api/v2010/account/incoming_phone_number/local.py index 9716b55a64..3a1d5ca72f 100644 --- a/twilio/rest/api/v2010/account/incoming_phone_number/local.py +++ b/twilio/rest/api/v2010/account/incoming_phone_number/local.py @@ -286,34 +286,34 @@ def __init__(self, version, payload, account_sid): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'address_sid': payload['address_sid'], - 'address_requirements': payload['address_requirements'], - 'api_version': payload['api_version'], - 'beta': payload['beta'], - 'capabilities': payload['capabilities'], - 'date_created': deserialize.rfc2822_datetime(payload['date_created']), - 'date_updated': deserialize.rfc2822_datetime(payload['date_updated']), - 'friendly_name': payload['friendly_name'], - 'identity_sid': payload['identity_sid'], - 'phone_number': payload['phone_number'], - 'origin': payload['origin'], - 'sid': payload['sid'], - 'sms_application_sid': payload['sms_application_sid'], - 'sms_fallback_method': payload['sms_fallback_method'], - 'sms_fallback_url': payload['sms_fallback_url'], - 'sms_method': payload['sms_method'], - 'sms_url': payload['sms_url'], - 'status_callback': payload['status_callback'], - 'status_callback_method': payload['status_callback_method'], - 'trunk_sid': payload['trunk_sid'], - 'uri': payload['uri'], - 'voice_application_sid': payload['voice_application_sid'], - 'voice_caller_id_lookup': payload['voice_caller_id_lookup'], - 'voice_fallback_method': payload['voice_fallback_method'], - 'voice_fallback_url': payload['voice_fallback_url'], - 'voice_method': payload['voice_method'], - 'voice_url': payload['voice_url'], + 'account_sid': payload.get('account_sid'), + 'address_sid': payload.get('address_sid'), + 'address_requirements': payload.get('address_requirements'), + 'api_version': payload.get('api_version'), + 'beta': payload.get('beta'), + 'capabilities': payload.get('capabilities'), + 'date_created': deserialize.rfc2822_datetime(payload.get('date_created')), + 'date_updated': deserialize.rfc2822_datetime(payload.get('date_updated')), + 'friendly_name': payload.get('friendly_name'), + 'identity_sid': payload.get('identity_sid'), + 'phone_number': payload.get('phone_number'), + 'origin': payload.get('origin'), + 'sid': payload.get('sid'), + 'sms_application_sid': payload.get('sms_application_sid'), + 'sms_fallback_method': payload.get('sms_fallback_method'), + 'sms_fallback_url': payload.get('sms_fallback_url'), + 'sms_method': payload.get('sms_method'), + 'sms_url': payload.get('sms_url'), + 'status_callback': payload.get('status_callback'), + 'status_callback_method': payload.get('status_callback_method'), + 'trunk_sid': payload.get('trunk_sid'), + 'uri': payload.get('uri'), + 'voice_application_sid': payload.get('voice_application_sid'), + 'voice_caller_id_lookup': payload.get('voice_caller_id_lookup'), + 'voice_fallback_method': payload.get('voice_fallback_method'), + 'voice_fallback_url': payload.get('voice_fallback_url'), + 'voice_method': payload.get('voice_method'), + 'voice_url': payload.get('voice_url'), } # Context diff --git a/twilio/rest/api/v2010/account/incoming_phone_number/mobile.py b/twilio/rest/api/v2010/account/incoming_phone_number/mobile.py index fbeefda1b9..a92f0bf682 100644 --- a/twilio/rest/api/v2010/account/incoming_phone_number/mobile.py +++ b/twilio/rest/api/v2010/account/incoming_phone_number/mobile.py @@ -286,34 +286,34 @@ def __init__(self, version, payload, account_sid): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'address_sid': payload['address_sid'], - 'address_requirements': payload['address_requirements'], - 'api_version': payload['api_version'], - 'beta': payload['beta'], - 'capabilities': payload['capabilities'], - 'date_created': deserialize.rfc2822_datetime(payload['date_created']), - 'date_updated': deserialize.rfc2822_datetime(payload['date_updated']), - 'friendly_name': payload['friendly_name'], - 'identity_sid': payload['identity_sid'], - 'phone_number': payload['phone_number'], - 'origin': payload['origin'], - 'sid': payload['sid'], - 'sms_application_sid': payload['sms_application_sid'], - 'sms_fallback_method': payload['sms_fallback_method'], - 'sms_fallback_url': payload['sms_fallback_url'], - 'sms_method': payload['sms_method'], - 'sms_url': payload['sms_url'], - 'status_callback': payload['status_callback'], - 'status_callback_method': payload['status_callback_method'], - 'trunk_sid': payload['trunk_sid'], - 'uri': payload['uri'], - 'voice_application_sid': payload['voice_application_sid'], - 'voice_caller_id_lookup': payload['voice_caller_id_lookup'], - 'voice_fallback_method': payload['voice_fallback_method'], - 'voice_fallback_url': payload['voice_fallback_url'], - 'voice_method': payload['voice_method'], - 'voice_url': payload['voice_url'], + 'account_sid': payload.get('account_sid'), + 'address_sid': payload.get('address_sid'), + 'address_requirements': payload.get('address_requirements'), + 'api_version': payload.get('api_version'), + 'beta': payload.get('beta'), + 'capabilities': payload.get('capabilities'), + 'date_created': deserialize.rfc2822_datetime(payload.get('date_created')), + 'date_updated': deserialize.rfc2822_datetime(payload.get('date_updated')), + 'friendly_name': payload.get('friendly_name'), + 'identity_sid': payload.get('identity_sid'), + 'phone_number': payload.get('phone_number'), + 'origin': payload.get('origin'), + 'sid': payload.get('sid'), + 'sms_application_sid': payload.get('sms_application_sid'), + 'sms_fallback_method': payload.get('sms_fallback_method'), + 'sms_fallback_url': payload.get('sms_fallback_url'), + 'sms_method': payload.get('sms_method'), + 'sms_url': payload.get('sms_url'), + 'status_callback': payload.get('status_callback'), + 'status_callback_method': payload.get('status_callback_method'), + 'trunk_sid': payload.get('trunk_sid'), + 'uri': payload.get('uri'), + 'voice_application_sid': payload.get('voice_application_sid'), + 'voice_caller_id_lookup': payload.get('voice_caller_id_lookup'), + 'voice_fallback_method': payload.get('voice_fallback_method'), + 'voice_fallback_url': payload.get('voice_fallback_url'), + 'voice_method': payload.get('voice_method'), + 'voice_url': payload.get('voice_url'), } # Context diff --git a/twilio/rest/api/v2010/account/incoming_phone_number/toll_free.py b/twilio/rest/api/v2010/account/incoming_phone_number/toll_free.py index cafff96a8a..58a32d7673 100644 --- a/twilio/rest/api/v2010/account/incoming_phone_number/toll_free.py +++ b/twilio/rest/api/v2010/account/incoming_phone_number/toll_free.py @@ -286,34 +286,34 @@ def __init__(self, version, payload, account_sid): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'address_sid': payload['address_sid'], - 'address_requirements': payload['address_requirements'], - 'api_version': payload['api_version'], - 'beta': payload['beta'], - 'capabilities': payload['capabilities'], - 'date_created': deserialize.rfc2822_datetime(payload['date_created']), - 'date_updated': deserialize.rfc2822_datetime(payload['date_updated']), - 'friendly_name': payload['friendly_name'], - 'identity_sid': payload['identity_sid'], - 'phone_number': payload['phone_number'], - 'origin': payload['origin'], - 'sid': payload['sid'], - 'sms_application_sid': payload['sms_application_sid'], - 'sms_fallback_method': payload['sms_fallback_method'], - 'sms_fallback_url': payload['sms_fallback_url'], - 'sms_method': payload['sms_method'], - 'sms_url': payload['sms_url'], - 'status_callback': payload['status_callback'], - 'status_callback_method': payload['status_callback_method'], - 'trunk_sid': payload['trunk_sid'], - 'uri': payload['uri'], - 'voice_application_sid': payload['voice_application_sid'], - 'voice_caller_id_lookup': payload['voice_caller_id_lookup'], - 'voice_fallback_method': payload['voice_fallback_method'], - 'voice_fallback_url': payload['voice_fallback_url'], - 'voice_method': payload['voice_method'], - 'voice_url': payload['voice_url'], + 'account_sid': payload.get('account_sid'), + 'address_sid': payload.get('address_sid'), + 'address_requirements': payload.get('address_requirements'), + 'api_version': payload.get('api_version'), + 'beta': payload.get('beta'), + 'capabilities': payload.get('capabilities'), + 'date_created': deserialize.rfc2822_datetime(payload.get('date_created')), + 'date_updated': deserialize.rfc2822_datetime(payload.get('date_updated')), + 'friendly_name': payload.get('friendly_name'), + 'identity_sid': payload.get('identity_sid'), + 'phone_number': payload.get('phone_number'), + 'origin': payload.get('origin'), + 'sid': payload.get('sid'), + 'sms_application_sid': payload.get('sms_application_sid'), + 'sms_fallback_method': payload.get('sms_fallback_method'), + 'sms_fallback_url': payload.get('sms_fallback_url'), + 'sms_method': payload.get('sms_method'), + 'sms_url': payload.get('sms_url'), + 'status_callback': payload.get('status_callback'), + 'status_callback_method': payload.get('status_callback_method'), + 'trunk_sid': payload.get('trunk_sid'), + 'uri': payload.get('uri'), + 'voice_application_sid': payload.get('voice_application_sid'), + 'voice_caller_id_lookup': payload.get('voice_caller_id_lookup'), + 'voice_fallback_method': payload.get('voice_fallback_method'), + 'voice_fallback_url': payload.get('voice_fallback_url'), + 'voice_method': payload.get('voice_method'), + 'voice_url': payload.get('voice_url'), } # Context diff --git a/twilio/rest/api/v2010/account/key.py b/twilio/rest/api/v2010/account/key.py index 53320232fa..1a97de4b1e 100644 --- a/twilio/rest/api/v2010/account/key.py +++ b/twilio/rest/api/v2010/account/key.py @@ -286,10 +286,10 @@ def __init__(self, version, payload, account_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'friendly_name': payload['friendly_name'], - 'date_created': deserialize.rfc2822_datetime(payload['date_created']), - 'date_updated': deserialize.rfc2822_datetime(payload['date_updated']), + 'sid': payload.get('sid'), + 'friendly_name': payload.get('friendly_name'), + 'date_created': deserialize.rfc2822_datetime(payload.get('date_created')), + 'date_updated': deserialize.rfc2822_datetime(payload.get('date_updated')), } # Context diff --git a/twilio/rest/api/v2010/account/message/__init__.py b/twilio/rest/api/v2010/account/message/__init__.py index 1983d759c3..cccc516b7a 100644 --- a/twilio/rest/api/v2010/account/message/__init__.py +++ b/twilio/rest/api/v2010/account/message/__init__.py @@ -448,26 +448,26 @@ def __init__(self, version, payload, account_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'api_version': payload['api_version'], - 'body': payload['body'], - 'date_created': deserialize.rfc2822_datetime(payload['date_created']), - 'date_updated': deserialize.rfc2822_datetime(payload['date_updated']), - 'date_sent': deserialize.rfc2822_datetime(payload['date_sent']), - 'direction': payload['direction'], - 'error_code': deserialize.integer(payload['error_code']), - 'error_message': payload['error_message'], - 'from_': payload['from'], - 'messaging_service_sid': payload['messaging_service_sid'], - 'num_media': payload['num_media'], - 'num_segments': payload['num_segments'], - 'price': payload['price'], - 'price_unit': payload['price_unit'], - 'sid': payload['sid'], - 'status': payload['status'], - 'subresource_uris': payload['subresource_uris'], - 'to': payload['to'], - 'uri': payload['uri'], + 'account_sid': payload.get('account_sid'), + 'api_version': payload.get('api_version'), + 'body': payload.get('body'), + 'date_created': deserialize.rfc2822_datetime(payload.get('date_created')), + 'date_updated': deserialize.rfc2822_datetime(payload.get('date_updated')), + 'date_sent': deserialize.rfc2822_datetime(payload.get('date_sent')), + 'direction': payload.get('direction'), + 'error_code': deserialize.integer(payload.get('error_code')), + 'error_message': payload.get('error_message'), + 'from_': payload.get('from'), + 'messaging_service_sid': payload.get('messaging_service_sid'), + 'num_media': payload.get('num_media'), + 'num_segments': payload.get('num_segments'), + 'price': payload.get('price'), + 'price_unit': payload.get('price_unit'), + 'sid': payload.get('sid'), + 'status': payload.get('status'), + 'subresource_uris': payload.get('subresource_uris'), + 'to': payload.get('to'), + 'uri': payload.get('uri'), } # Context diff --git a/twilio/rest/api/v2010/account/message/feedback.py b/twilio/rest/api/v2010/account/message/feedback.py index 1fc5deea86..23d8fdcfb7 100644 --- a/twilio/rest/api/v2010/account/message/feedback.py +++ b/twilio/rest/api/v2010/account/message/feedback.py @@ -131,12 +131,12 @@ def __init__(self, version, payload, account_sid, message_sid): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'message_sid': payload['message_sid'], - 'outcome': payload['outcome'], - 'date_created': deserialize.rfc2822_datetime(payload['date_created']), - 'date_updated': deserialize.rfc2822_datetime(payload['date_updated']), - 'uri': payload['uri'], + 'account_sid': payload.get('account_sid'), + 'message_sid': payload.get('message_sid'), + 'outcome': payload.get('outcome'), + 'date_created': deserialize.rfc2822_datetime(payload.get('date_created')), + 'date_updated': deserialize.rfc2822_datetime(payload.get('date_updated')), + 'uri': payload.get('uri'), } # Context diff --git a/twilio/rest/api/v2010/account/message/media.py b/twilio/rest/api/v2010/account/message/media.py index 50e20793ca..22eae0e60c 100644 --- a/twilio/rest/api/v2010/account/message/media.py +++ b/twilio/rest/api/v2010/account/message/media.py @@ -312,13 +312,13 @@ def __init__(self, version, payload, account_sid, message_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'content_type': payload['content_type'], - 'date_created': deserialize.rfc2822_datetime(payload['date_created']), - 'date_updated': deserialize.rfc2822_datetime(payload['date_updated']), - 'parent_sid': payload['parent_sid'], - 'sid': payload['sid'], - 'uri': payload['uri'], + 'account_sid': payload.get('account_sid'), + 'content_type': payload.get('content_type'), + 'date_created': deserialize.rfc2822_datetime(payload.get('date_created')), + 'date_updated': deserialize.rfc2822_datetime(payload.get('date_updated')), + 'parent_sid': payload.get('parent_sid'), + 'sid': payload.get('sid'), + 'uri': payload.get('uri'), } # Context diff --git a/twilio/rest/api/v2010/account/new_key.py b/twilio/rest/api/v2010/account/new_key.py index 8d002d1fbf..b7cace66d4 100644 --- a/twilio/rest/api/v2010/account/new_key.py +++ b/twilio/rest/api/v2010/account/new_key.py @@ -115,11 +115,11 @@ def __init__(self, version, payload, account_sid): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'friendly_name': payload['friendly_name'], - 'date_created': deserialize.rfc2822_datetime(payload['date_created']), - 'date_updated': deserialize.rfc2822_datetime(payload['date_updated']), - 'secret': payload['secret'], + 'sid': payload.get('sid'), + 'friendly_name': payload.get('friendly_name'), + 'date_created': deserialize.rfc2822_datetime(payload.get('date_created')), + 'date_updated': deserialize.rfc2822_datetime(payload.get('date_updated')), + 'secret': payload.get('secret'), } # Context diff --git a/twilio/rest/api/v2010/account/new_signing_key.py b/twilio/rest/api/v2010/account/new_signing_key.py index 51075aed36..4c29eef844 100644 --- a/twilio/rest/api/v2010/account/new_signing_key.py +++ b/twilio/rest/api/v2010/account/new_signing_key.py @@ -115,11 +115,11 @@ def __init__(self, version, payload, account_sid): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'friendly_name': payload['friendly_name'], - 'date_created': deserialize.rfc2822_datetime(payload['date_created']), - 'date_updated': deserialize.rfc2822_datetime(payload['date_updated']), - 'secret': payload['secret'], + 'sid': payload.get('sid'), + 'friendly_name': payload.get('friendly_name'), + 'date_created': deserialize.rfc2822_datetime(payload.get('date_created')), + 'date_updated': deserialize.rfc2822_datetime(payload.get('date_updated')), + 'secret': payload.get('secret'), } # Context diff --git a/twilio/rest/api/v2010/account/notification.py b/twilio/rest/api/v2010/account/notification.py index 3ef21fb7ce..b4b9602d6b 100644 --- a/twilio/rest/api/v2010/account/notification.py +++ b/twilio/rest/api/v2010/account/notification.py @@ -302,23 +302,23 @@ def __init__(self, version, payload, account_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'api_version': payload['api_version'], - 'call_sid': payload['call_sid'], - 'date_created': deserialize.rfc2822_datetime(payload['date_created']), - 'date_updated': deserialize.rfc2822_datetime(payload['date_updated']), - 'error_code': payload['error_code'], - 'log': payload['log'], - 'message_date': deserialize.rfc2822_datetime(payload['message_date']), - 'message_text': payload['message_text'], - 'more_info': payload['more_info'], - 'request_method': payload['request_method'], - 'request_url': payload['request_url'], - 'sid': payload['sid'], - 'uri': payload['uri'], + 'account_sid': payload.get('account_sid'), + 'api_version': payload.get('api_version'), + 'call_sid': payload.get('call_sid'), + 'date_created': deserialize.rfc2822_datetime(payload.get('date_created')), + 'date_updated': deserialize.rfc2822_datetime(payload.get('date_updated')), + 'error_code': payload.get('error_code'), + 'log': payload.get('log'), + 'message_date': deserialize.rfc2822_datetime(payload.get('message_date')), + 'message_text': payload.get('message_text'), + 'more_info': payload.get('more_info'), + 'request_method': payload.get('request_method'), + 'request_url': payload.get('request_url'), 'request_variables': payload.get('request_variables'), 'response_body': payload.get('response_body'), 'response_headers': payload.get('response_headers'), + 'sid': payload.get('sid'), + 'uri': payload.get('uri'), } # Context diff --git a/twilio/rest/api/v2010/account/outgoing_caller_id.py b/twilio/rest/api/v2010/account/outgoing_caller_id.py index 3b8d5df410..9fa9349483 100644 --- a/twilio/rest/api/v2010/account/outgoing_caller_id.py +++ b/twilio/rest/api/v2010/account/outgoing_caller_id.py @@ -310,13 +310,13 @@ def __init__(self, version, payload, account_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'date_created': deserialize.rfc2822_datetime(payload['date_created']), - 'date_updated': deserialize.rfc2822_datetime(payload['date_updated']), - 'friendly_name': payload['friendly_name'], - 'account_sid': payload['account_sid'], - 'phone_number': payload['phone_number'], - 'uri': payload['uri'], + 'sid': payload.get('sid'), + 'date_created': deserialize.rfc2822_datetime(payload.get('date_created')), + 'date_updated': deserialize.rfc2822_datetime(payload.get('date_updated')), + 'friendly_name': payload.get('friendly_name'), + 'account_sid': payload.get('account_sid'), + 'phone_number': payload.get('phone_number'), + 'uri': payload.get('uri'), } # Context diff --git a/twilio/rest/api/v2010/account/queue/__init__.py b/twilio/rest/api/v2010/account/queue/__init__.py index 8bfe1f9c0e..94aadf8496 100644 --- a/twilio/rest/api/v2010/account/queue/__init__.py +++ b/twilio/rest/api/v2010/account/queue/__init__.py @@ -327,15 +327,15 @@ def __init__(self, version, payload, account_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'average_wait_time': deserialize.integer(payload['average_wait_time']), - 'current_size': deserialize.integer(payload['current_size']), - 'date_created': deserialize.rfc2822_datetime(payload['date_created']), - 'date_updated': deserialize.rfc2822_datetime(payload['date_updated']), - 'friendly_name': payload['friendly_name'], - 'max_size': deserialize.integer(payload['max_size']), - 'sid': payload['sid'], - 'uri': payload['uri'], + 'account_sid': payload.get('account_sid'), + 'average_wait_time': deserialize.integer(payload.get('average_wait_time')), + 'current_size': deserialize.integer(payload.get('current_size')), + 'date_created': deserialize.rfc2822_datetime(payload.get('date_created')), + 'date_updated': deserialize.rfc2822_datetime(payload.get('date_updated')), + 'friendly_name': payload.get('friendly_name'), + 'max_size': deserialize.integer(payload.get('max_size')), + 'sid': payload.get('sid'), + 'uri': payload.get('uri'), } # Context diff --git a/twilio/rest/api/v2010/account/queue/member.py b/twilio/rest/api/v2010/account/queue/member.py index 4ce22e9318..321c4804e0 100644 --- a/twilio/rest/api/v2010/account/queue/member.py +++ b/twilio/rest/api/v2010/account/queue/member.py @@ -298,12 +298,12 @@ def __init__(self, version, payload, account_sid, queue_sid, call_sid=None): # Marshaled Properties self._properties = { - 'call_sid': payload['call_sid'], - 'date_enqueued': deserialize.rfc2822_datetime(payload['date_enqueued']), - 'position': deserialize.integer(payload['position']), - 'uri': payload['uri'], - 'wait_time': deserialize.integer(payload['wait_time']), - 'queue_sid': payload['queue_sid'], + 'call_sid': payload.get('call_sid'), + 'date_enqueued': deserialize.rfc2822_datetime(payload.get('date_enqueued')), + 'position': deserialize.integer(payload.get('position')), + 'uri': payload.get('uri'), + 'wait_time': deserialize.integer(payload.get('wait_time')), + 'queue_sid': payload.get('queue_sid'), } # Context diff --git a/twilio/rest/api/v2010/account/recording/__init__.py b/twilio/rest/api/v2010/account/recording/__init__.py index af04a2bf17..62e81a6e0c 100644 --- a/twilio/rest/api/v2010/account/recording/__init__.py +++ b/twilio/rest/api/v2010/account/recording/__init__.py @@ -363,24 +363,24 @@ def __init__(self, version, payload, account_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'api_version': payload['api_version'], - 'call_sid': payload['call_sid'], - 'conference_sid': payload['conference_sid'], - 'date_created': deserialize.rfc2822_datetime(payload['date_created']), - 'date_updated': deserialize.rfc2822_datetime(payload['date_updated']), - 'start_time': deserialize.rfc2822_datetime(payload['start_time']), - 'duration': payload['duration'], - 'sid': payload['sid'], - 'price': payload['price'], - 'price_unit': payload['price_unit'], - 'status': payload['status'], - 'channels': deserialize.integer(payload['channels']), - 'source': payload['source'], - 'error_code': deserialize.integer(payload['error_code']), - 'uri': payload['uri'], - 'encryption_details': payload['encryption_details'], - 'subresource_uris': payload['subresource_uris'], + 'account_sid': payload.get('account_sid'), + 'api_version': payload.get('api_version'), + 'call_sid': payload.get('call_sid'), + 'conference_sid': payload.get('conference_sid'), + 'date_created': deserialize.rfc2822_datetime(payload.get('date_created')), + 'date_updated': deserialize.rfc2822_datetime(payload.get('date_updated')), + 'start_time': deserialize.rfc2822_datetime(payload.get('start_time')), + 'duration': payload.get('duration'), + 'sid': payload.get('sid'), + 'price': payload.get('price'), + 'price_unit': payload.get('price_unit'), + 'status': payload.get('status'), + 'channels': deserialize.integer(payload.get('channels')), + 'source': payload.get('source'), + 'error_code': deserialize.integer(payload.get('error_code')), + 'uri': payload.get('uri'), + 'encryption_details': payload.get('encryption_details'), + 'subresource_uris': payload.get('subresource_uris'), } # Context diff --git a/twilio/rest/api/v2010/account/recording/add_on_result/__init__.py b/twilio/rest/api/v2010/account/recording/add_on_result/__init__.py index bb01b6b96e..f06a9d4f05 100644 --- a/twilio/rest/api/v2010/account/recording/add_on_result/__init__.py +++ b/twilio/rest/api/v2010/account/recording/add_on_result/__init__.py @@ -312,16 +312,16 @@ def __init__(self, version, payload, account_sid, reference_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'status': payload['status'], - 'add_on_sid': payload['add_on_sid'], - 'add_on_configuration_sid': payload['add_on_configuration_sid'], - 'date_created': deserialize.rfc2822_datetime(payload['date_created']), - 'date_updated': deserialize.rfc2822_datetime(payload['date_updated']), - 'date_completed': deserialize.rfc2822_datetime(payload['date_completed']), - 'reference_sid': payload['reference_sid'], - 'subresource_uris': payload['subresource_uris'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'status': payload.get('status'), + 'add_on_sid': payload.get('add_on_sid'), + 'add_on_configuration_sid': payload.get('add_on_configuration_sid'), + 'date_created': deserialize.rfc2822_datetime(payload.get('date_created')), + 'date_updated': deserialize.rfc2822_datetime(payload.get('date_updated')), + 'date_completed': deserialize.rfc2822_datetime(payload.get('date_completed')), + 'reference_sid': payload.get('reference_sid'), + 'subresource_uris': payload.get('subresource_uris'), } # Context diff --git a/twilio/rest/api/v2010/account/recording/add_on_result/payload/__init__.py b/twilio/rest/api/v2010/account/recording/add_on_result/payload/__init__.py index 8b3458408b..fa5e84ad03 100644 --- a/twilio/rest/api/v2010/account/recording/add_on_result/payload/__init__.py +++ b/twilio/rest/api/v2010/account/recording/add_on_result/payload/__init__.py @@ -298,17 +298,17 @@ def __init__(self, version, payload, account_sid, reference_sid, # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'add_on_result_sid': payload['add_on_result_sid'], - 'account_sid': payload['account_sid'], - 'label': payload['label'], - 'add_on_sid': payload['add_on_sid'], - 'add_on_configuration_sid': payload['add_on_configuration_sid'], - 'content_type': payload['content_type'], - 'date_created': deserialize.rfc2822_datetime(payload['date_created']), - 'date_updated': deserialize.rfc2822_datetime(payload['date_updated']), - 'reference_sid': payload['reference_sid'], - 'subresource_uris': payload['subresource_uris'], + 'sid': payload.get('sid'), + 'add_on_result_sid': payload.get('add_on_result_sid'), + 'account_sid': payload.get('account_sid'), + 'label': payload.get('label'), + 'add_on_sid': payload.get('add_on_sid'), + 'add_on_configuration_sid': payload.get('add_on_configuration_sid'), + 'content_type': payload.get('content_type'), + 'date_created': deserialize.rfc2822_datetime(payload.get('date_created')), + 'date_updated': deserialize.rfc2822_datetime(payload.get('date_updated')), + 'reference_sid': payload.get('reference_sid'), + 'subresource_uris': payload.get('subresource_uris'), } # Context diff --git a/twilio/rest/api/v2010/account/recording/transcription.py b/twilio/rest/api/v2010/account/recording/transcription.py index 8e0af5cb35..1317a5e2a7 100644 --- a/twilio/rest/api/v2010/account/recording/transcription.py +++ b/twilio/rest/api/v2010/account/recording/transcription.py @@ -286,19 +286,19 @@ def __init__(self, version, payload, account_sid, recording_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'api_version': payload['api_version'], - 'date_created': deserialize.rfc2822_datetime(payload['date_created']), - 'date_updated': deserialize.rfc2822_datetime(payload['date_updated']), - 'duration': payload['duration'], - 'price': deserialize.decimal(payload['price']), - 'price_unit': payload['price_unit'], - 'recording_sid': payload['recording_sid'], - 'sid': payload['sid'], - 'status': payload['status'], - 'transcription_text': payload['transcription_text'], - 'type': payload['type'], - 'uri': payload['uri'], + 'account_sid': payload.get('account_sid'), + 'api_version': payload.get('api_version'), + 'date_created': deserialize.rfc2822_datetime(payload.get('date_created')), + 'date_updated': deserialize.rfc2822_datetime(payload.get('date_updated')), + 'duration': payload.get('duration'), + 'price': deserialize.decimal(payload.get('price')), + 'price_unit': payload.get('price_unit'), + 'recording_sid': payload.get('recording_sid'), + 'sid': payload.get('sid'), + 'status': payload.get('status'), + 'transcription_text': payload.get('transcription_text'), + 'type': payload.get('type'), + 'uri': payload.get('uri'), } # Context diff --git a/twilio/rest/api/v2010/account/short_code.py b/twilio/rest/api/v2010/account/short_code.py index 7858c3010c..d03d05ee5b 100644 --- a/twilio/rest/api/v2010/account/short_code.py +++ b/twilio/rest/api/v2010/account/short_code.py @@ -311,18 +311,18 @@ def __init__(self, version, payload, account_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'api_version': payload['api_version'], - 'date_created': deserialize.rfc2822_datetime(payload['date_created']), - 'date_updated': deserialize.rfc2822_datetime(payload['date_updated']), - 'friendly_name': payload['friendly_name'], - 'short_code': payload['short_code'], - 'sid': payload['sid'], - 'sms_fallback_method': payload['sms_fallback_method'], - 'sms_fallback_url': payload['sms_fallback_url'], - 'sms_method': payload['sms_method'], - 'sms_url': payload['sms_url'], - 'uri': payload['uri'], + 'account_sid': payload.get('account_sid'), + 'api_version': payload.get('api_version'), + 'date_created': deserialize.rfc2822_datetime(payload.get('date_created')), + 'date_updated': deserialize.rfc2822_datetime(payload.get('date_updated')), + 'friendly_name': payload.get('friendly_name'), + 'short_code': payload.get('short_code'), + 'sid': payload.get('sid'), + 'sms_fallback_method': payload.get('sms_fallback_method'), + 'sms_fallback_url': payload.get('sms_fallback_url'), + 'sms_method': payload.get('sms_method'), + 'sms_url': payload.get('sms_url'), + 'uri': payload.get('uri'), } # Context diff --git a/twilio/rest/api/v2010/account/signing_key.py b/twilio/rest/api/v2010/account/signing_key.py index cb1a7a8566..1afbc681f9 100644 --- a/twilio/rest/api/v2010/account/signing_key.py +++ b/twilio/rest/api/v2010/account/signing_key.py @@ -286,10 +286,10 @@ def __init__(self, version, payload, account_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'friendly_name': payload['friendly_name'], - 'date_created': deserialize.rfc2822_datetime(payload['date_created']), - 'date_updated': deserialize.rfc2822_datetime(payload['date_updated']), + 'sid': payload.get('sid'), + 'friendly_name': payload.get('friendly_name'), + 'date_created': deserialize.rfc2822_datetime(payload.get('date_created')), + 'date_updated': deserialize.rfc2822_datetime(payload.get('date_updated')), } # Context diff --git a/twilio/rest/api/v2010/account/sip/credential_list/__init__.py b/twilio/rest/api/v2010/account/sip/credential_list/__init__.py index af23163506..494dc12b4c 100644 --- a/twilio/rest/api/v2010/account/sip/credential_list/__init__.py +++ b/twilio/rest/api/v2010/account/sip/credential_list/__init__.py @@ -325,13 +325,13 @@ def __init__(self, version, payload, account_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'date_created': deserialize.rfc2822_datetime(payload['date_created']), - 'date_updated': deserialize.rfc2822_datetime(payload['date_updated']), - 'friendly_name': payload['friendly_name'], - 'sid': payload['sid'], - 'subresource_uris': payload['subresource_uris'], - 'uri': payload['uri'], + 'account_sid': payload.get('account_sid'), + 'date_created': deserialize.rfc2822_datetime(payload.get('date_created')), + 'date_updated': deserialize.rfc2822_datetime(payload.get('date_updated')), + 'friendly_name': payload.get('friendly_name'), + 'sid': payload.get('sid'), + 'subresource_uris': payload.get('subresource_uris'), + 'uri': payload.get('uri'), } # Context diff --git a/twilio/rest/api/v2010/account/sip/credential_list/credential.py b/twilio/rest/api/v2010/account/sip/credential_list/credential.py index c4e59ed23c..2343d5be8f 100644 --- a/twilio/rest/api/v2010/account/sip/credential_list/credential.py +++ b/twilio/rest/api/v2010/account/sip/credential_list/credential.py @@ -336,13 +336,13 @@ def __init__(self, version, payload, account_sid, credential_list_sid, # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'credential_list_sid': payload['credential_list_sid'], - 'username': payload['username'], - 'date_created': deserialize.rfc2822_datetime(payload['date_created']), - 'date_updated': deserialize.rfc2822_datetime(payload['date_updated']), - 'uri': payload['uri'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'credential_list_sid': payload.get('credential_list_sid'), + 'username': payload.get('username'), + 'date_created': deserialize.rfc2822_datetime(payload.get('date_created')), + 'date_updated': deserialize.rfc2822_datetime(payload.get('date_updated')), + 'uri': payload.get('uri'), } # Context diff --git a/twilio/rest/api/v2010/account/sip/domain/__init__.py b/twilio/rest/api/v2010/account/sip/domain/__init__.py index 2f26f5f2c0..0cfd8aeed6 100644 --- a/twilio/rest/api/v2010/account/sip/domain/__init__.py +++ b/twilio/rest/api/v2010/account/sip/domain/__init__.py @@ -406,23 +406,23 @@ def __init__(self, version, payload, account_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'api_version': payload['api_version'], - 'auth_type': payload['auth_type'], - 'date_created': deserialize.rfc2822_datetime(payload['date_created']), - 'date_updated': deserialize.rfc2822_datetime(payload['date_updated']), - 'domain_name': payload['domain_name'], - 'friendly_name': payload['friendly_name'], - 'sid': payload['sid'], - 'uri': payload['uri'], - 'voice_fallback_method': payload['voice_fallback_method'], - 'voice_fallback_url': payload['voice_fallback_url'], - 'voice_method': payload['voice_method'], - 'voice_status_callback_method': payload['voice_status_callback_method'], - 'voice_status_callback_url': payload['voice_status_callback_url'], - 'voice_url': payload['voice_url'], - 'subresource_uris': payload['subresource_uris'], - 'sip_registration': payload['sip_registration'], + 'account_sid': payload.get('account_sid'), + 'api_version': payload.get('api_version'), + 'auth_type': payload.get('auth_type'), + 'date_created': deserialize.rfc2822_datetime(payload.get('date_created')), + 'date_updated': deserialize.rfc2822_datetime(payload.get('date_updated')), + 'domain_name': payload.get('domain_name'), + 'friendly_name': payload.get('friendly_name'), + 'sid': payload.get('sid'), + 'uri': payload.get('uri'), + 'voice_fallback_method': payload.get('voice_fallback_method'), + 'voice_fallback_url': payload.get('voice_fallback_url'), + 'voice_method': payload.get('voice_method'), + 'voice_status_callback_method': payload.get('voice_status_callback_method'), + 'voice_status_callback_url': payload.get('voice_status_callback_url'), + 'voice_url': payload.get('voice_url'), + 'subresource_uris': payload.get('subresource_uris'), + 'sip_registration': payload.get('sip_registration'), } # Context diff --git a/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_calls_mapping/auth_calls_credential_list_mapping.py b/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_calls_mapping/auth_calls_credential_list_mapping.py index ff89e4e027..1fdcbb481b 100644 --- a/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_calls_mapping/auth_calls_credential_list_mapping.py +++ b/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_calls_mapping/auth_calls_credential_list_mapping.py @@ -305,11 +305,11 @@ def __init__(self, version, payload, account_sid, domain_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'date_created': deserialize.rfc2822_datetime(payload['date_created']), - 'date_updated': deserialize.rfc2822_datetime(payload['date_updated']), - 'friendly_name': payload['friendly_name'], - 'sid': payload['sid'], + 'account_sid': payload.get('account_sid'), + 'date_created': deserialize.rfc2822_datetime(payload.get('date_created')), + 'date_updated': deserialize.rfc2822_datetime(payload.get('date_updated')), + 'friendly_name': payload.get('friendly_name'), + 'sid': payload.get('sid'), } # Context diff --git a/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_calls_mapping/auth_calls_ip_access_control_list_mapping.py b/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_calls_mapping/auth_calls_ip_access_control_list_mapping.py index 85c8a87b2d..06cb724e86 100644 --- a/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_calls_mapping/auth_calls_ip_access_control_list_mapping.py +++ b/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_calls_mapping/auth_calls_ip_access_control_list_mapping.py @@ -305,11 +305,11 @@ def __init__(self, version, payload, account_sid, domain_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'date_created': deserialize.rfc2822_datetime(payload['date_created']), - 'date_updated': deserialize.rfc2822_datetime(payload['date_updated']), - 'friendly_name': payload['friendly_name'], - 'sid': payload['sid'], + 'account_sid': payload.get('account_sid'), + 'date_created': deserialize.rfc2822_datetime(payload.get('date_created')), + 'date_updated': deserialize.rfc2822_datetime(payload.get('date_updated')), + 'friendly_name': payload.get('friendly_name'), + 'sid': payload.get('sid'), } # Context diff --git a/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_registrations_mapping/auth_registrations_credential_list_mapping.py b/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_registrations_mapping/auth_registrations_credential_list_mapping.py index def1c12ee1..eda0fb5c40 100644 --- a/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_registrations_mapping/auth_registrations_credential_list_mapping.py +++ b/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_registrations_mapping/auth_registrations_credential_list_mapping.py @@ -305,11 +305,11 @@ def __init__(self, version, payload, account_sid, domain_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'date_created': deserialize.rfc2822_datetime(payload['date_created']), - 'date_updated': deserialize.rfc2822_datetime(payload['date_updated']), - 'friendly_name': payload['friendly_name'], - 'sid': payload['sid'], + 'account_sid': payload.get('account_sid'), + 'date_created': deserialize.rfc2822_datetime(payload.get('date_created')), + 'date_updated': deserialize.rfc2822_datetime(payload.get('date_updated')), + 'friendly_name': payload.get('friendly_name'), + 'sid': payload.get('sid'), } # Context diff --git a/twilio/rest/api/v2010/account/sip/domain/credential_list_mapping.py b/twilio/rest/api/v2010/account/sip/domain/credential_list_mapping.py index c6f9bba7d4..1ccbefff3e 100644 --- a/twilio/rest/api/v2010/account/sip/domain/credential_list_mapping.py +++ b/twilio/rest/api/v2010/account/sip/domain/credential_list_mapping.py @@ -305,13 +305,13 @@ def __init__(self, version, payload, account_sid, domain_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'date_created': deserialize.rfc2822_datetime(payload['date_created']), - 'date_updated': deserialize.rfc2822_datetime(payload['date_updated']), - 'friendly_name': payload['friendly_name'], - 'sid': payload['sid'], - 'uri': payload['uri'], - 'subresource_uris': payload['subresource_uris'], + 'account_sid': payload.get('account_sid'), + 'date_created': deserialize.rfc2822_datetime(payload.get('date_created')), + 'date_updated': deserialize.rfc2822_datetime(payload.get('date_updated')), + 'friendly_name': payload.get('friendly_name'), + 'sid': payload.get('sid'), + 'uri': payload.get('uri'), + 'subresource_uris': payload.get('subresource_uris'), } # Context diff --git a/twilio/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.py b/twilio/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.py index 3e44ccd80d..b060970250 100644 --- a/twilio/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.py +++ b/twilio/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.py @@ -305,13 +305,13 @@ def __init__(self, version, payload, account_sid, domain_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'date_created': deserialize.rfc2822_datetime(payload['date_created']), - 'date_updated': deserialize.rfc2822_datetime(payload['date_updated']), - 'friendly_name': payload['friendly_name'], - 'sid': payload['sid'], - 'uri': payload['uri'], - 'subresource_uris': payload['subresource_uris'], + 'account_sid': payload.get('account_sid'), + 'date_created': deserialize.rfc2822_datetime(payload.get('date_created')), + 'date_updated': deserialize.rfc2822_datetime(payload.get('date_updated')), + 'friendly_name': payload.get('friendly_name'), + 'sid': payload.get('sid'), + 'uri': payload.get('uri'), + 'subresource_uris': payload.get('subresource_uris'), } # Context diff --git a/twilio/rest/api/v2010/account/sip/ip_access_control_list/__init__.py b/twilio/rest/api/v2010/account/sip/ip_access_control_list/__init__.py index f8f87cdbe3..4d9c035cd8 100644 --- a/twilio/rest/api/v2010/account/sip/ip_access_control_list/__init__.py +++ b/twilio/rest/api/v2010/account/sip/ip_access_control_list/__init__.py @@ -333,13 +333,13 @@ def __init__(self, version, payload, account_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'friendly_name': payload['friendly_name'], - 'date_created': deserialize.rfc2822_datetime(payload['date_created']), - 'date_updated': deserialize.rfc2822_datetime(payload['date_updated']), - 'subresource_uris': payload['subresource_uris'], - 'uri': payload['uri'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'friendly_name': payload.get('friendly_name'), + 'date_created': deserialize.rfc2822_datetime(payload.get('date_created')), + 'date_updated': deserialize.rfc2822_datetime(payload.get('date_updated')), + 'subresource_uris': payload.get('subresource_uris'), + 'uri': payload.get('uri'), } # Context diff --git a/twilio/rest/api/v2010/account/sip/ip_access_control_list/ip_address.py b/twilio/rest/api/v2010/account/sip/ip_access_control_list/ip_address.py index a4dc37cee6..db25201c50 100644 --- a/twilio/rest/api/v2010/account/sip/ip_access_control_list/ip_address.py +++ b/twilio/rest/api/v2010/account/sip/ip_access_control_list/ip_address.py @@ -351,15 +351,15 @@ def __init__(self, version, payload, account_sid, ip_access_control_list_sid, # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'friendly_name': payload['friendly_name'], - 'ip_address': payload['ip_address'], - 'cidr_prefix_length': deserialize.integer(payload['cidr_prefix_length']), - 'ip_access_control_list_sid': payload['ip_access_control_list_sid'], - 'date_created': deserialize.rfc2822_datetime(payload['date_created']), - 'date_updated': deserialize.rfc2822_datetime(payload['date_updated']), - 'uri': payload['uri'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'friendly_name': payload.get('friendly_name'), + 'ip_address': payload.get('ip_address'), + 'cidr_prefix_length': deserialize.integer(payload.get('cidr_prefix_length')), + 'ip_access_control_list_sid': payload.get('ip_access_control_list_sid'), + 'date_created': deserialize.rfc2822_datetime(payload.get('date_created')), + 'date_updated': deserialize.rfc2822_datetime(payload.get('date_updated')), + 'uri': payload.get('uri'), } # Context diff --git a/twilio/rest/api/v2010/account/token.py b/twilio/rest/api/v2010/account/token.py index 85dd9cf9c0..a651c28834 100644 --- a/twilio/rest/api/v2010/account/token.py +++ b/twilio/rest/api/v2010/account/token.py @@ -115,13 +115,13 @@ def __init__(self, version, payload, account_sid): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'date_created': deserialize.rfc2822_datetime(payload['date_created']), - 'date_updated': deserialize.rfc2822_datetime(payload['date_updated']), - 'ice_servers': payload['ice_servers'], - 'password': payload['password'], - 'ttl': payload['ttl'], - 'username': payload['username'], + 'account_sid': payload.get('account_sid'), + 'date_created': deserialize.rfc2822_datetime(payload.get('date_created')), + 'date_updated': deserialize.rfc2822_datetime(payload.get('date_updated')), + 'ice_servers': payload.get('ice_servers'), + 'password': payload.get('password'), + 'ttl': payload.get('ttl'), + 'username': payload.get('username'), } # Context diff --git a/twilio/rest/api/v2010/account/transcription.py b/twilio/rest/api/v2010/account/transcription.py index f405bc4c66..84f47fdf9c 100644 --- a/twilio/rest/api/v2010/account/transcription.py +++ b/twilio/rest/api/v2010/account/transcription.py @@ -267,19 +267,19 @@ def __init__(self, version, payload, account_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'api_version': payload['api_version'], - 'date_created': deserialize.rfc2822_datetime(payload['date_created']), - 'date_updated': deserialize.rfc2822_datetime(payload['date_updated']), - 'duration': payload['duration'], - 'price': deserialize.decimal(payload['price']), - 'price_unit': payload['price_unit'], - 'recording_sid': payload['recording_sid'], - 'sid': payload['sid'], - 'status': payload['status'], - 'transcription_text': payload['transcription_text'], - 'type': payload['type'], - 'uri': payload['uri'], + 'account_sid': payload.get('account_sid'), + 'api_version': payload.get('api_version'), + 'date_created': deserialize.rfc2822_datetime(payload.get('date_created')), + 'date_updated': deserialize.rfc2822_datetime(payload.get('date_updated')), + 'duration': payload.get('duration'), + 'price': deserialize.decimal(payload.get('price')), + 'price_unit': payload.get('price_unit'), + 'recording_sid': payload.get('recording_sid'), + 'sid': payload.get('sid'), + 'status': payload.get('status'), + 'transcription_text': payload.get('transcription_text'), + 'type': payload.get('type'), + 'uri': payload.get('uri'), } # Context diff --git a/twilio/rest/api/v2010/account/usage/record/__init__.py b/twilio/rest/api/v2010/account/usage/record/__init__.py index 804fc1f528..35bcbd419f 100644 --- a/twilio/rest/api/v2010/account/usage/record/__init__.py +++ b/twilio/rest/api/v2010/account/usage/record/__init__.py @@ -576,21 +576,21 @@ def __init__(self, version, payload, account_sid): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'api_version': payload['api_version'], - 'as_of': payload['as_of'], - 'category': payload['category'], - 'count': payload['count'], - 'count_unit': payload['count_unit'], - 'description': payload['description'], - 'end_date': deserialize.iso8601_date(payload['end_date']), - 'price': deserialize.decimal(payload['price']), - 'price_unit': payload['price_unit'], - 'start_date': deserialize.iso8601_date(payload['start_date']), - 'subresource_uris': payload['subresource_uris'], - 'uri': payload['uri'], - 'usage': payload['usage'], - 'usage_unit': payload['usage_unit'], + 'account_sid': payload.get('account_sid'), + 'api_version': payload.get('api_version'), + 'as_of': payload.get('as_of'), + 'category': payload.get('category'), + 'count': payload.get('count'), + 'count_unit': payload.get('count_unit'), + 'description': payload.get('description'), + 'end_date': deserialize.iso8601_date(payload.get('end_date')), + 'price': deserialize.decimal(payload.get('price')), + 'price_unit': payload.get('price_unit'), + 'start_date': deserialize.iso8601_date(payload.get('start_date')), + 'subresource_uris': payload.get('subresource_uris'), + 'uri': payload.get('uri'), + 'usage': payload.get('usage'), + 'usage_unit': payload.get('usage_unit'), } # Context diff --git a/twilio/rest/api/v2010/account/usage/record/all_time.py b/twilio/rest/api/v2010/account/usage/record/all_time.py index 4dcce72dea..bc152f6e34 100644 --- a/twilio/rest/api/v2010/account/usage/record/all_time.py +++ b/twilio/rest/api/v2010/account/usage/record/all_time.py @@ -462,21 +462,21 @@ def __init__(self, version, payload, account_sid): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'api_version': payload['api_version'], - 'as_of': payload['as_of'], - 'category': payload['category'], - 'count': payload['count'], - 'count_unit': payload['count_unit'], - 'description': payload['description'], - 'end_date': deserialize.iso8601_date(payload['end_date']), - 'price': deserialize.decimal(payload['price']), - 'price_unit': payload['price_unit'], - 'start_date': deserialize.iso8601_date(payload['start_date']), - 'subresource_uris': payload['subresource_uris'], - 'uri': payload['uri'], - 'usage': payload['usage'], - 'usage_unit': payload['usage_unit'], + 'account_sid': payload.get('account_sid'), + 'api_version': payload.get('api_version'), + 'as_of': payload.get('as_of'), + 'category': payload.get('category'), + 'count': payload.get('count'), + 'count_unit': payload.get('count_unit'), + 'description': payload.get('description'), + 'end_date': deserialize.iso8601_date(payload.get('end_date')), + 'price': deserialize.decimal(payload.get('price')), + 'price_unit': payload.get('price_unit'), + 'start_date': deserialize.iso8601_date(payload.get('start_date')), + 'subresource_uris': payload.get('subresource_uris'), + 'uri': payload.get('uri'), + 'usage': payload.get('usage'), + 'usage_unit': payload.get('usage_unit'), } # Context diff --git a/twilio/rest/api/v2010/account/usage/record/daily.py b/twilio/rest/api/v2010/account/usage/record/daily.py index 4de5f179c9..5e6fb24146 100644 --- a/twilio/rest/api/v2010/account/usage/record/daily.py +++ b/twilio/rest/api/v2010/account/usage/record/daily.py @@ -462,21 +462,21 @@ def __init__(self, version, payload, account_sid): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'api_version': payload['api_version'], - 'as_of': payload['as_of'], - 'category': payload['category'], - 'count': payload['count'], - 'count_unit': payload['count_unit'], - 'description': payload['description'], - 'end_date': deserialize.iso8601_date(payload['end_date']), - 'price': deserialize.decimal(payload['price']), - 'price_unit': payload['price_unit'], - 'start_date': deserialize.iso8601_date(payload['start_date']), - 'subresource_uris': payload['subresource_uris'], - 'uri': payload['uri'], - 'usage': payload['usage'], - 'usage_unit': payload['usage_unit'], + 'account_sid': payload.get('account_sid'), + 'api_version': payload.get('api_version'), + 'as_of': payload.get('as_of'), + 'category': payload.get('category'), + 'count': payload.get('count'), + 'count_unit': payload.get('count_unit'), + 'description': payload.get('description'), + 'end_date': deserialize.iso8601_date(payload.get('end_date')), + 'price': deserialize.decimal(payload.get('price')), + 'price_unit': payload.get('price_unit'), + 'start_date': deserialize.iso8601_date(payload.get('start_date')), + 'subresource_uris': payload.get('subresource_uris'), + 'uri': payload.get('uri'), + 'usage': payload.get('usage'), + 'usage_unit': payload.get('usage_unit'), } # Context diff --git a/twilio/rest/api/v2010/account/usage/record/last_month.py b/twilio/rest/api/v2010/account/usage/record/last_month.py index 6a76ffff54..f7c9a3ad24 100644 --- a/twilio/rest/api/v2010/account/usage/record/last_month.py +++ b/twilio/rest/api/v2010/account/usage/record/last_month.py @@ -462,21 +462,21 @@ def __init__(self, version, payload, account_sid): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'api_version': payload['api_version'], - 'as_of': payload['as_of'], - 'category': payload['category'], - 'count': payload['count'], - 'count_unit': payload['count_unit'], - 'description': payload['description'], - 'end_date': deserialize.iso8601_date(payload['end_date']), - 'price': deserialize.decimal(payload['price']), - 'price_unit': payload['price_unit'], - 'start_date': deserialize.iso8601_date(payload['start_date']), - 'subresource_uris': payload['subresource_uris'], - 'uri': payload['uri'], - 'usage': payload['usage'], - 'usage_unit': payload['usage_unit'], + 'account_sid': payload.get('account_sid'), + 'api_version': payload.get('api_version'), + 'as_of': payload.get('as_of'), + 'category': payload.get('category'), + 'count': payload.get('count'), + 'count_unit': payload.get('count_unit'), + 'description': payload.get('description'), + 'end_date': deserialize.iso8601_date(payload.get('end_date')), + 'price': deserialize.decimal(payload.get('price')), + 'price_unit': payload.get('price_unit'), + 'start_date': deserialize.iso8601_date(payload.get('start_date')), + 'subresource_uris': payload.get('subresource_uris'), + 'uri': payload.get('uri'), + 'usage': payload.get('usage'), + 'usage_unit': payload.get('usage_unit'), } # Context diff --git a/twilio/rest/api/v2010/account/usage/record/monthly.py b/twilio/rest/api/v2010/account/usage/record/monthly.py index df37a0588b..76a2491adc 100644 --- a/twilio/rest/api/v2010/account/usage/record/monthly.py +++ b/twilio/rest/api/v2010/account/usage/record/monthly.py @@ -462,21 +462,21 @@ def __init__(self, version, payload, account_sid): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'api_version': payload['api_version'], - 'as_of': payload['as_of'], - 'category': payload['category'], - 'count': payload['count'], - 'count_unit': payload['count_unit'], - 'description': payload['description'], - 'end_date': deserialize.iso8601_date(payload['end_date']), - 'price': deserialize.decimal(payload['price']), - 'price_unit': payload['price_unit'], - 'start_date': deserialize.iso8601_date(payload['start_date']), - 'subresource_uris': payload['subresource_uris'], - 'uri': payload['uri'], - 'usage': payload['usage'], - 'usage_unit': payload['usage_unit'], + 'account_sid': payload.get('account_sid'), + 'api_version': payload.get('api_version'), + 'as_of': payload.get('as_of'), + 'category': payload.get('category'), + 'count': payload.get('count'), + 'count_unit': payload.get('count_unit'), + 'description': payload.get('description'), + 'end_date': deserialize.iso8601_date(payload.get('end_date')), + 'price': deserialize.decimal(payload.get('price')), + 'price_unit': payload.get('price_unit'), + 'start_date': deserialize.iso8601_date(payload.get('start_date')), + 'subresource_uris': payload.get('subresource_uris'), + 'uri': payload.get('uri'), + 'usage': payload.get('usage'), + 'usage_unit': payload.get('usage_unit'), } # Context diff --git a/twilio/rest/api/v2010/account/usage/record/this_month.py b/twilio/rest/api/v2010/account/usage/record/this_month.py index ec48e76649..5d09c46d85 100644 --- a/twilio/rest/api/v2010/account/usage/record/this_month.py +++ b/twilio/rest/api/v2010/account/usage/record/this_month.py @@ -462,21 +462,21 @@ def __init__(self, version, payload, account_sid): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'api_version': payload['api_version'], - 'as_of': payload['as_of'], - 'category': payload['category'], - 'count': payload['count'], - 'count_unit': payload['count_unit'], - 'description': payload['description'], - 'end_date': deserialize.iso8601_date(payload['end_date']), - 'price': deserialize.decimal(payload['price']), - 'price_unit': payload['price_unit'], - 'start_date': deserialize.iso8601_date(payload['start_date']), - 'subresource_uris': payload['subresource_uris'], - 'uri': payload['uri'], - 'usage': payload['usage'], - 'usage_unit': payload['usage_unit'], + 'account_sid': payload.get('account_sid'), + 'api_version': payload.get('api_version'), + 'as_of': payload.get('as_of'), + 'category': payload.get('category'), + 'count': payload.get('count'), + 'count_unit': payload.get('count_unit'), + 'description': payload.get('description'), + 'end_date': deserialize.iso8601_date(payload.get('end_date')), + 'price': deserialize.decimal(payload.get('price')), + 'price_unit': payload.get('price_unit'), + 'start_date': deserialize.iso8601_date(payload.get('start_date')), + 'subresource_uris': payload.get('subresource_uris'), + 'uri': payload.get('uri'), + 'usage': payload.get('usage'), + 'usage_unit': payload.get('usage_unit'), } # Context diff --git a/twilio/rest/api/v2010/account/usage/record/today.py b/twilio/rest/api/v2010/account/usage/record/today.py index 38881a60de..d8b21ef7e9 100644 --- a/twilio/rest/api/v2010/account/usage/record/today.py +++ b/twilio/rest/api/v2010/account/usage/record/today.py @@ -462,21 +462,21 @@ def __init__(self, version, payload, account_sid): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'api_version': payload['api_version'], - 'as_of': payload['as_of'], - 'category': payload['category'], - 'count': payload['count'], - 'count_unit': payload['count_unit'], - 'description': payload['description'], - 'end_date': deserialize.iso8601_date(payload['end_date']), - 'price': deserialize.decimal(payload['price']), - 'price_unit': payload['price_unit'], - 'start_date': deserialize.iso8601_date(payload['start_date']), - 'subresource_uris': payload['subresource_uris'], - 'uri': payload['uri'], - 'usage': payload['usage'], - 'usage_unit': payload['usage_unit'], + 'account_sid': payload.get('account_sid'), + 'api_version': payload.get('api_version'), + 'as_of': payload.get('as_of'), + 'category': payload.get('category'), + 'count': payload.get('count'), + 'count_unit': payload.get('count_unit'), + 'description': payload.get('description'), + 'end_date': deserialize.iso8601_date(payload.get('end_date')), + 'price': deserialize.decimal(payload.get('price')), + 'price_unit': payload.get('price_unit'), + 'start_date': deserialize.iso8601_date(payload.get('start_date')), + 'subresource_uris': payload.get('subresource_uris'), + 'uri': payload.get('uri'), + 'usage': payload.get('usage'), + 'usage_unit': payload.get('usage_unit'), } # Context diff --git a/twilio/rest/api/v2010/account/usage/record/yearly.py b/twilio/rest/api/v2010/account/usage/record/yearly.py index e187dadbca..89c95c84d6 100644 --- a/twilio/rest/api/v2010/account/usage/record/yearly.py +++ b/twilio/rest/api/v2010/account/usage/record/yearly.py @@ -462,21 +462,21 @@ def __init__(self, version, payload, account_sid): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'api_version': payload['api_version'], - 'as_of': payload['as_of'], - 'category': payload['category'], - 'count': payload['count'], - 'count_unit': payload['count_unit'], - 'description': payload['description'], - 'end_date': deserialize.iso8601_date(payload['end_date']), - 'price': deserialize.decimal(payload['price']), - 'price_unit': payload['price_unit'], - 'start_date': deserialize.iso8601_date(payload['start_date']), - 'subresource_uris': payload['subresource_uris'], - 'uri': payload['uri'], - 'usage': payload['usage'], - 'usage_unit': payload['usage_unit'], + 'account_sid': payload.get('account_sid'), + 'api_version': payload.get('api_version'), + 'as_of': payload.get('as_of'), + 'category': payload.get('category'), + 'count': payload.get('count'), + 'count_unit': payload.get('count_unit'), + 'description': payload.get('description'), + 'end_date': deserialize.iso8601_date(payload.get('end_date')), + 'price': deserialize.decimal(payload.get('price')), + 'price_unit': payload.get('price_unit'), + 'start_date': deserialize.iso8601_date(payload.get('start_date')), + 'subresource_uris': payload.get('subresource_uris'), + 'uri': payload.get('uri'), + 'usage': payload.get('usage'), + 'usage_unit': payload.get('usage_unit'), } # Context diff --git a/twilio/rest/api/v2010/account/usage/record/yesterday.py b/twilio/rest/api/v2010/account/usage/record/yesterday.py index 02440a868b..14ed607952 100644 --- a/twilio/rest/api/v2010/account/usage/record/yesterday.py +++ b/twilio/rest/api/v2010/account/usage/record/yesterday.py @@ -462,21 +462,21 @@ def __init__(self, version, payload, account_sid): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'api_version': payload['api_version'], - 'as_of': payload['as_of'], - 'category': payload['category'], - 'count': payload['count'], - 'count_unit': payload['count_unit'], - 'description': payload['description'], - 'end_date': deserialize.iso8601_date(payload['end_date']), - 'price': deserialize.decimal(payload['price']), - 'price_unit': payload['price_unit'], - 'start_date': deserialize.iso8601_date(payload['start_date']), - 'subresource_uris': payload['subresource_uris'], - 'uri': payload['uri'], - 'usage': payload['usage'], - 'usage_unit': payload['usage_unit'], + 'account_sid': payload.get('account_sid'), + 'api_version': payload.get('api_version'), + 'as_of': payload.get('as_of'), + 'category': payload.get('category'), + 'count': payload.get('count'), + 'count_unit': payload.get('count_unit'), + 'description': payload.get('description'), + 'end_date': deserialize.iso8601_date(payload.get('end_date')), + 'price': deserialize.decimal(payload.get('price')), + 'price_unit': payload.get('price_unit'), + 'start_date': deserialize.iso8601_date(payload.get('start_date')), + 'subresource_uris': payload.get('subresource_uris'), + 'uri': payload.get('uri'), + 'usage': payload.get('usage'), + 'usage_unit': payload.get('usage_unit'), } # Context diff --git a/twilio/rest/api/v2010/account/usage/trigger.py b/twilio/rest/api/v2010/account/usage/trigger.py index 109fa1123d..8d6e1e1fdc 100644 --- a/twilio/rest/api/v2010/account/usage/trigger.py +++ b/twilio/rest/api/v2010/account/usage/trigger.py @@ -614,22 +614,22 @@ def __init__(self, version, payload, account_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'api_version': payload['api_version'], - 'callback_method': payload['callback_method'], - 'callback_url': payload['callback_url'], - 'current_value': payload['current_value'], - 'date_created': deserialize.rfc2822_datetime(payload['date_created']), - 'date_fired': deserialize.rfc2822_datetime(payload['date_fired']), - 'date_updated': deserialize.rfc2822_datetime(payload['date_updated']), - 'friendly_name': payload['friendly_name'], - 'recurring': payload['recurring'], - 'sid': payload['sid'], - 'trigger_by': payload['trigger_by'], - 'trigger_value': payload['trigger_value'], - 'uri': payload['uri'], - 'usage_category': payload['usage_category'], - 'usage_record_uri': payload['usage_record_uri'], + 'account_sid': payload.get('account_sid'), + 'api_version': payload.get('api_version'), + 'callback_method': payload.get('callback_method'), + 'callback_url': payload.get('callback_url'), + 'current_value': payload.get('current_value'), + 'date_created': deserialize.rfc2822_datetime(payload.get('date_created')), + 'date_fired': deserialize.rfc2822_datetime(payload.get('date_fired')), + 'date_updated': deserialize.rfc2822_datetime(payload.get('date_updated')), + 'friendly_name': payload.get('friendly_name'), + 'recurring': payload.get('recurring'), + 'sid': payload.get('sid'), + 'trigger_by': payload.get('trigger_by'), + 'trigger_value': payload.get('trigger_value'), + 'uri': payload.get('uri'), + 'usage_category': payload.get('usage_category'), + 'usage_record_uri': payload.get('usage_record_uri'), } # Context diff --git a/twilio/rest/api/v2010/account/validation_request.py b/twilio/rest/api/v2010/account/validation_request.py index 57862d2137..c6bd64868a 100644 --- a/twilio/rest/api/v2010/account/validation_request.py +++ b/twilio/rest/api/v2010/account/validation_request.py @@ -129,11 +129,11 @@ def __init__(self, version, payload, account_sid): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'phone_number': payload['phone_number'], - 'friendly_name': payload['friendly_name'], - 'validation_code': deserialize.integer(payload['validation_code']), - 'call_sid': payload['call_sid'], + 'account_sid': payload.get('account_sid'), + 'phone_number': payload.get('phone_number'), + 'friendly_name': payload.get('friendly_name'), + 'validation_code': deserialize.integer(payload.get('validation_code')), + 'call_sid': payload.get('call_sid'), } # Context diff --git a/twilio/rest/authy/v1/form.py b/twilio/rest/authy/v1/form.py index ccafaa43ee..a6a9fa7011 100644 --- a/twilio/rest/authy/v1/form.py +++ b/twilio/rest/authy/v1/form.py @@ -175,10 +175,10 @@ def __init__(self, version, payload, form_type=None): # Marshaled Properties self._properties = { - 'form_type': payload['form_type'], - 'forms': payload['forms'], - 'form_meta': payload['form_meta'], - 'url': payload['url'], + 'form_type': payload.get('form_type'), + 'forms': payload.get('forms'), + 'form_meta': payload.get('form_meta'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/authy/v1/service/__init__.py b/twilio/rest/authy/v1/service/__init__.py index 69d48a4ce2..b4951369c5 100644 --- a/twilio/rest/authy/v1/service/__init__.py +++ b/twilio/rest/authy/v1/service/__init__.py @@ -316,13 +316,13 @@ def __init__(self, version, payload, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'friendly_name': payload['friendly_name'], - 'account_sid': payload['account_sid'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], - 'links': payload['links'], + 'sid': payload.get('sid'), + 'friendly_name': payload.get('friendly_name'), + 'account_sid': payload.get('account_sid'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/authy/v1/service/entity/__init__.py b/twilio/rest/authy/v1/service/entity/__init__.py index c774ad928c..fe5068e860 100644 --- a/twilio/rest/authy/v1/service/entity/__init__.py +++ b/twilio/rest/authy/v1/service/entity/__init__.py @@ -309,14 +309,14 @@ def __init__(self, version, payload, service_sid, identity=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'identity': payload['identity'], - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], - 'links': payload['links'], + 'sid': payload.get('sid'), + 'identity': payload.get('identity'), + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/authy/v1/service/entity/factor/__init__.py b/twilio/rest/authy/v1/service/entity/factor/__init__.py index bf2c80e569..f2f97cc9ad 100644 --- a/twilio/rest/authy/v1/service/entity/factor/__init__.py +++ b/twilio/rest/authy/v1/service/entity/factor/__init__.py @@ -378,19 +378,19 @@ def __init__(self, version, payload, service_sid, identity, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'entity_sid': payload['entity_sid'], - 'identity': payload['identity'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'friendly_name': payload['friendly_name'], - 'status': payload['status'], - 'factor_type': payload['factor_type'], - 'factor_strength': payload['factor_strength'], - 'url': payload['url'], - 'links': payload['links'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'entity_sid': payload.get('entity_sid'), + 'identity': payload.get('identity'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'friendly_name': payload.get('friendly_name'), + 'status': payload.get('status'), + 'factor_type': payload.get('factor_type'), + 'factor_strength': payload.get('factor_strength'), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/authy/v1/service/entity/factor/challenge.py b/twilio/rest/authy/v1/service/entity/factor/challenge.py index 8b3b891dcc..cd86f9f896 100644 --- a/twilio/rest/authy/v1/service/entity/factor/challenge.py +++ b/twilio/rest/authy/v1/service/entity/factor/challenge.py @@ -304,23 +304,23 @@ def __init__(self, version, payload, service_sid, identity, factor_sid, # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'entity_sid': payload['entity_sid'], - 'identity': payload['identity'], - 'factor_sid': payload['factor_sid'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'date_responded': deserialize.iso8601_datetime(payload['date_responded']), - 'expiration_date': deserialize.iso8601_datetime(payload['expiration_date']), - 'status': payload['status'], - 'responded_reason': payload['responded_reason'], - 'details': payload['details'], - 'hidden_details': payload['hidden_details'], - 'factor_type': payload['factor_type'], - 'factor_strength': payload['factor_strength'], - 'url': payload['url'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'entity_sid': payload.get('entity_sid'), + 'identity': payload.get('identity'), + 'factor_sid': payload.get('factor_sid'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'date_responded': deserialize.iso8601_datetime(payload.get('date_responded')), + 'expiration_date': deserialize.iso8601_datetime(payload.get('expiration_date')), + 'status': payload.get('status'), + 'responded_reason': payload.get('responded_reason'), + 'details': payload.get('details'), + 'hidden_details': payload.get('hidden_details'), + 'factor_type': payload.get('factor_type'), + 'factor_strength': payload.get('factor_strength'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/autopilot/v1/assistant/__init__.py b/twilio/rest/autopilot/v1/assistant/__init__.py index e09278cf66..5174f058d9 100644 --- a/twilio/rest/autopilot/v1/assistant/__init__.py +++ b/twilio/rest/autopilot/v1/assistant/__init__.py @@ -451,20 +451,20 @@ def __init__(self, version, payload, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'friendly_name': payload['friendly_name'], - 'latest_model_build_sid': payload['latest_model_build_sid'], - 'links': payload['links'], - 'log_queries': payload['log_queries'], - 'development_stage': payload['development_stage'], - 'needs_model_build': payload['needs_model_build'], - 'sid': payload['sid'], - 'unique_name': payload['unique_name'], - 'url': payload['url'], - 'callback_url': payload['callback_url'], - 'callback_events': payload['callback_events'], + 'account_sid': payload.get('account_sid'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'friendly_name': payload.get('friendly_name'), + 'latest_model_build_sid': payload.get('latest_model_build_sid'), + 'links': payload.get('links'), + 'log_queries': payload.get('log_queries'), + 'development_stage': payload.get('development_stage'), + 'needs_model_build': payload.get('needs_model_build'), + 'sid': payload.get('sid'), + 'unique_name': payload.get('unique_name'), + 'url': payload.get('url'), + 'callback_url': payload.get('callback_url'), + 'callback_events': payload.get('callback_events'), } # Context diff --git a/twilio/rest/autopilot/v1/assistant/defaults.py b/twilio/rest/autopilot/v1/assistant/defaults.py index bc3aab06fe..4a54e1db64 100644 --- a/twilio/rest/autopilot/v1/assistant/defaults.py +++ b/twilio/rest/autopilot/v1/assistant/defaults.py @@ -188,10 +188,10 @@ def __init__(self, version, payload, assistant_sid): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'assistant_sid': payload['assistant_sid'], - 'url': payload['url'], - 'data': payload['data'], + 'account_sid': payload.get('account_sid'), + 'assistant_sid': payload.get('assistant_sid'), + 'url': payload.get('url'), + 'data': payload.get('data'), } # Context diff --git a/twilio/rest/autopilot/v1/assistant/dialogue.py b/twilio/rest/autopilot/v1/assistant/dialogue.py index 8d1ed2e05b..0322a22e90 100644 --- a/twilio/rest/autopilot/v1/assistant/dialogue.py +++ b/twilio/rest/autopilot/v1/assistant/dialogue.py @@ -178,11 +178,11 @@ def __init__(self, version, payload, assistant_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'assistant_sid': payload['assistant_sid'], - 'sid': payload['sid'], - 'data': payload['data'], - 'url': payload['url'], + 'account_sid': payload.get('account_sid'), + 'assistant_sid': payload.get('assistant_sid'), + 'sid': payload.get('sid'), + 'data': payload.get('data'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/autopilot/v1/assistant/field_type/__init__.py b/twilio/rest/autopilot/v1/assistant/field_type/__init__.py index 032a0ebb9f..4fcbf8c2f4 100644 --- a/twilio/rest/autopilot/v1/assistant/field_type/__init__.py +++ b/twilio/rest/autopilot/v1/assistant/field_type/__init__.py @@ -335,15 +335,15 @@ def __init__(self, version, payload, assistant_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'friendly_name': payload['friendly_name'], - 'links': payload['links'], - 'assistant_sid': payload['assistant_sid'], - 'sid': payload['sid'], - 'unique_name': payload['unique_name'], - 'url': payload['url'], + 'account_sid': payload.get('account_sid'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'friendly_name': payload.get('friendly_name'), + 'links': payload.get('links'), + 'assistant_sid': payload.get('assistant_sid'), + 'sid': payload.get('sid'), + 'unique_name': payload.get('unique_name'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/autopilot/v1/assistant/field_type/field_value.py b/twilio/rest/autopilot/v1/assistant/field_type/field_value.py index a034c4c919..d83d9fbbb7 100644 --- a/twilio/rest/autopilot/v1/assistant/field_type/field_value.py +++ b/twilio/rest/autopilot/v1/assistant/field_type/field_value.py @@ -323,16 +323,16 @@ def __init__(self, version, payload, assistant_sid, field_type_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'field_type_sid': payload['field_type_sid'], - 'language': payload['language'], - 'assistant_sid': payload['assistant_sid'], - 'sid': payload['sid'], - 'value': payload['value'], - 'url': payload['url'], - 'synonym_of': payload['synonym_of'], + 'account_sid': payload.get('account_sid'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'field_type_sid': payload.get('field_type_sid'), + 'language': payload.get('language'), + 'assistant_sid': payload.get('assistant_sid'), + 'sid': payload.get('sid'), + 'value': payload.get('value'), + 'url': payload.get('url'), + 'synonym_of': payload.get('synonym_of'), } # Context diff --git a/twilio/rest/autopilot/v1/assistant/model_build.py b/twilio/rest/autopilot/v1/assistant/model_build.py index 56c34eafda..46b9bad155 100644 --- a/twilio/rest/autopilot/v1/assistant/model_build.py +++ b/twilio/rest/autopilot/v1/assistant/model_build.py @@ -321,16 +321,16 @@ def __init__(self, version, payload, assistant_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'assistant_sid': payload['assistant_sid'], - 'sid': payload['sid'], - 'status': payload['status'], - 'unique_name': payload['unique_name'], - 'url': payload['url'], - 'build_duration': deserialize.integer(payload['build_duration']), - 'error_code': deserialize.integer(payload['error_code']), + 'account_sid': payload.get('account_sid'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'assistant_sid': payload.get('assistant_sid'), + 'sid': payload.get('sid'), + 'status': payload.get('status'), + 'unique_name': payload.get('unique_name'), + 'url': payload.get('url'), + 'build_duration': deserialize.integer(payload.get('build_duration')), + 'error_code': deserialize.integer(payload.get('error_code')), } # Context diff --git a/twilio/rest/autopilot/v1/assistant/query.py b/twilio/rest/autopilot/v1/assistant/query.py index 133df01108..2de65453ff 100644 --- a/twilio/rest/autopilot/v1/assistant/query.py +++ b/twilio/rest/autopilot/v1/assistant/query.py @@ -347,19 +347,19 @@ def __init__(self, version, payload, assistant_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'results': payload['results'], - 'language': payload['language'], - 'model_build_sid': payload['model_build_sid'], - 'query': payload['query'], - 'sample_sid': payload['sample_sid'], - 'assistant_sid': payload['assistant_sid'], - 'sid': payload['sid'], - 'status': payload['status'], - 'url': payload['url'], - 'source_channel': payload['source_channel'], + 'account_sid': payload.get('account_sid'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'results': payload.get('results'), + 'language': payload.get('language'), + 'model_build_sid': payload.get('model_build_sid'), + 'query': payload.get('query'), + 'sample_sid': payload.get('sample_sid'), + 'assistant_sid': payload.get('assistant_sid'), + 'sid': payload.get('sid'), + 'status': payload.get('status'), + 'url': payload.get('url'), + 'source_channel': payload.get('source_channel'), } # Context diff --git a/twilio/rest/autopilot/v1/assistant/style_sheet.py b/twilio/rest/autopilot/v1/assistant/style_sheet.py index e1436f72d4..5909b310ce 100644 --- a/twilio/rest/autopilot/v1/assistant/style_sheet.py +++ b/twilio/rest/autopilot/v1/assistant/style_sheet.py @@ -188,10 +188,10 @@ def __init__(self, version, payload, assistant_sid): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'assistant_sid': payload['assistant_sid'], - 'url': payload['url'], - 'data': payload['data'], + 'account_sid': payload.get('account_sid'), + 'assistant_sid': payload.get('assistant_sid'), + 'url': payload.get('url'), + 'data': payload.get('data'), } # Context diff --git a/twilio/rest/autopilot/v1/assistant/task/__init__.py b/twilio/rest/autopilot/v1/assistant/task/__init__.py index c55d2276d5..7c73b8db3d 100644 --- a/twilio/rest/autopilot/v1/assistant/task/__init__.py +++ b/twilio/rest/autopilot/v1/assistant/task/__init__.py @@ -406,16 +406,16 @@ def __init__(self, version, payload, assistant_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'friendly_name': payload['friendly_name'], - 'links': payload['links'], - 'assistant_sid': payload['assistant_sid'], - 'sid': payload['sid'], - 'unique_name': payload['unique_name'], - 'actions_url': payload['actions_url'], - 'url': payload['url'], + 'account_sid': payload.get('account_sid'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'friendly_name': payload.get('friendly_name'), + 'links': payload.get('links'), + 'assistant_sid': payload.get('assistant_sid'), + 'sid': payload.get('sid'), + 'unique_name': payload.get('unique_name'), + 'actions_url': payload.get('actions_url'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/autopilot/v1/assistant/task/field.py b/twilio/rest/autopilot/v1/assistant/task/field.py index 18def8838e..47a6c73854 100644 --- a/twilio/rest/autopilot/v1/assistant/task/field.py +++ b/twilio/rest/autopilot/v1/assistant/task/field.py @@ -314,15 +314,15 @@ def __init__(self, version, payload, assistant_sid, task_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'field_type': payload['field_type'], - 'task_sid': payload['task_sid'], - 'assistant_sid': payload['assistant_sid'], - 'sid': payload['sid'], - 'unique_name': payload['unique_name'], - 'url': payload['url'], + 'account_sid': payload.get('account_sid'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'field_type': payload.get('field_type'), + 'task_sid': payload.get('task_sid'), + 'assistant_sid': payload.get('assistant_sid'), + 'sid': payload.get('sid'), + 'unique_name': payload.get('unique_name'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/autopilot/v1/assistant/task/sample.py b/twilio/rest/autopilot/v1/assistant/task/sample.py index cf1833e7d3..079b67e885 100644 --- a/twilio/rest/autopilot/v1/assistant/task/sample.py +++ b/twilio/rest/autopilot/v1/assistant/task/sample.py @@ -351,16 +351,16 @@ def __init__(self, version, payload, assistant_sid, task_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'task_sid': payload['task_sid'], - 'language': payload['language'], - 'assistant_sid': payload['assistant_sid'], - 'sid': payload['sid'], - 'tagged_text': payload['tagged_text'], - 'url': payload['url'], - 'source_channel': payload['source_channel'], + 'account_sid': payload.get('account_sid'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'task_sid': payload.get('task_sid'), + 'language': payload.get('language'), + 'assistant_sid': payload.get('assistant_sid'), + 'sid': payload.get('sid'), + 'tagged_text': payload.get('tagged_text'), + 'url': payload.get('url'), + 'source_channel': payload.get('source_channel'), } # Context diff --git a/twilio/rest/autopilot/v1/assistant/task/task_actions.py b/twilio/rest/autopilot/v1/assistant/task/task_actions.py index 7a679ca61d..1cb50fa280 100644 --- a/twilio/rest/autopilot/v1/assistant/task/task_actions.py +++ b/twilio/rest/autopilot/v1/assistant/task/task_actions.py @@ -214,11 +214,11 @@ def __init__(self, version, payload, assistant_sid, task_sid): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'assistant_sid': payload['assistant_sid'], - 'task_sid': payload['task_sid'], - 'url': payload['url'], - 'data': payload['data'], + 'account_sid': payload.get('account_sid'), + 'assistant_sid': payload.get('assistant_sid'), + 'task_sid': payload.get('task_sid'), + 'url': payload.get('url'), + 'data': payload.get('data'), } # Context diff --git a/twilio/rest/autopilot/v1/assistant/task/task_statistics.py b/twilio/rest/autopilot/v1/assistant/task/task_statistics.py index e82dcd05fc..8e02ec35f8 100644 --- a/twilio/rest/autopilot/v1/assistant/task/task_statistics.py +++ b/twilio/rest/autopilot/v1/assistant/task/task_statistics.py @@ -190,12 +190,12 @@ def __init__(self, version, payload, assistant_sid, task_sid): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'assistant_sid': payload['assistant_sid'], - 'task_sid': payload['task_sid'], - 'samples_count': deserialize.integer(payload['samples_count']), - 'fields_count': deserialize.integer(payload['fields_count']), - 'url': payload['url'], + 'account_sid': payload.get('account_sid'), + 'assistant_sid': payload.get('assistant_sid'), + 'task_sid': payload.get('task_sid'), + 'samples_count': deserialize.integer(payload.get('samples_count')), + 'fields_count': deserialize.integer(payload.get('fields_count')), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/autopilot/v1/assistant/webhook.py b/twilio/rest/autopilot/v1/assistant/webhook.py index 39f861c406..92f012b51f 100644 --- a/twilio/rest/autopilot/v1/assistant/webhook.py +++ b/twilio/rest/autopilot/v1/assistant/webhook.py @@ -330,16 +330,16 @@ def __init__(self, version, payload, assistant_sid, sid=None): # Marshaled Properties self._properties = { - 'url': payload['url'], - 'account_sid': payload['account_sid'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'assistant_sid': payload['assistant_sid'], - 'sid': payload['sid'], - 'unique_name': payload['unique_name'], - 'events': payload['events'], - 'webhook_url': payload['webhook_url'], - 'webhook_method': payload['webhook_method'], + 'url': payload.get('url'), + 'account_sid': payload.get('account_sid'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'assistant_sid': payload.get('assistant_sid'), + 'sid': payload.get('sid'), + 'unique_name': payload.get('unique_name'), + 'events': payload.get('events'), + 'webhook_url': payload.get('webhook_url'), + 'webhook_method': payload.get('webhook_method'), } # Context diff --git a/twilio/rest/chat/v1/credential.py b/twilio/rest/chat/v1/credential.py index 42b80b3b87..4cdd0bd1eb 100644 --- a/twilio/rest/chat/v1/credential.py +++ b/twilio/rest/chat/v1/credential.py @@ -327,14 +327,14 @@ def __init__(self, version, payload, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'friendly_name': payload['friendly_name'], - 'type': payload['type'], - 'sandbox': payload['sandbox'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'friendly_name': payload.get('friendly_name'), + 'type': payload.get('type'), + 'sandbox': payload.get('sandbox'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/chat/v1/service/__init__.py b/twilio/rest/chat/v1/service/__init__.py index 7aa0ac1029..1479c78a58 100644 --- a/twilio/rest/chat/v1/service/__init__.py +++ b/twilio/rest/chat/v1/service/__init__.py @@ -495,27 +495,27 @@ def __init__(self, version, payload, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'friendly_name': payload['friendly_name'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'default_service_role_sid': payload['default_service_role_sid'], - 'default_channel_role_sid': payload['default_channel_role_sid'], - 'default_channel_creator_role_sid': payload['default_channel_creator_role_sid'], - 'read_status_enabled': payload['read_status_enabled'], - 'reachability_enabled': payload['reachability_enabled'], - 'typing_indicator_timeout': deserialize.integer(payload['typing_indicator_timeout']), - 'consumption_report_interval': deserialize.integer(payload['consumption_report_interval']), - 'limits': payload['limits'], - 'webhooks': payload['webhooks'], - 'pre_webhook_url': payload['pre_webhook_url'], - 'post_webhook_url': payload['post_webhook_url'], - 'webhook_method': payload['webhook_method'], - 'webhook_filters': payload['webhook_filters'], - 'notifications': payload['notifications'], - 'url': payload['url'], - 'links': payload['links'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'friendly_name': payload.get('friendly_name'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'default_service_role_sid': payload.get('default_service_role_sid'), + 'default_channel_role_sid': payload.get('default_channel_role_sid'), + 'default_channel_creator_role_sid': payload.get('default_channel_creator_role_sid'), + 'read_status_enabled': payload.get('read_status_enabled'), + 'reachability_enabled': payload.get('reachability_enabled'), + 'typing_indicator_timeout': deserialize.integer(payload.get('typing_indicator_timeout')), + 'consumption_report_interval': deserialize.integer(payload.get('consumption_report_interval')), + 'limits': payload.get('limits'), + 'webhooks': payload.get('webhooks'), + 'pre_webhook_url': payload.get('pre_webhook_url'), + 'post_webhook_url': payload.get('post_webhook_url'), + 'webhook_method': payload.get('webhook_method'), + 'webhook_filters': payload.get('webhook_filters'), + 'notifications': payload.get('notifications'), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/chat/v1/service/channel/__init__.py b/twilio/rest/chat/v1/service/channel/__init__.py index 9ae24e2849..9e1633e516 100644 --- a/twilio/rest/chat/v1/service/channel/__init__.py +++ b/twilio/rest/chat/v1/service/channel/__init__.py @@ -390,20 +390,20 @@ def __init__(self, version, payload, service_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'friendly_name': payload['friendly_name'], - 'unique_name': payload['unique_name'], - 'attributes': payload['attributes'], - 'type': payload['type'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'created_by': payload['created_by'], - 'members_count': deserialize.integer(payload['members_count']), - 'messages_count': deserialize.integer(payload['messages_count']), - 'url': payload['url'], - 'links': payload['links'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'friendly_name': payload.get('friendly_name'), + 'unique_name': payload.get('unique_name'), + 'attributes': payload.get('attributes'), + 'type': payload.get('type'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'created_by': payload.get('created_by'), + 'members_count': deserialize.integer(payload.get('members_count')), + 'messages_count': deserialize.integer(payload.get('messages_count')), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/chat/v1/service/channel/invite.py b/twilio/rest/chat/v1/service/channel/invite.py index 4d1644e7b9..21f07fbf10 100644 --- a/twilio/rest/chat/v1/service/channel/invite.py +++ b/twilio/rest/chat/v1/service/channel/invite.py @@ -315,16 +315,16 @@ def __init__(self, version, payload, service_sid, channel_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'channel_sid': payload['channel_sid'], - 'service_sid': payload['service_sid'], - 'identity': payload['identity'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'role_sid': payload['role_sid'], - 'created_by': payload['created_by'], - 'url': payload['url'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'channel_sid': payload.get('channel_sid'), + 'service_sid': payload.get('service_sid'), + 'identity': payload.get('identity'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'role_sid': payload.get('role_sid'), + 'created_by': payload.get('created_by'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/chat/v1/service/channel/member.py b/twilio/rest/chat/v1/service/channel/member.py index 71ef6497de..3dcef1f590 100644 --- a/twilio/rest/chat/v1/service/channel/member.py +++ b/twilio/rest/chat/v1/service/channel/member.py @@ -342,17 +342,17 @@ def __init__(self, version, payload, service_sid, channel_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'channel_sid': payload['channel_sid'], - 'service_sid': payload['service_sid'], - 'identity': payload['identity'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'role_sid': payload['role_sid'], - 'last_consumed_message_index': deserialize.integer(payload['last_consumed_message_index']), - 'last_consumption_timestamp': deserialize.iso8601_datetime(payload['last_consumption_timestamp']), - 'url': payload['url'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'channel_sid': payload.get('channel_sid'), + 'service_sid': payload.get('service_sid'), + 'identity': payload.get('identity'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'role_sid': payload.get('role_sid'), + 'last_consumed_message_index': deserialize.integer(payload.get('last_consumed_message_index')), + 'last_consumption_timestamp': deserialize.iso8601_datetime(payload.get('last_consumption_timestamp')), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/chat/v1/service/channel/message.py b/twilio/rest/chat/v1/service/channel/message.py index 92a78bbc25..8c319d2a5e 100644 --- a/twilio/rest/chat/v1/service/channel/message.py +++ b/twilio/rest/chat/v1/service/channel/message.py @@ -345,19 +345,19 @@ def __init__(self, version, payload, service_sid, channel_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'attributes': payload['attributes'], - 'service_sid': payload['service_sid'], - 'to': payload['to'], - 'channel_sid': payload['channel_sid'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'was_edited': payload['was_edited'], - 'from_': payload['from'], - 'body': payload['body'], - 'index': deserialize.integer(payload['index']), - 'url': payload['url'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'attributes': payload.get('attributes'), + 'service_sid': payload.get('service_sid'), + 'to': payload.get('to'), + 'channel_sid': payload.get('channel_sid'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'was_edited': payload.get('was_edited'), + 'from_': payload.get('from'), + 'body': payload.get('body'), + 'index': deserialize.integer(payload.get('index')), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/chat/v1/service/role.py b/twilio/rest/chat/v1/service/role.py index 1756bd6e12..41cb42076d 100644 --- a/twilio/rest/chat/v1/service/role.py +++ b/twilio/rest/chat/v1/service/role.py @@ -316,15 +316,15 @@ def __init__(self, version, payload, service_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'friendly_name': payload['friendly_name'], - 'type': payload['type'], - 'permissions': payload['permissions'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'friendly_name': payload.get('friendly_name'), + 'type': payload.get('type'), + 'permissions': payload.get('permissions'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/chat/v1/service/user/__init__.py b/twilio/rest/chat/v1/service/user/__init__.py index 83e14195e5..0d62158d79 100644 --- a/twilio/rest/chat/v1/service/user/__init__.py +++ b/twilio/rest/chat/v1/service/user/__init__.py @@ -337,20 +337,20 @@ def __init__(self, version, payload, service_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'attributes': payload['attributes'], - 'friendly_name': payload['friendly_name'], - 'role_sid': payload['role_sid'], - 'identity': payload['identity'], - 'is_online': payload['is_online'], - 'is_notifiable': payload['is_notifiable'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'joined_channels_count': deserialize.integer(payload['joined_channels_count']), - 'links': payload['links'], - 'url': payload['url'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'attributes': payload.get('attributes'), + 'friendly_name': payload.get('friendly_name'), + 'role_sid': payload.get('role_sid'), + 'identity': payload.get('identity'), + 'is_online': payload.get('is_online'), + 'is_notifiable': payload.get('is_notifiable'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'joined_channels_count': deserialize.integer(payload.get('joined_channels_count')), + 'links': payload.get('links'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/chat/v1/service/user/user_channel.py b/twilio/rest/chat/v1/service/user/user_channel.py index 9bd795fb6d..950b01cb8e 100644 --- a/twilio/rest/chat/v1/service/user/user_channel.py +++ b/twilio/rest/chat/v1/service/user/user_channel.py @@ -189,14 +189,14 @@ def __init__(self, version, payload, service_sid, user_sid): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'channel_sid': payload['channel_sid'], - 'member_sid': payload['member_sid'], - 'status': payload['status'], - 'last_consumed_message_index': deserialize.integer(payload['last_consumed_message_index']), - 'unread_messages_count': deserialize.integer(payload['unread_messages_count']), - 'links': payload['links'], + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'channel_sid': payload.get('channel_sid'), + 'member_sid': payload.get('member_sid'), + 'status': payload.get('status'), + 'last_consumed_message_index': deserialize.integer(payload.get('last_consumed_message_index')), + 'unread_messages_count': deserialize.integer(payload.get('unread_messages_count')), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/chat/v2/credential.py b/twilio/rest/chat/v2/credential.py index 4b0f7ce2c8..95dc9d1f19 100644 --- a/twilio/rest/chat/v2/credential.py +++ b/twilio/rest/chat/v2/credential.py @@ -327,14 +327,14 @@ def __init__(self, version, payload, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'friendly_name': payload['friendly_name'], - 'type': payload['type'], - 'sandbox': payload['sandbox'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'friendly_name': payload.get('friendly_name'), + 'type': payload.get('type'), + 'sandbox': payload.get('sandbox'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/chat/v2/service/__init__.py b/twilio/rest/chat/v2/service/__init__.py index d2662e9124..7121865836 100644 --- a/twilio/rest/chat/v2/service/__init__.py +++ b/twilio/rest/chat/v2/service/__init__.py @@ -440,29 +440,29 @@ def __init__(self, version, payload, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'friendly_name': payload['friendly_name'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'default_service_role_sid': payload['default_service_role_sid'], - 'default_channel_role_sid': payload['default_channel_role_sid'], - 'default_channel_creator_role_sid': payload['default_channel_creator_role_sid'], - 'read_status_enabled': payload['read_status_enabled'], - 'reachability_enabled': payload['reachability_enabled'], - 'typing_indicator_timeout': deserialize.integer(payload['typing_indicator_timeout']), - 'consumption_report_interval': deserialize.integer(payload['consumption_report_interval']), - 'limits': payload['limits'], - 'pre_webhook_url': payload['pre_webhook_url'], - 'post_webhook_url': payload['post_webhook_url'], - 'webhook_method': payload['webhook_method'], - 'webhook_filters': payload['webhook_filters'], - 'pre_webhook_retry_count': deserialize.integer(payload['pre_webhook_retry_count']), - 'post_webhook_retry_count': deserialize.integer(payload['post_webhook_retry_count']), - 'notifications': payload['notifications'], - 'media': payload['media'], - 'url': payload['url'], - 'links': payload['links'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'friendly_name': payload.get('friendly_name'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'default_service_role_sid': payload.get('default_service_role_sid'), + 'default_channel_role_sid': payload.get('default_channel_role_sid'), + 'default_channel_creator_role_sid': payload.get('default_channel_creator_role_sid'), + 'read_status_enabled': payload.get('read_status_enabled'), + 'reachability_enabled': payload.get('reachability_enabled'), + 'typing_indicator_timeout': deserialize.integer(payload.get('typing_indicator_timeout')), + 'consumption_report_interval': deserialize.integer(payload.get('consumption_report_interval')), + 'limits': payload.get('limits'), + 'pre_webhook_url': payload.get('pre_webhook_url'), + 'post_webhook_url': payload.get('post_webhook_url'), + 'webhook_method': payload.get('webhook_method'), + 'webhook_filters': payload.get('webhook_filters'), + 'pre_webhook_retry_count': deserialize.integer(payload.get('pre_webhook_retry_count')), + 'post_webhook_retry_count': deserialize.integer(payload.get('post_webhook_retry_count')), + 'notifications': payload.get('notifications'), + 'media': payload.get('media'), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/chat/v2/service/binding.py b/twilio/rest/chat/v2/service/binding.py index 966de7cb7f..1e1953c44d 100644 --- a/twilio/rest/chat/v2/service/binding.py +++ b/twilio/rest/chat/v2/service/binding.py @@ -288,18 +288,18 @@ def __init__(self, version, payload, service_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'endpoint': payload['endpoint'], - 'identity': payload['identity'], - 'credential_sid': payload['credential_sid'], - 'binding_type': payload['binding_type'], - 'message_types': payload['message_types'], - 'url': payload['url'], - 'links': payload['links'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'endpoint': payload.get('endpoint'), + 'identity': payload.get('identity'), + 'credential_sid': payload.get('credential_sid'), + 'binding_type': payload.get('binding_type'), + 'message_types': payload.get('message_types'), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/chat/v2/service/channel/__init__.py b/twilio/rest/chat/v2/service/channel/__init__.py index 62d84ecec8..c121f8756d 100644 --- a/twilio/rest/chat/v2/service/channel/__init__.py +++ b/twilio/rest/chat/v2/service/channel/__init__.py @@ -427,20 +427,20 @@ def __init__(self, version, payload, service_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'friendly_name': payload['friendly_name'], - 'unique_name': payload['unique_name'], - 'attributes': payload['attributes'], - 'type': payload['type'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'created_by': payload['created_by'], - 'members_count': deserialize.integer(payload['members_count']), - 'messages_count': deserialize.integer(payload['messages_count']), - 'url': payload['url'], - 'links': payload['links'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'friendly_name': payload.get('friendly_name'), + 'unique_name': payload.get('unique_name'), + 'attributes': payload.get('attributes'), + 'type': payload.get('type'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'created_by': payload.get('created_by'), + 'members_count': deserialize.integer(payload.get('members_count')), + 'messages_count': deserialize.integer(payload.get('messages_count')), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/chat/v2/service/channel/invite.py b/twilio/rest/chat/v2/service/channel/invite.py index e26e4daffd..24590d6ab2 100644 --- a/twilio/rest/chat/v2/service/channel/invite.py +++ b/twilio/rest/chat/v2/service/channel/invite.py @@ -315,16 +315,16 @@ def __init__(self, version, payload, service_sid, channel_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'channel_sid': payload['channel_sid'], - 'service_sid': payload['service_sid'], - 'identity': payload['identity'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'role_sid': payload['role_sid'], - 'created_by': payload['created_by'], - 'url': payload['url'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'channel_sid': payload.get('channel_sid'), + 'service_sid': payload.get('service_sid'), + 'identity': payload.get('identity'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'role_sid': payload.get('role_sid'), + 'created_by': payload.get('created_by'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/chat/v2/service/channel/member.py b/twilio/rest/chat/v2/service/channel/member.py index d93fab1175..24ba0a7592 100644 --- a/twilio/rest/chat/v2/service/channel/member.py +++ b/twilio/rest/chat/v2/service/channel/member.py @@ -375,18 +375,18 @@ def __init__(self, version, payload, service_sid, channel_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'channel_sid': payload['channel_sid'], - 'service_sid': payload['service_sid'], - 'identity': payload['identity'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'role_sid': payload['role_sid'], - 'last_consumed_message_index': deserialize.integer(payload['last_consumed_message_index']), - 'last_consumption_timestamp': deserialize.iso8601_datetime(payload['last_consumption_timestamp']), - 'url': payload['url'], - 'attributes': payload['attributes'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'channel_sid': payload.get('channel_sid'), + 'service_sid': payload.get('service_sid'), + 'identity': payload.get('identity'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'role_sid': payload.get('role_sid'), + 'last_consumed_message_index': deserialize.integer(payload.get('last_consumed_message_index')), + 'last_consumption_timestamp': deserialize.iso8601_datetime(payload.get('last_consumption_timestamp')), + 'url': payload.get('url'), + 'attributes': payload.get('attributes'), } # Context diff --git a/twilio/rest/chat/v2/service/channel/message.py b/twilio/rest/chat/v2/service/channel/message.py index 8a16e8932c..0775cb62e0 100644 --- a/twilio/rest/chat/v2/service/channel/message.py +++ b/twilio/rest/chat/v2/service/channel/message.py @@ -378,22 +378,22 @@ def __init__(self, version, payload, service_sid, channel_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'attributes': payload['attributes'], - 'service_sid': payload['service_sid'], - 'to': payload['to'], - 'channel_sid': payload['channel_sid'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'last_updated_by': payload['last_updated_by'], - 'was_edited': payload['was_edited'], - 'from_': payload['from'], - 'body': payload['body'], - 'index': deserialize.integer(payload['index']), - 'type': payload['type'], - 'media': payload['media'], - 'url': payload['url'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'attributes': payload.get('attributes'), + 'service_sid': payload.get('service_sid'), + 'to': payload.get('to'), + 'channel_sid': payload.get('channel_sid'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'last_updated_by': payload.get('last_updated_by'), + 'was_edited': payload.get('was_edited'), + 'from_': payload.get('from'), + 'body': payload.get('body'), + 'index': deserialize.integer(payload.get('index')), + 'type': payload.get('type'), + 'media': payload.get('media'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/chat/v2/service/channel/webhook.py b/twilio/rest/chat/v2/service/channel/webhook.py index 672823e0ce..3fa5c6842e 100644 --- a/twilio/rest/chat/v2/service/channel/webhook.py +++ b/twilio/rest/chat/v2/service/channel/webhook.py @@ -376,15 +376,15 @@ def __init__(self, version, payload, service_sid, channel_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'channel_sid': payload['channel_sid'], - 'type': payload['type'], - 'url': payload['url'], - 'configuration': payload['configuration'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'channel_sid': payload.get('channel_sid'), + 'type': payload.get('type'), + 'url': payload.get('url'), + 'configuration': payload.get('configuration'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), } # Context diff --git a/twilio/rest/chat/v2/service/role.py b/twilio/rest/chat/v2/service/role.py index 2b8c2530a1..133b01ad24 100644 --- a/twilio/rest/chat/v2/service/role.py +++ b/twilio/rest/chat/v2/service/role.py @@ -316,15 +316,15 @@ def __init__(self, version, payload, service_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'friendly_name': payload['friendly_name'], - 'type': payload['type'], - 'permissions': payload['permissions'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'friendly_name': payload.get('friendly_name'), + 'type': payload.get('type'), + 'permissions': payload.get('permissions'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/chat/v2/service/user/__init__.py b/twilio/rest/chat/v2/service/user/__init__.py index 6178f58822..e2eb308096 100644 --- a/twilio/rest/chat/v2/service/user/__init__.py +++ b/twilio/rest/chat/v2/service/user/__init__.py @@ -359,20 +359,20 @@ def __init__(self, version, payload, service_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'attributes': payload['attributes'], - 'friendly_name': payload['friendly_name'], - 'role_sid': payload['role_sid'], - 'identity': payload['identity'], - 'is_online': payload['is_online'], - 'is_notifiable': payload['is_notifiable'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'joined_channels_count': deserialize.integer(payload['joined_channels_count']), - 'links': payload['links'], - 'url': payload['url'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'attributes': payload.get('attributes'), + 'friendly_name': payload.get('friendly_name'), + 'role_sid': payload.get('role_sid'), + 'identity': payload.get('identity'), + 'is_online': payload.get('is_online'), + 'is_notifiable': payload.get('is_notifiable'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'joined_channels_count': deserialize.integer(payload.get('joined_channels_count')), + 'links': payload.get('links'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/chat/v2/service/user/user_binding.py b/twilio/rest/chat/v2/service/user/user_binding.py index 0a539a5359..7f1b4ca3c0 100644 --- a/twilio/rest/chat/v2/service/user/user_binding.py +++ b/twilio/rest/chat/v2/service/user/user_binding.py @@ -295,18 +295,18 @@ def __init__(self, version, payload, service_sid, user_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'endpoint': payload['endpoint'], - 'identity': payload['identity'], - 'user_sid': payload['user_sid'], - 'credential_sid': payload['credential_sid'], - 'binding_type': payload['binding_type'], - 'message_types': payload['message_types'], - 'url': payload['url'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'endpoint': payload.get('endpoint'), + 'identity': payload.get('identity'), + 'user_sid': payload.get('user_sid'), + 'credential_sid': payload.get('credential_sid'), + 'binding_type': payload.get('binding_type'), + 'message_types': payload.get('message_types'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/chat/v2/service/user/user_channel.py b/twilio/rest/chat/v2/service/user/user_channel.py index 5612a04541..138b1472f0 100644 --- a/twilio/rest/chat/v2/service/user/user_channel.py +++ b/twilio/rest/chat/v2/service/user/user_channel.py @@ -306,17 +306,17 @@ def __init__(self, version, payload, service_sid, user_sid, channel_sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'channel_sid': payload['channel_sid'], - 'user_sid': payload['user_sid'], - 'member_sid': payload['member_sid'], - 'status': payload['status'], - 'last_consumed_message_index': deserialize.integer(payload['last_consumed_message_index']), - 'unread_messages_count': deserialize.integer(payload['unread_messages_count']), - 'links': payload['links'], - 'url': payload['url'], - 'notification_level': payload['notification_level'], + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'channel_sid': payload.get('channel_sid'), + 'user_sid': payload.get('user_sid'), + 'member_sid': payload.get('member_sid'), + 'status': payload.get('status'), + 'last_consumed_message_index': deserialize.integer(payload.get('last_consumed_message_index')), + 'unread_messages_count': deserialize.integer(payload.get('unread_messages_count')), + 'links': payload.get('links'), + 'url': payload.get('url'), + 'notification_level': payload.get('notification_level'), } # Context diff --git a/twilio/rest/conversations/v1/conversation/__init__.py b/twilio/rest/conversations/v1/conversation/__init__.py index 8c8a9e70c7..7a93d7b7da 100644 --- a/twilio/rest/conversations/v1/conversation/__init__.py +++ b/twilio/rest/conversations/v1/conversation/__init__.py @@ -366,16 +366,16 @@ def __init__(self, version, payload, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'chat_service_sid': payload['chat_service_sid'], - 'messaging_service_sid': payload['messaging_service_sid'], - 'sid': payload['sid'], - 'friendly_name': payload['friendly_name'], - 'attributes': payload['attributes'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], - 'links': payload['links'], + 'account_sid': payload.get('account_sid'), + 'chat_service_sid': payload.get('chat_service_sid'), + 'messaging_service_sid': payload.get('messaging_service_sid'), + 'sid': payload.get('sid'), + 'friendly_name': payload.get('friendly_name'), + 'attributes': payload.get('attributes'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/conversations/v1/conversation/message.py b/twilio/rest/conversations/v1/conversation/message.py index 6cead6e5c5..dd46a0cd59 100644 --- a/twilio/rest/conversations/v1/conversation/message.py +++ b/twilio/rest/conversations/v1/conversation/message.py @@ -340,17 +340,17 @@ def __init__(self, version, payload, conversation_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'conversation_sid': payload['conversation_sid'], - 'sid': payload['sid'], - 'index': deserialize.integer(payload['index']), - 'author': payload['author'], - 'body': payload['body'], - 'media': payload['media'], - 'attributes': payload['attributes'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], + 'account_sid': payload.get('account_sid'), + 'conversation_sid': payload.get('conversation_sid'), + 'sid': payload.get('sid'), + 'index': deserialize.integer(payload.get('index')), + 'author': payload.get('author'), + 'body': payload.get('body'), + 'media': payload.get('media'), + 'attributes': payload.get('attributes'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/conversations/v1/conversation/participant.py b/twilio/rest/conversations/v1/conversation/participant.py index 9fb508e64d..67eb377ca9 100644 --- a/twilio/rest/conversations/v1/conversation/participant.py +++ b/twilio/rest/conversations/v1/conversation/participant.py @@ -352,15 +352,15 @@ def __init__(self, version, payload, conversation_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'conversation_sid': payload['conversation_sid'], - 'sid': payload['sid'], - 'identity': payload['identity'], - 'attributes': payload['attributes'], - 'messaging_binding': payload['messaging_binding'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], + 'account_sid': payload.get('account_sid'), + 'conversation_sid': payload.get('conversation_sid'), + 'sid': payload.get('sid'), + 'identity': payload.get('identity'), + 'attributes': payload.get('attributes'), + 'messaging_binding': payload.get('messaging_binding'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/conversations/v1/conversation/webhook.py b/twilio/rest/conversations/v1/conversation/webhook.py index 211dfa7931..888beb22ee 100644 --- a/twilio/rest/conversations/v1/conversation/webhook.py +++ b/twilio/rest/conversations/v1/conversation/webhook.py @@ -352,14 +352,14 @@ def __init__(self, version, payload, conversation_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'conversation_sid': payload['conversation_sid'], - 'target': payload['target'], - 'url': payload['url'], - 'configuration': payload['configuration'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'conversation_sid': payload.get('conversation_sid'), + 'target': payload.get('target'), + 'url': payload.get('url'), + 'configuration': payload.get('configuration'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), } # Context diff --git a/twilio/rest/conversations/v1/webhook.py b/twilio/rest/conversations/v1/webhook.py index 02a2b9d380..f06cf04941 100644 --- a/twilio/rest/conversations/v1/webhook.py +++ b/twilio/rest/conversations/v1/webhook.py @@ -201,13 +201,13 @@ def __init__(self, version, payload): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'method': payload['method'], - 'filters': payload['filters'], - 'pre_webhook_url': payload['pre_webhook_url'], - 'post_webhook_url': payload['post_webhook_url'], - 'target': payload['target'], - 'url': payload['url'], + 'account_sid': payload.get('account_sid'), + 'method': payload.get('method'), + 'filters': payload.get('filters'), + 'pre_webhook_url': payload.get('pre_webhook_url'), + 'post_webhook_url': payload.get('post_webhook_url'), + 'target': payload.get('target'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/fax/v1/fax/__init__.py b/twilio/rest/fax/v1/fax/__init__.py index 677747a934..4db04e662a 100644 --- a/twilio/rest/fax/v1/fax/__init__.py +++ b/twilio/rest/fax/v1/fax/__init__.py @@ -397,24 +397,24 @@ def __init__(self, version, payload, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'from_': payload['from'], - 'to': payload['to'], - 'quality': payload['quality'], - 'media_sid': payload['media_sid'], - 'media_url': payload['media_url'], - 'num_pages': deserialize.integer(payload['num_pages']), - 'duration': deserialize.integer(payload['duration']), - 'status': payload['status'], - 'direction': payload['direction'], - 'api_version': payload['api_version'], - 'price': deserialize.decimal(payload['price']), - 'price_unit': payload['price_unit'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'links': payload['links'], - 'url': payload['url'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'from_': payload.get('from'), + 'to': payload.get('to'), + 'quality': payload.get('quality'), + 'media_sid': payload.get('media_sid'), + 'media_url': payload.get('media_url'), + 'num_pages': deserialize.integer(payload.get('num_pages')), + 'duration': deserialize.integer(payload.get('duration')), + 'status': payload.get('status'), + 'direction': payload.get('direction'), + 'api_version': payload.get('api_version'), + 'price': deserialize.decimal(payload.get('price')), + 'price_unit': payload.get('price_unit'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'links': payload.get('links'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/fax/v1/fax/fax_media.py b/twilio/rest/fax/v1/fax/fax_media.py index d463785535..55a90ce0ed 100644 --- a/twilio/rest/fax/v1/fax/fax_media.py +++ b/twilio/rest/fax/v1/fax/fax_media.py @@ -266,13 +266,13 @@ def __init__(self, version, payload, fax_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'fax_sid': payload['fax_sid'], - 'content_type': payload['content_type'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'fax_sid': payload.get('fax_sid'), + 'content_type': payload.get('content_type'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/flex_api/v1/channel.py b/twilio/rest/flex_api/v1/channel.py index e51515ba25..6227d7025a 100644 --- a/twilio/rest/flex_api/v1/channel.py +++ b/twilio/rest/flex_api/v1/channel.py @@ -297,14 +297,14 @@ def __init__(self, version, payload, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'flex_flow_sid': payload['flex_flow_sid'], - 'sid': payload['sid'], - 'user_sid': payload['user_sid'], - 'task_sid': payload['task_sid'], - 'url': payload['url'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), + 'account_sid': payload.get('account_sid'), + 'flex_flow_sid': payload.get('flex_flow_sid'), + 'sid': payload.get('sid'), + 'user_sid': payload.get('user_sid'), + 'task_sid': payload.get('task_sid'), + 'url': payload.get('url'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), } # Context diff --git a/twilio/rest/flex_api/v1/configuration.py b/twilio/rest/flex_api/v1/configuration.py index 247d286be8..a2cfc12bf5 100644 --- a/twilio/rest/flex_api/v1/configuration.py +++ b/twilio/rest/flex_api/v1/configuration.py @@ -199,41 +199,41 @@ def __init__(self, version, payload): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'attributes': payload['attributes'], - 'status': payload['status'], - 'taskrouter_workspace_sid': payload['taskrouter_workspace_sid'], - 'taskrouter_target_workflow_sid': payload['taskrouter_target_workflow_sid'], - 'taskrouter_target_taskqueue_sid': payload['taskrouter_target_taskqueue_sid'], - 'taskrouter_taskqueues': payload['taskrouter_taskqueues'], - 'taskrouter_skills': payload['taskrouter_skills'], - 'taskrouter_worker_channels': payload['taskrouter_worker_channels'], - 'taskrouter_worker_attributes': payload['taskrouter_worker_attributes'], - 'taskrouter_offline_activity_sid': payload['taskrouter_offline_activity_sid'], - 'runtime_domain': payload['runtime_domain'], - 'messaging_service_instance_sid': payload['messaging_service_instance_sid'], - 'chat_service_instance_sid': payload['chat_service_instance_sid'], - 'ui_language': payload['ui_language'], - 'ui_attributes': payload['ui_attributes'], - 'ui_version': payload['ui_version'], - 'service_version': payload['service_version'], - 'call_recording_enabled': payload['call_recording_enabled'], - 'call_recording_webhook_url': payload['call_recording_webhook_url'], - 'crm_enabled': payload['crm_enabled'], - 'crm_type': payload['crm_type'], - 'crm_callback_url': payload['crm_callback_url'], - 'crm_fallback_url': payload['crm_fallback_url'], - 'crm_attributes': payload['crm_attributes'], - 'public_attributes': payload['public_attributes'], - 'plugin_service_enabled': payload['plugin_service_enabled'], - 'plugin_service_attributes': payload['plugin_service_attributes'], - 'integrations': payload['integrations'], - 'outbound_call_flows': payload['outbound_call_flows'], - 'features_enabled': payload['features_enabled'], - 'serverless_service_sids': payload['serverless_service_sids'], - 'url': payload['url'], + 'account_sid': payload.get('account_sid'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'attributes': payload.get('attributes'), + 'status': payload.get('status'), + 'taskrouter_workspace_sid': payload.get('taskrouter_workspace_sid'), + 'taskrouter_target_workflow_sid': payload.get('taskrouter_target_workflow_sid'), + 'taskrouter_target_taskqueue_sid': payload.get('taskrouter_target_taskqueue_sid'), + 'taskrouter_taskqueues': payload.get('taskrouter_taskqueues'), + 'taskrouter_skills': payload.get('taskrouter_skills'), + 'taskrouter_worker_channels': payload.get('taskrouter_worker_channels'), + 'taskrouter_worker_attributes': payload.get('taskrouter_worker_attributes'), + 'taskrouter_offline_activity_sid': payload.get('taskrouter_offline_activity_sid'), + 'runtime_domain': payload.get('runtime_domain'), + 'messaging_service_instance_sid': payload.get('messaging_service_instance_sid'), + 'chat_service_instance_sid': payload.get('chat_service_instance_sid'), + 'ui_language': payload.get('ui_language'), + 'ui_attributes': payload.get('ui_attributes'), + 'ui_version': payload.get('ui_version'), + 'service_version': payload.get('service_version'), + 'call_recording_enabled': payload.get('call_recording_enabled'), + 'call_recording_webhook_url': payload.get('call_recording_webhook_url'), + 'crm_enabled': payload.get('crm_enabled'), + 'crm_type': payload.get('crm_type'), + 'crm_callback_url': payload.get('crm_callback_url'), + 'crm_fallback_url': payload.get('crm_fallback_url'), + 'crm_attributes': payload.get('crm_attributes'), + 'public_attributes': payload.get('public_attributes'), + 'plugin_service_enabled': payload.get('plugin_service_enabled'), + 'plugin_service_attributes': payload.get('plugin_service_attributes'), + 'integrations': payload.get('integrations'), + 'outbound_call_flows': payload.get('outbound_call_flows'), + 'features_enabled': payload.get('features_enabled'), + 'serverless_service_sids': payload.get('serverless_service_sids'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/flex_api/v1/flex_flow.py b/twilio/rest/flex_api/v1/flex_flow.py index 7bc69f9e5d..3f83a291d2 100644 --- a/twilio/rest/flex_api/v1/flex_flow.py +++ b/twilio/rest/flex_api/v1/flex_flow.py @@ -390,19 +390,19 @@ def __init__(self, version, payload, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'sid': payload['sid'], - 'friendly_name': payload['friendly_name'], - 'chat_service_sid': payload['chat_service_sid'], - 'channel_type': payload['channel_type'], - 'contact_identity': payload['contact_identity'], - 'enabled': payload['enabled'], - 'integration_type': payload['integration_type'], - 'integration': payload['integration'], - 'long_lived': payload['long_lived'], - 'url': payload['url'], + 'account_sid': payload.get('account_sid'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'sid': payload.get('sid'), + 'friendly_name': payload.get('friendly_name'), + 'chat_service_sid': payload.get('chat_service_sid'), + 'channel_type': payload.get('channel_type'), + 'contact_identity': payload.get('contact_identity'), + 'enabled': payload.get('enabled'), + 'integration_type': payload.get('integration_type'), + 'integration': payload.get('integration'), + 'long_lived': payload.get('long_lived'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/flex_api/v1/web_channel.py b/twilio/rest/flex_api/v1/web_channel.py index 69f304a0b4..44f59e73dc 100644 --- a/twilio/rest/flex_api/v1/web_channel.py +++ b/twilio/rest/flex_api/v1/web_channel.py @@ -310,12 +310,12 @@ def __init__(self, version, payload, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'flex_flow_sid': payload['flex_flow_sid'], - 'sid': payload['sid'], - 'url': payload['url'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), + 'account_sid': payload.get('account_sid'), + 'flex_flow_sid': payload.get('flex_flow_sid'), + 'sid': payload.get('sid'), + 'url': payload.get('url'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), } # Context diff --git a/twilio/rest/insights/v1/summary.py b/twilio/rest/insights/v1/summary.py index 6777ae45d4..b74ca3b7b7 100644 --- a/twilio/rest/insights/v1/summary.py +++ b/twilio/rest/insights/v1/summary.py @@ -193,25 +193,25 @@ def __init__(self, version, payload, call_sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'call_sid': payload['call_sid'], - 'call_type': payload['call_type'], - 'call_state': payload['call_state'], - 'processing_state': payload['processing_state'], - 'start_time': deserialize.iso8601_datetime(payload['start_time']), - 'end_time': deserialize.iso8601_datetime(payload['end_time']), - 'duration': deserialize.integer(payload['duration']), - 'connect_duration': deserialize.integer(payload['connect_duration']), - 'from_': payload['from'], - 'to': payload['to'], - 'carrier_edge': payload['carrier_edge'], - 'client_edge': payload['client_edge'], - 'sdk_edge': payload['sdk_edge'], - 'sip_edge': payload['sip_edge'], - 'tags': payload['tags'], - 'url': payload['url'], - 'attributes': payload['attributes'], - 'properties': payload['properties'], + 'account_sid': payload.get('account_sid'), + 'call_sid': payload.get('call_sid'), + 'call_type': payload.get('call_type'), + 'call_state': payload.get('call_state'), + 'processing_state': payload.get('processing_state'), + 'start_time': deserialize.iso8601_datetime(payload.get('start_time')), + 'end_time': deserialize.iso8601_datetime(payload.get('end_time')), + 'duration': deserialize.integer(payload.get('duration')), + 'connect_duration': deserialize.integer(payload.get('connect_duration')), + 'from_': payload.get('from'), + 'to': payload.get('to'), + 'carrier_edge': payload.get('carrier_edge'), + 'client_edge': payload.get('client_edge'), + 'sdk_edge': payload.get('sdk_edge'), + 'sip_edge': payload.get('sip_edge'), + 'tags': payload.get('tags'), + 'url': payload.get('url'), + 'attributes': payload.get('attributes'), + 'properties': payload.get('properties'), } # Context diff --git a/twilio/rest/ip_messaging/v1/credential.py b/twilio/rest/ip_messaging/v1/credential.py index 867648dbdc..cca9187071 100644 --- a/twilio/rest/ip_messaging/v1/credential.py +++ b/twilio/rest/ip_messaging/v1/credential.py @@ -327,14 +327,14 @@ def __init__(self, version, payload, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'friendly_name': payload['friendly_name'], - 'type': payload['type'], - 'sandbox': payload['sandbox'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'friendly_name': payload.get('friendly_name'), + 'type': payload.get('type'), + 'sandbox': payload.get('sandbox'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/ip_messaging/v1/service/__init__.py b/twilio/rest/ip_messaging/v1/service/__init__.py index 40ecfa6a8c..df8dee1269 100644 --- a/twilio/rest/ip_messaging/v1/service/__init__.py +++ b/twilio/rest/ip_messaging/v1/service/__init__.py @@ -495,27 +495,27 @@ def __init__(self, version, payload, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'friendly_name': payload['friendly_name'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'default_service_role_sid': payload['default_service_role_sid'], - 'default_channel_role_sid': payload['default_channel_role_sid'], - 'default_channel_creator_role_sid': payload['default_channel_creator_role_sid'], - 'read_status_enabled': payload['read_status_enabled'], - 'reachability_enabled': payload['reachability_enabled'], - 'typing_indicator_timeout': deserialize.integer(payload['typing_indicator_timeout']), - 'consumption_report_interval': deserialize.integer(payload['consumption_report_interval']), - 'limits': payload['limits'], - 'webhooks': payload['webhooks'], - 'pre_webhook_url': payload['pre_webhook_url'], - 'post_webhook_url': payload['post_webhook_url'], - 'webhook_method': payload['webhook_method'], - 'webhook_filters': payload['webhook_filters'], - 'notifications': payload['notifications'], - 'url': payload['url'], - 'links': payload['links'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'friendly_name': payload.get('friendly_name'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'default_service_role_sid': payload.get('default_service_role_sid'), + 'default_channel_role_sid': payload.get('default_channel_role_sid'), + 'default_channel_creator_role_sid': payload.get('default_channel_creator_role_sid'), + 'read_status_enabled': payload.get('read_status_enabled'), + 'reachability_enabled': payload.get('reachability_enabled'), + 'typing_indicator_timeout': deserialize.integer(payload.get('typing_indicator_timeout')), + 'consumption_report_interval': deserialize.integer(payload.get('consumption_report_interval')), + 'limits': payload.get('limits'), + 'webhooks': payload.get('webhooks'), + 'pre_webhook_url': payload.get('pre_webhook_url'), + 'post_webhook_url': payload.get('post_webhook_url'), + 'webhook_method': payload.get('webhook_method'), + 'webhook_filters': payload.get('webhook_filters'), + 'notifications': payload.get('notifications'), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/ip_messaging/v1/service/channel/__init__.py b/twilio/rest/ip_messaging/v1/service/channel/__init__.py index 812f709a2d..97bc29924f 100644 --- a/twilio/rest/ip_messaging/v1/service/channel/__init__.py +++ b/twilio/rest/ip_messaging/v1/service/channel/__init__.py @@ -390,20 +390,20 @@ def __init__(self, version, payload, service_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'friendly_name': payload['friendly_name'], - 'unique_name': payload['unique_name'], - 'attributes': payload['attributes'], - 'type': payload['type'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'created_by': payload['created_by'], - 'members_count': deserialize.integer(payload['members_count']), - 'messages_count': deserialize.integer(payload['messages_count']), - 'url': payload['url'], - 'links': payload['links'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'friendly_name': payload.get('friendly_name'), + 'unique_name': payload.get('unique_name'), + 'attributes': payload.get('attributes'), + 'type': payload.get('type'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'created_by': payload.get('created_by'), + 'members_count': deserialize.integer(payload.get('members_count')), + 'messages_count': deserialize.integer(payload.get('messages_count')), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/ip_messaging/v1/service/channel/invite.py b/twilio/rest/ip_messaging/v1/service/channel/invite.py index aa1f649469..c83cdaa816 100644 --- a/twilio/rest/ip_messaging/v1/service/channel/invite.py +++ b/twilio/rest/ip_messaging/v1/service/channel/invite.py @@ -315,16 +315,16 @@ def __init__(self, version, payload, service_sid, channel_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'channel_sid': payload['channel_sid'], - 'service_sid': payload['service_sid'], - 'identity': payload['identity'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'role_sid': payload['role_sid'], - 'created_by': payload['created_by'], - 'url': payload['url'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'channel_sid': payload.get('channel_sid'), + 'service_sid': payload.get('service_sid'), + 'identity': payload.get('identity'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'role_sid': payload.get('role_sid'), + 'created_by': payload.get('created_by'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/ip_messaging/v1/service/channel/member.py b/twilio/rest/ip_messaging/v1/service/channel/member.py index e781c5c7cf..521d1782f7 100644 --- a/twilio/rest/ip_messaging/v1/service/channel/member.py +++ b/twilio/rest/ip_messaging/v1/service/channel/member.py @@ -342,17 +342,17 @@ def __init__(self, version, payload, service_sid, channel_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'channel_sid': payload['channel_sid'], - 'service_sid': payload['service_sid'], - 'identity': payload['identity'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'role_sid': payload['role_sid'], - 'last_consumed_message_index': deserialize.integer(payload['last_consumed_message_index']), - 'last_consumption_timestamp': deserialize.iso8601_datetime(payload['last_consumption_timestamp']), - 'url': payload['url'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'channel_sid': payload.get('channel_sid'), + 'service_sid': payload.get('service_sid'), + 'identity': payload.get('identity'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'role_sid': payload.get('role_sid'), + 'last_consumed_message_index': deserialize.integer(payload.get('last_consumed_message_index')), + 'last_consumption_timestamp': deserialize.iso8601_datetime(payload.get('last_consumption_timestamp')), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/ip_messaging/v1/service/channel/message.py b/twilio/rest/ip_messaging/v1/service/channel/message.py index 9379f38f92..cdbc79eabd 100644 --- a/twilio/rest/ip_messaging/v1/service/channel/message.py +++ b/twilio/rest/ip_messaging/v1/service/channel/message.py @@ -345,19 +345,19 @@ def __init__(self, version, payload, service_sid, channel_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'attributes': payload['attributes'], - 'service_sid': payload['service_sid'], - 'to': payload['to'], - 'channel_sid': payload['channel_sid'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'was_edited': payload['was_edited'], - 'from_': payload['from'], - 'body': payload['body'], - 'index': deserialize.integer(payload['index']), - 'url': payload['url'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'attributes': payload.get('attributes'), + 'service_sid': payload.get('service_sid'), + 'to': payload.get('to'), + 'channel_sid': payload.get('channel_sid'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'was_edited': payload.get('was_edited'), + 'from_': payload.get('from'), + 'body': payload.get('body'), + 'index': deserialize.integer(payload.get('index')), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/ip_messaging/v1/service/role.py b/twilio/rest/ip_messaging/v1/service/role.py index 38005aa3c0..cdf4f617e8 100644 --- a/twilio/rest/ip_messaging/v1/service/role.py +++ b/twilio/rest/ip_messaging/v1/service/role.py @@ -316,15 +316,15 @@ def __init__(self, version, payload, service_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'friendly_name': payload['friendly_name'], - 'type': payload['type'], - 'permissions': payload['permissions'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'friendly_name': payload.get('friendly_name'), + 'type': payload.get('type'), + 'permissions': payload.get('permissions'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/ip_messaging/v1/service/user/__init__.py b/twilio/rest/ip_messaging/v1/service/user/__init__.py index b2de38f849..b17655cfcc 100644 --- a/twilio/rest/ip_messaging/v1/service/user/__init__.py +++ b/twilio/rest/ip_messaging/v1/service/user/__init__.py @@ -337,20 +337,20 @@ def __init__(self, version, payload, service_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'attributes': payload['attributes'], - 'friendly_name': payload['friendly_name'], - 'role_sid': payload['role_sid'], - 'identity': payload['identity'], - 'is_online': payload['is_online'], - 'is_notifiable': payload['is_notifiable'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'joined_channels_count': deserialize.integer(payload['joined_channels_count']), - 'links': payload['links'], - 'url': payload['url'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'attributes': payload.get('attributes'), + 'friendly_name': payload.get('friendly_name'), + 'role_sid': payload.get('role_sid'), + 'identity': payload.get('identity'), + 'is_online': payload.get('is_online'), + 'is_notifiable': payload.get('is_notifiable'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'joined_channels_count': deserialize.integer(payload.get('joined_channels_count')), + 'links': payload.get('links'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/ip_messaging/v1/service/user/user_channel.py b/twilio/rest/ip_messaging/v1/service/user/user_channel.py index 3ea97a9e7e..aa0b562af4 100644 --- a/twilio/rest/ip_messaging/v1/service/user/user_channel.py +++ b/twilio/rest/ip_messaging/v1/service/user/user_channel.py @@ -189,14 +189,14 @@ def __init__(self, version, payload, service_sid, user_sid): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'channel_sid': payload['channel_sid'], - 'member_sid': payload['member_sid'], - 'status': payload['status'], - 'last_consumed_message_index': deserialize.integer(payload['last_consumed_message_index']), - 'unread_messages_count': deserialize.integer(payload['unread_messages_count']), - 'links': payload['links'], + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'channel_sid': payload.get('channel_sid'), + 'member_sid': payload.get('member_sid'), + 'status': payload.get('status'), + 'last_consumed_message_index': deserialize.integer(payload.get('last_consumed_message_index')), + 'unread_messages_count': deserialize.integer(payload.get('unread_messages_count')), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/ip_messaging/v2/credential.py b/twilio/rest/ip_messaging/v2/credential.py index 1bc48ded35..fcfeb7a1cd 100644 --- a/twilio/rest/ip_messaging/v2/credential.py +++ b/twilio/rest/ip_messaging/v2/credential.py @@ -327,14 +327,14 @@ def __init__(self, version, payload, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'friendly_name': payload['friendly_name'], - 'type': payload['type'], - 'sandbox': payload['sandbox'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'friendly_name': payload.get('friendly_name'), + 'type': payload.get('type'), + 'sandbox': payload.get('sandbox'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/ip_messaging/v2/service/__init__.py b/twilio/rest/ip_messaging/v2/service/__init__.py index 788c1cc9b2..33bb659ea9 100644 --- a/twilio/rest/ip_messaging/v2/service/__init__.py +++ b/twilio/rest/ip_messaging/v2/service/__init__.py @@ -440,29 +440,29 @@ def __init__(self, version, payload, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'friendly_name': payload['friendly_name'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'default_service_role_sid': payload['default_service_role_sid'], - 'default_channel_role_sid': payload['default_channel_role_sid'], - 'default_channel_creator_role_sid': payload['default_channel_creator_role_sid'], - 'read_status_enabled': payload['read_status_enabled'], - 'reachability_enabled': payload['reachability_enabled'], - 'typing_indicator_timeout': deserialize.integer(payload['typing_indicator_timeout']), - 'consumption_report_interval': deserialize.integer(payload['consumption_report_interval']), - 'limits': payload['limits'], - 'pre_webhook_url': payload['pre_webhook_url'], - 'post_webhook_url': payload['post_webhook_url'], - 'webhook_method': payload['webhook_method'], - 'webhook_filters': payload['webhook_filters'], - 'pre_webhook_retry_count': deserialize.integer(payload['pre_webhook_retry_count']), - 'post_webhook_retry_count': deserialize.integer(payload['post_webhook_retry_count']), - 'notifications': payload['notifications'], - 'media': payload['media'], - 'url': payload['url'], - 'links': payload['links'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'friendly_name': payload.get('friendly_name'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'default_service_role_sid': payload.get('default_service_role_sid'), + 'default_channel_role_sid': payload.get('default_channel_role_sid'), + 'default_channel_creator_role_sid': payload.get('default_channel_creator_role_sid'), + 'read_status_enabled': payload.get('read_status_enabled'), + 'reachability_enabled': payload.get('reachability_enabled'), + 'typing_indicator_timeout': deserialize.integer(payload.get('typing_indicator_timeout')), + 'consumption_report_interval': deserialize.integer(payload.get('consumption_report_interval')), + 'limits': payload.get('limits'), + 'pre_webhook_url': payload.get('pre_webhook_url'), + 'post_webhook_url': payload.get('post_webhook_url'), + 'webhook_method': payload.get('webhook_method'), + 'webhook_filters': payload.get('webhook_filters'), + 'pre_webhook_retry_count': deserialize.integer(payload.get('pre_webhook_retry_count')), + 'post_webhook_retry_count': deserialize.integer(payload.get('post_webhook_retry_count')), + 'notifications': payload.get('notifications'), + 'media': payload.get('media'), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/ip_messaging/v2/service/binding.py b/twilio/rest/ip_messaging/v2/service/binding.py index 9aae8a6aad..302fb5f327 100644 --- a/twilio/rest/ip_messaging/v2/service/binding.py +++ b/twilio/rest/ip_messaging/v2/service/binding.py @@ -288,18 +288,18 @@ def __init__(self, version, payload, service_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'endpoint': payload['endpoint'], - 'identity': payload['identity'], - 'credential_sid': payload['credential_sid'], - 'binding_type': payload['binding_type'], - 'message_types': payload['message_types'], - 'url': payload['url'], - 'links': payload['links'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'endpoint': payload.get('endpoint'), + 'identity': payload.get('identity'), + 'credential_sid': payload.get('credential_sid'), + 'binding_type': payload.get('binding_type'), + 'message_types': payload.get('message_types'), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/ip_messaging/v2/service/channel/__init__.py b/twilio/rest/ip_messaging/v2/service/channel/__init__.py index 6907642004..0da5abaafe 100644 --- a/twilio/rest/ip_messaging/v2/service/channel/__init__.py +++ b/twilio/rest/ip_messaging/v2/service/channel/__init__.py @@ -427,20 +427,20 @@ def __init__(self, version, payload, service_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'friendly_name': payload['friendly_name'], - 'unique_name': payload['unique_name'], - 'attributes': payload['attributes'], - 'type': payload['type'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'created_by': payload['created_by'], - 'members_count': deserialize.integer(payload['members_count']), - 'messages_count': deserialize.integer(payload['messages_count']), - 'url': payload['url'], - 'links': payload['links'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'friendly_name': payload.get('friendly_name'), + 'unique_name': payload.get('unique_name'), + 'attributes': payload.get('attributes'), + 'type': payload.get('type'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'created_by': payload.get('created_by'), + 'members_count': deserialize.integer(payload.get('members_count')), + 'messages_count': deserialize.integer(payload.get('messages_count')), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/ip_messaging/v2/service/channel/invite.py b/twilio/rest/ip_messaging/v2/service/channel/invite.py index 9f0ff47a50..cbaa1fc98d 100644 --- a/twilio/rest/ip_messaging/v2/service/channel/invite.py +++ b/twilio/rest/ip_messaging/v2/service/channel/invite.py @@ -315,16 +315,16 @@ def __init__(self, version, payload, service_sid, channel_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'channel_sid': payload['channel_sid'], - 'service_sid': payload['service_sid'], - 'identity': payload['identity'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'role_sid': payload['role_sid'], - 'created_by': payload['created_by'], - 'url': payload['url'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'channel_sid': payload.get('channel_sid'), + 'service_sid': payload.get('service_sid'), + 'identity': payload.get('identity'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'role_sid': payload.get('role_sid'), + 'created_by': payload.get('created_by'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/ip_messaging/v2/service/channel/member.py b/twilio/rest/ip_messaging/v2/service/channel/member.py index 29733f9c5c..c4557230d3 100644 --- a/twilio/rest/ip_messaging/v2/service/channel/member.py +++ b/twilio/rest/ip_messaging/v2/service/channel/member.py @@ -375,18 +375,18 @@ def __init__(self, version, payload, service_sid, channel_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'channel_sid': payload['channel_sid'], - 'service_sid': payload['service_sid'], - 'identity': payload['identity'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'role_sid': payload['role_sid'], - 'last_consumed_message_index': deserialize.integer(payload['last_consumed_message_index']), - 'last_consumption_timestamp': deserialize.iso8601_datetime(payload['last_consumption_timestamp']), - 'url': payload['url'], - 'attributes': payload['attributes'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'channel_sid': payload.get('channel_sid'), + 'service_sid': payload.get('service_sid'), + 'identity': payload.get('identity'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'role_sid': payload.get('role_sid'), + 'last_consumed_message_index': deserialize.integer(payload.get('last_consumed_message_index')), + 'last_consumption_timestamp': deserialize.iso8601_datetime(payload.get('last_consumption_timestamp')), + 'url': payload.get('url'), + 'attributes': payload.get('attributes'), } # Context diff --git a/twilio/rest/ip_messaging/v2/service/channel/message.py b/twilio/rest/ip_messaging/v2/service/channel/message.py index b5a83e4a60..2cf08b5ea7 100644 --- a/twilio/rest/ip_messaging/v2/service/channel/message.py +++ b/twilio/rest/ip_messaging/v2/service/channel/message.py @@ -378,22 +378,22 @@ def __init__(self, version, payload, service_sid, channel_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'attributes': payload['attributes'], - 'service_sid': payload['service_sid'], - 'to': payload['to'], - 'channel_sid': payload['channel_sid'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'last_updated_by': payload['last_updated_by'], - 'was_edited': payload['was_edited'], - 'from_': payload['from'], - 'body': payload['body'], - 'index': deserialize.integer(payload['index']), - 'type': payload['type'], - 'media': payload['media'], - 'url': payload['url'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'attributes': payload.get('attributes'), + 'service_sid': payload.get('service_sid'), + 'to': payload.get('to'), + 'channel_sid': payload.get('channel_sid'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'last_updated_by': payload.get('last_updated_by'), + 'was_edited': payload.get('was_edited'), + 'from_': payload.get('from'), + 'body': payload.get('body'), + 'index': deserialize.integer(payload.get('index')), + 'type': payload.get('type'), + 'media': payload.get('media'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/ip_messaging/v2/service/channel/webhook.py b/twilio/rest/ip_messaging/v2/service/channel/webhook.py index fe51c49346..8a728d9b85 100644 --- a/twilio/rest/ip_messaging/v2/service/channel/webhook.py +++ b/twilio/rest/ip_messaging/v2/service/channel/webhook.py @@ -376,15 +376,15 @@ def __init__(self, version, payload, service_sid, channel_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'channel_sid': payload['channel_sid'], - 'type': payload['type'], - 'url': payload['url'], - 'configuration': payload['configuration'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'channel_sid': payload.get('channel_sid'), + 'type': payload.get('type'), + 'url': payload.get('url'), + 'configuration': payload.get('configuration'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), } # Context diff --git a/twilio/rest/ip_messaging/v2/service/role.py b/twilio/rest/ip_messaging/v2/service/role.py index 4f4825510a..cb37f975cd 100644 --- a/twilio/rest/ip_messaging/v2/service/role.py +++ b/twilio/rest/ip_messaging/v2/service/role.py @@ -316,15 +316,15 @@ def __init__(self, version, payload, service_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'friendly_name': payload['friendly_name'], - 'type': payload['type'], - 'permissions': payload['permissions'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'friendly_name': payload.get('friendly_name'), + 'type': payload.get('type'), + 'permissions': payload.get('permissions'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/ip_messaging/v2/service/user/__init__.py b/twilio/rest/ip_messaging/v2/service/user/__init__.py index b5f0a43aa8..119a03fc14 100644 --- a/twilio/rest/ip_messaging/v2/service/user/__init__.py +++ b/twilio/rest/ip_messaging/v2/service/user/__init__.py @@ -359,20 +359,20 @@ def __init__(self, version, payload, service_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'attributes': payload['attributes'], - 'friendly_name': payload['friendly_name'], - 'role_sid': payload['role_sid'], - 'identity': payload['identity'], - 'is_online': payload['is_online'], - 'is_notifiable': payload['is_notifiable'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'joined_channels_count': deserialize.integer(payload['joined_channels_count']), - 'links': payload['links'], - 'url': payload['url'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'attributes': payload.get('attributes'), + 'friendly_name': payload.get('friendly_name'), + 'role_sid': payload.get('role_sid'), + 'identity': payload.get('identity'), + 'is_online': payload.get('is_online'), + 'is_notifiable': payload.get('is_notifiable'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'joined_channels_count': deserialize.integer(payload.get('joined_channels_count')), + 'links': payload.get('links'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/ip_messaging/v2/service/user/user_binding.py b/twilio/rest/ip_messaging/v2/service/user/user_binding.py index 4a13597501..4ef430372d 100644 --- a/twilio/rest/ip_messaging/v2/service/user/user_binding.py +++ b/twilio/rest/ip_messaging/v2/service/user/user_binding.py @@ -295,18 +295,18 @@ def __init__(self, version, payload, service_sid, user_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'endpoint': payload['endpoint'], - 'identity': payload['identity'], - 'user_sid': payload['user_sid'], - 'credential_sid': payload['credential_sid'], - 'binding_type': payload['binding_type'], - 'message_types': payload['message_types'], - 'url': payload['url'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'endpoint': payload.get('endpoint'), + 'identity': payload.get('identity'), + 'user_sid': payload.get('user_sid'), + 'credential_sid': payload.get('credential_sid'), + 'binding_type': payload.get('binding_type'), + 'message_types': payload.get('message_types'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/ip_messaging/v2/service/user/user_channel.py b/twilio/rest/ip_messaging/v2/service/user/user_channel.py index e88673cc4a..a133330dbf 100644 --- a/twilio/rest/ip_messaging/v2/service/user/user_channel.py +++ b/twilio/rest/ip_messaging/v2/service/user/user_channel.py @@ -306,17 +306,17 @@ def __init__(self, version, payload, service_sid, user_sid, channel_sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'channel_sid': payload['channel_sid'], - 'user_sid': payload['user_sid'], - 'member_sid': payload['member_sid'], - 'status': payload['status'], - 'last_consumed_message_index': deserialize.integer(payload['last_consumed_message_index']), - 'unread_messages_count': deserialize.integer(payload['unread_messages_count']), - 'links': payload['links'], - 'url': payload['url'], - 'notification_level': payload['notification_level'], + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'channel_sid': payload.get('channel_sid'), + 'user_sid': payload.get('user_sid'), + 'member_sid': payload.get('member_sid'), + 'status': payload.get('status'), + 'last_consumed_message_index': deserialize.integer(payload.get('last_consumed_message_index')), + 'unread_messages_count': deserialize.integer(payload.get('unread_messages_count')), + 'links': payload.get('links'), + 'url': payload.get('url'), + 'notification_level': payload.get('notification_level'), } # Context diff --git a/twilio/rest/lookups/v1/phone_number.py b/twilio/rest/lookups/v1/phone_number.py index a38842fcb2..906feebebc 100644 --- a/twilio/rest/lookups/v1/phone_number.py +++ b/twilio/rest/lookups/v1/phone_number.py @@ -179,13 +179,13 @@ def __init__(self, version, payload, phone_number=None): # Marshaled Properties self._properties = { - 'caller_name': payload['caller_name'], - 'country_code': payload['country_code'], - 'phone_number': payload['phone_number'], - 'national_format': payload['national_format'], - 'carrier': payload['carrier'], - 'add_ons': payload['add_ons'], - 'url': payload['url'], + 'caller_name': payload.get('caller_name'), + 'country_code': payload.get('country_code'), + 'phone_number': payload.get('phone_number'), + 'national_format': payload.get('national_format'), + 'carrier': payload.get('carrier'), + 'add_ons': payload.get('add_ons'), + 'url': payload.get('url'), } # Context @@ -241,7 +241,7 @@ def national_format(self): def carrier(self): """ :returns: The telecom company that provides the phone number - :rtype: dict + :rtype: unicode """ return self._properties['carrier'] diff --git a/twilio/rest/messaging/v1/service/__init__.py b/twilio/rest/messaging/v1/service/__init__.py index 61ad0e5de2..f62029cf9f 100644 --- a/twilio/rest/messaging/v1/service/__init__.py +++ b/twilio/rest/messaging/v1/service/__init__.py @@ -413,26 +413,26 @@ def __init__(self, version, payload, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'friendly_name': payload['friendly_name'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'inbound_request_url': payload['inbound_request_url'], - 'inbound_method': payload['inbound_method'], - 'fallback_url': payload['fallback_url'], - 'fallback_method': payload['fallback_method'], - 'status_callback': payload['status_callback'], - 'sticky_sender': payload['sticky_sender'], - 'mms_converter': payload['mms_converter'], - 'smart_encoding': payload['smart_encoding'], - 'scan_message_content': payload['scan_message_content'], - 'fallback_to_long_code': payload['fallback_to_long_code'], - 'area_code_geomatch': payload['area_code_geomatch'], - 'synchronous_validation': payload['synchronous_validation'], - 'validity_period': deserialize.integer(payload['validity_period']), - 'url': payload['url'], - 'links': payload['links'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'friendly_name': payload.get('friendly_name'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'inbound_request_url': payload.get('inbound_request_url'), + 'inbound_method': payload.get('inbound_method'), + 'fallback_url': payload.get('fallback_url'), + 'fallback_method': payload.get('fallback_method'), + 'status_callback': payload.get('status_callback'), + 'sticky_sender': payload.get('sticky_sender'), + 'mms_converter': payload.get('mms_converter'), + 'smart_encoding': payload.get('smart_encoding'), + 'scan_message_content': payload.get('scan_message_content'), + 'fallback_to_long_code': payload.get('fallback_to_long_code'), + 'area_code_geomatch': payload.get('area_code_geomatch'), + 'synchronous_validation': payload.get('synchronous_validation'), + 'validity_period': deserialize.integer(payload.get('validity_period')), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/messaging/v1/service/alpha_sender.py b/twilio/rest/messaging/v1/service/alpha_sender.py index 05dabb28a0..b04c0a6462 100644 --- a/twilio/rest/messaging/v1/service/alpha_sender.py +++ b/twilio/rest/messaging/v1/service/alpha_sender.py @@ -285,14 +285,14 @@ def __init__(self, version, payload, service_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'alpha_sender': payload['alpha_sender'], - 'capabilities': payload['capabilities'], - 'url': payload['url'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'alpha_sender': payload.get('alpha_sender'), + 'capabilities': payload.get('capabilities'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/messaging/v1/service/phone_number.py b/twilio/rest/messaging/v1/service/phone_number.py index 44ca16d3b5..6dd510ec14 100644 --- a/twilio/rest/messaging/v1/service/phone_number.py +++ b/twilio/rest/messaging/v1/service/phone_number.py @@ -285,15 +285,15 @@ def __init__(self, version, payload, service_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'phone_number': payload['phone_number'], - 'country_code': payload['country_code'], - 'capabilities': payload['capabilities'], - 'url': payload['url'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'phone_number': payload.get('phone_number'), + 'country_code': payload.get('country_code'), + 'capabilities': payload.get('capabilities'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/messaging/v1/service/short_code.py b/twilio/rest/messaging/v1/service/short_code.py index 841c7775d0..5969f88c99 100644 --- a/twilio/rest/messaging/v1/service/short_code.py +++ b/twilio/rest/messaging/v1/service/short_code.py @@ -285,15 +285,15 @@ def __init__(self, version, payload, service_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'short_code': payload['short_code'], - 'country_code': payload['country_code'], - 'capabilities': payload['capabilities'], - 'url': payload['url'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'short_code': payload.get('short_code'), + 'country_code': payload.get('country_code'), + 'capabilities': payload.get('capabilities'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/messaging/v1/session/__init__.py b/twilio/rest/messaging/v1/session/__init__.py index f5777d787e..10522830b7 100644 --- a/twilio/rest/messaging/v1/session/__init__.py +++ b/twilio/rest/messaging/v1/session/__init__.py @@ -371,17 +371,17 @@ def __init__(self, version, payload, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'messaging_service_sid': payload['messaging_service_sid'], - 'friendly_name': payload['friendly_name'], - 'attributes': payload['attributes'], - 'created_by': payload['created_by'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], - 'links': payload['links'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'messaging_service_sid': payload.get('messaging_service_sid'), + 'friendly_name': payload.get('friendly_name'), + 'attributes': payload.get('attributes'), + 'created_by': payload.get('created_by'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/messaging/v1/session/message.py b/twilio/rest/messaging/v1/session/message.py index b7e83ff75f..6dfea33d0f 100644 --- a/twilio/rest/messaging/v1/session/message.py +++ b/twilio/rest/messaging/v1/session/message.py @@ -338,18 +338,18 @@ def __init__(self, version, payload, session_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'messaging_service_sid': payload['messaging_service_sid'], - 'session_sid': payload['session_sid'], - 'sid': payload['sid'], - 'index': deserialize.integer(payload['index']), - 'author': payload['author'], - 'body': payload['body'], - 'attributes': payload['attributes'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'messaging_service_sid': payload.get('messaging_service_sid'), + 'session_sid': payload.get('session_sid'), + 'sid': payload.get('sid'), + 'index': deserialize.integer(payload.get('index')), + 'author': payload.get('author'), + 'body': payload.get('body'), + 'attributes': payload.get('attributes'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/messaging/v1/session/participant.py b/twilio/rest/messaging/v1/session/participant.py index ebb2e4bf88..825d5f12cc 100644 --- a/twilio/rest/messaging/v1/session/participant.py +++ b/twilio/rest/messaging/v1/session/participant.py @@ -339,19 +339,19 @@ def __init__(self, version, payload, session_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'messaging_service_sid': payload['messaging_service_sid'], - 'session_sid': payload['session_sid'], - 'sid': payload['sid'], - 'identity': payload['identity'], - 'twilio_address': payload['twilio_address'], - 'user_address': payload['user_address'], - 'attributes': payload['attributes'], - 'type': payload['type'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'messaging_service_sid': payload.get('messaging_service_sid'), + 'session_sid': payload.get('session_sid'), + 'sid': payload.get('sid'), + 'identity': payload.get('identity'), + 'twilio_address': payload.get('twilio_address'), + 'user_address': payload.get('user_address'), + 'attributes': payload.get('attributes'), + 'type': payload.get('type'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/messaging/v1/session/webhook.py b/twilio/rest/messaging/v1/session/webhook.py index b92b574a64..56f4d57192 100644 --- a/twilio/rest/messaging/v1/session/webhook.py +++ b/twilio/rest/messaging/v1/session/webhook.py @@ -374,14 +374,14 @@ def __init__(self, version, payload, session_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'session_sid': payload['session_sid'], - 'target': payload['target'], - 'url': payload['url'], - 'configuration': payload['configuration'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'session_sid': payload.get('session_sid'), + 'target': payload.get('target'), + 'url': payload.get('url'), + 'configuration': payload.get('configuration'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), } # Context diff --git a/twilio/rest/messaging/v1/webhook.py b/twilio/rest/messaging/v1/webhook.py index 8f7d1b7898..332b7ed234 100644 --- a/twilio/rest/messaging/v1/webhook.py +++ b/twilio/rest/messaging/v1/webhook.py @@ -207,16 +207,16 @@ def __init__(self, version, payload): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'webhook_method': payload['webhook_method'], - 'webhook_filters': payload['webhook_filters'], - 'pre_webhook_url': payload['pre_webhook_url'], - 'post_webhook_url': payload['post_webhook_url'], - 'pre_webhook_retry_count': deserialize.integer(payload['pre_webhook_retry_count']), - 'post_webhook_retry_count': deserialize.integer(payload['post_webhook_retry_count']), - 'target': payload['target'], - 'url': payload['url'], + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'webhook_method': payload.get('webhook_method'), + 'webhook_filters': payload.get('webhook_filters'), + 'pre_webhook_url': payload.get('pre_webhook_url'), + 'post_webhook_url': payload.get('post_webhook_url'), + 'pre_webhook_retry_count': deserialize.integer(payload.get('pre_webhook_retry_count')), + 'post_webhook_retry_count': deserialize.integer(payload.get('post_webhook_retry_count')), + 'target': payload.get('target'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/monitor/v1/alert.py b/twilio/rest/monitor/v1/alert.py index de16b76f1e..156aabaf23 100644 --- a/twilio/rest/monitor/v1/alert.py +++ b/twilio/rest/monitor/v1/alert.py @@ -276,25 +276,25 @@ def __init__(self, version, payload, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'alert_text': payload['alert_text'], - 'api_version': payload['api_version'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_generated': deserialize.iso8601_datetime(payload['date_generated']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'error_code': payload['error_code'], - 'log_level': payload['log_level'], - 'more_info': payload['more_info'], - 'request_method': payload['request_method'], - 'request_url': payload['request_url'], - 'resource_sid': payload['resource_sid'], - 'sid': payload['sid'], - 'url': payload['url'], - 'service_sid': payload['service_sid'], + 'account_sid': payload.get('account_sid'), + 'alert_text': payload.get('alert_text'), + 'api_version': payload.get('api_version'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_generated': deserialize.iso8601_datetime(payload.get('date_generated')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'error_code': payload.get('error_code'), + 'log_level': payload.get('log_level'), + 'more_info': payload.get('more_info'), + 'request_method': payload.get('request_method'), + 'request_url': payload.get('request_url'), 'request_variables': payload.get('request_variables'), + 'resource_sid': payload.get('resource_sid'), 'response_body': payload.get('response_body'), 'response_headers': payload.get('response_headers'), + 'sid': payload.get('sid'), + 'url': payload.get('url'), 'request_headers': payload.get('request_headers'), + 'service_sid': payload.get('service_sid'), } # Context diff --git a/twilio/rest/monitor/v1/event.py b/twilio/rest/monitor/v1/event.py index eeb0a5c023..471f710c4c 100644 --- a/twilio/rest/monitor/v1/event.py +++ b/twilio/rest/monitor/v1/event.py @@ -300,20 +300,20 @@ def __init__(self, version, payload, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'actor_sid': payload['actor_sid'], - 'actor_type': payload['actor_type'], - 'description': payload['description'], - 'event_data': payload['event_data'], - 'event_date': deserialize.iso8601_datetime(payload['event_date']), - 'event_type': payload['event_type'], - 'resource_sid': payload['resource_sid'], - 'resource_type': payload['resource_type'], - 'sid': payload['sid'], - 'source': payload['source'], - 'source_ip_address': payload['source_ip_address'], - 'url': payload['url'], - 'links': payload['links'], + 'account_sid': payload.get('account_sid'), + 'actor_sid': payload.get('actor_sid'), + 'actor_type': payload.get('actor_type'), + 'description': payload.get('description'), + 'event_data': payload.get('event_data'), + 'event_date': deserialize.iso8601_datetime(payload.get('event_date')), + 'event_type': payload.get('event_type'), + 'resource_sid': payload.get('resource_sid'), + 'resource_type': payload.get('resource_type'), + 'sid': payload.get('sid'), + 'source': payload.get('source'), + 'source_ip_address': payload.get('source_ip_address'), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/notify/v1/credential.py b/twilio/rest/notify/v1/credential.py index 60dbd7fb1b..56229ae6dd 100644 --- a/twilio/rest/notify/v1/credential.py +++ b/twilio/rest/notify/v1/credential.py @@ -331,14 +331,14 @@ def __init__(self, version, payload, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'friendly_name': payload['friendly_name'], - 'type': payload['type'], - 'sandbox': payload['sandbox'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'friendly_name': payload.get('friendly_name'), + 'type': payload.get('type'), + 'sandbox': payload.get('sandbox'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/notify/v1/service/__init__.py b/twilio/rest/notify/v1/service/__init__.py index 80f458d931..933dda04b1 100644 --- a/twilio/rest/notify/v1/service/__init__.py +++ b/twilio/rest/notify/v1/service/__init__.py @@ -398,24 +398,24 @@ def __init__(self, version, payload, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'friendly_name': payload['friendly_name'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'apn_credential_sid': payload['apn_credential_sid'], - 'gcm_credential_sid': payload['gcm_credential_sid'], - 'fcm_credential_sid': payload['fcm_credential_sid'], - 'messaging_service_sid': payload['messaging_service_sid'], - 'facebook_messenger_page_id': payload['facebook_messenger_page_id'], - 'default_apn_notification_protocol_version': payload['default_apn_notification_protocol_version'], - 'default_gcm_notification_protocol_version': payload['default_gcm_notification_protocol_version'], - 'default_fcm_notification_protocol_version': payload['default_fcm_notification_protocol_version'], - 'log_enabled': payload['log_enabled'], - 'url': payload['url'], - 'links': payload['links'], - 'alexa_skill_id': payload['alexa_skill_id'], - 'default_alexa_notification_protocol_version': payload['default_alexa_notification_protocol_version'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'friendly_name': payload.get('friendly_name'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'apn_credential_sid': payload.get('apn_credential_sid'), + 'gcm_credential_sid': payload.get('gcm_credential_sid'), + 'fcm_credential_sid': payload.get('fcm_credential_sid'), + 'messaging_service_sid': payload.get('messaging_service_sid'), + 'facebook_messenger_page_id': payload.get('facebook_messenger_page_id'), + 'default_apn_notification_protocol_version': payload.get('default_apn_notification_protocol_version'), + 'default_gcm_notification_protocol_version': payload.get('default_gcm_notification_protocol_version'), + 'default_fcm_notification_protocol_version': payload.get('default_fcm_notification_protocol_version'), + 'log_enabled': payload.get('log_enabled'), + 'url': payload.get('url'), + 'links': payload.get('links'), + 'alexa_skill_id': payload.get('alexa_skill_id'), + 'default_alexa_notification_protocol_version': payload.get('default_alexa_notification_protocol_version'), } # Context diff --git a/twilio/rest/notify/v1/service/binding.py b/twilio/rest/notify/v1/service/binding.py index 0eab556668..ad7e243d09 100644 --- a/twilio/rest/notify/v1/service/binding.py +++ b/twilio/rest/notify/v1/service/binding.py @@ -346,20 +346,20 @@ def __init__(self, version, payload, service_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'credential_sid': payload['credential_sid'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'notification_protocol_version': payload['notification_protocol_version'], - 'endpoint': payload['endpoint'], - 'identity': payload['identity'], - 'binding_type': payload['binding_type'], - 'address': payload['address'], - 'tags': payload['tags'], - 'url': payload['url'], - 'links': payload['links'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'credential_sid': payload.get('credential_sid'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'notification_protocol_version': payload.get('notification_protocol_version'), + 'endpoint': payload.get('endpoint'), + 'identity': payload.get('identity'), + 'binding_type': payload.get('binding_type'), + 'address': payload.get('address'), + 'tags': payload.get('tags'), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/notify/v1/service/notification.py b/twilio/rest/notify/v1/service/notification.py index f67648b50f..0b7709e786 100644 --- a/twilio/rest/notify/v1/service/notification.py +++ b/twilio/rest/notify/v1/service/notification.py @@ -162,26 +162,26 @@ def __init__(self, version, payload, service_sid): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'identities': payload['identities'], - 'tags': payload['tags'], - 'segments': payload['segments'], - 'priority': payload['priority'], - 'ttl': deserialize.integer(payload['ttl']), - 'title': payload['title'], - 'body': payload['body'], - 'sound': payload['sound'], - 'action': payload['action'], - 'data': payload['data'], - 'apn': payload['apn'], - 'gcm': payload['gcm'], - 'fcm': payload['fcm'], - 'sms': payload['sms'], - 'facebook_messenger': payload['facebook_messenger'], - 'alexa': payload['alexa'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'identities': payload.get('identities'), + 'tags': payload.get('tags'), + 'segments': payload.get('segments'), + 'priority': payload.get('priority'), + 'ttl': deserialize.integer(payload.get('ttl')), + 'title': payload.get('title'), + 'body': payload.get('body'), + 'sound': payload.get('sound'), + 'action': payload.get('action'), + 'data': payload.get('data'), + 'apn': payload.get('apn'), + 'gcm': payload.get('gcm'), + 'fcm': payload.get('fcm'), + 'sms': payload.get('sms'), + 'facebook_messenger': payload.get('facebook_messenger'), + 'alexa': payload.get('alexa'), } # Context diff --git a/twilio/rest/preview/acc_security/service/__init__.py b/twilio/rest/preview/acc_security/service/__init__.py index 33c0064d24..e5757317a4 100644 --- a/twilio/rest/preview/acc_security/service/__init__.py +++ b/twilio/rest/preview/acc_security/service/__init__.py @@ -323,14 +323,14 @@ def __init__(self, version, payload, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'name': payload['name'], - 'code_length': deserialize.integer(payload['code_length']), - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], - 'links': payload['links'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'name': payload.get('name'), + 'code_length': deserialize.integer(payload.get('code_length')), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/preview/acc_security/service/verification.py b/twilio/rest/preview/acc_security/service/verification.py index aa605bc96e..e7b9fa14ac 100644 --- a/twilio/rest/preview/acc_security/service/verification.py +++ b/twilio/rest/preview/acc_security/service/verification.py @@ -127,15 +127,15 @@ def __init__(self, version, payload, service_sid): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'service_sid': payload['service_sid'], - 'account_sid': payload['account_sid'], - 'to': payload['to'], - 'channel': payload['channel'], - 'status': payload['status'], - 'valid': payload['valid'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), + 'sid': payload.get('sid'), + 'service_sid': payload.get('service_sid'), + 'account_sid': payload.get('account_sid'), + 'to': payload.get('to'), + 'channel': payload.get('channel'), + 'status': payload.get('status'), + 'valid': payload.get('valid'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), } # Context diff --git a/twilio/rest/preview/acc_security/service/verification_check.py b/twilio/rest/preview/acc_security/service/verification_check.py index 587344b82a..99ae6be1d7 100644 --- a/twilio/rest/preview/acc_security/service/verification_check.py +++ b/twilio/rest/preview/acc_security/service/verification_check.py @@ -126,15 +126,15 @@ def __init__(self, version, payload, service_sid): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'service_sid': payload['service_sid'], - 'account_sid': payload['account_sid'], - 'to': payload['to'], - 'channel': payload['channel'], - 'status': payload['status'], - 'valid': payload['valid'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), + 'sid': payload.get('sid'), + 'service_sid': payload.get('service_sid'), + 'account_sid': payload.get('account_sid'), + 'to': payload.get('to'), + 'channel': payload.get('channel'), + 'status': payload.get('status'), + 'valid': payload.get('valid'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), } # Context diff --git a/twilio/rest/preview/bulk_exports/export/__init__.py b/twilio/rest/preview/bulk_exports/export/__init__.py index f485cbc0ca..5c19575489 100644 --- a/twilio/rest/preview/bulk_exports/export/__init__.py +++ b/twilio/rest/preview/bulk_exports/export/__init__.py @@ -186,9 +186,9 @@ def __init__(self, version, payload, resource_type=None): # Marshaled Properties self._properties = { - 'resource_type': payload['resource_type'], - 'url': payload['url'], - 'links': payload['links'], + 'resource_type': payload.get('resource_type'), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/preview/bulk_exports/export_configuration.py b/twilio/rest/preview/bulk_exports/export_configuration.py index 5a4d5e5054..cf1073d2a8 100644 --- a/twilio/rest/preview/bulk_exports/export_configuration.py +++ b/twilio/rest/preview/bulk_exports/export_configuration.py @@ -200,11 +200,11 @@ def __init__(self, version, payload, resource_type=None): # Marshaled Properties self._properties = { - 'enabled': payload['enabled'], - 'webhook_url': payload['webhook_url'], - 'webhook_method': payload['webhook_method'], - 'resource_type': payload['resource_type'], - 'url': payload['url'], + 'enabled': payload.get('enabled'), + 'webhook_url': payload.get('webhook_url'), + 'webhook_method': payload.get('webhook_method'), + 'resource_type': payload.get('resource_type'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/preview/deployed_devices/fleet/__init__.py b/twilio/rest/preview/deployed_devices/fleet/__init__.py index 69e9905777..74abd8a0a8 100644 --- a/twilio/rest/preview/deployed_devices/fleet/__init__.py +++ b/twilio/rest/preview/deployed_devices/fleet/__init__.py @@ -360,15 +360,15 @@ def __init__(self, version, payload, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'url': payload['url'], - 'unique_name': payload['unique_name'], - 'friendly_name': payload['friendly_name'], - 'account_sid': payload['account_sid'], - 'default_deployment_sid': payload['default_deployment_sid'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'links': payload['links'], + 'sid': payload.get('sid'), + 'url': payload.get('url'), + 'unique_name': payload.get('unique_name'), + 'friendly_name': payload.get('friendly_name'), + 'account_sid': payload.get('account_sid'), + 'default_deployment_sid': payload.get('default_deployment_sid'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/preview/deployed_devices/fleet/certificate.py b/twilio/rest/preview/deployed_devices/fleet/certificate.py index 23aaba6aae..84946b70a1 100644 --- a/twilio/rest/preview/deployed_devices/fleet/certificate.py +++ b/twilio/rest/preview/deployed_devices/fleet/certificate.py @@ -329,15 +329,15 @@ def __init__(self, version, payload, fleet_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'url': payload['url'], - 'friendly_name': payload['friendly_name'], - 'fleet_sid': payload['fleet_sid'], - 'account_sid': payload['account_sid'], - 'device_sid': payload['device_sid'], - 'thumbprint': payload['thumbprint'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), + 'sid': payload.get('sid'), + 'url': payload.get('url'), + 'friendly_name': payload.get('friendly_name'), + 'fleet_sid': payload.get('fleet_sid'), + 'account_sid': payload.get('account_sid'), + 'device_sid': payload.get('device_sid'), + 'thumbprint': payload.get('thumbprint'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), } # Context diff --git a/twilio/rest/preview/deployed_devices/fleet/deployment.py b/twilio/rest/preview/deployed_devices/fleet/deployment.py index 2de002eac0..e5dfbeeb13 100644 --- a/twilio/rest/preview/deployed_devices/fleet/deployment.py +++ b/twilio/rest/preview/deployed_devices/fleet/deployment.py @@ -315,14 +315,14 @@ def __init__(self, version, payload, fleet_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'url': payload['url'], - 'friendly_name': payload['friendly_name'], - 'fleet_sid': payload['fleet_sid'], - 'account_sid': payload['account_sid'], - 'sync_service_sid': payload['sync_service_sid'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), + 'sid': payload.get('sid'), + 'url': payload.get('url'), + 'friendly_name': payload.get('friendly_name'), + 'fleet_sid': payload.get('fleet_sid'), + 'account_sid': payload.get('account_sid'), + 'sync_service_sid': payload.get('sync_service_sid'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), } # Context diff --git a/twilio/rest/preview/deployed_devices/fleet/device.py b/twilio/rest/preview/deployed_devices/fleet/device.py index 3e40d1a23e..dd85dd04fb 100644 --- a/twilio/rest/preview/deployed_devices/fleet/device.py +++ b/twilio/rest/preview/deployed_devices/fleet/device.py @@ -342,18 +342,18 @@ def __init__(self, version, payload, fleet_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'url': payload['url'], - 'unique_name': payload['unique_name'], - 'friendly_name': payload['friendly_name'], - 'fleet_sid': payload['fleet_sid'], - 'enabled': payload['enabled'], - 'account_sid': payload['account_sid'], - 'identity': payload['identity'], - 'deployment_sid': payload['deployment_sid'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'date_authenticated': deserialize.iso8601_datetime(payload['date_authenticated']), + 'sid': payload.get('sid'), + 'url': payload.get('url'), + 'unique_name': payload.get('unique_name'), + 'friendly_name': payload.get('friendly_name'), + 'fleet_sid': payload.get('fleet_sid'), + 'enabled': payload.get('enabled'), + 'account_sid': payload.get('account_sid'), + 'identity': payload.get('identity'), + 'deployment_sid': payload.get('deployment_sid'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'date_authenticated': deserialize.iso8601_datetime(payload.get('date_authenticated')), } # Context diff --git a/twilio/rest/preview/deployed_devices/fleet/key.py b/twilio/rest/preview/deployed_devices/fleet/key.py index 1c8c495573..609afcca52 100644 --- a/twilio/rest/preview/deployed_devices/fleet/key.py +++ b/twilio/rest/preview/deployed_devices/fleet/key.py @@ -323,15 +323,15 @@ def __init__(self, version, payload, fleet_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'url': payload['url'], - 'friendly_name': payload['friendly_name'], - 'fleet_sid': payload['fleet_sid'], - 'account_sid': payload['account_sid'], - 'device_sid': payload['device_sid'], - 'secret': payload['secret'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), + 'sid': payload.get('sid'), + 'url': payload.get('url'), + 'friendly_name': payload.get('friendly_name'), + 'fleet_sid': payload.get('fleet_sid'), + 'account_sid': payload.get('account_sid'), + 'device_sid': payload.get('device_sid'), + 'secret': payload.get('secret'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), } # Context diff --git a/twilio/rest/preview/hosted_numbers/authorization_document/__init__.py b/twilio/rest/preview/hosted_numbers/authorization_document/__init__.py index fb834402a9..8a73707f77 100644 --- a/twilio/rest/preview/hosted_numbers/authorization_document/__init__.py +++ b/twilio/rest/preview/hosted_numbers/authorization_document/__init__.py @@ -362,15 +362,15 @@ def __init__(self, version, payload, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'address_sid': payload['address_sid'], - 'status': payload['status'], - 'email': payload['email'], - 'cc_emails': payload['cc_emails'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], - 'links': payload['links'], + 'sid': payload.get('sid'), + 'address_sid': payload.get('address_sid'), + 'status': payload.get('status'), + 'email': payload.get('email'), + 'cc_emails': payload.get('cc_emails'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/preview/hosted_numbers/authorization_document/dependent_hosted_number_order.py b/twilio/rest/preview/hosted_numbers/authorization_document/dependent_hosted_number_order.py index 8c8cd4120e..568bdcb041 100644 --- a/twilio/rest/preview/hosted_numbers/authorization_document/dependent_hosted_number_order.py +++ b/twilio/rest/preview/hosted_numbers/authorization_document/dependent_hosted_number_order.py @@ -247,28 +247,28 @@ def __init__(self, version, payload, signing_document_sid): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'incoming_phone_number_sid': payload['incoming_phone_number_sid'], - 'address_sid': payload['address_sid'], - 'signing_document_sid': payload['signing_document_sid'], - 'phone_number': payload['phone_number'], - 'capabilities': payload['capabilities'], - 'friendly_name': payload['friendly_name'], - 'unique_name': payload['unique_name'], - 'status': payload['status'], - 'failure_reason': payload['failure_reason'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'verification_attempts': deserialize.integer(payload['verification_attempts']), - 'email': payload['email'], - 'cc_emails': payload['cc_emails'], - 'verification_type': payload['verification_type'], - 'verification_document_sid': payload['verification_document_sid'], - 'extension': payload['extension'], - 'call_delay': deserialize.integer(payload['call_delay']), - 'verification_code': payload['verification_code'], - 'verification_call_sids': payload['verification_call_sids'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'incoming_phone_number_sid': payload.get('incoming_phone_number_sid'), + 'address_sid': payload.get('address_sid'), + 'signing_document_sid': payload.get('signing_document_sid'), + 'phone_number': payload.get('phone_number'), + 'capabilities': payload.get('capabilities'), + 'friendly_name': payload.get('friendly_name'), + 'unique_name': payload.get('unique_name'), + 'status': payload.get('status'), + 'failure_reason': payload.get('failure_reason'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'verification_attempts': deserialize.integer(payload.get('verification_attempts')), + 'email': payload.get('email'), + 'cc_emails': payload.get('cc_emails'), + 'verification_type': payload.get('verification_type'), + 'verification_document_sid': payload.get('verification_document_sid'), + 'extension': payload.get('extension'), + 'call_delay': deserialize.integer(payload.get('call_delay')), + 'verification_code': payload.get('verification_code'), + 'verification_call_sids': payload.get('verification_call_sids'), } # Context diff --git a/twilio/rest/preview/hosted_numbers/hosted_number_order.py b/twilio/rest/preview/hosted_numbers/hosted_number_order.py index 389d6319d9..06ce9a0dd8 100644 --- a/twilio/rest/preview/hosted_numbers/hosted_number_order.py +++ b/twilio/rest/preview/hosted_numbers/hosted_number_order.py @@ -427,29 +427,29 @@ def __init__(self, version, payload, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'incoming_phone_number_sid': payload['incoming_phone_number_sid'], - 'address_sid': payload['address_sid'], - 'signing_document_sid': payload['signing_document_sid'], - 'phone_number': payload['phone_number'], - 'capabilities': payload['capabilities'], - 'friendly_name': payload['friendly_name'], - 'unique_name': payload['unique_name'], - 'status': payload['status'], - 'failure_reason': payload['failure_reason'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'verification_attempts': deserialize.integer(payload['verification_attempts']), - 'email': payload['email'], - 'cc_emails': payload['cc_emails'], - 'url': payload['url'], - 'verification_type': payload['verification_type'], - 'verification_document_sid': payload['verification_document_sid'], - 'extension': payload['extension'], - 'call_delay': deserialize.integer(payload['call_delay']), - 'verification_code': payload['verification_code'], - 'verification_call_sids': payload['verification_call_sids'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'incoming_phone_number_sid': payload.get('incoming_phone_number_sid'), + 'address_sid': payload.get('address_sid'), + 'signing_document_sid': payload.get('signing_document_sid'), + 'phone_number': payload.get('phone_number'), + 'capabilities': payload.get('capabilities'), + 'friendly_name': payload.get('friendly_name'), + 'unique_name': payload.get('unique_name'), + 'status': payload.get('status'), + 'failure_reason': payload.get('failure_reason'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'verification_attempts': deserialize.integer(payload.get('verification_attempts')), + 'email': payload.get('email'), + 'cc_emails': payload.get('cc_emails'), + 'url': payload.get('url'), + 'verification_type': payload.get('verification_type'), + 'verification_document_sid': payload.get('verification_document_sid'), + 'extension': payload.get('extension'), + 'call_delay': deserialize.integer(payload.get('call_delay')), + 'verification_code': payload.get('verification_code'), + 'verification_call_sids': payload.get('verification_call_sids'), } # Context diff --git a/twilio/rest/preview/marketplace/available_add_on/__init__.py b/twilio/rest/preview/marketplace/available_add_on/__init__.py index 676c1b5b3f..6d5fb93a9e 100644 --- a/twilio/rest/preview/marketplace/available_add_on/__init__.py +++ b/twilio/rest/preview/marketplace/available_add_on/__init__.py @@ -271,13 +271,13 @@ def __init__(self, version, payload, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'friendly_name': payload['friendly_name'], - 'description': payload['description'], - 'pricing_type': payload['pricing_type'], - 'configuration_schema': payload['configuration_schema'], - 'url': payload['url'], - 'links': payload['links'], + 'sid': payload.get('sid'), + 'friendly_name': payload.get('friendly_name'), + 'description': payload.get('description'), + 'pricing_type': payload.get('pricing_type'), + 'configuration_schema': payload.get('configuration_schema'), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/preview/marketplace/available_add_on/available_add_on_extension.py b/twilio/rest/preview/marketplace/available_add_on/available_add_on_extension.py index 3ac85d9e76..ade77fc226 100644 --- a/twilio/rest/preview/marketplace/available_add_on/available_add_on_extension.py +++ b/twilio/rest/preview/marketplace/available_add_on/available_add_on_extension.py @@ -272,12 +272,12 @@ def __init__(self, version, payload, available_add_on_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'available_add_on_sid': payload['available_add_on_sid'], - 'friendly_name': payload['friendly_name'], - 'product_name': payload['product_name'], - 'unique_name': payload['unique_name'], - 'url': payload['url'], + 'sid': payload.get('sid'), + 'available_add_on_sid': payload.get('available_add_on_sid'), + 'friendly_name': payload.get('friendly_name'), + 'product_name': payload.get('product_name'), + 'unique_name': payload.get('unique_name'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/preview/marketplace/installed_add_on/__init__.py b/twilio/rest/preview/marketplace/installed_add_on/__init__.py index 8ef533b653..825946e293 100644 --- a/twilio/rest/preview/marketplace/installed_add_on/__init__.py +++ b/twilio/rest/preview/marketplace/installed_add_on/__init__.py @@ -330,16 +330,16 @@ def __init__(self, version, payload, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'friendly_name': payload['friendly_name'], - 'description': payload['description'], - 'configuration': payload['configuration'], - 'unique_name': payload['unique_name'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], - 'links': payload['links'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'friendly_name': payload.get('friendly_name'), + 'description': payload.get('description'), + 'configuration': payload.get('configuration'), + 'unique_name': payload.get('unique_name'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/preview/marketplace/installed_add_on/installed_add_on_extension.py b/twilio/rest/preview/marketplace/installed_add_on/installed_add_on_extension.py index c80bc75bca..1a9dc5b04e 100644 --- a/twilio/rest/preview/marketplace/installed_add_on/installed_add_on_extension.py +++ b/twilio/rest/preview/marketplace/installed_add_on/installed_add_on_extension.py @@ -296,13 +296,13 @@ def __init__(self, version, payload, installed_add_on_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'installed_add_on_sid': payload['installed_add_on_sid'], - 'friendly_name': payload['friendly_name'], - 'product_name': payload['product_name'], - 'unique_name': payload['unique_name'], - 'enabled': payload['enabled'], - 'url': payload['url'], + 'sid': payload.get('sid'), + 'installed_add_on_sid': payload.get('installed_add_on_sid'), + 'friendly_name': payload.get('friendly_name'), + 'product_name': payload.get('product_name'), + 'unique_name': payload.get('unique_name'), + 'enabled': payload.get('enabled'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/preview/sync/service/__init__.py b/twilio/rest/preview/sync/service/__init__.py index 04250d5ebf..ea24575a64 100644 --- a/twilio/rest/preview/sync/service/__init__.py +++ b/twilio/rest/preview/sync/service/__init__.py @@ -364,16 +364,16 @@ def __init__(self, version, payload, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'friendly_name': payload['friendly_name'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], - 'webhook_url': payload['webhook_url'], - 'reachability_webhooks_enabled': payload['reachability_webhooks_enabled'], - 'acl_enabled': payload['acl_enabled'], - 'links': payload['links'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'friendly_name': payload.get('friendly_name'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), + 'webhook_url': payload.get('webhook_url'), + 'reachability_webhooks_enabled': payload.get('reachability_webhooks_enabled'), + 'acl_enabled': payload.get('acl_enabled'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/preview/sync/service/document/__init__.py b/twilio/rest/preview/sync/service/document/__init__.py index c745cb7c21..ec7b6e9b09 100644 --- a/twilio/rest/preview/sync/service/document/__init__.py +++ b/twilio/rest/preview/sync/service/document/__init__.py @@ -335,17 +335,17 @@ def __init__(self, version, payload, service_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'unique_name': payload['unique_name'], - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'url': payload['url'], - 'links': payload['links'], - 'revision': payload['revision'], - 'data': payload['data'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'created_by': payload['created_by'], + 'sid': payload.get('sid'), + 'unique_name': payload.get('unique_name'), + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'url': payload.get('url'), + 'links': payload.get('links'), + 'revision': payload.get('revision'), + 'data': payload.get('data'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'created_by': payload.get('created_by'), } # Context diff --git a/twilio/rest/preview/sync/service/document/document_permission.py b/twilio/rest/preview/sync/service/document/document_permission.py index b52f67a523..ba0c690701 100644 --- a/twilio/rest/preview/sync/service/document/document_permission.py +++ b/twilio/rest/preview/sync/service/document/document_permission.py @@ -315,14 +315,14 @@ def __init__(self, version, payload, service_sid, document_sid, identity=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'document_sid': payload['document_sid'], - 'identity': payload['identity'], - 'read': payload['read'], - 'write': payload['write'], - 'manage': payload['manage'], - 'url': payload['url'], + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'document_sid': payload.get('document_sid'), + 'identity': payload.get('identity'), + 'read': payload.get('read'), + 'write': payload.get('write'), + 'manage': payload.get('manage'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/preview/sync/service/sync_list/__init__.py b/twilio/rest/preview/sync/service/sync_list/__init__.py index a4602c2b3d..f46dda0a1f 100644 --- a/twilio/rest/preview/sync/service/sync_list/__init__.py +++ b/twilio/rest/preview/sync/service/sync_list/__init__.py @@ -327,16 +327,16 @@ def __init__(self, version, payload, service_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'unique_name': payload['unique_name'], - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'url': payload['url'], - 'links': payload['links'], - 'revision': payload['revision'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'created_by': payload['created_by'], + 'sid': payload.get('sid'), + 'unique_name': payload.get('unique_name'), + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'url': payload.get('url'), + 'links': payload.get('links'), + 'revision': payload.get('revision'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'created_by': payload.get('created_by'), } # Context 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 231d91cc03..9387a95883 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 @@ -366,16 +366,16 @@ def __init__(self, version, payload, service_sid, list_sid, index=None): # Marshaled Properties self._properties = { - 'index': deserialize.integer(payload['index']), - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'list_sid': payload['list_sid'], - 'url': payload['url'], - 'revision': payload['revision'], - 'data': payload['data'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'created_by': payload['created_by'], + 'index': deserialize.integer(payload.get('index')), + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'list_sid': payload.get('list_sid'), + 'url': payload.get('url'), + 'revision': payload.get('revision'), + 'data': payload.get('data'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'created_by': payload.get('created_by'), } # Context diff --git a/twilio/rest/preview/sync/service/sync_list/sync_list_permission.py b/twilio/rest/preview/sync/service/sync_list/sync_list_permission.py index d02f17abdd..6258ca6079 100644 --- a/twilio/rest/preview/sync/service/sync_list/sync_list_permission.py +++ b/twilio/rest/preview/sync/service/sync_list/sync_list_permission.py @@ -315,14 +315,14 @@ def __init__(self, version, payload, service_sid, list_sid, identity=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'list_sid': payload['list_sid'], - 'identity': payload['identity'], - 'read': payload['read'], - 'write': payload['write'], - 'manage': payload['manage'], - 'url': payload['url'], + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'list_sid': payload.get('list_sid'), + 'identity': payload.get('identity'), + 'read': payload.get('read'), + 'write': payload.get('write'), + 'manage': payload.get('manage'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/preview/sync/service/sync_map/__init__.py b/twilio/rest/preview/sync/service/sync_map/__init__.py index 0cb792ec46..5b1e030bdd 100644 --- a/twilio/rest/preview/sync/service/sync_map/__init__.py +++ b/twilio/rest/preview/sync/service/sync_map/__init__.py @@ -327,16 +327,16 @@ def __init__(self, version, payload, service_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'unique_name': payload['unique_name'], - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'url': payload['url'], - 'links': payload['links'], - 'revision': payload['revision'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'created_by': payload['created_by'], + 'sid': payload.get('sid'), + 'unique_name': payload.get('unique_name'), + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'url': payload.get('url'), + 'links': payload.get('links'), + 'revision': payload.get('revision'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'created_by': payload.get('created_by'), } # Context 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 5bed36e23b..c7b293a251 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 @@ -367,16 +367,16 @@ def __init__(self, version, payload, service_sid, map_sid, key=None): # Marshaled Properties self._properties = { - 'key': payload['key'], - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'map_sid': payload['map_sid'], - 'url': payload['url'], - 'revision': payload['revision'], - 'data': payload['data'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'created_by': payload['created_by'], + 'key': payload.get('key'), + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'map_sid': payload.get('map_sid'), + 'url': payload.get('url'), + 'revision': payload.get('revision'), + 'data': payload.get('data'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'created_by': payload.get('created_by'), } # Context diff --git a/twilio/rest/preview/sync/service/sync_map/sync_map_permission.py b/twilio/rest/preview/sync/service/sync_map/sync_map_permission.py index fa4e21aba5..0ada16baed 100644 --- a/twilio/rest/preview/sync/service/sync_map/sync_map_permission.py +++ b/twilio/rest/preview/sync/service/sync_map/sync_map_permission.py @@ -315,14 +315,14 @@ def __init__(self, version, payload, service_sid, map_sid, identity=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'map_sid': payload['map_sid'], - 'identity': payload['identity'], - 'read': payload['read'], - 'write': payload['write'], - 'manage': payload['manage'], - 'url': payload['url'], + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'map_sid': payload.get('map_sid'), + 'identity': payload.get('identity'), + 'read': payload.get('read'), + 'write': payload.get('write'), + 'manage': payload.get('manage'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/preview/trusted_comms/branded_call.py b/twilio/rest/preview/trusted_comms/branded_call.py index 3467b54960..32e29c4bbd 100644 --- a/twilio/rest/preview/trusted_comms/branded_call.py +++ b/twilio/rest/preview/trusted_comms/branded_call.py @@ -122,19 +122,19 @@ def __init__(self, version, payload): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'bg_color': payload['bg_color'], - 'caller': payload['caller'], - 'created_at': deserialize.iso8601_datetime(payload['created_at']), - 'font_color': payload['font_color'], - 'from_': payload['from'], - 'logo': payload['logo'], - 'reason': payload['reason'], - 'sid': payload['sid'], - 'status': payload['status'], - 'to': payload['to'], - 'url': payload['url'], - 'use_case': payload['use_case'], + 'account_sid': payload.get('account_sid'), + 'bg_color': payload.get('bg_color'), + 'caller': payload.get('caller'), + 'created_at': deserialize.iso8601_datetime(payload.get('created_at')), + 'font_color': payload.get('font_color'), + 'from_': payload.get('from'), + 'logo': payload.get('logo'), + 'reason': payload.get('reason'), + 'sid': payload.get('sid'), + 'status': payload.get('status'), + 'to': payload.get('to'), + 'url': payload.get('url'), + 'use_case': payload.get('use_case'), } # Context diff --git a/twilio/rest/preview/trusted_comms/cps.py b/twilio/rest/preview/trusted_comms/cps.py index 52b384d0cd..381e2eb0c6 100644 --- a/twilio/rest/preview/trusted_comms/cps.py +++ b/twilio/rest/preview/trusted_comms/cps.py @@ -165,9 +165,9 @@ def __init__(self, version, payload): # Marshaled Properties self._properties = { - 'phone_number': payload['phone_number'], - 'cps_url': payload['cps_url'], - 'url': payload['url'], + 'phone_number': payload.get('phone_number'), + 'cps_url': payload.get('cps_url'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/preview/trusted_comms/current_call.py b/twilio/rest/preview/trusted_comms/current_call.py index 905e0c14d2..b47682680b 100644 --- a/twilio/rest/preview/trusted_comms/current_call.py +++ b/twilio/rest/preview/trusted_comms/current_call.py @@ -166,20 +166,20 @@ def __init__(self, version, payload): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'from_': payload['from'], - 'to': payload['to'], - 'status': payload['status'], - 'reason': payload['reason'], - 'created_at': deserialize.iso8601_datetime(payload['created_at']), - 'caller': payload['caller'], - 'logo': payload['logo'], - 'bg_color': payload['bg_color'], - 'font_color': payload['font_color'], - 'use_case': payload['use_case'], - 'manager': payload['manager'], - 'shield_img': payload['shield_img'], - 'url': payload['url'], + 'sid': payload.get('sid'), + 'from_': payload.get('from'), + 'to': payload.get('to'), + 'status': payload.get('status'), + 'reason': payload.get('reason'), + 'created_at': deserialize.iso8601_datetime(payload.get('created_at')), + 'caller': payload.get('caller'), + 'logo': payload.get('logo'), + 'bg_color': payload.get('bg_color'), + 'font_color': payload.get('font_color'), + 'use_case': payload.get('use_case'), + 'manager': payload.get('manager'), + 'shield_img': payload.get('shield_img'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/preview/trusted_comms/device.py b/twilio/rest/preview/trusted_comms/device.py index 68226561b1..1480e58561 100644 --- a/twilio/rest/preview/trusted_comms/device.py +++ b/twilio/rest/preview/trusted_comms/device.py @@ -119,10 +119,10 @@ def __init__(self, version, payload): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'phone_number': payload['phone_number'], - 'binding_sid': payload['binding_sid'], - 'url': payload['url'], + 'sid': payload.get('sid'), + 'phone_number': payload.get('phone_number'), + 'binding_sid': payload.get('binding_sid'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/preview/trusted_comms/phone_call.py b/twilio/rest/preview/trusted_comms/phone_call.py index 7e935ed8ef..322780091a 100644 --- a/twilio/rest/preview/trusted_comms/phone_call.py +++ b/twilio/rest/preview/trusted_comms/phone_call.py @@ -189,13 +189,13 @@ def __init__(self, version, payload): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'from_': payload['from'], - 'to': payload['to'], - 'reason': payload['reason'], - 'created_at': deserialize.iso8601_datetime(payload['created_at']), - 'url': payload['url'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'from_': payload.get('from'), + 'to': payload.get('to'), + 'reason': payload.get('reason'), + 'created_at': deserialize.iso8601_datetime(payload.get('created_at')), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/preview/understand/assistant/__init__.py b/twilio/rest/preview/understand/assistant/__init__.py index eb08f67efa..dab7bd15a2 100644 --- a/twilio/rest/preview/understand/assistant/__init__.py +++ b/twilio/rest/preview/understand/assistant/__init__.py @@ -459,18 +459,18 @@ def __init__(self, version, payload, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'friendly_name': payload['friendly_name'], - 'latest_model_build_sid': payload['latest_model_build_sid'], - 'links': payload['links'], - 'log_queries': payload['log_queries'], - 'sid': payload['sid'], - 'unique_name': payload['unique_name'], - 'url': payload['url'], - 'callback_url': payload['callback_url'], - 'callback_events': payload['callback_events'], + 'account_sid': payload.get('account_sid'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'friendly_name': payload.get('friendly_name'), + 'latest_model_build_sid': payload.get('latest_model_build_sid'), + 'links': payload.get('links'), + 'log_queries': payload.get('log_queries'), + 'sid': payload.get('sid'), + 'unique_name': payload.get('unique_name'), + 'url': payload.get('url'), + 'callback_url': payload.get('callback_url'), + 'callback_events': payload.get('callback_events'), } # Context diff --git a/twilio/rest/preview/understand/assistant/assistant_fallback_actions.py b/twilio/rest/preview/understand/assistant/assistant_fallback_actions.py index 85037e8393..5d27f666dd 100644 --- a/twilio/rest/preview/understand/assistant/assistant_fallback_actions.py +++ b/twilio/rest/preview/understand/assistant/assistant_fallback_actions.py @@ -200,10 +200,10 @@ def __init__(self, version, payload, assistant_sid): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'assistant_sid': payload['assistant_sid'], - 'url': payload['url'], - 'data': payload['data'], + 'account_sid': payload.get('account_sid'), + 'assistant_sid': payload.get('assistant_sid'), + 'url': payload.get('url'), + 'data': payload.get('data'), } # Context diff --git a/twilio/rest/preview/understand/assistant/assistant_initiation_actions.py b/twilio/rest/preview/understand/assistant/assistant_initiation_actions.py index 1e7e67709d..21ca9c33b1 100644 --- a/twilio/rest/preview/understand/assistant/assistant_initiation_actions.py +++ b/twilio/rest/preview/understand/assistant/assistant_initiation_actions.py @@ -206,10 +206,10 @@ def __init__(self, version, payload, assistant_sid): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'assistant_sid': payload['assistant_sid'], - 'url': payload['url'], - 'data': payload['data'], + 'account_sid': payload.get('account_sid'), + 'assistant_sid': payload.get('assistant_sid'), + 'url': payload.get('url'), + 'data': payload.get('data'), } # Context diff --git a/twilio/rest/preview/understand/assistant/dialogue.py b/twilio/rest/preview/understand/assistant/dialogue.py index dc05fd132a..a614456acb 100644 --- a/twilio/rest/preview/understand/assistant/dialogue.py +++ b/twilio/rest/preview/understand/assistant/dialogue.py @@ -178,11 +178,11 @@ def __init__(self, version, payload, assistant_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'assistant_sid': payload['assistant_sid'], - 'sid': payload['sid'], - 'data': payload['data'], - 'url': payload['url'], + 'account_sid': payload.get('account_sid'), + 'assistant_sid': payload.get('assistant_sid'), + 'sid': payload.get('sid'), + 'data': payload.get('data'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/preview/understand/assistant/field_type/__init__.py b/twilio/rest/preview/understand/assistant/field_type/__init__.py index cc6238c4ac..991eca43f9 100644 --- a/twilio/rest/preview/understand/assistant/field_type/__init__.py +++ b/twilio/rest/preview/understand/assistant/field_type/__init__.py @@ -335,15 +335,15 @@ def __init__(self, version, payload, assistant_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'friendly_name': payload['friendly_name'], - 'links': payload['links'], - 'assistant_sid': payload['assistant_sid'], - 'sid': payload['sid'], - 'unique_name': payload['unique_name'], - 'url': payload['url'], + 'account_sid': payload.get('account_sid'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'friendly_name': payload.get('friendly_name'), + 'links': payload.get('links'), + 'assistant_sid': payload.get('assistant_sid'), + 'sid': payload.get('sid'), + 'unique_name': payload.get('unique_name'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/preview/understand/assistant/field_type/field_value.py b/twilio/rest/preview/understand/assistant/field_type/field_value.py index fa60c2117b..a7a0b1bd02 100644 --- a/twilio/rest/preview/understand/assistant/field_type/field_value.py +++ b/twilio/rest/preview/understand/assistant/field_type/field_value.py @@ -323,16 +323,16 @@ def __init__(self, version, payload, assistant_sid, field_type_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'field_type_sid': payload['field_type_sid'], - 'language': payload['language'], - 'assistant_sid': payload['assistant_sid'], - 'sid': payload['sid'], - 'value': payload['value'], - 'url': payload['url'], - 'synonym_of': payload['synonym_of'], + 'account_sid': payload.get('account_sid'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'field_type_sid': payload.get('field_type_sid'), + 'language': payload.get('language'), + 'assistant_sid': payload.get('assistant_sid'), + 'sid': payload.get('sid'), + 'value': payload.get('value'), + 'url': payload.get('url'), + 'synonym_of': payload.get('synonym_of'), } # Context diff --git a/twilio/rest/preview/understand/assistant/model_build.py b/twilio/rest/preview/understand/assistant/model_build.py index 0fcf167b77..9f6fdabe7f 100644 --- a/twilio/rest/preview/understand/assistant/model_build.py +++ b/twilio/rest/preview/understand/assistant/model_build.py @@ -321,16 +321,16 @@ def __init__(self, version, payload, assistant_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'assistant_sid': payload['assistant_sid'], - 'sid': payload['sid'], - 'status': payload['status'], - 'unique_name': payload['unique_name'], - 'url': payload['url'], - 'build_duration': deserialize.integer(payload['build_duration']), - 'error_code': deserialize.integer(payload['error_code']), + 'account_sid': payload.get('account_sid'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'assistant_sid': payload.get('assistant_sid'), + 'sid': payload.get('sid'), + 'status': payload.get('status'), + 'unique_name': payload.get('unique_name'), + 'url': payload.get('url'), + 'build_duration': deserialize.integer(payload.get('build_duration')), + 'error_code': deserialize.integer(payload.get('error_code')), } # Context diff --git a/twilio/rest/preview/understand/assistant/query.py b/twilio/rest/preview/understand/assistant/query.py index cbc2e4ce71..253700b34f 100644 --- a/twilio/rest/preview/understand/assistant/query.py +++ b/twilio/rest/preview/understand/assistant/query.py @@ -355,19 +355,19 @@ def __init__(self, version, payload, assistant_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'results': payload['results'], - 'language': payload['language'], - 'model_build_sid': payload['model_build_sid'], - 'query': payload['query'], - 'sample_sid': payload['sample_sid'], - 'assistant_sid': payload['assistant_sid'], - 'sid': payload['sid'], - 'status': payload['status'], - 'url': payload['url'], - 'source_channel': payload['source_channel'], + 'account_sid': payload.get('account_sid'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'results': payload.get('results'), + 'language': payload.get('language'), + 'model_build_sid': payload.get('model_build_sid'), + 'query': payload.get('query'), + 'sample_sid': payload.get('sample_sid'), + 'assistant_sid': payload.get('assistant_sid'), + 'sid': payload.get('sid'), + 'status': payload.get('status'), + 'url': payload.get('url'), + 'source_channel': payload.get('source_channel'), } # Context diff --git a/twilio/rest/preview/understand/assistant/style_sheet.py b/twilio/rest/preview/understand/assistant/style_sheet.py index 360fc5decc..c5c3979d1f 100644 --- a/twilio/rest/preview/understand/assistant/style_sheet.py +++ b/twilio/rest/preview/understand/assistant/style_sheet.py @@ -188,10 +188,10 @@ def __init__(self, version, payload, assistant_sid): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'assistant_sid': payload['assistant_sid'], - 'url': payload['url'], - 'data': payload['data'], + 'account_sid': payload.get('account_sid'), + 'assistant_sid': payload.get('assistant_sid'), + 'url': payload.get('url'), + 'data': payload.get('data'), } # Context diff --git a/twilio/rest/preview/understand/assistant/task/__init__.py b/twilio/rest/preview/understand/assistant/task/__init__.py index a0854257a4..9a767dac7e 100644 --- a/twilio/rest/preview/understand/assistant/task/__init__.py +++ b/twilio/rest/preview/understand/assistant/task/__init__.py @@ -406,16 +406,16 @@ def __init__(self, version, payload, assistant_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'friendly_name': payload['friendly_name'], - 'links': payload['links'], - 'assistant_sid': payload['assistant_sid'], - 'sid': payload['sid'], - 'unique_name': payload['unique_name'], - 'actions_url': payload['actions_url'], - 'url': payload['url'], + 'account_sid': payload.get('account_sid'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'friendly_name': payload.get('friendly_name'), + 'links': payload.get('links'), + 'assistant_sid': payload.get('assistant_sid'), + 'sid': payload.get('sid'), + 'unique_name': payload.get('unique_name'), + 'actions_url': payload.get('actions_url'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/preview/understand/assistant/task/field.py b/twilio/rest/preview/understand/assistant/task/field.py index e3afd3b924..bf03825b9e 100644 --- a/twilio/rest/preview/understand/assistant/task/field.py +++ b/twilio/rest/preview/understand/assistant/task/field.py @@ -314,15 +314,15 @@ def __init__(self, version, payload, assistant_sid, task_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'field_type': payload['field_type'], - 'task_sid': payload['task_sid'], - 'assistant_sid': payload['assistant_sid'], - 'sid': payload['sid'], - 'unique_name': payload['unique_name'], - 'url': payload['url'], + 'account_sid': payload.get('account_sid'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'field_type': payload.get('field_type'), + 'task_sid': payload.get('task_sid'), + 'assistant_sid': payload.get('assistant_sid'), + 'sid': payload.get('sid'), + 'unique_name': payload.get('unique_name'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/preview/understand/assistant/task/sample.py b/twilio/rest/preview/understand/assistant/task/sample.py index 18f87395b7..575ee7a68b 100644 --- a/twilio/rest/preview/understand/assistant/task/sample.py +++ b/twilio/rest/preview/understand/assistant/task/sample.py @@ -351,16 +351,16 @@ def __init__(self, version, payload, assistant_sid, task_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'task_sid': payload['task_sid'], - 'language': payload['language'], - 'assistant_sid': payload['assistant_sid'], - 'sid': payload['sid'], - 'tagged_text': payload['tagged_text'], - 'url': payload['url'], - 'source_channel': payload['source_channel'], + 'account_sid': payload.get('account_sid'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'task_sid': payload.get('task_sid'), + 'language': payload.get('language'), + 'assistant_sid': payload.get('assistant_sid'), + 'sid': payload.get('sid'), + 'tagged_text': payload.get('tagged_text'), + 'url': payload.get('url'), + 'source_channel': payload.get('source_channel'), } # Context diff --git a/twilio/rest/preview/understand/assistant/task/task_actions.py b/twilio/rest/preview/understand/assistant/task/task_actions.py index 2a1099668d..f67975cfce 100644 --- a/twilio/rest/preview/understand/assistant/task/task_actions.py +++ b/twilio/rest/preview/understand/assistant/task/task_actions.py @@ -214,11 +214,11 @@ def __init__(self, version, payload, assistant_sid, task_sid): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'assistant_sid': payload['assistant_sid'], - 'task_sid': payload['task_sid'], - 'url': payload['url'], - 'data': payload['data'], + 'account_sid': payload.get('account_sid'), + 'assistant_sid': payload.get('assistant_sid'), + 'task_sid': payload.get('task_sid'), + 'url': payload.get('url'), + 'data': payload.get('data'), } # Context diff --git a/twilio/rest/preview/understand/assistant/task/task_statistics.py b/twilio/rest/preview/understand/assistant/task/task_statistics.py index 606c1fba0d..7926d1f696 100644 --- a/twilio/rest/preview/understand/assistant/task/task_statistics.py +++ b/twilio/rest/preview/understand/assistant/task/task_statistics.py @@ -190,12 +190,12 @@ def __init__(self, version, payload, assistant_sid, task_sid): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'assistant_sid': payload['assistant_sid'], - 'task_sid': payload['task_sid'], - 'samples_count': deserialize.integer(payload['samples_count']), - 'fields_count': deserialize.integer(payload['fields_count']), - 'url': payload['url'], + 'account_sid': payload.get('account_sid'), + 'assistant_sid': payload.get('assistant_sid'), + 'task_sid': payload.get('task_sid'), + 'samples_count': deserialize.integer(payload.get('samples_count')), + 'fields_count': deserialize.integer(payload.get('fields_count')), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/preview/wireless/command.py b/twilio/rest/preview/wireless/command.py index bd05773439..4ea422af42 100644 --- a/twilio/rest/preview/wireless/command.py +++ b/twilio/rest/preview/wireless/command.py @@ -324,17 +324,17 @@ def __init__(self, version, payload, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'device_sid': payload['device_sid'], - 'sim_sid': payload['sim_sid'], - 'command': payload['command'], - 'command_mode': payload['command_mode'], - 'status': payload['status'], - 'direction': payload['direction'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'device_sid': payload.get('device_sid'), + 'sim_sid': payload.get('sim_sid'), + 'command': payload.get('command'), + 'command_mode': payload.get('command_mode'), + 'status': payload.get('status'), + 'direction': payload.get('direction'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/preview/wireless/rate_plan.py b/twilio/rest/preview/wireless/rate_plan.py index 5a39f5c0bd..6f6cfd627f 100644 --- a/twilio/rest/preview/wireless/rate_plan.py +++ b/twilio/rest/preview/wireless/rate_plan.py @@ -327,20 +327,20 @@ def __init__(self, version, payload, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'unique_name': payload['unique_name'], - 'account_sid': payload['account_sid'], - 'friendly_name': payload['friendly_name'], - 'data_enabled': payload['data_enabled'], - 'data_metering': payload['data_metering'], - 'data_limit': deserialize.integer(payload['data_limit']), - 'messaging_enabled': payload['messaging_enabled'], - 'voice_enabled': payload['voice_enabled'], - 'national_roaming_enabled': payload['national_roaming_enabled'], - 'international_roaming': payload['international_roaming'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], + 'sid': payload.get('sid'), + 'unique_name': payload.get('unique_name'), + 'account_sid': payload.get('account_sid'), + 'friendly_name': payload.get('friendly_name'), + 'data_enabled': payload.get('data_enabled'), + 'data_metering': payload.get('data_metering'), + 'data_limit': deserialize.integer(payload.get('data_limit')), + 'messaging_enabled': payload.get('messaging_enabled'), + 'voice_enabled': payload.get('voice_enabled'), + 'national_roaming_enabled': payload.get('national_roaming_enabled'), + 'international_roaming': payload.get('international_roaming'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/preview/wireless/sim/__init__.py b/twilio/rest/preview/wireless/sim/__init__.py index ff86f4f3e8..64d6f0dc5e 100644 --- a/twilio/rest/preview/wireless/sim/__init__.py +++ b/twilio/rest/preview/wireless/sim/__init__.py @@ -373,28 +373,28 @@ def __init__(self, version, payload, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'unique_name': payload['unique_name'], - 'account_sid': payload['account_sid'], - 'rate_plan_sid': payload['rate_plan_sid'], - 'friendly_name': payload['friendly_name'], - 'iccid': payload['iccid'], - 'e_id': payload['e_id'], - 'status': payload['status'], - 'commands_callback_url': payload['commands_callback_url'], - 'commands_callback_method': payload['commands_callback_method'], - 'sms_fallback_method': payload['sms_fallback_method'], - 'sms_fallback_url': payload['sms_fallback_url'], - 'sms_method': payload['sms_method'], - 'sms_url': payload['sms_url'], - 'voice_fallback_method': payload['voice_fallback_method'], - 'voice_fallback_url': payload['voice_fallback_url'], - 'voice_method': payload['voice_method'], - 'voice_url': payload['voice_url'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], - 'links': payload['links'], + 'sid': payload.get('sid'), + 'unique_name': payload.get('unique_name'), + 'account_sid': payload.get('account_sid'), + 'rate_plan_sid': payload.get('rate_plan_sid'), + 'friendly_name': payload.get('friendly_name'), + 'iccid': payload.get('iccid'), + 'e_id': payload.get('e_id'), + 'status': payload.get('status'), + 'commands_callback_url': payload.get('commands_callback_url'), + 'commands_callback_method': payload.get('commands_callback_method'), + 'sms_fallback_method': payload.get('sms_fallback_method'), + 'sms_fallback_url': payload.get('sms_fallback_url'), + 'sms_method': payload.get('sms_method'), + 'sms_url': payload.get('sms_url'), + 'voice_fallback_method': payload.get('voice_fallback_method'), + 'voice_fallback_url': payload.get('voice_fallback_url'), + 'voice_method': payload.get('voice_method'), + 'voice_url': payload.get('voice_url'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/preview/wireless/sim/usage.py b/twilio/rest/preview/wireless/sim/usage.py index fa16959abd..49ccfeb4f3 100644 --- a/twilio/rest/preview/wireless/sim/usage.py +++ b/twilio/rest/preview/wireless/sim/usage.py @@ -171,15 +171,15 @@ def __init__(self, version, payload, sim_sid): # Marshaled Properties self._properties = { - 'sim_sid': payload['sim_sid'], - 'sim_unique_name': payload['sim_unique_name'], - 'account_sid': payload['account_sid'], - 'period': payload['period'], - 'commands_usage': payload['commands_usage'], - 'commands_costs': payload['commands_costs'], - 'data_usage': payload['data_usage'], - 'data_costs': payload['data_costs'], - 'url': payload['url'], + 'sim_sid': payload.get('sim_sid'), + 'sim_unique_name': payload.get('sim_unique_name'), + 'account_sid': payload.get('account_sid'), + 'period': payload.get('period'), + 'commands_usage': payload.get('commands_usage'), + 'commands_costs': payload.get('commands_costs'), + 'data_usage': payload.get('data_usage'), + 'data_costs': payload.get('data_costs'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/pricing/v1/messaging/__init__.py b/twilio/rest/pricing/v1/messaging/__init__.py index 74e09497bc..f6036dc7e3 100644 --- a/twilio/rest/pricing/v1/messaging/__init__.py +++ b/twilio/rest/pricing/v1/messaging/__init__.py @@ -106,7 +106,11 @@ def __init__(self, version, payload): super(MessagingInstance, self).__init__(version) # Marshaled Properties - self._properties = {'name': payload['name'], 'url': payload['url'], 'links': payload['links'], } + self._properties = { + 'name': payload.get('name'), + 'url': payload.get('url'), + 'links': payload.get('links'), + } # Context self._context = None diff --git a/twilio/rest/pricing/v1/messaging/country.py b/twilio/rest/pricing/v1/messaging/country.py index 49d2bafe9e..35def28932 100644 --- a/twilio/rest/pricing/v1/messaging/country.py +++ b/twilio/rest/pricing/v1/messaging/country.py @@ -244,12 +244,12 @@ def __init__(self, version, payload, iso_country=None): # Marshaled Properties self._properties = { - 'country': payload['country'], - 'iso_country': payload['iso_country'], - 'url': payload['url'], + 'country': payload.get('country'), + 'iso_country': payload.get('iso_country'), 'outbound_sms_prices': payload.get('outbound_sms_prices'), 'inbound_sms_prices': payload.get('inbound_sms_prices'), 'price_unit': payload.get('price_unit'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/pricing/v1/phone_number/__init__.py b/twilio/rest/pricing/v1/phone_number/__init__.py index 929db8281b..787e4d64b2 100644 --- a/twilio/rest/pricing/v1/phone_number/__init__.py +++ b/twilio/rest/pricing/v1/phone_number/__init__.py @@ -106,7 +106,11 @@ def __init__(self, version, payload): super(PhoneNumberInstance, self).__init__(version) # Marshaled Properties - self._properties = {'name': payload['name'], 'url': payload['url'], 'links': payload['links'], } + self._properties = { + 'name': payload.get('name'), + 'url': payload.get('url'), + 'links': payload.get('links'), + } # Context self._context = None diff --git a/twilio/rest/pricing/v1/phone_number/country.py b/twilio/rest/pricing/v1/phone_number/country.py index b4b782694f..261cbef473 100644 --- a/twilio/rest/pricing/v1/phone_number/country.py +++ b/twilio/rest/pricing/v1/phone_number/country.py @@ -244,11 +244,11 @@ def __init__(self, version, payload, iso_country=None): # Marshaled Properties self._properties = { - 'country': payload['country'], - 'iso_country': payload['iso_country'], - 'url': payload['url'], + 'country': payload.get('country'), + 'iso_country': payload.get('iso_country'), 'phone_number_prices': payload.get('phone_number_prices'), 'price_unit': payload.get('price_unit'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/pricing/v1/voice/__init__.py b/twilio/rest/pricing/v1/voice/__init__.py index 67819c9614..68a6222903 100644 --- a/twilio/rest/pricing/v1/voice/__init__.py +++ b/twilio/rest/pricing/v1/voice/__init__.py @@ -120,7 +120,11 @@ def __init__(self, version, payload): super(VoiceInstance, self).__init__(version) # Marshaled Properties - self._properties = {'name': payload['name'], 'url': payload['url'], 'links': payload['links'], } + self._properties = { + 'name': payload.get('name'), + 'url': payload.get('url'), + 'links': payload.get('links'), + } # Context self._context = None diff --git a/twilio/rest/pricing/v1/voice/country.py b/twilio/rest/pricing/v1/voice/country.py index 7531bdd359..b3c15672c9 100644 --- a/twilio/rest/pricing/v1/voice/country.py +++ b/twilio/rest/pricing/v1/voice/country.py @@ -244,12 +244,12 @@ def __init__(self, version, payload, iso_country=None): # Marshaled Properties self._properties = { - 'country': payload['country'], - 'iso_country': payload['iso_country'], - 'url': payload['url'], + 'country': payload.get('country'), + 'iso_country': payload.get('iso_country'), 'outbound_prefix_prices': payload.get('outbound_prefix_prices'), 'inbound_call_prices': payload.get('inbound_call_prices'), 'price_unit': payload.get('price_unit'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/pricing/v1/voice/number.py b/twilio/rest/pricing/v1/voice/number.py index 3cef6ec00e..992cdaeeb0 100644 --- a/twilio/rest/pricing/v1/voice/number.py +++ b/twilio/rest/pricing/v1/voice/number.py @@ -162,13 +162,13 @@ def __init__(self, version, payload, number=None): # Marshaled Properties self._properties = { - 'number': payload['number'], - 'country': payload['country'], - 'iso_country': payload['iso_country'], - 'outbound_call_price': payload['outbound_call_price'], - 'inbound_call_price': payload['inbound_call_price'], - 'price_unit': payload['price_unit'], - 'url': payload['url'], + 'number': payload.get('number'), + 'country': payload.get('country'), + 'iso_country': payload.get('iso_country'), + 'outbound_call_price': payload.get('outbound_call_price'), + 'inbound_call_price': payload.get('inbound_call_price'), + 'price_unit': payload.get('price_unit'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/pricing/v2/voice/__init__.py b/twilio/rest/pricing/v2/voice/__init__.py index 4486bbeafb..3b9b865aef 100644 --- a/twilio/rest/pricing/v2/voice/__init__.py +++ b/twilio/rest/pricing/v2/voice/__init__.py @@ -120,7 +120,11 @@ def __init__(self, version, payload): super(VoiceInstance, self).__init__(version) # Marshaled Properties - self._properties = {'name': payload['name'], 'url': payload['url'], 'links': payload['links'], } + self._properties = { + 'name': payload.get('name'), + 'url': payload.get('url'), + 'links': payload.get('links'), + } # Context self._context = None diff --git a/twilio/rest/pricing/v2/voice/country.py b/twilio/rest/pricing/v2/voice/country.py index 2a2c4998c5..1ee1eb9813 100644 --- a/twilio/rest/pricing/v2/voice/country.py +++ b/twilio/rest/pricing/v2/voice/country.py @@ -244,12 +244,12 @@ def __init__(self, version, payload, iso_country=None): # Marshaled Properties self._properties = { - 'country': payload['country'], - 'iso_country': payload['iso_country'], - 'url': payload['url'], + 'country': payload.get('country'), + 'iso_country': payload.get('iso_country'), 'outbound_prefix_prices': payload.get('outbound_prefix_prices'), 'inbound_call_prices': payload.get('inbound_call_prices'), 'price_unit': payload.get('price_unit'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/pricing/v2/voice/number.py b/twilio/rest/pricing/v2/voice/number.py index 85d7724209..6bc50e0581 100644 --- a/twilio/rest/pricing/v2/voice/number.py +++ b/twilio/rest/pricing/v2/voice/number.py @@ -168,14 +168,14 @@ def __init__(self, version, payload, destination_number=None): # Marshaled Properties self._properties = { - 'destination_number': payload['destination_number'], - 'origination_number': payload['origination_number'], - 'country': payload['country'], - 'iso_country': payload['iso_country'], - 'outbound_call_prices': payload['outbound_call_prices'], - 'inbound_call_price': payload['inbound_call_price'], - 'price_unit': payload['price_unit'], - 'url': payload['url'], + 'destination_number': payload.get('destination_number'), + 'origination_number': payload.get('origination_number'), + 'country': payload.get('country'), + 'iso_country': payload.get('iso_country'), + 'outbound_call_prices': payload.get('outbound_call_prices'), + 'inbound_call_price': payload.get('inbound_call_price'), + 'price_unit': payload.get('price_unit'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/proxy/v1/service/__init__.py b/twilio/rest/proxy/v1/service/__init__.py index 7f8ec2150f..31471c0b8e 100644 --- a/twilio/rest/proxy/v1/service/__init__.py +++ b/twilio/rest/proxy/v1/service/__init__.py @@ -392,20 +392,20 @@ def __init__(self, version, payload, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'unique_name': payload['unique_name'], - 'account_sid': payload['account_sid'], - 'chat_instance_sid': payload['chat_instance_sid'], - 'callback_url': payload['callback_url'], - 'default_ttl': deserialize.integer(payload['default_ttl']), - 'number_selection_behavior': payload['number_selection_behavior'], - 'geo_match_level': payload['geo_match_level'], - 'intercept_callback_url': payload['intercept_callback_url'], - 'out_of_session_callback_url': payload['out_of_session_callback_url'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], - 'links': payload['links'], + 'sid': payload.get('sid'), + 'unique_name': payload.get('unique_name'), + 'account_sid': payload.get('account_sid'), + 'chat_instance_sid': payload.get('chat_instance_sid'), + 'callback_url': payload.get('callback_url'), + 'default_ttl': deserialize.integer(payload.get('default_ttl')), + 'number_selection_behavior': payload.get('number_selection_behavior'), + 'geo_match_level': payload.get('geo_match_level'), + 'intercept_callback_url': payload.get('intercept_callback_url'), + 'out_of_session_callback_url': payload.get('out_of_session_callback_url'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/proxy/v1/service/phone_number.py b/twilio/rest/proxy/v1/service/phone_number.py index fbcb4a1345..0379a53801 100644 --- a/twilio/rest/proxy/v1/service/phone_number.py +++ b/twilio/rest/proxy/v1/service/phone_number.py @@ -312,18 +312,18 @@ def __init__(self, version, payload, service_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'phone_number': payload['phone_number'], - 'friendly_name': payload['friendly_name'], - 'iso_country': payload['iso_country'], - 'capabilities': payload['capabilities'], - 'url': payload['url'], - 'is_reserved': payload['is_reserved'], - 'in_use': deserialize.integer(payload['in_use']), + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'phone_number': payload.get('phone_number'), + 'friendly_name': payload.get('friendly_name'), + 'iso_country': payload.get('iso_country'), + 'capabilities': payload.get('capabilities'), + 'url': payload.get('url'), + 'is_reserved': payload.get('is_reserved'), + 'in_use': deserialize.integer(payload.get('in_use')), } # Context diff --git a/twilio/rest/proxy/v1/service/session/__init__.py b/twilio/rest/proxy/v1/service/session/__init__.py index b50b2bc967..03df88e917 100644 --- a/twilio/rest/proxy/v1/service/session/__init__.py +++ b/twilio/rest/proxy/v1/service/session/__init__.py @@ -381,22 +381,22 @@ def __init__(self, version, payload, service_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'service_sid': payload['service_sid'], - 'account_sid': payload['account_sid'], - 'date_started': deserialize.iso8601_datetime(payload['date_started']), - 'date_ended': deserialize.iso8601_datetime(payload['date_ended']), - 'date_last_interaction': deserialize.iso8601_datetime(payload['date_last_interaction']), - 'date_expiry': deserialize.iso8601_datetime(payload['date_expiry']), - 'unique_name': payload['unique_name'], - 'status': payload['status'], - 'closed_reason': payload['closed_reason'], - 'ttl': deserialize.integer(payload['ttl']), - 'mode': payload['mode'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], - 'links': payload['links'], + 'sid': payload.get('sid'), + 'service_sid': payload.get('service_sid'), + 'account_sid': payload.get('account_sid'), + 'date_started': deserialize.iso8601_datetime(payload.get('date_started')), + 'date_ended': deserialize.iso8601_datetime(payload.get('date_ended')), + 'date_last_interaction': deserialize.iso8601_datetime(payload.get('date_last_interaction')), + 'date_expiry': deserialize.iso8601_datetime(payload.get('date_expiry')), + 'unique_name': payload.get('unique_name'), + 'status': payload.get('status'), + 'closed_reason': payload.get('closed_reason'), + 'ttl': deserialize.integer(payload.get('ttl')), + 'mode': payload.get('mode'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/proxy/v1/service/session/interaction.py b/twilio/rest/proxy/v1/service/session/interaction.py index 5d6d79682c..1e05228256 100644 --- a/twilio/rest/proxy/v1/service/session/interaction.py +++ b/twilio/rest/proxy/v1/service/session/interaction.py @@ -313,25 +313,25 @@ def __init__(self, version, payload, service_sid, session_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'session_sid': payload['session_sid'], - 'service_sid': payload['service_sid'], - 'account_sid': payload['account_sid'], - 'data': payload['data'], - 'type': payload['type'], - 'inbound_participant_sid': payload['inbound_participant_sid'], - 'inbound_resource_sid': payload['inbound_resource_sid'], - 'inbound_resource_status': payload['inbound_resource_status'], - 'inbound_resource_type': payload['inbound_resource_type'], - 'inbound_resource_url': payload['inbound_resource_url'], - 'outbound_participant_sid': payload['outbound_participant_sid'], - 'outbound_resource_sid': payload['outbound_resource_sid'], - 'outbound_resource_status': payload['outbound_resource_status'], - 'outbound_resource_type': payload['outbound_resource_type'], - 'outbound_resource_url': payload['outbound_resource_url'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], + 'sid': payload.get('sid'), + 'session_sid': payload.get('session_sid'), + 'service_sid': payload.get('service_sid'), + 'account_sid': payload.get('account_sid'), + 'data': payload.get('data'), + 'type': payload.get('type'), + 'inbound_participant_sid': payload.get('inbound_participant_sid'), + 'inbound_resource_sid': payload.get('inbound_resource_sid'), + 'inbound_resource_status': payload.get('inbound_resource_status'), + 'inbound_resource_type': payload.get('inbound_resource_type'), + 'inbound_resource_url': payload.get('inbound_resource_url'), + 'outbound_participant_sid': payload.get('outbound_participant_sid'), + 'outbound_resource_sid': payload.get('outbound_resource_sid'), + 'outbound_resource_status': payload.get('outbound_resource_status'), + 'outbound_resource_type': payload.get('outbound_resource_type'), + 'outbound_resource_url': payload.get('outbound_resource_url'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/proxy/v1/service/session/participant/__init__.py b/twilio/rest/proxy/v1/service/session/participant/__init__.py index f455324d10..78292b1df3 100644 --- a/twilio/rest/proxy/v1/service/session/participant/__init__.py +++ b/twilio/rest/proxy/v1/service/session/participant/__init__.py @@ -339,19 +339,19 @@ def __init__(self, version, payload, service_sid, session_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'session_sid': payload['session_sid'], - 'service_sid': payload['service_sid'], - 'account_sid': payload['account_sid'], - 'friendly_name': payload['friendly_name'], - 'identifier': payload['identifier'], - 'proxy_identifier': payload['proxy_identifier'], - 'proxy_identifier_sid': payload['proxy_identifier_sid'], - 'date_deleted': deserialize.iso8601_datetime(payload['date_deleted']), - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], - 'links': payload['links'], + 'sid': payload.get('sid'), + 'session_sid': payload.get('session_sid'), + 'service_sid': payload.get('service_sid'), + 'account_sid': payload.get('account_sid'), + 'friendly_name': payload.get('friendly_name'), + 'identifier': payload.get('identifier'), + 'proxy_identifier': payload.get('proxy_identifier'), + 'proxy_identifier_sid': payload.get('proxy_identifier_sid'), + 'date_deleted': deserialize.iso8601_datetime(payload.get('date_deleted')), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/proxy/v1/service/session/participant/message_interaction.py b/twilio/rest/proxy/v1/service/session/participant/message_interaction.py index dbd3246f17..ffcf992274 100644 --- a/twilio/rest/proxy/v1/service/session/participant/message_interaction.py +++ b/twilio/rest/proxy/v1/service/session/participant/message_interaction.py @@ -348,26 +348,26 @@ def __init__(self, version, payload, service_sid, session_sid, participant_sid, # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'session_sid': payload['session_sid'], - 'service_sid': payload['service_sid'], - 'account_sid': payload['account_sid'], - 'data': payload['data'], - 'type': payload['type'], - 'participant_sid': payload['participant_sid'], - 'inbound_participant_sid': payload['inbound_participant_sid'], - 'inbound_resource_sid': payload['inbound_resource_sid'], - 'inbound_resource_status': payload['inbound_resource_status'], - 'inbound_resource_type': payload['inbound_resource_type'], - 'inbound_resource_url': payload['inbound_resource_url'], - 'outbound_participant_sid': payload['outbound_participant_sid'], - 'outbound_resource_sid': payload['outbound_resource_sid'], - 'outbound_resource_status': payload['outbound_resource_status'], - 'outbound_resource_type': payload['outbound_resource_type'], - 'outbound_resource_url': payload['outbound_resource_url'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], + 'sid': payload.get('sid'), + 'session_sid': payload.get('session_sid'), + 'service_sid': payload.get('service_sid'), + 'account_sid': payload.get('account_sid'), + 'data': payload.get('data'), + 'type': payload.get('type'), + 'participant_sid': payload.get('participant_sid'), + 'inbound_participant_sid': payload.get('inbound_participant_sid'), + 'inbound_resource_sid': payload.get('inbound_resource_sid'), + 'inbound_resource_status': payload.get('inbound_resource_status'), + 'inbound_resource_type': payload.get('inbound_resource_type'), + 'inbound_resource_url': payload.get('inbound_resource_url'), + 'outbound_participant_sid': payload.get('outbound_participant_sid'), + 'outbound_resource_sid': payload.get('outbound_resource_sid'), + 'outbound_resource_status': payload.get('outbound_resource_status'), + 'outbound_resource_type': payload.get('outbound_resource_type'), + 'outbound_resource_url': payload.get('outbound_resource_url'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/proxy/v1/service/short_code.py b/twilio/rest/proxy/v1/service/short_code.py index 0c0f88f062..f64d79afac 100644 --- a/twilio/rest/proxy/v1/service/short_code.py +++ b/twilio/rest/proxy/v1/service/short_code.py @@ -309,16 +309,16 @@ def __init__(self, version, payload, service_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'short_code': payload['short_code'], - 'iso_country': payload['iso_country'], - 'capabilities': payload['capabilities'], - 'url': payload['url'], - 'is_reserved': payload['is_reserved'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'short_code': payload.get('short_code'), + 'iso_country': payload.get('iso_country'), + 'capabilities': payload.get('capabilities'), + 'url': payload.get('url'), + 'is_reserved': payload.get('is_reserved'), } # Context diff --git a/twilio/rest/serverless/v1/service/__init__.py b/twilio/rest/serverless/v1/service/__init__.py index 6b2a1c006c..619a097389 100644 --- a/twilio/rest/serverless/v1/service/__init__.py +++ b/twilio/rest/serverless/v1/service/__init__.py @@ -365,15 +365,15 @@ def __init__(self, version, payload, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'friendly_name': payload['friendly_name'], - 'unique_name': payload['unique_name'], - 'include_credentials': payload['include_credentials'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], - 'links': payload['links'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'friendly_name': payload.get('friendly_name'), + 'unique_name': payload.get('unique_name'), + 'include_credentials': payload.get('include_credentials'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/serverless/v1/service/asset/__init__.py b/twilio/rest/serverless/v1/service/asset/__init__.py index fdf56a9bde..3b7d9ad1b2 100644 --- a/twilio/rest/serverless/v1/service/asset/__init__.py +++ b/twilio/rest/serverless/v1/service/asset/__init__.py @@ -333,14 +333,14 @@ def __init__(self, version, payload, service_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'friendly_name': payload['friendly_name'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], - 'links': payload['links'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'friendly_name': payload.get('friendly_name'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/serverless/v1/service/asset/asset_version.py b/twilio/rest/serverless/v1/service/asset/asset_version.py index 63f8304adc..a2ddd86c6f 100644 --- a/twilio/rest/serverless/v1/service/asset/asset_version.py +++ b/twilio/rest/serverless/v1/service/asset/asset_version.py @@ -285,14 +285,14 @@ def __init__(self, version, payload, service_sid, asset_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'asset_sid': payload['asset_sid'], - 'path': payload['path'], - 'visibility': payload['visibility'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'url': payload['url'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'asset_sid': payload.get('asset_sid'), + 'path': payload.get('path'), + 'visibility': payload.get('visibility'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/serverless/v1/service/build.py b/twilio/rest/serverless/v1/service/build.py index ea445fa97e..b4298d1350 100644 --- a/twilio/rest/serverless/v1/service/build.py +++ b/twilio/rest/serverless/v1/service/build.py @@ -302,16 +302,16 @@ def __init__(self, version, payload, service_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'status': payload['status'], - 'asset_versions': payload['asset_versions'], - 'function_versions': payload['function_versions'], - 'dependencies': payload['dependencies'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'status': payload.get('status'), + 'asset_versions': payload.get('asset_versions'), + 'function_versions': payload.get('function_versions'), + 'dependencies': payload.get('dependencies'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/serverless/v1/service/environment/__init__.py b/twilio/rest/serverless/v1/service/environment/__init__.py index e31014d1c5..99c1975be4 100644 --- a/twilio/rest/serverless/v1/service/environment/__init__.py +++ b/twilio/rest/serverless/v1/service/environment/__init__.py @@ -346,17 +346,17 @@ def __init__(self, version, payload, service_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'build_sid': payload['build_sid'], - 'unique_name': payload['unique_name'], - 'domain_suffix': payload['domain_suffix'], - 'domain_name': payload['domain_name'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], - 'links': payload['links'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'build_sid': payload.get('build_sid'), + 'unique_name': payload.get('unique_name'), + 'domain_suffix': payload.get('domain_suffix'), + 'domain_name': payload.get('domain_name'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/serverless/v1/service/environment/deployment.py b/twilio/rest/serverless/v1/service/environment/deployment.py index e3aebcde81..e2c806f9f6 100644 --- a/twilio/rest/serverless/v1/service/environment/deployment.py +++ b/twilio/rest/serverless/v1/service/environment/deployment.py @@ -304,14 +304,14 @@ def __init__(self, version, payload, service_sid, environment_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'environment_sid': payload['environment_sid'], - 'build_sid': payload['build_sid'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'environment_sid': payload.get('environment_sid'), + 'build_sid': payload.get('build_sid'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/serverless/v1/service/environment/log.py b/twilio/rest/serverless/v1/service/environment/log.py index e1127e2ed6..775faf3a6c 100644 --- a/twilio/rest/serverless/v1/service/environment/log.py +++ b/twilio/rest/serverless/v1/service/environment/log.py @@ -293,17 +293,17 @@ def __init__(self, version, payload, service_sid, environment_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'environment_sid': payload['environment_sid'], - 'deployment_sid': payload['deployment_sid'], - 'function_sid': payload['function_sid'], - 'request_sid': payload['request_sid'], - 'level': payload['level'], - 'message': payload['message'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'url': payload['url'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'environment_sid': payload.get('environment_sid'), + 'deployment_sid': payload.get('deployment_sid'), + 'function_sid': payload.get('function_sid'), + 'request_sid': payload.get('request_sid'), + 'level': payload.get('level'), + 'message': payload.get('message'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/serverless/v1/service/environment/variable.py b/twilio/rest/serverless/v1/service/environment/variable.py index cea401598b..3a7352ea5f 100644 --- a/twilio/rest/serverless/v1/service/environment/variable.py +++ b/twilio/rest/serverless/v1/service/environment/variable.py @@ -340,15 +340,15 @@ def __init__(self, version, payload, service_sid, environment_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'environment_sid': payload['environment_sid'], - 'key': payload['key'], - 'value': payload['value'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'environment_sid': payload.get('environment_sid'), + 'key': payload.get('key'), + 'value': payload.get('value'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/serverless/v1/service/function/__init__.py b/twilio/rest/serverless/v1/service/function/__init__.py index f110288964..47b80943d9 100644 --- a/twilio/rest/serverless/v1/service/function/__init__.py +++ b/twilio/rest/serverless/v1/service/function/__init__.py @@ -333,14 +333,14 @@ def __init__(self, version, payload, service_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'friendly_name': payload['friendly_name'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], - 'links': payload['links'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'friendly_name': payload.get('friendly_name'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/serverless/v1/service/function/function_version.py b/twilio/rest/serverless/v1/service/function/function_version.py index e3f3d37374..9c5fbb034c 100644 --- a/twilio/rest/serverless/v1/service/function/function_version.py +++ b/twilio/rest/serverless/v1/service/function/function_version.py @@ -285,14 +285,14 @@ def __init__(self, version, payload, service_sid, function_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'function_sid': payload['function_sid'], - 'path': payload['path'], - 'visibility': payload['visibility'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'url': payload['url'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'function_sid': payload.get('function_sid'), + 'path': payload.get('path'), + 'visibility': payload.get('visibility'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/studio/v1/flow/__init__.py b/twilio/rest/studio/v1/flow/__init__.py index b835589da5..ea5ae038a3 100644 --- a/twilio/rest/studio/v1/flow/__init__.py +++ b/twilio/rest/studio/v1/flow/__init__.py @@ -288,15 +288,15 @@ def __init__(self, version, payload, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'friendly_name': payload['friendly_name'], - 'status': payload['status'], - 'version': deserialize.integer(payload['version']), - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], - 'links': payload['links'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'friendly_name': payload.get('friendly_name'), + 'status': payload.get('status'), + 'version': deserialize.integer(payload.get('version')), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/studio/v1/flow/engagement/__init__.py b/twilio/rest/studio/v1/flow/engagement/__init__.py index dc794c1220..e5f840a2e7 100644 --- a/twilio/rest/studio/v1/flow/engagement/__init__.py +++ b/twilio/rest/studio/v1/flow/engagement/__init__.py @@ -326,17 +326,17 @@ def __init__(self, version, payload, flow_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'flow_sid': payload['flow_sid'], - 'contact_sid': payload['contact_sid'], - 'contact_channel_address': payload['contact_channel_address'], - 'context': payload['context'], - 'status': payload['status'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], - 'links': payload['links'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'flow_sid': payload.get('flow_sid'), + 'contact_sid': payload.get('contact_sid'), + 'contact_channel_address': payload.get('contact_channel_address'), + 'context': payload.get('context'), + 'status': payload.get('status'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/studio/v1/flow/engagement/engagement_context.py b/twilio/rest/studio/v1/flow/engagement/engagement_context.py index 5f0c925f12..846a653c4f 100644 --- a/twilio/rest/studio/v1/flow/engagement/engagement_context.py +++ b/twilio/rest/studio/v1/flow/engagement/engagement_context.py @@ -181,11 +181,11 @@ def __init__(self, version, payload, flow_sid, engagement_sid): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'context': payload['context'], - 'engagement_sid': payload['engagement_sid'], - 'flow_sid': payload['flow_sid'], - 'url': payload['url'], + 'account_sid': payload.get('account_sid'), + 'context': payload.get('context'), + 'engagement_sid': payload.get('engagement_sid'), + 'flow_sid': payload.get('flow_sid'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/studio/v1/flow/engagement/step/__init__.py b/twilio/rest/studio/v1/flow/engagement/step/__init__.py index 4434c501b8..c27cb1da39 100644 --- a/twilio/rest/studio/v1/flow/engagement/step/__init__.py +++ b/twilio/rest/studio/v1/flow/engagement/step/__init__.py @@ -293,18 +293,18 @@ def __init__(self, version, payload, flow_sid, engagement_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'flow_sid': payload['flow_sid'], - 'engagement_sid': payload['engagement_sid'], - 'name': payload['name'], - 'context': payload['context'], - 'transitioned_from': payload['transitioned_from'], - 'transitioned_to': payload['transitioned_to'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], - 'links': payload['links'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'flow_sid': payload.get('flow_sid'), + 'engagement_sid': payload.get('engagement_sid'), + 'name': payload.get('name'), + 'context': payload.get('context'), + 'transitioned_from': payload.get('transitioned_from'), + 'transitioned_to': payload.get('transitioned_to'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/studio/v1/flow/engagement/step/step_context.py b/twilio/rest/studio/v1/flow/engagement/step/step_context.py index b60cfab824..88f70f4b54 100644 --- a/twilio/rest/studio/v1/flow/engagement/step/step_context.py +++ b/twilio/rest/studio/v1/flow/engagement/step/step_context.py @@ -188,12 +188,12 @@ def __init__(self, version, payload, flow_sid, engagement_sid, step_sid): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'context': payload['context'], - 'engagement_sid': payload['engagement_sid'], - 'flow_sid': payload['flow_sid'], - 'step_sid': payload['step_sid'], - 'url': payload['url'], + 'account_sid': payload.get('account_sid'), + 'context': payload.get('context'), + 'engagement_sid': payload.get('engagement_sid'), + 'flow_sid': payload.get('flow_sid'), + 'step_sid': payload.get('step_sid'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/studio/v1/flow/execution/__init__.py b/twilio/rest/studio/v1/flow/execution/__init__.py index 6a280c6e0e..83478813cc 100644 --- a/twilio/rest/studio/v1/flow/execution/__init__.py +++ b/twilio/rest/studio/v1/flow/execution/__init__.py @@ -350,17 +350,17 @@ def __init__(self, version, payload, flow_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'flow_sid': payload['flow_sid'], - 'contact_sid': payload['contact_sid'], - 'contact_channel_address': payload['contact_channel_address'], - 'context': payload['context'], - 'status': payload['status'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], - 'links': payload['links'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'flow_sid': payload.get('flow_sid'), + 'contact_sid': payload.get('contact_sid'), + 'contact_channel_address': payload.get('contact_channel_address'), + 'context': payload.get('context'), + 'status': payload.get('status'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/studio/v1/flow/execution/execution_context.py b/twilio/rest/studio/v1/flow/execution/execution_context.py index 3aeec0e3bf..7d35eeaed7 100644 --- a/twilio/rest/studio/v1/flow/execution/execution_context.py +++ b/twilio/rest/studio/v1/flow/execution/execution_context.py @@ -181,11 +181,11 @@ def __init__(self, version, payload, flow_sid, execution_sid): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'context': payload['context'], - 'flow_sid': payload['flow_sid'], - 'execution_sid': payload['execution_sid'], - 'url': payload['url'], + 'account_sid': payload.get('account_sid'), + 'context': payload.get('context'), + 'flow_sid': payload.get('flow_sid'), + 'execution_sid': payload.get('execution_sid'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/studio/v1/flow/execution/execution_step/__init__.py b/twilio/rest/studio/v1/flow/execution/execution_step/__init__.py index a31c82c5e0..9b0a7f1e85 100644 --- a/twilio/rest/studio/v1/flow/execution/execution_step/__init__.py +++ b/twilio/rest/studio/v1/flow/execution/execution_step/__init__.py @@ -293,18 +293,18 @@ def __init__(self, version, payload, flow_sid, execution_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'flow_sid': payload['flow_sid'], - 'execution_sid': payload['execution_sid'], - 'name': payload['name'], - 'context': payload['context'], - 'transitioned_from': payload['transitioned_from'], - 'transitioned_to': payload['transitioned_to'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], - 'links': payload['links'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'flow_sid': payload.get('flow_sid'), + 'execution_sid': payload.get('execution_sid'), + 'name': payload.get('name'), + 'context': payload.get('context'), + 'transitioned_from': payload.get('transitioned_from'), + 'transitioned_to': payload.get('transitioned_to'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/studio/v1/flow/execution/execution_step/execution_step_context.py b/twilio/rest/studio/v1/flow/execution/execution_step/execution_step_context.py index 66e161cf70..baeb21d9f0 100644 --- a/twilio/rest/studio/v1/flow/execution/execution_step/execution_step_context.py +++ b/twilio/rest/studio/v1/flow/execution/execution_step/execution_step_context.py @@ -188,12 +188,12 @@ def __init__(self, version, payload, flow_sid, execution_sid, step_sid): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'context': payload['context'], - 'execution_sid': payload['execution_sid'], - 'flow_sid': payload['flow_sid'], - 'step_sid': payload['step_sid'], - 'url': payload['url'], + 'account_sid': payload.get('account_sid'), + 'context': payload.get('context'), + 'execution_sid': payload.get('execution_sid'), + 'flow_sid': payload.get('flow_sid'), + 'step_sid': payload.get('step_sid'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/sync/v1/service/__init__.py b/twilio/rest/sync/v1/service/__init__.py index d3f9796601..b85425364a 100644 --- a/twilio/rest/sync/v1/service/__init__.py +++ b/twilio/rest/sync/v1/service/__init__.py @@ -390,20 +390,20 @@ def __init__(self, version, payload, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'unique_name': payload['unique_name'], - 'account_sid': payload['account_sid'], - 'friendly_name': payload['friendly_name'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], - 'webhook_url': payload['webhook_url'], - 'webhooks_from_rest_enabled': payload['webhooks_from_rest_enabled'], - 'reachability_webhooks_enabled': payload['reachability_webhooks_enabled'], - 'acl_enabled': payload['acl_enabled'], - 'reachability_debouncing_enabled': payload['reachability_debouncing_enabled'], - 'reachability_debouncing_window': deserialize.integer(payload['reachability_debouncing_window']), - 'links': payload['links'], + 'sid': payload.get('sid'), + 'unique_name': payload.get('unique_name'), + 'account_sid': payload.get('account_sid'), + 'friendly_name': payload.get('friendly_name'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), + 'webhook_url': payload.get('webhook_url'), + 'webhooks_from_rest_enabled': payload.get('webhooks_from_rest_enabled'), + 'reachability_webhooks_enabled': payload.get('reachability_webhooks_enabled'), + 'acl_enabled': payload.get('acl_enabled'), + 'reachability_debouncing_enabled': payload.get('reachability_debouncing_enabled'), + 'reachability_debouncing_window': deserialize.integer(payload.get('reachability_debouncing_window')), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/sync/v1/service/document/__init__.py b/twilio/rest/sync/v1/service/document/__init__.py index 16de22283e..12d51639ce 100644 --- a/twilio/rest/sync/v1/service/document/__init__.py +++ b/twilio/rest/sync/v1/service/document/__init__.py @@ -333,18 +333,18 @@ def __init__(self, version, payload, service_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'unique_name': payload['unique_name'], - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'url': payload['url'], - 'links': payload['links'], - 'revision': payload['revision'], - 'data': payload['data'], - 'date_expires': deserialize.iso8601_datetime(payload['date_expires']), - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'created_by': payload['created_by'], + 'sid': payload.get('sid'), + 'unique_name': payload.get('unique_name'), + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'url': payload.get('url'), + 'links': payload.get('links'), + 'revision': payload.get('revision'), + 'data': payload.get('data'), + 'date_expires': deserialize.iso8601_datetime(payload.get('date_expires')), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'created_by': payload.get('created_by'), } # Context diff --git a/twilio/rest/sync/v1/service/document/document_permission.py b/twilio/rest/sync/v1/service/document/document_permission.py index da3f5cb09d..493d958f64 100644 --- a/twilio/rest/sync/v1/service/document/document_permission.py +++ b/twilio/rest/sync/v1/service/document/document_permission.py @@ -311,14 +311,14 @@ def __init__(self, version, payload, service_sid, document_sid, identity=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'document_sid': payload['document_sid'], - 'identity': payload['identity'], - 'read': payload['read'], - 'write': payload['write'], - 'manage': payload['manage'], - 'url': payload['url'], + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'document_sid': payload.get('document_sid'), + 'identity': payload.get('identity'), + 'read': payload.get('read'), + 'write': payload.get('write'), + 'manage': payload.get('manage'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/sync/v1/service/sync_list/__init__.py b/twilio/rest/sync/v1/service/sync_list/__init__.py index 94e31bebd9..809a7fa327 100644 --- a/twilio/rest/sync/v1/service/sync_list/__init__.py +++ b/twilio/rest/sync/v1/service/sync_list/__init__.py @@ -351,17 +351,17 @@ def __init__(self, version, payload, service_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'unique_name': payload['unique_name'], - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'url': payload['url'], - 'links': payload['links'], - 'revision': payload['revision'], - 'date_expires': deserialize.iso8601_datetime(payload['date_expires']), - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'created_by': payload['created_by'], + 'sid': payload.get('sid'), + 'unique_name': payload.get('unique_name'), + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'url': payload.get('url'), + 'links': payload.get('links'), + 'revision': payload.get('revision'), + 'date_expires': deserialize.iso8601_datetime(payload.get('date_expires')), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'created_by': payload.get('created_by'), } # Context 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 2b54e900f1..be5b95962b 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 @@ -380,17 +380,17 @@ def __init__(self, version, payload, service_sid, list_sid, index=None): # Marshaled Properties self._properties = { - 'index': deserialize.integer(payload['index']), - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'list_sid': payload['list_sid'], - 'url': payload['url'], - 'revision': payload['revision'], - 'data': payload['data'], - 'date_expires': deserialize.iso8601_datetime(payload['date_expires']), - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'created_by': payload['created_by'], + 'index': deserialize.integer(payload.get('index')), + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'list_sid': payload.get('list_sid'), + 'url': payload.get('url'), + 'revision': payload.get('revision'), + 'data': payload.get('data'), + 'date_expires': deserialize.iso8601_datetime(payload.get('date_expires')), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'created_by': payload.get('created_by'), } # Context diff --git a/twilio/rest/sync/v1/service/sync_list/sync_list_permission.py b/twilio/rest/sync/v1/service/sync_list/sync_list_permission.py index 11ad906b32..83e5e5cdc6 100644 --- a/twilio/rest/sync/v1/service/sync_list/sync_list_permission.py +++ b/twilio/rest/sync/v1/service/sync_list/sync_list_permission.py @@ -311,14 +311,14 @@ def __init__(self, version, payload, service_sid, list_sid, identity=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'list_sid': payload['list_sid'], - 'identity': payload['identity'], - 'read': payload['read'], - 'write': payload['write'], - 'manage': payload['manage'], - 'url': payload['url'], + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'list_sid': payload.get('list_sid'), + 'identity': payload.get('identity'), + 'read': payload.get('read'), + 'write': payload.get('write'), + 'manage': payload.get('manage'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/sync/v1/service/sync_map/__init__.py b/twilio/rest/sync/v1/service/sync_map/__init__.py index 5e8bc2d93d..345f7de318 100644 --- a/twilio/rest/sync/v1/service/sync_map/__init__.py +++ b/twilio/rest/sync/v1/service/sync_map/__init__.py @@ -351,17 +351,17 @@ def __init__(self, version, payload, service_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'unique_name': payload['unique_name'], - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'url': payload['url'], - 'links': payload['links'], - 'revision': payload['revision'], - 'date_expires': deserialize.iso8601_datetime(payload['date_expires']), - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'created_by': payload['created_by'], + 'sid': payload.get('sid'), + 'unique_name': payload.get('unique_name'), + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'url': payload.get('url'), + 'links': payload.get('links'), + 'revision': payload.get('revision'), + 'date_expires': deserialize.iso8601_datetime(payload.get('date_expires')), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'created_by': payload.get('created_by'), } # Context 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 d97475d987..fe3919bc49 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 @@ -382,17 +382,17 @@ def __init__(self, version, payload, service_sid, map_sid, key=None): # Marshaled Properties self._properties = { - 'key': payload['key'], - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'map_sid': payload['map_sid'], - 'url': payload['url'], - 'revision': payload['revision'], - 'data': payload['data'], - 'date_expires': deserialize.iso8601_datetime(payload['date_expires']), - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'created_by': payload['created_by'], + 'key': payload.get('key'), + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'map_sid': payload.get('map_sid'), + 'url': payload.get('url'), + 'revision': payload.get('revision'), + 'data': payload.get('data'), + 'date_expires': deserialize.iso8601_datetime(payload.get('date_expires')), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'created_by': payload.get('created_by'), } # Context diff --git a/twilio/rest/sync/v1/service/sync_map/sync_map_permission.py b/twilio/rest/sync/v1/service/sync_map/sync_map_permission.py index 515429f497..13bc787254 100644 --- a/twilio/rest/sync/v1/service/sync_map/sync_map_permission.py +++ b/twilio/rest/sync/v1/service/sync_map/sync_map_permission.py @@ -311,14 +311,14 @@ def __init__(self, version, payload, service_sid, map_sid, identity=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'map_sid': payload['map_sid'], - 'identity': payload['identity'], - 'read': payload['read'], - 'write': payload['write'], - 'manage': payload['manage'], - 'url': payload['url'], + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'map_sid': payload.get('map_sid'), + 'identity': payload.get('identity'), + 'read': payload.get('read'), + 'write': payload.get('write'), + 'manage': payload.get('manage'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/sync/v1/service/sync_stream/__init__.py b/twilio/rest/sync/v1/service/sync_stream/__init__.py index 0552fc4833..3136d7874e 100644 --- a/twilio/rest/sync/v1/service/sync_stream/__init__.py +++ b/twilio/rest/sync/v1/service/sync_stream/__init__.py @@ -330,16 +330,16 @@ def __init__(self, version, payload, service_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'unique_name': payload['unique_name'], - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'url': payload['url'], - 'links': payload['links'], - 'date_expires': deserialize.iso8601_datetime(payload['date_expires']), - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'created_by': payload['created_by'], + 'sid': payload.get('sid'), + 'unique_name': payload.get('unique_name'), + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'url': payload.get('url'), + 'links': payload.get('links'), + 'date_expires': deserialize.iso8601_datetime(payload.get('date_expires')), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'created_by': payload.get('created_by'), } # Context diff --git a/twilio/rest/sync/v1/service/sync_stream/stream_message.py b/twilio/rest/sync/v1/service/sync_stream/stream_message.py index 41e21ee9d2..450cb52525 100644 --- a/twilio/rest/sync/v1/service/sync_stream/stream_message.py +++ b/twilio/rest/sync/v1/service/sync_stream/stream_message.py @@ -129,7 +129,7 @@ def __init__(self, version, payload, service_sid, stream_sid): super(StreamMessageInstance, self).__init__(version) # Marshaled Properties - self._properties = {'sid': payload['sid'], 'data': payload['data'], } + self._properties = {'sid': payload.get('sid'), 'data': payload.get('data'), } # Context self._context = None diff --git a/twilio/rest/taskrouter/v1/workspace/__init__.py b/twilio/rest/taskrouter/v1/workspace/__init__.py index 44afb0f371..e817c58adc 100644 --- a/twilio/rest/taskrouter/v1/workspace/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/__init__.py @@ -484,21 +484,21 @@ def __init__(self, version, payload, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'default_activity_name': payload['default_activity_name'], - 'default_activity_sid': payload['default_activity_sid'], - 'event_callback_url': payload['event_callback_url'], - 'events_filter': payload['events_filter'], - 'friendly_name': payload['friendly_name'], - 'multi_task_enabled': payload['multi_task_enabled'], - 'sid': payload['sid'], - 'timeout_activity_name': payload['timeout_activity_name'], - 'timeout_activity_sid': payload['timeout_activity_sid'], - 'prioritize_queue_order': payload['prioritize_queue_order'], - 'url': payload['url'], - 'links': payload['links'], + 'account_sid': payload.get('account_sid'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'default_activity_name': payload.get('default_activity_name'), + 'default_activity_sid': payload.get('default_activity_sid'), + 'event_callback_url': payload.get('event_callback_url'), + 'events_filter': payload.get('events_filter'), + 'friendly_name': payload.get('friendly_name'), + 'multi_task_enabled': payload.get('multi_task_enabled'), + 'sid': payload.get('sid'), + 'timeout_activity_name': payload.get('timeout_activity_name'), + 'timeout_activity_sid': payload.get('timeout_activity_sid'), + 'prioritize_queue_order': payload.get('prioritize_queue_order'), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/taskrouter/v1/workspace/activity.py b/twilio/rest/taskrouter/v1/workspace/activity.py index 83153f89a8..82cf574688 100644 --- a/twilio/rest/taskrouter/v1/workspace/activity.py +++ b/twilio/rest/taskrouter/v1/workspace/activity.py @@ -326,14 +326,14 @@ def __init__(self, version, payload, workspace_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'available': payload['available'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'friendly_name': payload['friendly_name'], - 'sid': payload['sid'], - 'workspace_sid': payload['workspace_sid'], - 'url': payload['url'], + 'account_sid': payload.get('account_sid'), + 'available': payload.get('available'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'friendly_name': payload.get('friendly_name'), + 'sid': payload.get('sid'), + 'workspace_sid': payload.get('workspace_sid'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/taskrouter/v1/workspace/event.py b/twilio/rest/taskrouter/v1/workspace/event.py index 15ac232ce4..8fe92439fa 100644 --- a/twilio/rest/taskrouter/v1/workspace/event.py +++ b/twilio/rest/taskrouter/v1/workspace/event.py @@ -344,23 +344,23 @@ def __init__(self, version, payload, workspace_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'actor_sid': payload['actor_sid'], - 'actor_type': payload['actor_type'], - 'actor_url': payload['actor_url'], - 'description': payload['description'], - 'event_data': payload['event_data'], - 'event_date': deserialize.iso8601_datetime(payload['event_date']), - 'event_date_ms': deserialize.integer(payload['event_date_ms']), - 'event_type': payload['event_type'], - 'resource_sid': payload['resource_sid'], - 'resource_type': payload['resource_type'], - 'resource_url': payload['resource_url'], - 'sid': payload['sid'], - 'source': payload['source'], - 'source_ip_address': payload['source_ip_address'], - 'url': payload['url'], - 'workspace_sid': payload['workspace_sid'], + 'account_sid': payload.get('account_sid'), + 'actor_sid': payload.get('actor_sid'), + 'actor_type': payload.get('actor_type'), + 'actor_url': payload.get('actor_url'), + 'description': payload.get('description'), + 'event_data': payload.get('event_data'), + 'event_date': deserialize.iso8601_datetime(payload.get('event_date')), + 'event_date_ms': deserialize.integer(payload.get('event_date_ms')), + 'event_type': payload.get('event_type'), + 'resource_sid': payload.get('resource_sid'), + 'resource_type': payload.get('resource_type'), + 'resource_url': payload.get('resource_url'), + 'sid': payload.get('sid'), + 'source': payload.get('source'), + 'source_ip_address': payload.get('source_ip_address'), + 'url': payload.get('url'), + 'workspace_sid': payload.get('workspace_sid'), } # Context diff --git a/twilio/rest/taskrouter/v1/workspace/task/__init__.py b/twilio/rest/taskrouter/v1/workspace/task/__init__.py index ca6de918a5..06121ad30f 100644 --- a/twilio/rest/taskrouter/v1/workspace/task/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/task/__init__.py @@ -433,26 +433,26 @@ def __init__(self, version, payload, workspace_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'age': deserialize.integer(payload['age']), - 'assignment_status': payload['assignment_status'], - 'attributes': payload['attributes'], - 'addons': payload['addons'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'priority': deserialize.integer(payload['priority']), - 'reason': payload['reason'], - 'sid': payload['sid'], - 'task_queue_sid': payload['task_queue_sid'], - 'task_queue_friendly_name': payload['task_queue_friendly_name'], - 'task_channel_sid': payload['task_channel_sid'], - 'task_channel_unique_name': payload['task_channel_unique_name'], - 'timeout': deserialize.integer(payload['timeout']), - 'workflow_sid': payload['workflow_sid'], - 'workflow_friendly_name': payload['workflow_friendly_name'], - 'workspace_sid': payload['workspace_sid'], - 'url': payload['url'], - 'links': payload['links'], + 'account_sid': payload.get('account_sid'), + 'age': deserialize.integer(payload.get('age')), + 'assignment_status': payload.get('assignment_status'), + 'attributes': payload.get('attributes'), + 'addons': payload.get('addons'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'priority': deserialize.integer(payload.get('priority')), + 'reason': payload.get('reason'), + 'sid': payload.get('sid'), + 'task_queue_sid': payload.get('task_queue_sid'), + 'task_queue_friendly_name': payload.get('task_queue_friendly_name'), + 'task_channel_sid': payload.get('task_channel_sid'), + 'task_channel_unique_name': payload.get('task_channel_unique_name'), + 'timeout': deserialize.integer(payload.get('timeout')), + 'workflow_sid': payload.get('workflow_sid'), + 'workflow_friendly_name': payload.get('workflow_friendly_name'), + 'workspace_sid': payload.get('workspace_sid'), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/taskrouter/v1/workspace/task/reservation.py b/twilio/rest/taskrouter/v1/workspace/task/reservation.py index 8b79d553e8..a006fd1da3 100644 --- a/twilio/rest/taskrouter/v1/workspace/task/reservation.py +++ b/twilio/rest/taskrouter/v1/workspace/task/reservation.py @@ -475,17 +475,17 @@ def __init__(self, version, payload, workspace_sid, task_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'reservation_status': payload['reservation_status'], - 'sid': payload['sid'], - 'task_sid': payload['task_sid'], - 'worker_name': payload['worker_name'], - 'worker_sid': payload['worker_sid'], - 'workspace_sid': payload['workspace_sid'], - 'url': payload['url'], - 'links': payload['links'], + 'account_sid': payload.get('account_sid'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'reservation_status': payload.get('reservation_status'), + 'sid': payload.get('sid'), + 'task_sid': payload.get('task_sid'), + 'worker_name': payload.get('worker_name'), + 'worker_sid': payload.get('worker_sid'), + 'workspace_sid': payload.get('workspace_sid'), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/taskrouter/v1/workspace/task_channel.py b/twilio/rest/taskrouter/v1/workspace/task_channel.py index 30e7b563ec..9bdb8b6676 100644 --- a/twilio/rest/taskrouter/v1/workspace/task_channel.py +++ b/twilio/rest/taskrouter/v1/workspace/task_channel.py @@ -317,16 +317,16 @@ def __init__(self, version, payload, workspace_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'friendly_name': payload['friendly_name'], - 'sid': payload['sid'], - 'unique_name': payload['unique_name'], - 'workspace_sid': payload['workspace_sid'], - 'channel_optimized_routing': payload['channel_optimized_routing'], - 'url': payload['url'], - 'links': payload['links'], + 'account_sid': payload.get('account_sid'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'friendly_name': payload.get('friendly_name'), + 'sid': payload.get('sid'), + 'unique_name': payload.get('unique_name'), + 'workspace_sid': payload.get('workspace_sid'), + 'channel_optimized_routing': payload.get('channel_optimized_routing'), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py b/twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py index ebc13071f3..bcd4455099 100644 --- a/twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py @@ -447,21 +447,21 @@ def __init__(self, version, payload, workspace_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'assignment_activity_sid': payload['assignment_activity_sid'], - 'assignment_activity_name': payload['assignment_activity_name'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'friendly_name': payload['friendly_name'], - 'max_reserved_workers': deserialize.integer(payload['max_reserved_workers']), - 'reservation_activity_sid': payload['reservation_activity_sid'], - 'reservation_activity_name': payload['reservation_activity_name'], - 'sid': payload['sid'], - 'target_workers': payload['target_workers'], - 'task_order': payload['task_order'], - 'url': payload['url'], - 'workspace_sid': payload['workspace_sid'], - 'links': payload['links'], + 'account_sid': payload.get('account_sid'), + 'assignment_activity_sid': payload.get('assignment_activity_sid'), + 'assignment_activity_name': payload.get('assignment_activity_name'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'friendly_name': payload.get('friendly_name'), + 'max_reserved_workers': deserialize.integer(payload.get('max_reserved_workers')), + 'reservation_activity_sid': payload.get('reservation_activity_sid'), + 'reservation_activity_name': payload.get('reservation_activity_name'), + 'sid': payload.get('sid'), + 'target_workers': payload.get('target_workers'), + 'task_order': payload.get('task_order'), + 'url': payload.get('url'), + 'workspace_sid': payload.get('workspace_sid'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.py b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.py index 1a122237b6..36a9724de5 100644 --- a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.py @@ -197,27 +197,27 @@ def __init__(self, version, payload, workspace_sid, task_queue_sid): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'avg_task_acceptance_time': deserialize.integer(payload['avg_task_acceptance_time']), - 'start_time': deserialize.iso8601_datetime(payload['start_time']), - 'end_time': deserialize.iso8601_datetime(payload['end_time']), - 'reservations_created': deserialize.integer(payload['reservations_created']), - 'reservations_accepted': deserialize.integer(payload['reservations_accepted']), - 'reservations_rejected': deserialize.integer(payload['reservations_rejected']), - 'reservations_timed_out': deserialize.integer(payload['reservations_timed_out']), - 'reservations_canceled': deserialize.integer(payload['reservations_canceled']), - 'reservations_rescinded': deserialize.integer(payload['reservations_rescinded']), - 'split_by_wait_time': payload['split_by_wait_time'], - 'task_queue_sid': payload['task_queue_sid'], - 'wait_duration_until_accepted': payload['wait_duration_until_accepted'], - 'wait_duration_until_canceled': payload['wait_duration_until_canceled'], - 'tasks_canceled': deserialize.integer(payload['tasks_canceled']), - 'tasks_completed': deserialize.integer(payload['tasks_completed']), - 'tasks_deleted': deserialize.integer(payload['tasks_deleted']), - 'tasks_entered': deserialize.integer(payload['tasks_entered']), - 'tasks_moved': deserialize.integer(payload['tasks_moved']), - 'workspace_sid': payload['workspace_sid'], - 'url': payload['url'], + 'account_sid': payload.get('account_sid'), + 'avg_task_acceptance_time': deserialize.integer(payload.get('avg_task_acceptance_time')), + 'start_time': deserialize.iso8601_datetime(payload.get('start_time')), + 'end_time': deserialize.iso8601_datetime(payload.get('end_time')), + 'reservations_created': deserialize.integer(payload.get('reservations_created')), + 'reservations_accepted': deserialize.integer(payload.get('reservations_accepted')), + 'reservations_rejected': deserialize.integer(payload.get('reservations_rejected')), + 'reservations_timed_out': deserialize.integer(payload.get('reservations_timed_out')), + 'reservations_canceled': deserialize.integer(payload.get('reservations_canceled')), + 'reservations_rescinded': deserialize.integer(payload.get('reservations_rescinded')), + 'split_by_wait_time': payload.get('split_by_wait_time'), + 'task_queue_sid': payload.get('task_queue_sid'), + 'wait_duration_until_accepted': payload.get('wait_duration_until_accepted'), + 'wait_duration_until_canceled': payload.get('wait_duration_until_canceled'), + 'tasks_canceled': deserialize.integer(payload.get('tasks_canceled')), + 'tasks_completed': deserialize.integer(payload.get('tasks_completed')), + 'tasks_deleted': deserialize.integer(payload.get('tasks_deleted')), + 'tasks_entered': deserialize.integer(payload.get('tasks_entered')), + 'tasks_moved': deserialize.integer(payload.get('tasks_moved')), + 'workspace_sid': payload.get('workspace_sid'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.py b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.py index 3fe6d461d7..3c24c9d876 100644 --- a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.py @@ -184,18 +184,18 @@ def __init__(self, version, payload, workspace_sid, task_queue_sid): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'activity_statistics': payload['activity_statistics'], - 'longest_task_waiting_age': deserialize.integer(payload['longest_task_waiting_age']), - 'longest_task_waiting_sid': payload['longest_task_waiting_sid'], - 'task_queue_sid': payload['task_queue_sid'], - 'tasks_by_priority': payload['tasks_by_priority'], - 'tasks_by_status': payload['tasks_by_status'], - 'total_available_workers': deserialize.integer(payload['total_available_workers']), - 'total_eligible_workers': deserialize.integer(payload['total_eligible_workers']), - 'total_tasks': deserialize.integer(payload['total_tasks']), - 'workspace_sid': payload['workspace_sid'], - 'url': payload['url'], + 'account_sid': payload.get('account_sid'), + 'activity_statistics': payload.get('activity_statistics'), + 'longest_task_waiting_age': deserialize.integer(payload.get('longest_task_waiting_age')), + 'longest_task_waiting_sid': payload.get('longest_task_waiting_sid'), + 'task_queue_sid': payload.get('task_queue_sid'), + 'tasks_by_priority': payload.get('tasks_by_priority'), + 'tasks_by_status': payload.get('tasks_by_status'), + 'total_available_workers': deserialize.integer(payload.get('total_available_workers')), + 'total_eligible_workers': deserialize.integer(payload.get('total_eligible_workers')), + 'total_tasks': deserialize.integer(payload.get('total_tasks')), + 'workspace_sid': payload.get('workspace_sid'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.py b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.py index aff54c225f..ad57171f7d 100644 --- a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.py @@ -196,12 +196,12 @@ def __init__(self, version, payload, workspace_sid, task_queue_sid): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'cumulative': payload['cumulative'], - 'realtime': payload['realtime'], - 'task_queue_sid': payload['task_queue_sid'], - 'workspace_sid': payload['workspace_sid'], - 'url': payload['url'], + 'account_sid': payload.get('account_sid'), + 'cumulative': payload.get('cumulative'), + 'realtime': payload.get('realtime'), + 'task_queue_sid': payload.get('task_queue_sid'), + 'workspace_sid': payload.get('workspace_sid'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.py b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.py index dfef4de3a8..7aac9352bc 100644 --- a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.py @@ -235,11 +235,11 @@ def __init__(self, version, payload, workspace_sid): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'cumulative': payload['cumulative'], - 'realtime': payload['realtime'], - 'task_queue_sid': payload['task_queue_sid'], - 'workspace_sid': payload['workspace_sid'], + 'account_sid': payload.get('account_sid'), + 'cumulative': payload.get('cumulative'), + 'realtime': payload.get('realtime'), + 'task_queue_sid': payload.get('task_queue_sid'), + 'workspace_sid': payload.get('workspace_sid'), } # Context diff --git a/twilio/rest/taskrouter/v1/workspace/worker/__init__.py b/twilio/rest/taskrouter/v1/workspace/worker/__init__.py index 08bfa63ec8..c28bcebcce 100644 --- a/twilio/rest/taskrouter/v1/workspace/worker/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/worker/__init__.py @@ -491,19 +491,19 @@ def __init__(self, version, payload, workspace_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'activity_name': payload['activity_name'], - 'activity_sid': payload['activity_sid'], - 'attributes': payload['attributes'], - 'available': payload['available'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_status_changed': deserialize.iso8601_datetime(payload['date_status_changed']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'friendly_name': payload['friendly_name'], - 'sid': payload['sid'], - 'workspace_sid': payload['workspace_sid'], - 'url': payload['url'], - 'links': payload['links'], + 'account_sid': payload.get('account_sid'), + 'activity_name': payload.get('activity_name'), + 'activity_sid': payload.get('activity_sid'), + 'attributes': payload.get('attributes'), + 'available': payload.get('available'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_status_changed': deserialize.iso8601_datetime(payload.get('date_status_changed')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'friendly_name': payload.get('friendly_name'), + 'sid': payload.get('sid'), + 'workspace_sid': payload.get('workspace_sid'), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/taskrouter/v1/workspace/worker/reservation.py b/twilio/rest/taskrouter/v1/workspace/worker/reservation.py index 9d5f03ba12..3ef7578be5 100644 --- a/twilio/rest/taskrouter/v1/workspace/worker/reservation.py +++ b/twilio/rest/taskrouter/v1/workspace/worker/reservation.py @@ -465,17 +465,17 @@ def __init__(self, version, payload, workspace_sid, worker_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'reservation_status': payload['reservation_status'], - 'sid': payload['sid'], - 'task_sid': payload['task_sid'], - 'worker_name': payload['worker_name'], - 'worker_sid': payload['worker_sid'], - 'workspace_sid': payload['workspace_sid'], - 'url': payload['url'], - 'links': payload['links'], + 'account_sid': payload.get('account_sid'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'reservation_status': payload.get('reservation_status'), + 'sid': payload.get('sid'), + 'task_sid': payload.get('task_sid'), + 'worker_name': payload.get('worker_name'), + 'worker_sid': payload.get('worker_sid'), + 'workspace_sid': payload.get('workspace_sid'), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/taskrouter/v1/workspace/worker/worker_channel.py b/twilio/rest/taskrouter/v1/workspace/worker/worker_channel.py index 6e22804d31..75eb14d072 100644 --- a/twilio/rest/taskrouter/v1/workspace/worker/worker_channel.py +++ b/twilio/rest/taskrouter/v1/workspace/worker/worker_channel.py @@ -298,19 +298,19 @@ def __init__(self, version, payload, workspace_sid, worker_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'assigned_tasks': deserialize.integer(payload['assigned_tasks']), - 'available': payload['available'], - 'available_capacity_percentage': deserialize.integer(payload['available_capacity_percentage']), - 'configured_capacity': deserialize.integer(payload['configured_capacity']), - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'sid': payload['sid'], - 'task_channel_sid': payload['task_channel_sid'], - 'task_channel_unique_name': payload['task_channel_unique_name'], - 'worker_sid': payload['worker_sid'], - 'workspace_sid': payload['workspace_sid'], - 'url': payload['url'], + 'account_sid': payload.get('account_sid'), + 'assigned_tasks': deserialize.integer(payload.get('assigned_tasks')), + 'available': payload.get('available'), + 'available_capacity_percentage': deserialize.integer(payload.get('available_capacity_percentage')), + 'configured_capacity': deserialize.integer(payload.get('configured_capacity')), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'sid': payload.get('sid'), + 'task_channel_sid': payload.get('task_channel_sid'), + 'task_channel_unique_name': payload.get('task_channel_unique_name'), + 'worker_sid': payload.get('worker_sid'), + 'workspace_sid': payload.get('workspace_sid'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/taskrouter/v1/workspace/worker/worker_statistics.py b/twilio/rest/taskrouter/v1/workspace/worker/worker_statistics.py index 1152c75189..d9587cfbc3 100644 --- a/twilio/rest/taskrouter/v1/workspace/worker/worker_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/worker/worker_statistics.py @@ -193,11 +193,11 @@ def __init__(self, version, payload, workspace_sid, worker_sid): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'cumulative': payload['cumulative'], - 'worker_sid': payload['worker_sid'], - 'workspace_sid': payload['workspace_sid'], - 'url': payload['url'], + 'account_sid': payload.get('account_sid'), + 'cumulative': payload.get('cumulative'), + 'worker_sid': payload.get('worker_sid'), + 'workspace_sid': payload.get('workspace_sid'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/taskrouter/v1/workspace/worker/workers_cumulative_statistics.py b/twilio/rest/taskrouter/v1/workspace/worker/workers_cumulative_statistics.py index c68013a2bb..0485c6462b 100644 --- a/twilio/rest/taskrouter/v1/workspace/worker/workers_cumulative_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/worker/workers_cumulative_statistics.py @@ -187,18 +187,18 @@ def __init__(self, version, payload, workspace_sid): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'start_time': deserialize.iso8601_datetime(payload['start_time']), - 'end_time': deserialize.iso8601_datetime(payload['end_time']), - 'activity_durations': payload['activity_durations'], - 'reservations_created': deserialize.integer(payload['reservations_created']), - 'reservations_accepted': deserialize.integer(payload['reservations_accepted']), - 'reservations_rejected': deserialize.integer(payload['reservations_rejected']), - 'reservations_timed_out': deserialize.integer(payload['reservations_timed_out']), - 'reservations_canceled': deserialize.integer(payload['reservations_canceled']), - 'reservations_rescinded': deserialize.integer(payload['reservations_rescinded']), - 'workspace_sid': payload['workspace_sid'], - 'url': payload['url'], + 'account_sid': payload.get('account_sid'), + 'start_time': deserialize.iso8601_datetime(payload.get('start_time')), + 'end_time': deserialize.iso8601_datetime(payload.get('end_time')), + 'activity_durations': payload.get('activity_durations'), + 'reservations_created': deserialize.integer(payload.get('reservations_created')), + 'reservations_accepted': deserialize.integer(payload.get('reservations_accepted')), + 'reservations_rejected': deserialize.integer(payload.get('reservations_rejected')), + 'reservations_timed_out': deserialize.integer(payload.get('reservations_timed_out')), + 'reservations_canceled': deserialize.integer(payload.get('reservations_canceled')), + 'reservations_rescinded': deserialize.integer(payload.get('reservations_rescinded')), + 'workspace_sid': payload.get('workspace_sid'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.py b/twilio/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.py index bcc3e0fab8..a5180be4ad 100644 --- a/twilio/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.py @@ -177,11 +177,11 @@ def __init__(self, version, payload, workspace_sid): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'activity_statistics': payload['activity_statistics'], - 'total_workers': deserialize.integer(payload['total_workers']), - 'workspace_sid': payload['workspace_sid'], - 'url': payload['url'], + 'account_sid': payload.get('account_sid'), + 'activity_statistics': payload.get('activity_statistics'), + 'total_workers': deserialize.integer(payload.get('total_workers')), + 'workspace_sid': payload.get('workspace_sid'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/taskrouter/v1/workspace/worker/workers_statistics.py b/twilio/rest/taskrouter/v1/workspace/worker/workers_statistics.py index aa8408d391..fd750910b6 100644 --- a/twilio/rest/taskrouter/v1/workspace/worker/workers_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/worker/workers_statistics.py @@ -188,11 +188,11 @@ def __init__(self, version, payload, workspace_sid): # Marshaled Properties self._properties = { - 'realtime': payload['realtime'], - 'cumulative': payload['cumulative'], - 'account_sid': payload['account_sid'], - 'workspace_sid': payload['workspace_sid'], - 'url': payload['url'], + 'realtime': payload.get('realtime'), + 'cumulative': payload.get('cumulative'), + 'account_sid': payload.get('account_sid'), + 'workspace_sid': payload.get('workspace_sid'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/taskrouter/v1/workspace/workflow/__init__.py b/twilio/rest/taskrouter/v1/workspace/workflow/__init__.py index b18a9834a8..afc54c7845 100644 --- a/twilio/rest/taskrouter/v1/workspace/workflow/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/workflow/__init__.py @@ -395,19 +395,19 @@ def __init__(self, version, payload, workspace_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'assignment_callback_url': payload['assignment_callback_url'], - 'configuration': payload['configuration'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'document_content_type': payload['document_content_type'], - 'fallback_assignment_callback_url': payload['fallback_assignment_callback_url'], - 'friendly_name': payload['friendly_name'], - 'sid': payload['sid'], - 'task_reservation_timeout': deserialize.integer(payload['task_reservation_timeout']), - 'workspace_sid': payload['workspace_sid'], - 'url': payload['url'], - 'links': payload['links'], + 'account_sid': payload.get('account_sid'), + 'assignment_callback_url': payload.get('assignment_callback_url'), + 'configuration': payload.get('configuration'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'document_content_type': payload.get('document_content_type'), + 'fallback_assignment_callback_url': payload.get('fallback_assignment_callback_url'), + 'friendly_name': payload.get('friendly_name'), + 'sid': payload.get('sid'), + 'task_reservation_timeout': deserialize.integer(payload.get('task_reservation_timeout')), + 'workspace_sid': payload.get('workspace_sid'), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.py b/twilio/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.py index ab579bb781..90885dae20 100644 --- a/twilio/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.py @@ -197,28 +197,28 @@ def __init__(self, version, payload, workspace_sid, workflow_sid): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'avg_task_acceptance_time': deserialize.integer(payload['avg_task_acceptance_time']), - 'start_time': deserialize.iso8601_datetime(payload['start_time']), - 'end_time': deserialize.iso8601_datetime(payload['end_time']), - 'reservations_created': deserialize.integer(payload['reservations_created']), - 'reservations_accepted': deserialize.integer(payload['reservations_accepted']), - 'reservations_rejected': deserialize.integer(payload['reservations_rejected']), - 'reservations_timed_out': deserialize.integer(payload['reservations_timed_out']), - 'reservations_canceled': deserialize.integer(payload['reservations_canceled']), - 'reservations_rescinded': deserialize.integer(payload['reservations_rescinded']), - 'split_by_wait_time': payload['split_by_wait_time'], - 'wait_duration_until_accepted': payload['wait_duration_until_accepted'], - 'wait_duration_until_canceled': payload['wait_duration_until_canceled'], - 'tasks_canceled': deserialize.integer(payload['tasks_canceled']), - 'tasks_completed': deserialize.integer(payload['tasks_completed']), - 'tasks_entered': deserialize.integer(payload['tasks_entered']), - 'tasks_deleted': deserialize.integer(payload['tasks_deleted']), - 'tasks_moved': deserialize.integer(payload['tasks_moved']), - 'tasks_timed_out_in_workflow': deserialize.integer(payload['tasks_timed_out_in_workflow']), - 'workflow_sid': payload['workflow_sid'], - 'workspace_sid': payload['workspace_sid'], - 'url': payload['url'], + 'account_sid': payload.get('account_sid'), + 'avg_task_acceptance_time': deserialize.integer(payload.get('avg_task_acceptance_time')), + 'start_time': deserialize.iso8601_datetime(payload.get('start_time')), + 'end_time': deserialize.iso8601_datetime(payload.get('end_time')), + 'reservations_created': deserialize.integer(payload.get('reservations_created')), + 'reservations_accepted': deserialize.integer(payload.get('reservations_accepted')), + 'reservations_rejected': deserialize.integer(payload.get('reservations_rejected')), + 'reservations_timed_out': deserialize.integer(payload.get('reservations_timed_out')), + 'reservations_canceled': deserialize.integer(payload.get('reservations_canceled')), + 'reservations_rescinded': deserialize.integer(payload.get('reservations_rescinded')), + 'split_by_wait_time': payload.get('split_by_wait_time'), + 'wait_duration_until_accepted': payload.get('wait_duration_until_accepted'), + 'wait_duration_until_canceled': payload.get('wait_duration_until_canceled'), + 'tasks_canceled': deserialize.integer(payload.get('tasks_canceled')), + 'tasks_completed': deserialize.integer(payload.get('tasks_completed')), + 'tasks_entered': deserialize.integer(payload.get('tasks_entered')), + 'tasks_deleted': deserialize.integer(payload.get('tasks_deleted')), + 'tasks_moved': deserialize.integer(payload.get('tasks_moved')), + 'tasks_timed_out_in_workflow': deserialize.integer(payload.get('tasks_timed_out_in_workflow')), + 'workflow_sid': payload.get('workflow_sid'), + 'workspace_sid': payload.get('workspace_sid'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.py b/twilio/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.py index f04a9c8d5b..40187c8635 100644 --- a/twilio/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.py @@ -184,15 +184,15 @@ def __init__(self, version, payload, workspace_sid, workflow_sid): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'longest_task_waiting_age': deserialize.integer(payload['longest_task_waiting_age']), - 'longest_task_waiting_sid': payload['longest_task_waiting_sid'], - 'tasks_by_priority': payload['tasks_by_priority'], - 'tasks_by_status': payload['tasks_by_status'], - 'total_tasks': deserialize.integer(payload['total_tasks']), - 'workflow_sid': payload['workflow_sid'], - 'workspace_sid': payload['workspace_sid'], - 'url': payload['url'], + 'account_sid': payload.get('account_sid'), + 'longest_task_waiting_age': deserialize.integer(payload.get('longest_task_waiting_age')), + 'longest_task_waiting_sid': payload.get('longest_task_waiting_sid'), + 'tasks_by_priority': payload.get('tasks_by_priority'), + 'tasks_by_status': payload.get('tasks_by_status'), + 'total_tasks': deserialize.integer(payload.get('total_tasks')), + 'workflow_sid': payload.get('workflow_sid'), + 'workspace_sid': payload.get('workspace_sid'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/taskrouter/v1/workspace/workflow/workflow_statistics.py b/twilio/rest/taskrouter/v1/workspace/workflow/workflow_statistics.py index 98581b1143..3ed0a088fe 100644 --- a/twilio/rest/taskrouter/v1/workspace/workflow/workflow_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/workflow/workflow_statistics.py @@ -196,12 +196,12 @@ def __init__(self, version, payload, workspace_sid, workflow_sid): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'cumulative': payload['cumulative'], - 'realtime': payload['realtime'], - 'workflow_sid': payload['workflow_sid'], - 'workspace_sid': payload['workspace_sid'], - 'url': payload['url'], + 'account_sid': payload.get('account_sid'), + 'cumulative': payload.get('cumulative'), + 'realtime': payload.get('realtime'), + 'workflow_sid': payload.get('workflow_sid'), + 'workspace_sid': payload.get('workspace_sid'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.py b/twilio/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.py index 1f6b25afb9..7bcb6899a6 100644 --- a/twilio/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.py @@ -190,27 +190,27 @@ def __init__(self, version, payload, workspace_sid): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'avg_task_acceptance_time': deserialize.integer(payload['avg_task_acceptance_time']), - 'start_time': deserialize.iso8601_datetime(payload['start_time']), - 'end_time': deserialize.iso8601_datetime(payload['end_time']), - 'reservations_created': deserialize.integer(payload['reservations_created']), - 'reservations_accepted': deserialize.integer(payload['reservations_accepted']), - 'reservations_rejected': deserialize.integer(payload['reservations_rejected']), - 'reservations_timed_out': deserialize.integer(payload['reservations_timed_out']), - 'reservations_canceled': deserialize.integer(payload['reservations_canceled']), - 'reservations_rescinded': deserialize.integer(payload['reservations_rescinded']), - 'split_by_wait_time': payload['split_by_wait_time'], - 'wait_duration_until_accepted': payload['wait_duration_until_accepted'], - 'wait_duration_until_canceled': payload['wait_duration_until_canceled'], - 'tasks_canceled': deserialize.integer(payload['tasks_canceled']), - 'tasks_completed': deserialize.integer(payload['tasks_completed']), - 'tasks_created': deserialize.integer(payload['tasks_created']), - 'tasks_deleted': deserialize.integer(payload['tasks_deleted']), - 'tasks_moved': deserialize.integer(payload['tasks_moved']), - 'tasks_timed_out_in_workflow': deserialize.integer(payload['tasks_timed_out_in_workflow']), - 'workspace_sid': payload['workspace_sid'], - 'url': payload['url'], + 'account_sid': payload.get('account_sid'), + 'avg_task_acceptance_time': deserialize.integer(payload.get('avg_task_acceptance_time')), + 'start_time': deserialize.iso8601_datetime(payload.get('start_time')), + 'end_time': deserialize.iso8601_datetime(payload.get('end_time')), + 'reservations_created': deserialize.integer(payload.get('reservations_created')), + 'reservations_accepted': deserialize.integer(payload.get('reservations_accepted')), + 'reservations_rejected': deserialize.integer(payload.get('reservations_rejected')), + 'reservations_timed_out': deserialize.integer(payload.get('reservations_timed_out')), + 'reservations_canceled': deserialize.integer(payload.get('reservations_canceled')), + 'reservations_rescinded': deserialize.integer(payload.get('reservations_rescinded')), + 'split_by_wait_time': payload.get('split_by_wait_time'), + 'wait_duration_until_accepted': payload.get('wait_duration_until_accepted'), + 'wait_duration_until_canceled': payload.get('wait_duration_until_canceled'), + 'tasks_canceled': deserialize.integer(payload.get('tasks_canceled')), + 'tasks_completed': deserialize.integer(payload.get('tasks_completed')), + 'tasks_created': deserialize.integer(payload.get('tasks_created')), + 'tasks_deleted': deserialize.integer(payload.get('tasks_deleted')), + 'tasks_moved': deserialize.integer(payload.get('tasks_moved')), + 'tasks_timed_out_in_workflow': deserialize.integer(payload.get('tasks_timed_out_in_workflow')), + 'workspace_sid': payload.get('workspace_sid'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/taskrouter/v1/workspace/workspace_real_time_statistics.py b/twilio/rest/taskrouter/v1/workspace/workspace_real_time_statistics.py index e5ff09a338..d3126850e7 100644 --- a/twilio/rest/taskrouter/v1/workspace/workspace_real_time_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/workspace_real_time_statistics.py @@ -177,16 +177,16 @@ def __init__(self, version, payload, workspace_sid): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'activity_statistics': payload['activity_statistics'], - 'longest_task_waiting_age': deserialize.integer(payload['longest_task_waiting_age']), - 'longest_task_waiting_sid': payload['longest_task_waiting_sid'], - 'tasks_by_priority': payload['tasks_by_priority'], - 'tasks_by_status': payload['tasks_by_status'], - 'total_tasks': deserialize.integer(payload['total_tasks']), - 'total_workers': deserialize.integer(payload['total_workers']), - 'workspace_sid': payload['workspace_sid'], - 'url': payload['url'], + 'account_sid': payload.get('account_sid'), + 'activity_statistics': payload.get('activity_statistics'), + 'longest_task_waiting_age': deserialize.integer(payload.get('longest_task_waiting_age')), + 'longest_task_waiting_sid': payload.get('longest_task_waiting_sid'), + 'tasks_by_priority': payload.get('tasks_by_priority'), + 'tasks_by_status': payload.get('tasks_by_status'), + 'total_tasks': deserialize.integer(payload.get('total_tasks')), + 'total_workers': deserialize.integer(payload.get('total_workers')), + 'workspace_sid': payload.get('workspace_sid'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/taskrouter/v1/workspace/workspace_statistics.py b/twilio/rest/taskrouter/v1/workspace/workspace_statistics.py index f698e82948..348c1ad94c 100644 --- a/twilio/rest/taskrouter/v1/workspace/workspace_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/workspace_statistics.py @@ -183,11 +183,11 @@ def __init__(self, version, payload, workspace_sid): # Marshaled Properties self._properties = { - 'realtime': payload['realtime'], - 'cumulative': payload['cumulative'], - 'account_sid': payload['account_sid'], - 'workspace_sid': payload['workspace_sid'], - 'url': payload['url'], + 'realtime': payload.get('realtime'), + 'cumulative': payload.get('cumulative'), + 'account_sid': payload.get('account_sid'), + 'workspace_sid': payload.get('workspace_sid'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/trunking/v1/trunk/__init__.py b/twilio/rest/trunking/v1/trunk/__init__.py index 1123df91ca..e9d79e103e 100644 --- a/twilio/rest/trunking/v1/trunk/__init__.py +++ b/twilio/rest/trunking/v1/trunk/__init__.py @@ -409,21 +409,21 @@ def __init__(self, version, payload, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'domain_name': payload['domain_name'], - 'disaster_recovery_method': payload['disaster_recovery_method'], - 'disaster_recovery_url': payload['disaster_recovery_url'], - 'friendly_name': payload['friendly_name'], - 'secure': payload['secure'], - 'recording': payload['recording'], - 'cnam_lookup_enabled': payload['cnam_lookup_enabled'], - 'auth_type': payload['auth_type'], - 'auth_type_set': payload['auth_type_set'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'sid': payload['sid'], - 'url': payload['url'], - 'links': payload['links'], + 'account_sid': payload.get('account_sid'), + 'domain_name': payload.get('domain_name'), + 'disaster_recovery_method': payload.get('disaster_recovery_method'), + 'disaster_recovery_url': payload.get('disaster_recovery_url'), + 'friendly_name': payload.get('friendly_name'), + 'secure': payload.get('secure'), + 'recording': payload.get('recording'), + 'cnam_lookup_enabled': payload.get('cnam_lookup_enabled'), + 'auth_type': payload.get('auth_type'), + 'auth_type_set': payload.get('auth_type_set'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'sid': payload.get('sid'), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/trunking/v1/trunk/credential_list.py b/twilio/rest/trunking/v1/trunk/credential_list.py index 08721316bc..019a1376db 100644 --- a/twilio/rest/trunking/v1/trunk/credential_list.py +++ b/twilio/rest/trunking/v1/trunk/credential_list.py @@ -281,13 +281,13 @@ def __init__(self, version, payload, trunk_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'sid': payload['sid'], - 'trunk_sid': payload['trunk_sid'], - 'friendly_name': payload['friendly_name'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], + 'account_sid': payload.get('account_sid'), + 'sid': payload.get('sid'), + 'trunk_sid': payload.get('trunk_sid'), + 'friendly_name': payload.get('friendly_name'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/trunking/v1/trunk/ip_access_control_list.py b/twilio/rest/trunking/v1/trunk/ip_access_control_list.py index b29c5c3ee0..adeb6ada40 100644 --- a/twilio/rest/trunking/v1/trunk/ip_access_control_list.py +++ b/twilio/rest/trunking/v1/trunk/ip_access_control_list.py @@ -281,13 +281,13 @@ def __init__(self, version, payload, trunk_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'sid': payload['sid'], - 'trunk_sid': payload['trunk_sid'], - 'friendly_name': payload['friendly_name'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], + 'account_sid': payload.get('account_sid'), + 'sid': payload.get('sid'), + 'trunk_sid': payload.get('trunk_sid'), + 'friendly_name': payload.get('friendly_name'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/trunking/v1/trunk/origination_url.py b/twilio/rest/trunking/v1/trunk/origination_url.py index 1b36ccf441..d7f03b7d04 100644 --- a/twilio/rest/trunking/v1/trunk/origination_url.py +++ b/twilio/rest/trunking/v1/trunk/origination_url.py @@ -327,17 +327,17 @@ def __init__(self, version, payload, trunk_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'sid': payload['sid'], - 'trunk_sid': payload['trunk_sid'], - 'weight': deserialize.integer(payload['weight']), - 'enabled': payload['enabled'], - 'sip_url': payload['sip_url'], - 'friendly_name': payload['friendly_name'], - 'priority': deserialize.integer(payload['priority']), - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], + 'account_sid': payload.get('account_sid'), + 'sid': payload.get('sid'), + 'trunk_sid': payload.get('trunk_sid'), + 'weight': deserialize.integer(payload.get('weight')), + 'enabled': payload.get('enabled'), + 'sip_url': payload.get('sip_url'), + 'friendly_name': payload.get('friendly_name'), + 'priority': deserialize.integer(payload.get('priority')), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/trunking/v1/trunk/phone_number.py b/twilio/rest/trunking/v1/trunk/phone_number.py index 1b83495bff..88c1a80cfe 100644 --- a/twilio/rest/trunking/v1/trunk/phone_number.py +++ b/twilio/rest/trunking/v1/trunk/phone_number.py @@ -287,32 +287,32 @@ def __init__(self, version, payload, trunk_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'address_requirements': payload['address_requirements'], - 'api_version': payload['api_version'], - 'beta': payload['beta'], - 'capabilities': payload['capabilities'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'friendly_name': payload['friendly_name'], - 'links': payload['links'], - 'phone_number': payload['phone_number'], - 'sid': payload['sid'], - 'sms_application_sid': payload['sms_application_sid'], - 'sms_fallback_method': payload['sms_fallback_method'], - 'sms_fallback_url': payload['sms_fallback_url'], - 'sms_method': payload['sms_method'], - 'sms_url': payload['sms_url'], - 'status_callback': payload['status_callback'], - 'status_callback_method': payload['status_callback_method'], - 'trunk_sid': payload['trunk_sid'], - 'url': payload['url'], - 'voice_application_sid': payload['voice_application_sid'], - 'voice_caller_id_lookup': payload['voice_caller_id_lookup'], - 'voice_fallback_method': payload['voice_fallback_method'], - 'voice_fallback_url': payload['voice_fallback_url'], - 'voice_method': payload['voice_method'], - 'voice_url': payload['voice_url'], + 'account_sid': payload.get('account_sid'), + 'address_requirements': payload.get('address_requirements'), + 'api_version': payload.get('api_version'), + 'beta': payload.get('beta'), + 'capabilities': payload.get('capabilities'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'friendly_name': payload.get('friendly_name'), + 'links': payload.get('links'), + 'phone_number': payload.get('phone_number'), + 'sid': payload.get('sid'), + 'sms_application_sid': payload.get('sms_application_sid'), + 'sms_fallback_method': payload.get('sms_fallback_method'), + 'sms_fallback_url': payload.get('sms_fallback_url'), + 'sms_method': payload.get('sms_method'), + 'sms_url': payload.get('sms_url'), + 'status_callback': payload.get('status_callback'), + 'status_callback_method': payload.get('status_callback_method'), + 'trunk_sid': payload.get('trunk_sid'), + 'url': payload.get('url'), + 'voice_application_sid': payload.get('voice_application_sid'), + 'voice_caller_id_lookup': payload.get('voice_caller_id_lookup'), + 'voice_fallback_method': payload.get('voice_fallback_method'), + 'voice_fallback_url': payload.get('voice_fallback_url'), + 'voice_method': payload.get('voice_method'), + 'voice_url': payload.get('voice_url'), } # Context diff --git a/twilio/rest/trunking/v1/trunk/terminating_sip_domain.py b/twilio/rest/trunking/v1/trunk/terminating_sip_domain.py index 23789c6880..8ae8423154 100644 --- a/twilio/rest/trunking/v1/trunk/terminating_sip_domain.py +++ b/twilio/rest/trunking/v1/trunk/terminating_sip_domain.py @@ -281,24 +281,24 @@ def __init__(self, version, payload, trunk_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'api_version': payload['api_version'], - 'auth_type': payload['auth_type'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'domain_name': payload['domain_name'], - 'friendly_name': payload['friendly_name'], - 'sid': payload['sid'], - 'url': payload['url'], - 'voice_fallback_method': payload['voice_fallback_method'], - 'voice_fallback_url': payload['voice_fallback_url'], - 'voice_method': payload['voice_method'], - 'voice_status_callback_method': payload['voice_status_callback_method'], - 'voice_status_callback_url': payload['voice_status_callback_url'], - 'voice_url': payload['voice_url'], - 'sip_registration': payload['sip_registration'], - 'trunk_sid': payload['trunk_sid'], - 'links': payload['links'], + 'account_sid': payload.get('account_sid'), + 'api_version': payload.get('api_version'), + 'auth_type': payload.get('auth_type'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'domain_name': payload.get('domain_name'), + 'friendly_name': payload.get('friendly_name'), + 'sid': payload.get('sid'), + 'url': payload.get('url'), + 'voice_fallback_method': payload.get('voice_fallback_method'), + 'voice_fallback_url': payload.get('voice_fallback_url'), + 'voice_method': payload.get('voice_method'), + 'voice_status_callback_method': payload.get('voice_status_callback_method'), + 'voice_status_callback_url': payload.get('voice_status_callback_url'), + 'voice_url': payload.get('voice_url'), + 'sip_registration': payload.get('sip_registration'), + 'trunk_sid': payload.get('trunk_sid'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/verify/v2/service/__init__.py b/twilio/rest/verify/v2/service/__init__.py index 1a53a714fc..1b77d23a85 100644 --- a/twilio/rest/verify/v2/service/__init__.py +++ b/twilio/rest/verify/v2/service/__init__.py @@ -391,19 +391,19 @@ def __init__(self, version, payload, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'friendly_name': payload['friendly_name'], - 'code_length': deserialize.integer(payload['code_length']), - 'lookup_enabled': payload['lookup_enabled'], - 'psd2_enabled': payload['psd2_enabled'], - 'skip_sms_to_landlines': payload['skip_sms_to_landlines'], - 'dtmf_input_required': payload['dtmf_input_required'], - 'tts_name': payload['tts_name'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], - 'links': payload['links'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'friendly_name': payload.get('friendly_name'), + 'code_length': deserialize.integer(payload.get('code_length')), + 'lookup_enabled': payload.get('lookup_enabled'), + 'psd2_enabled': payload.get('psd2_enabled'), + 'skip_sms_to_landlines': payload.get('skip_sms_to_landlines'), + 'dtmf_input_required': payload.get('dtmf_input_required'), + 'tts_name': payload.get('tts_name'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/verify/v2/service/messaging_configuration.py b/twilio/rest/verify/v2/service/messaging_configuration.py index c521cf9c0f..17c801bd7a 100644 --- a/twilio/rest/verify/v2/service/messaging_configuration.py +++ b/twilio/rest/verify/v2/service/messaging_configuration.py @@ -326,13 +326,13 @@ def __init__(self, version, payload, service_sid, country=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'service_sid': payload['service_sid'], - 'country': payload['country'], - 'messaging_service_sid': payload['messaging_service_sid'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], + 'account_sid': payload.get('account_sid'), + 'service_sid': payload.get('service_sid'), + 'country': payload.get('country'), + 'messaging_service_sid': payload.get('messaging_service_sid'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/verify/v2/service/rate_limit/__init__.py b/twilio/rest/verify/v2/service/rate_limit/__init__.py index 8a27fc8a29..6f53821cc6 100644 --- a/twilio/rest/verify/v2/service/rate_limit/__init__.py +++ b/twilio/rest/verify/v2/service/rate_limit/__init__.py @@ -330,15 +330,15 @@ def __init__(self, version, payload, service_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'service_sid': payload['service_sid'], - 'account_sid': payload['account_sid'], - 'unique_name': payload['unique_name'], - 'description': payload['description'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], - 'links': payload['links'], + 'sid': payload.get('sid'), + 'service_sid': payload.get('service_sid'), + 'account_sid': payload.get('account_sid'), + 'unique_name': payload.get('unique_name'), + 'description': payload.get('description'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/verify/v2/service/rate_limit/bucket.py b/twilio/rest/verify/v2/service/rate_limit/bucket.py index 5ddc0a2cca..e1e1e714de 100644 --- a/twilio/rest/verify/v2/service/rate_limit/bucket.py +++ b/twilio/rest/verify/v2/service/rate_limit/bucket.py @@ -336,15 +336,15 @@ def __init__(self, version, payload, service_sid, rate_limit_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'rate_limit_sid': payload['rate_limit_sid'], - 'service_sid': payload['service_sid'], - 'account_sid': payload['account_sid'], - 'max': deserialize.integer(payload['max']), - 'interval': deserialize.integer(payload['interval']), - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], + 'sid': payload.get('sid'), + 'rate_limit_sid': payload.get('rate_limit_sid'), + 'service_sid': payload.get('service_sid'), + 'account_sid': payload.get('account_sid'), + 'max': deserialize.integer(payload.get('max')), + 'interval': deserialize.integer(payload.get('interval')), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/verify/v2/service/verification.py b/twilio/rest/verify/v2/service/verification.py index 2e6d7b2ddc..f6797d4cd9 100644 --- a/twilio/rest/verify/v2/service/verification.py +++ b/twilio/rest/verify/v2/service/verification.py @@ -249,19 +249,19 @@ def __init__(self, version, payload, service_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'service_sid': payload['service_sid'], - 'account_sid': payload['account_sid'], - 'to': payload['to'], - 'channel': payload['channel'], - 'status': payload['status'], - 'valid': payload['valid'], - 'lookup': payload['lookup'], - 'amount': payload['amount'], - 'payee': payload['payee'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], + 'sid': payload.get('sid'), + 'service_sid': payload.get('service_sid'), + 'account_sid': payload.get('account_sid'), + 'to': payload.get('to'), + 'channel': payload.get('channel'), + 'status': payload.get('status'), + 'valid': payload.get('valid'), + 'lookup': payload.get('lookup'), + 'amount': payload.get('amount'), + 'payee': payload.get('payee'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/verify/v2/service/verification_check.py b/twilio/rest/verify/v2/service/verification_check.py index 1388bc8d89..92c24f2141 100644 --- a/twilio/rest/verify/v2/service/verification_check.py +++ b/twilio/rest/verify/v2/service/verification_check.py @@ -133,17 +133,17 @@ def __init__(self, version, payload, service_sid): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'service_sid': payload['service_sid'], - 'account_sid': payload['account_sid'], - 'to': payload['to'], - 'channel': payload['channel'], - 'status': payload['status'], - 'valid': payload['valid'], - 'amount': payload['amount'], - 'payee': payload['payee'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), + 'sid': payload.get('sid'), + 'service_sid': payload.get('service_sid'), + 'account_sid': payload.get('account_sid'), + 'to': payload.get('to'), + 'channel': payload.get('channel'), + 'status': payload.get('status'), + 'valid': payload.get('valid'), + 'amount': payload.get('amount'), + 'payee': payload.get('payee'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), } # Context diff --git a/twilio/rest/video/v1/composition/__init__.py b/twilio/rest/video/v1/composition/__init__.py index a4e7acbe86..cefad890ff 100644 --- a/twilio/rest/video/v1/composition/__init__.py +++ b/twilio/rest/video/v1/composition/__init__.py @@ -354,24 +354,24 @@ def __init__(self, version, payload, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'status': payload['status'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_completed': deserialize.iso8601_datetime(payload['date_completed']), - 'date_deleted': deserialize.iso8601_datetime(payload['date_deleted']), - 'sid': payload['sid'], - 'room_sid': payload['room_sid'], - 'audio_sources': payload['audio_sources'], - 'audio_sources_excluded': payload['audio_sources_excluded'], - 'video_layout': payload['video_layout'], - 'resolution': payload['resolution'], - 'trim': payload['trim'], - 'format': payload['format'], - 'bitrate': deserialize.integer(payload['bitrate']), - 'size': deserialize.integer(payload['size']), - 'duration': deserialize.integer(payload['duration']), - 'url': payload['url'], - 'links': payload['links'], + 'account_sid': payload.get('account_sid'), + 'status': payload.get('status'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_completed': deserialize.iso8601_datetime(payload.get('date_completed')), + 'date_deleted': deserialize.iso8601_datetime(payload.get('date_deleted')), + 'sid': payload.get('sid'), + 'room_sid': payload.get('room_sid'), + 'audio_sources': payload.get('audio_sources'), + 'audio_sources_excluded': payload.get('audio_sources_excluded'), + 'video_layout': payload.get('video_layout'), + 'resolution': payload.get('resolution'), + 'trim': payload.get('trim'), + 'format': payload.get('format'), + 'bitrate': deserialize.integer(payload.get('bitrate')), + 'size': deserialize.integer(payload.get('size')), + 'duration': deserialize.integer(payload.get('duration')), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/video/v1/composition_hook.py b/twilio/rest/video/v1/composition_hook.py index 1535cfdb6a..ca54bedd4d 100644 --- a/twilio/rest/video/v1/composition_hook.py +++ b/twilio/rest/video/v1/composition_hook.py @@ -391,21 +391,21 @@ def __init__(self, version, payload, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'friendly_name': payload['friendly_name'], - 'enabled': payload['enabled'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'sid': payload['sid'], - 'audio_sources': payload['audio_sources'], - 'audio_sources_excluded': payload['audio_sources_excluded'], - 'video_layout': payload['video_layout'], - 'resolution': payload['resolution'], - 'trim': payload['trim'], - 'format': payload['format'], - 'status_callback': payload['status_callback'], - 'status_callback_method': payload['status_callback_method'], - 'url': payload['url'], + 'account_sid': payload.get('account_sid'), + 'friendly_name': payload.get('friendly_name'), + 'enabled': payload.get('enabled'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'sid': payload.get('sid'), + 'audio_sources': payload.get('audio_sources'), + 'audio_sources_excluded': payload.get('audio_sources_excluded'), + 'video_layout': payload.get('video_layout'), + 'resolution': payload.get('resolution'), + 'trim': payload.get('trim'), + 'format': payload.get('format'), + 'status_callback': payload.get('status_callback'), + 'status_callback_method': payload.get('status_callback_method'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/video/v1/composition_settings.py b/twilio/rest/video/v1/composition_settings.py index 8fc797faa1..89df2583ba 100644 --- a/twilio/rest/video/v1/composition_settings.py +++ b/twilio/rest/video/v1/composition_settings.py @@ -198,14 +198,14 @@ def __init__(self, version, payload): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'friendly_name': payload['friendly_name'], - 'aws_credentials_sid': payload['aws_credentials_sid'], - 'aws_s3_url': payload['aws_s3_url'], - 'aws_storage_enabled': payload['aws_storage_enabled'], - 'encryption_key_sid': payload['encryption_key_sid'], - 'encryption_enabled': payload['encryption_enabled'], - 'url': payload['url'], + 'account_sid': payload.get('account_sid'), + 'friendly_name': payload.get('friendly_name'), + 'aws_credentials_sid': payload.get('aws_credentials_sid'), + 'aws_s3_url': payload.get('aws_s3_url'), + 'aws_storage_enabled': payload.get('aws_storage_enabled'), + 'encryption_key_sid': payload.get('encryption_key_sid'), + 'encryption_enabled': payload.get('encryption_enabled'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/video/v1/recording/__init__.py b/twilio/rest/video/v1/recording/__init__.py index 1b012f2bae..6fcd985f6a 100644 --- a/twilio/rest/video/v1/recording/__init__.py +++ b/twilio/rest/video/v1/recording/__init__.py @@ -330,21 +330,21 @@ def __init__(self, version, payload, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'status': payload['status'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'sid': payload['sid'], - 'source_sid': payload['source_sid'], - 'size': deserialize.integer(payload['size']), - 'url': payload['url'], - 'type': payload['type'], - 'duration': deserialize.integer(payload['duration']), - 'container_format': payload['container_format'], - 'codec': payload['codec'], - 'grouping_sids': payload['grouping_sids'], - 'track_name': payload['track_name'], - 'offset': deserialize.integer(payload['offset']), - 'links': payload['links'], + 'account_sid': payload.get('account_sid'), + 'status': payload.get('status'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'sid': payload.get('sid'), + 'source_sid': payload.get('source_sid'), + 'size': deserialize.integer(payload.get('size')), + 'url': payload.get('url'), + 'type': payload.get('type'), + 'duration': deserialize.integer(payload.get('duration')), + 'container_format': payload.get('container_format'), + 'codec': payload.get('codec'), + 'grouping_sids': payload.get('grouping_sids'), + 'track_name': payload.get('track_name'), + 'offset': deserialize.integer(payload.get('offset')), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/video/v1/recording_settings.py b/twilio/rest/video/v1/recording_settings.py index 3870173b1c..d43b01f643 100644 --- a/twilio/rest/video/v1/recording_settings.py +++ b/twilio/rest/video/v1/recording_settings.py @@ -198,14 +198,14 @@ def __init__(self, version, payload): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'friendly_name': payload['friendly_name'], - 'aws_credentials_sid': payload['aws_credentials_sid'], - 'aws_s3_url': payload['aws_s3_url'], - 'aws_storage_enabled': payload['aws_storage_enabled'], - 'encryption_key_sid': payload['encryption_key_sid'], - 'encryption_enabled': payload['encryption_enabled'], - 'url': payload['url'], + 'account_sid': payload.get('account_sid'), + 'friendly_name': payload.get('friendly_name'), + 'aws_credentials_sid': payload.get('aws_credentials_sid'), + 'aws_s3_url': payload.get('aws_s3_url'), + 'aws_storage_enabled': payload.get('aws_storage_enabled'), + 'encryption_key_sid': payload.get('encryption_key_sid'), + 'encryption_enabled': payload.get('encryption_enabled'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/video/v1/room/__init__.py b/twilio/rest/video/v1/room/__init__.py index 210556682b..a8ad428e4e 100644 --- a/twilio/rest/video/v1/room/__init__.py +++ b/twilio/rest/video/v1/room/__init__.py @@ -389,24 +389,24 @@ def __init__(self, version, payload, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'status': payload['status'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'account_sid': payload['account_sid'], - 'enable_turn': payload['enable_turn'], - 'unique_name': payload['unique_name'], - 'status_callback': payload['status_callback'], - 'status_callback_method': payload['status_callback_method'], - 'end_time': deserialize.iso8601_datetime(payload['end_time']), - 'duration': deserialize.integer(payload['duration']), - 'type': payload['type'], - 'max_participants': deserialize.integer(payload['max_participants']), - 'record_participants_on_connect': payload['record_participants_on_connect'], - 'video_codecs': payload['video_codecs'], - 'media_region': payload['media_region'], - 'url': payload['url'], - 'links': payload['links'], + 'sid': payload.get('sid'), + 'status': payload.get('status'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'account_sid': payload.get('account_sid'), + 'enable_turn': payload.get('enable_turn'), + 'unique_name': payload.get('unique_name'), + 'status_callback': payload.get('status_callback'), + 'status_callback_method': payload.get('status_callback_method'), + 'end_time': deserialize.iso8601_datetime(payload.get('end_time')), + 'duration': deserialize.integer(payload.get('duration')), + 'type': payload.get('type'), + 'max_participants': deserialize.integer(payload.get('max_participants')), + 'record_participants_on_connect': payload.get('record_participants_on_connect'), + 'video_codecs': payload.get('video_codecs'), + 'media_region': payload.get('media_region'), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/video/v1/room/recording/__init__.py b/twilio/rest/video/v1/room/recording/__init__.py index 1f2448f14d..8c640c78ef 100644 --- a/twilio/rest/video/v1/room/recording/__init__.py +++ b/twilio/rest/video/v1/room/recording/__init__.py @@ -323,22 +323,22 @@ def __init__(self, version, payload, room_sid, sid=None): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'status': payload['status'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'sid': payload['sid'], - 'source_sid': payload['source_sid'], - 'size': deserialize.integer(payload['size']), - 'url': payload['url'], - 'type': payload['type'], - 'duration': deserialize.integer(payload['duration']), - 'container_format': payload['container_format'], - 'codec': payload['codec'], - 'grouping_sids': payload['grouping_sids'], - 'track_name': payload['track_name'], - 'offset': deserialize.integer(payload['offset']), - 'room_sid': payload['room_sid'], - 'links': payload['links'], + 'account_sid': payload.get('account_sid'), + 'status': payload.get('status'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'sid': payload.get('sid'), + 'source_sid': payload.get('source_sid'), + 'size': deserialize.integer(payload.get('size')), + 'url': payload.get('url'), + 'type': payload.get('type'), + 'duration': deserialize.integer(payload.get('duration')), + 'container_format': payload.get('container_format'), + 'codec': payload.get('codec'), + 'grouping_sids': payload.get('grouping_sids'), + 'track_name': payload.get('track_name'), + 'offset': deserialize.integer(payload.get('offset')), + 'room_sid': payload.get('room_sid'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/video/v1/room/room_participant/__init__.py b/twilio/rest/video/v1/room/room_participant/__init__.py index 0e040975f3..7a9990ab94 100644 --- a/twilio/rest/video/v1/room/room_participant/__init__.py +++ b/twilio/rest/video/v1/room/room_participant/__init__.py @@ -377,18 +377,18 @@ def __init__(self, version, payload, room_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'room_sid': payload['room_sid'], - 'account_sid': payload['account_sid'], - 'status': payload['status'], - 'identity': payload['identity'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'start_time': deserialize.iso8601_datetime(payload['start_time']), - 'end_time': deserialize.iso8601_datetime(payload['end_time']), - 'duration': deserialize.integer(payload['duration']), - 'url': payload['url'], - 'links': payload['links'], + 'sid': payload.get('sid'), + 'room_sid': payload.get('room_sid'), + 'account_sid': payload.get('account_sid'), + 'status': payload.get('status'), + 'identity': payload.get('identity'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'start_time': deserialize.iso8601_datetime(payload.get('start_time')), + 'end_time': deserialize.iso8601_datetime(payload.get('end_time')), + 'duration': deserialize.integer(payload.get('duration')), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/video/v1/room/room_participant/room_participant_published_track.py b/twilio/rest/video/v1/room/room_participant/room_participant_published_track.py index 55f331de59..e24d062ff5 100644 --- a/twilio/rest/video/v1/room/room_participant/room_participant_published_track.py +++ b/twilio/rest/video/v1/room/room_participant/room_participant_published_track.py @@ -277,15 +277,15 @@ def __init__(self, version, payload, room_sid, participant_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'participant_sid': payload['participant_sid'], - 'room_sid': payload['room_sid'], - 'name': payload['name'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'enabled': payload['enabled'], - 'kind': payload['kind'], - 'url': payload['url'], + 'sid': payload.get('sid'), + 'participant_sid': payload.get('participant_sid'), + 'room_sid': payload.get('room_sid'), + 'name': payload.get('name'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'enabled': payload.get('enabled'), + 'kind': payload.get('kind'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/video/v1/room/room_participant/room_participant_subscribe_rule.py b/twilio/rest/video/v1/room/room_participant/room_participant_subscribe_rule.py index b72cc72959..33e5678393 100644 --- a/twilio/rest/video/v1/room/room_participant/room_participant_subscribe_rule.py +++ b/twilio/rest/video/v1/room/room_participant/room_participant_subscribe_rule.py @@ -153,11 +153,11 @@ def __init__(self, version, payload, room_sid, participant_sid): # Marshaled Properties self._properties = { - 'participant_sid': payload['participant_sid'], - 'room_sid': payload['room_sid'], - 'rules': payload['rules'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), + 'participant_sid': payload.get('participant_sid'), + 'room_sid': payload.get('room_sid'), + 'rules': payload.get('rules'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), } # Context diff --git a/twilio/rest/video/v1/room/room_participant/room_participant_subscribed_track.py b/twilio/rest/video/v1/room/room_participant/room_participant_subscribed_track.py index ac16772bb8..e6887b9bc7 100644 --- a/twilio/rest/video/v1/room/room_participant/room_participant_subscribed_track.py +++ b/twilio/rest/video/v1/room/room_participant/room_participant_subscribed_track.py @@ -277,16 +277,16 @@ def __init__(self, version, payload, room_sid, participant_sid, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'participant_sid': payload['participant_sid'], - 'publisher_sid': payload['publisher_sid'], - 'room_sid': payload['room_sid'], - 'name': payload['name'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'enabled': payload['enabled'], - 'kind': payload['kind'], - 'url': payload['url'], + 'sid': payload.get('sid'), + 'participant_sid': payload.get('participant_sid'), + 'publisher_sid': payload.get('publisher_sid'), + 'room_sid': payload.get('room_sid'), + 'name': payload.get('name'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'enabled': payload.get('enabled'), + 'kind': payload.get('kind'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/voice/v1/dialing_permissions/bulk_country_update.py b/twilio/rest/voice/v1/dialing_permissions/bulk_country_update.py index c8246780e3..84353ed329 100644 --- a/twilio/rest/voice/v1/dialing_permissions/bulk_country_update.py +++ b/twilio/rest/voice/v1/dialing_permissions/bulk_country_update.py @@ -119,8 +119,8 @@ def __init__(self, version, payload): # Marshaled Properties self._properties = { - 'update_count': deserialize.integer(payload['update_count']), - 'update_request': payload['update_request'], + 'update_count': deserialize.integer(payload.get('update_count')), + 'update_request': payload.get('update_request'), } # Context diff --git a/twilio/rest/voice/v1/dialing_permissions/country/__init__.py b/twilio/rest/voice/v1/dialing_permissions/country/__init__.py index 8933b0fd4d..f8bbb88592 100644 --- a/twilio/rest/voice/v1/dialing_permissions/country/__init__.py +++ b/twilio/rest/voice/v1/dialing_permissions/country/__init__.py @@ -328,15 +328,15 @@ def __init__(self, version, payload, iso_code=None): # Marshaled Properties self._properties = { - 'iso_code': payload['iso_code'], - 'name': payload['name'], - 'continent': payload['continent'], - 'country_codes': payload['country_codes'], - 'low_risk_numbers_enabled': payload['low_risk_numbers_enabled'], - 'high_risk_special_numbers_enabled': payload['high_risk_special_numbers_enabled'], - 'high_risk_tollfraud_numbers_enabled': payload['high_risk_tollfraud_numbers_enabled'], - 'url': payload['url'], - 'links': payload['links'], + 'iso_code': payload.get('iso_code'), + 'name': payload.get('name'), + 'continent': payload.get('continent'), + 'country_codes': payload.get('country_codes'), + 'low_risk_numbers_enabled': payload.get('low_risk_numbers_enabled'), + 'high_risk_special_numbers_enabled': payload.get('high_risk_special_numbers_enabled'), + 'high_risk_tollfraud_numbers_enabled': payload.get('high_risk_tollfraud_numbers_enabled'), + 'url': payload.get('url'), + 'links': payload.get('links'), } # Context diff --git a/twilio/rest/voice/v1/dialing_permissions/country/highrisk_special_prefix.py b/twilio/rest/voice/v1/dialing_permissions/country/highrisk_special_prefix.py index 7e516bf4d4..baedddd0a4 100644 --- a/twilio/rest/voice/v1/dialing_permissions/country/highrisk_special_prefix.py +++ b/twilio/rest/voice/v1/dialing_permissions/country/highrisk_special_prefix.py @@ -181,7 +181,7 @@ def __init__(self, version, payload, iso_code): super(HighriskSpecialPrefixInstance, self).__init__(version) # Marshaled Properties - self._properties = {'prefix': payload['prefix'], } + self._properties = {'prefix': payload.get('prefix'), } # Context self._context = None diff --git a/twilio/rest/voice/v1/dialing_permissions/settings.py b/twilio/rest/voice/v1/dialing_permissions/settings.py index e18105495b..a0c3c42949 100644 --- a/twilio/rest/voice/v1/dialing_permissions/settings.py +++ b/twilio/rest/voice/v1/dialing_permissions/settings.py @@ -184,8 +184,8 @@ def __init__(self, version, payload): # Marshaled Properties self._properties = { - 'dialing_permissions_inheritance': payload['dialing_permissions_inheritance'], - 'url': payload['url'], + 'dialing_permissions_inheritance': payload.get('dialing_permissions_inheritance'), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/wireless/v1/command.py b/twilio/rest/wireless/v1/command.py index 98e071b399..472aa6772e 100644 --- a/twilio/rest/wireless/v1/command.py +++ b/twilio/rest/wireless/v1/command.py @@ -344,18 +344,18 @@ def __init__(self, version, payload, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'account_sid': payload['account_sid'], - 'sim_sid': payload['sim_sid'], - 'command': payload['command'], - 'command_mode': payload['command_mode'], - 'transport': payload['transport'], - 'delivery_receipt_requested': payload['delivery_receipt_requested'], - 'status': payload['status'], - 'direction': payload['direction'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], + 'sid': payload.get('sid'), + 'account_sid': payload.get('account_sid'), + 'sim_sid': payload.get('sim_sid'), + 'command': payload.get('command'), + 'command_mode': payload.get('command_mode'), + 'transport': payload.get('transport'), + 'delivery_receipt_requested': payload.get('delivery_receipt_requested'), + 'status': payload.get('status'), + 'direction': payload.get('direction'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/wireless/v1/rate_plan.py b/twilio/rest/wireless/v1/rate_plan.py index 9bcd9b7ba0..2f9471645a 100644 --- a/twilio/rest/wireless/v1/rate_plan.py +++ b/twilio/rest/wireless/v1/rate_plan.py @@ -322,22 +322,22 @@ def __init__(self, version, payload, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'unique_name': payload['unique_name'], - 'account_sid': payload['account_sid'], - 'friendly_name': payload['friendly_name'], - 'data_enabled': payload['data_enabled'], - 'data_metering': payload['data_metering'], - 'data_limit': deserialize.integer(payload['data_limit']), - 'messaging_enabled': payload['messaging_enabled'], - 'voice_enabled': payload['voice_enabled'], - 'national_roaming_enabled': payload['national_roaming_enabled'], - 'national_roaming_data_limit': deserialize.integer(payload['national_roaming_data_limit']), - 'international_roaming': payload['international_roaming'], - 'international_roaming_data_limit': deserialize.integer(payload['international_roaming_data_limit']), - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], + 'sid': payload.get('sid'), + 'unique_name': payload.get('unique_name'), + 'account_sid': payload.get('account_sid'), + 'friendly_name': payload.get('friendly_name'), + 'data_enabled': payload.get('data_enabled'), + 'data_metering': payload.get('data_metering'), + 'data_limit': deserialize.integer(payload.get('data_limit')), + 'messaging_enabled': payload.get('messaging_enabled'), + 'voice_enabled': payload.get('voice_enabled'), + 'national_roaming_enabled': payload.get('national_roaming_enabled'), + 'national_roaming_data_limit': deserialize.integer(payload.get('national_roaming_data_limit')), + 'international_roaming': payload.get('international_roaming'), + 'international_roaming_data_limit': deserialize.integer(payload.get('international_roaming_data_limit')), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), } # Context diff --git a/twilio/rest/wireless/v1/sim/__init__.py b/twilio/rest/wireless/v1/sim/__init__.py index 890e6a437e..f8bf2dd298 100644 --- a/twilio/rest/wireless/v1/sim/__init__.py +++ b/twilio/rest/wireless/v1/sim/__init__.py @@ -403,30 +403,30 @@ def __init__(self, version, payload, sid=None): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'unique_name': payload['unique_name'], - 'account_sid': payload['account_sid'], - 'rate_plan_sid': payload['rate_plan_sid'], - 'friendly_name': payload['friendly_name'], - 'iccid': payload['iccid'], - 'e_id': payload['e_id'], - 'status': payload['status'], - 'reset_status': payload['reset_status'], - 'commands_callback_url': payload['commands_callback_url'], - 'commands_callback_method': payload['commands_callback_method'], - 'sms_fallback_method': payload['sms_fallback_method'], - 'sms_fallback_url': payload['sms_fallback_url'], - 'sms_method': payload['sms_method'], - 'sms_url': payload['sms_url'], - 'voice_fallback_method': payload['voice_fallback_method'], - 'voice_fallback_url': payload['voice_fallback_url'], - 'voice_method': payload['voice_method'], - 'voice_url': payload['voice_url'], - 'date_created': deserialize.iso8601_datetime(payload['date_created']), - 'date_updated': deserialize.iso8601_datetime(payload['date_updated']), - 'url': payload['url'], - 'links': payload['links'], - 'ip_address': payload['ip_address'], + 'sid': payload.get('sid'), + 'unique_name': payload.get('unique_name'), + 'account_sid': payload.get('account_sid'), + 'rate_plan_sid': payload.get('rate_plan_sid'), + 'friendly_name': payload.get('friendly_name'), + 'iccid': payload.get('iccid'), + 'e_id': payload.get('e_id'), + 'status': payload.get('status'), + 'reset_status': payload.get('reset_status'), + 'commands_callback_url': payload.get('commands_callback_url'), + 'commands_callback_method': payload.get('commands_callback_method'), + 'sms_fallback_method': payload.get('sms_fallback_method'), + 'sms_fallback_url': payload.get('sms_fallback_url'), + 'sms_method': payload.get('sms_method'), + 'sms_url': payload.get('sms_url'), + 'voice_fallback_method': payload.get('voice_fallback_method'), + 'voice_fallback_url': payload.get('voice_fallback_url'), + 'voice_method': payload.get('voice_method'), + 'voice_url': payload.get('voice_url'), + 'date_created': deserialize.iso8601_datetime(payload.get('date_created')), + 'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')), + 'url': payload.get('url'), + 'links': payload.get('links'), + 'ip_address': payload.get('ip_address'), } # Context diff --git a/twilio/rest/wireless/v1/sim/data_session.py b/twilio/rest/wireless/v1/sim/data_session.py index f0596f638b..db49180228 100644 --- a/twilio/rest/wireless/v1/sim/data_session.py +++ b/twilio/rest/wireless/v1/sim/data_session.py @@ -192,22 +192,22 @@ def __init__(self, version, payload, sim_sid): # Marshaled Properties self._properties = { - 'sid': payload['sid'], - 'sim_sid': payload['sim_sid'], - 'account_sid': payload['account_sid'], - 'radio_link': payload['radio_link'], - 'operator_mcc': payload['operator_mcc'], - 'operator_mnc': payload['operator_mnc'], - 'operator_country': payload['operator_country'], - 'operator_name': payload['operator_name'], - 'cell_id': payload['cell_id'], - 'cell_location_estimate': payload['cell_location_estimate'], - 'packets_uploaded': deserialize.integer(payload['packets_uploaded']), - 'packets_downloaded': deserialize.integer(payload['packets_downloaded']), - 'last_updated': deserialize.iso8601_datetime(payload['last_updated']), - 'start': deserialize.iso8601_datetime(payload['start']), - 'end': deserialize.iso8601_datetime(payload['end']), - 'imei': payload['imei'], + 'sid': payload.get('sid'), + 'sim_sid': payload.get('sim_sid'), + 'account_sid': payload.get('account_sid'), + 'radio_link': payload.get('radio_link'), + 'operator_mcc': payload.get('operator_mcc'), + 'operator_mnc': payload.get('operator_mnc'), + 'operator_country': payload.get('operator_country'), + 'operator_name': payload.get('operator_name'), + 'cell_id': payload.get('cell_id'), + 'cell_location_estimate': payload.get('cell_location_estimate'), + 'packets_uploaded': deserialize.integer(payload.get('packets_uploaded')), + 'packets_downloaded': deserialize.integer(payload.get('packets_downloaded')), + 'last_updated': deserialize.iso8601_datetime(payload.get('last_updated')), + 'start': deserialize.iso8601_datetime(payload.get('start')), + 'end': deserialize.iso8601_datetime(payload.get('end')), + 'imei': payload.get('imei'), } # Context diff --git a/twilio/rest/wireless/v1/sim/usage_record.py b/twilio/rest/wireless/v1/sim/usage_record.py index 38dd96c469..41f5e3f209 100644 --- a/twilio/rest/wireless/v1/sim/usage_record.py +++ b/twilio/rest/wireless/v1/sim/usage_record.py @@ -207,11 +207,11 @@ def __init__(self, version, payload, sim_sid): # Marshaled Properties self._properties = { - 'sim_sid': payload['sim_sid'], - 'account_sid': payload['account_sid'], - 'period': payload['period'], - 'commands': payload['commands'], - 'data': payload['data'], + 'sim_sid': payload.get('sim_sid'), + 'account_sid': payload.get('account_sid'), + 'period': payload.get('period'), + 'commands': payload.get('commands'), + 'data': payload.get('data'), } # Context diff --git a/twilio/rest/wireless/v1/usage_record.py b/twilio/rest/wireless/v1/usage_record.py index 91867ba874..e825cb4fdb 100644 --- a/twilio/rest/wireless/v1/usage_record.py +++ b/twilio/rest/wireless/v1/usage_record.py @@ -205,10 +205,10 @@ def __init__(self, version, payload): # Marshaled Properties self._properties = { - 'account_sid': payload['account_sid'], - 'period': payload['period'], - 'commands': payload['commands'], - 'data': payload['data'], + 'account_sid': payload.get('account_sid'), + 'period': payload.get('period'), + 'commands': payload.get('commands'), + 'data': payload.get('data'), } # Context