Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update instance property marshaling to allow missing properties #483

Merged
merged 1 commit into from
Oct 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 6 additions & 6 deletions twilio/rest/accounts/v1/credential/aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions twilio/rest/accounts/v1/credential/public_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 10 additions & 10 deletions twilio/rest/api/v2010/account/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
30 changes: 15 additions & 15 deletions twilio/rest/api/v2010/account/address/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
52 changes: 26 additions & 26 deletions twilio/rest/api/v2010/account/address/dependent_phone_number.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
40 changes: 20 additions & 20 deletions twilio/rest/api/v2010/account/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 10 additions & 10 deletions twilio/rest/api/v2010/account/authorized_connect_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions twilio/rest/api/v2010/account/available_phone_number/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 13 additions & 13 deletions twilio/rest/api/v2010/account/available_phone_number/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 13 additions & 13 deletions twilio/rest/api/v2010/account/available_phone_number/mobile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 13 additions & 13 deletions twilio/rest/api/v2010/account/available_phone_number/national.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading