twilio-ruby 5.72.1 → 5.73.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +25 -0
  3. data/README.md +2 -2
  4. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/local.rb +2 -2
  5. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/machine_to_machine.rb +2 -2
  6. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/mobile.rb +2 -2
  7. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/national.rb +2 -2
  8. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/shared_cost.rb +2 -2
  9. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb +2 -2
  10. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/voip.rb +2 -2
  11. data/lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb +1 -1
  12. data/lib/twilio-ruby/rest/api/v2010/account/call/feedback_summary.rb +5 -5
  13. data/lib/twilio-ruby/rest/api/v2010/account/call/recording.rb +2 -2
  14. data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +22 -16
  15. data/lib/twilio-ruby/rest/api/v2010/account/conference/recording.rb +1 -1
  16. data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +4 -4
  17. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +8 -1
  18. data/lib/twilio-ruby/rest/api/v2010/account/queue/member.rb +2 -2
  19. data/lib/twilio-ruby/rest/api/v2010/account/queue.rb +3 -3
  20. data/lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb +1 -1
  21. data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +1 -1
  22. data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb +1 -1
  23. data/lib/twilio-ruby/rest/api/v2010/account/transcription.rb +1 -1
  24. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/all_time.rb +1 -1
  25. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/daily.rb +1 -1
  26. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/last_month.rb +1 -1
  27. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb +1 -1
  28. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/this_month.rb +1 -1
  29. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/today.rb +1 -1
  30. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yearly.rb +1 -1
  31. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yesterday.rb +1 -1
  32. data/lib/twilio-ruby/rest/api/v2010/account/usage/record.rb +1 -1
  33. data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_statistics.rb +2 -2
  34. data/lib/twilio-ruby/rest/bulkexports/v1/export/day.rb +1 -1
  35. data/lib/twilio-ruby/rest/chat/v1/service/channel/message.rb +1 -1
  36. data/lib/twilio-ruby/rest/chat/v1/service/channel.rb +2 -2
  37. data/lib/twilio-ruby/rest/chat/v1/service/user.rb +1 -1
  38. data/lib/twilio-ruby/rest/chat/v1/service.rb +2 -2
  39. data/lib/twilio-ruby/rest/chat/v2/service/channel/message.rb +1 -1
  40. data/lib/twilio-ruby/rest/chat/v2/service/channel.rb +2 -2
  41. data/lib/twilio-ruby/rest/chat/v2/service/user.rb +1 -1
  42. data/lib/twilio-ruby/rest/chat/v2/service.rb +4 -4
  43. data/lib/twilio-ruby/rest/chat/v3/channel.rb +2 -2
  44. data/lib/twilio-ruby/rest/client.rb +7 -0
  45. data/lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb +1 -1
  46. data/lib/twilio-ruby/rest/conversations/v1/conversation/message.rb +1 -1
  47. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb +1 -1
  48. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb +1 -1
  49. data/lib/twilio-ruby/rest/events/v1/schema/version.rb +1 -1
  50. data/lib/twilio-ruby/rest/events/v1/schema.rb +1 -1
  51. data/lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb +1 -1
  52. data/lib/twilio-ruby/rest/insights/v1/room/participant.rb +1 -1
  53. data/lib/twilio-ruby/rest/insights/v1/room.rb +3 -3
  54. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/message.rb +1 -1
  55. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb +2 -2
  56. data/lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb +1 -1
  57. data/lib/twilio-ruby/rest/ip_messaging/v1/service.rb +2 -2
  58. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/message.rb +1 -1
  59. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb +2 -2
  60. data/lib/twilio-ruby/rest/ip_messaging/v2/service/user.rb +1 -1
  61. data/lib/twilio-ruby/rest/ip_messaging/v2/service.rb +4 -4
  62. data/lib/twilio-ruby/rest/media/v1/media_processor.rb +1 -1
  63. data/lib/twilio-ruby/rest/media/v1/media_recording.rb +2 -2
  64. data/lib/twilio-ruby/rest/media/v1/player_streamer.rb +1 -1
  65. data/lib/twilio-ruby/rest/messaging/v1/service.rb +1 -1
  66. data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +1 -1
  67. data/lib/twilio-ruby/rest/oauth/v1/oauth.rb +162 -0
  68. data/lib/twilio-ruby/rest/oauth/v1/openid_discovery.rb +242 -0
  69. data/lib/twilio-ruby/rest/oauth/v1/token.rb +157 -0
  70. data/lib/twilio-ruby/rest/oauth/v1/user_info.rb +193 -0
  71. data/lib/twilio-ruby/rest/oauth/v1.rb +56 -0
  72. data/lib/twilio-ruby/rest/oauth.rb +62 -0
  73. data/lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document/dependent_hosted_number_order.rb +2 -2
  74. data/lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb +2 -2
  75. data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb +1 -1
  76. data/lib/twilio-ruby/rest/preview/understand/assistant/task/task_statistics.rb +2 -2
  77. data/lib/twilio-ruby/rest/preview/wireless/rate_plan.rb +1 -1
  78. data/lib/twilio-ruby/rest/proxy/v1/service/phone_number.rb +1 -1
  79. data/lib/twilio-ruby/rest/proxy/v1/service/session.rb +1 -1
  80. data/lib/twilio-ruby/rest/proxy/v1/service.rb +1 -1
  81. data/lib/twilio-ruby/rest/studio/v1/flow.rb +1 -1
  82. data/lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb +1 -1
  83. data/lib/twilio-ruby/rest/studio/v2/flow.rb +1 -1
  84. data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +1 -1
  85. data/lib/twilio-ruby/rest/supersim/v1/ip_command.rb +1 -1
  86. data/lib/twilio-ruby/rest/supersim/v1/settings_update.rb +240 -0
  87. data/lib/twilio-ruby/rest/supersim/v1/usage_record.rb +4 -4
  88. data/lib/twilio-ruby/rest/supersim/v1.rb +7 -0
  89. data/lib/twilio-ruby/rest/supersim.rb +6 -0
  90. data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb +1 -1
  91. data/lib/twilio-ruby/rest/sync/v1/service.rb +1 -1
  92. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb +1 -1
  93. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +3 -3
  94. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.rb +12 -12
  95. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb +5 -5
  96. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb +1 -1
  97. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb +3 -3
  98. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_cumulative_statistics.rb +6 -6
  99. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.rb +1 -1
  100. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb +13 -13
  101. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.rb +2 -2
  102. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb +1 -1
  103. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.rb +13 -13
  104. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_real_time_statistics.rb +3 -3
  105. data/lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb +2 -2
  106. data/lib/twilio-ruby/rest/verify/v2/service/access_token.rb +1 -9
  107. data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge/notification.rb +1 -7
  108. data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +0 -8
  109. data/lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb +0 -8
  110. data/lib/twilio-ruby/rest/verify/v2/service/entity/new_factor.rb +0 -6
  111. data/lib/twilio-ruby/rest/verify/v2/service/entity.rb +0 -8
  112. data/lib/twilio-ruby/rest/verify/v2/service/rate_limit/bucket.rb +2 -2
  113. data/lib/twilio-ruby/rest/verify/v2/service/webhook.rb +0 -8
  114. data/lib/twilio-ruby/rest/verify/v2/service.rb +1 -1
  115. data/lib/twilio-ruby/rest/verify/v2/template.rb +7 -0
  116. data/lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb +4 -4
  117. data/lib/twilio-ruby/rest/video/v1/composition.rb +3 -3
  118. data/lib/twilio-ruby/rest/video/v1/recording.rb +2 -2
  119. data/lib/twilio-ruby/rest/video/v1/room/recording.rb +2 -2
  120. data/lib/twilio-ruby/rest/video/v1/room.rb +4 -4
  121. data/lib/twilio-ruby/rest/voice/v1/connection_policy/connection_policy_target.rb +2 -2
  122. data/lib/twilio-ruby/rest/voice/v1/dialing_permissions/bulk_country_update.rb +1 -1
  123. data/lib/twilio-ruby/rest/voice/v1/ip_record.rb +1 -1
  124. data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +3 -3
  125. data/lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb +2 -2
  126. data/lib/twilio-ruby/twiml/voice_response.rb +6 -4
  127. data/lib/twilio-ruby/version.rb +1 -1
  128. metadata +9 -2
@@ -323,7 +323,7 @@ module Twilio
323
323
  'is_notifiable' => payload['is_notifiable'],
324
324
  'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
325
325
  'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
326
- 'joined_channels_count' => payload['joined_channels_count'].to_i,
326
+ 'joined_channels_count' => payload['joined_channels_count'] == nil ? payload['joined_channels_count'] : payload['joined_channels_count'].to_i,
327
327
  'links' => payload['links'],
328
328
  'url' => payload['url'],
329
329
  }
@@ -429,15 +429,15 @@ module Twilio
429
429
  'default_channel_creator_role_sid' => payload['default_channel_creator_role_sid'],
430
430
  'read_status_enabled' => payload['read_status_enabled'],
431
431
  'reachability_enabled' => payload['reachability_enabled'],
432
- 'typing_indicator_timeout' => payload['typing_indicator_timeout'].to_i,
433
- 'consumption_report_interval' => payload['consumption_report_interval'].to_i,
432
+ 'typing_indicator_timeout' => payload['typing_indicator_timeout'] == nil ? payload['typing_indicator_timeout'] : payload['typing_indicator_timeout'].to_i,
433
+ 'consumption_report_interval' => payload['consumption_report_interval'] == nil ? payload['consumption_report_interval'] : payload['consumption_report_interval'].to_i,
434
434
  'limits' => payload['limits'],
435
435
  'pre_webhook_url' => payload['pre_webhook_url'],
436
436
  'post_webhook_url' => payload['post_webhook_url'],
437
437
  'webhook_method' => payload['webhook_method'],
438
438
  'webhook_filters' => payload['webhook_filters'],
439
- 'pre_webhook_retry_count' => payload['pre_webhook_retry_count'].to_i,
440
- 'post_webhook_retry_count' => payload['post_webhook_retry_count'].to_i,
439
+ 'pre_webhook_retry_count' => payload['pre_webhook_retry_count'] == nil ? payload['pre_webhook_retry_count'] : payload['pre_webhook_retry_count'].to_i,
440
+ 'post_webhook_retry_count' => payload['post_webhook_retry_count'] == nil ? payload['post_webhook_retry_count'] : payload['post_webhook_retry_count'].to_i,
441
441
  'notifications' => payload['notifications'],
442
442
  'media' => payload['media'],
443
443
  'url' => payload['url'],
@@ -129,8 +129,8 @@ module Twilio
129
129
  'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
130
130
  'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
131
131
  'created_by' => payload['created_by'],
132
- 'members_count' => payload['members_count'].to_i,
133
- 'messages_count' => payload['messages_count'].to_i,
132
+ 'members_count' => payload['members_count'] == nil ? payload['members_count'] : payload['members_count'].to_i,
133
+ 'messages_count' => payload['messages_count'] == nil ? payload['messages_count'] : payload['messages_count'].to_i,
134
134
  'messaging_service_sid' => payload['messaging_service_sid'],
135
135
  'url' => payload['url'],
136
136
  }
@@ -46,6 +46,7 @@ module Twilio
46
46
  @monitor = nil
47
47
  @notify = nil
48
48
  @numbers = nil
49
+ @oauth = nil
49
50
  @preview = nil
50
51
  @pricing = nil
51
52
  @proxy = nil
@@ -259,6 +260,12 @@ module Twilio
259
260
  @numbers ||= Numbers.new self
260
261
  end
261
262
 
263
+ ##
264
+ # Access the Oauth Twilio Domain
265
+ def oauth
266
+ @oauth ||= Oauth.new self
267
+ end
268
+
262
269
  ##
263
270
  # Access the Preview Twilio Domain
264
271
  def preview
@@ -229,7 +229,7 @@ module Twilio
229
229
  'channel_message_sid' => payload['channel_message_sid'],
230
230
  'participant_sid' => payload['participant_sid'],
231
231
  'status' => payload['status'],
232
- 'error_code' => payload['error_code'].to_i,
232
+ 'error_code' => payload['error_code'] == nil ? payload['error_code'] : payload['error_code'].to_i,
233
233
  'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
234
234
  'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
235
235
  'url' => payload['url'],
@@ -319,7 +319,7 @@ module Twilio
319
319
  'account_sid' => payload['account_sid'],
320
320
  'conversation_sid' => payload['conversation_sid'],
321
321
  'sid' => payload['sid'],
322
- 'index' => payload['index'].to_i,
322
+ 'index' => payload['index'] == nil ? payload['index'] : payload['index'].to_i,
323
323
  'author' => payload['author'],
324
324
  'body' => payload['body'],
325
325
  'media' => payload['media'],
@@ -251,7 +251,7 @@ module Twilio
251
251
  'channel_message_sid' => payload['channel_message_sid'],
252
252
  'participant_sid' => payload['participant_sid'],
253
253
  'status' => payload['status'],
254
- 'error_code' => payload['error_code'].to_i,
254
+ 'error_code' => payload['error_code'] == nil ? payload['error_code'] : payload['error_code'].to_i,
255
255
  'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
256
256
  'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
257
257
  'url' => payload['url'],
@@ -349,7 +349,7 @@ module Twilio
349
349
  'chat_service_sid' => payload['chat_service_sid'],
350
350
  'conversation_sid' => payload['conversation_sid'],
351
351
  'sid' => payload['sid'],
352
- 'index' => payload['index'].to_i,
352
+ 'index' => payload['index'] == nil ? payload['index'] : payload['index'].to_i,
353
353
  'author' => payload['author'],
354
354
  'body' => payload['body'],
355
355
  'media' => payload['media'],
@@ -210,7 +210,7 @@ module Twilio
210
210
  # Marshaled Properties
211
211
  @properties = {
212
212
  'id' => payload['id'],
213
- 'schema_version' => payload['schema_version'].to_i,
213
+ 'schema_version' => payload['schema_version'] == nil ? payload['schema_version'] : payload['schema_version'].to_i,
214
214
  'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
215
215
  'url' => payload['url'],
216
216
  'raw' => payload['raw'],
@@ -143,7 +143,7 @@ module Twilio
143
143
  'url' => payload['url'],
144
144
  'links' => payload['links'],
145
145
  'latest_version_date_created' => Twilio.deserialize_iso8601_datetime(payload['latest_version_date_created']),
146
- 'latest_version' => payload['latest_version'].to_i,
146
+ 'latest_version' => payload['latest_version'] == nil ? payload['latest_version'] : payload['latest_version'].to_i,
147
147
  }
148
148
 
149
149
  # Context
@@ -247,7 +247,7 @@ module Twilio
247
247
  @properties = {
248
248
  'account_sid' => payload['account_sid'],
249
249
  'type' => payload['type'],
250
- 'schema_version' => payload['schema_version'].to_i,
250
+ 'schema_version' => payload['schema_version'] == nil ? payload['schema_version'] : payload['schema_version'].to_i,
251
251
  'subscription_sid' => payload['subscription_sid'],
252
252
  'url' => payload['url'],
253
253
  }
@@ -210,7 +210,7 @@ module Twilio
210
210
  'participant_identity' => payload['participant_identity'],
211
211
  'join_time' => Twilio.deserialize_iso8601_datetime(payload['join_time']),
212
212
  'leave_time' => Twilio.deserialize_iso8601_datetime(payload['leave_time']),
213
- 'duration_sec' => payload['duration_sec'].to_i,
213
+ 'duration_sec' => payload['duration_sec'] == nil ? payload['duration_sec'] : payload['duration_sec'].to_i,
214
214
  'account_sid' => payload['account_sid'],
215
215
  'room_sid' => payload['room_sid'],
216
216
  'status' => payload['status'],
@@ -283,9 +283,9 @@ module Twilio
283
283
  'max_concurrent_participants' => payload['max_concurrent_participants'] == nil ? payload['max_concurrent_participants'] : payload['max_concurrent_participants'].to_i,
284
284
  'codecs' => payload['codecs'],
285
285
  'media_region' => payload['media_region'],
286
- 'duration_sec' => payload['duration_sec'].to_i,
287
- 'total_participant_duration_sec' => payload['total_participant_duration_sec'].to_i,
288
- 'total_recording_duration_sec' => payload['total_recording_duration_sec'].to_i,
286
+ 'duration_sec' => payload['duration_sec'] == nil ? payload['duration_sec'] : payload['duration_sec'].to_i,
287
+ 'total_participant_duration_sec' => payload['total_participant_duration_sec'] == nil ? payload['total_participant_duration_sec'] : payload['total_participant_duration_sec'].to_i,
288
+ 'total_recording_duration_sec' => payload['total_recording_duration_sec'] == nil ? payload['total_recording_duration_sec'] : payload['total_recording_duration_sec'].to_i,
289
289
  'processing_state' => payload['processing_state'],
290
290
  'recording_enabled' => payload['recording_enabled'],
291
291
  'edge_location' => payload['edge_location'],
@@ -268,7 +268,7 @@ module Twilio
268
268
  'was_edited' => payload['was_edited'],
269
269
  'from' => payload['from'],
270
270
  'body' => payload['body'],
271
- 'index' => payload['index'].to_i,
271
+ 'index' => payload['index'] == nil ? payload['index'] : payload['index'].to_i,
272
272
  'url' => payload['url'],
273
273
  }
274
274
 
@@ -323,8 +323,8 @@ module Twilio
323
323
  'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
324
324
  'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
325
325
  'created_by' => payload['created_by'],
326
- 'members_count' => payload['members_count'].to_i,
327
- 'messages_count' => payload['messages_count'].to_i,
326
+ 'members_count' => payload['members_count'] == nil ? payload['members_count'] : payload['members_count'].to_i,
327
+ 'messages_count' => payload['messages_count'] == nil ? payload['messages_count'] : payload['messages_count'].to_i,
328
328
  'url' => payload['url'],
329
329
  'links' => payload['links'],
330
330
  }
@@ -268,7 +268,7 @@ module Twilio
268
268
  'is_notifiable' => payload['is_notifiable'],
269
269
  'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
270
270
  'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
271
- 'joined_channels_count' => payload['joined_channels_count'].to_i,
271
+ 'joined_channels_count' => payload['joined_channels_count'] == nil ? payload['joined_channels_count'] : payload['joined_channels_count'].to_i,
272
272
  'links' => payload['links'],
273
273
  'url' => payload['url'],
274
274
  }
@@ -430,8 +430,8 @@ module Twilio
430
430
  'default_channel_creator_role_sid' => payload['default_channel_creator_role_sid'],
431
431
  'read_status_enabled' => payload['read_status_enabled'],
432
432
  'reachability_enabled' => payload['reachability_enabled'],
433
- 'typing_indicator_timeout' => payload['typing_indicator_timeout'].to_i,
434
- 'consumption_report_interval' => payload['consumption_report_interval'].to_i,
433
+ 'typing_indicator_timeout' => payload['typing_indicator_timeout'] == nil ? payload['typing_indicator_timeout'] : payload['typing_indicator_timeout'].to_i,
434
+ 'consumption_report_interval' => payload['consumption_report_interval'] == nil ? payload['consumption_report_interval'] : payload['consumption_report_interval'].to_i,
435
435
  'limits' => payload['limits'],
436
436
  'webhooks' => payload['webhooks'],
437
437
  'pre_webhook_url' => payload['pre_webhook_url'],
@@ -302,7 +302,7 @@ module Twilio
302
302
  'was_edited' => payload['was_edited'],
303
303
  'from' => payload['from'],
304
304
  'body' => payload['body'],
305
- 'index' => payload['index'].to_i,
305
+ 'index' => payload['index'] == nil ? payload['index'] : payload['index'].to_i,
306
306
  'type' => payload['type'],
307
307
  'media' => payload['media'],
308
308
  'url' => payload['url'],
@@ -368,8 +368,8 @@ module Twilio
368
368
  'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
369
369
  'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
370
370
  'created_by' => payload['created_by'],
371
- 'members_count' => payload['members_count'].to_i,
372
- 'messages_count' => payload['messages_count'].to_i,
371
+ 'members_count' => payload['members_count'] == nil ? payload['members_count'] : payload['members_count'].to_i,
372
+ 'messages_count' => payload['messages_count'] == nil ? payload['messages_count'] : payload['messages_count'].to_i,
373
373
  'url' => payload['url'],
374
374
  'links' => payload['links'],
375
375
  }
@@ -303,7 +303,7 @@ module Twilio
303
303
  'is_notifiable' => payload['is_notifiable'],
304
304
  'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
305
305
  'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
306
- 'joined_channels_count' => payload['joined_channels_count'].to_i,
306
+ 'joined_channels_count' => payload['joined_channels_count'] == nil ? payload['joined_channels_count'] : payload['joined_channels_count'].to_i,
307
307
  'links' => payload['links'],
308
308
  'url' => payload['url'],
309
309
  }
@@ -384,15 +384,15 @@ module Twilio
384
384
  'default_channel_creator_role_sid' => payload['default_channel_creator_role_sid'],
385
385
  'read_status_enabled' => payload['read_status_enabled'],
386
386
  'reachability_enabled' => payload['reachability_enabled'],
387
- 'typing_indicator_timeout' => payload['typing_indicator_timeout'].to_i,
388
- 'consumption_report_interval' => payload['consumption_report_interval'].to_i,
387
+ 'typing_indicator_timeout' => payload['typing_indicator_timeout'] == nil ? payload['typing_indicator_timeout'] : payload['typing_indicator_timeout'].to_i,
388
+ 'consumption_report_interval' => payload['consumption_report_interval'] == nil ? payload['consumption_report_interval'] : payload['consumption_report_interval'].to_i,
389
389
  'limits' => payload['limits'],
390
390
  'pre_webhook_url' => payload['pre_webhook_url'],
391
391
  'post_webhook_url' => payload['post_webhook_url'],
392
392
  'webhook_method' => payload['webhook_method'],
393
393
  'webhook_filters' => payload['webhook_filters'],
394
- 'pre_webhook_retry_count' => payload['pre_webhook_retry_count'].to_i,
395
- 'post_webhook_retry_count' => payload['post_webhook_retry_count'].to_i,
394
+ 'pre_webhook_retry_count' => payload['pre_webhook_retry_count'] == nil ? payload['pre_webhook_retry_count'] : payload['pre_webhook_retry_count'].to_i,
395
+ 'post_webhook_retry_count' => payload['post_webhook_retry_count'] == nil ? payload['post_webhook_retry_count'] : payload['post_webhook_retry_count'].to_i,
396
396
  'notifications' => payload['notifications'],
397
397
  'media' => payload['media'],
398
398
  'url' => payload['url'],
@@ -270,7 +270,7 @@ module Twilio
270
270
  'ended_reason' => payload['ended_reason'],
271
271
  'status_callback' => payload['status_callback'],
272
272
  'status_callback_method' => payload['status_callback_method'],
273
- 'max_duration' => payload['max_duration'].to_i,
273
+ 'max_duration' => payload['max_duration'] == nil ? payload['max_duration'] : payload['max_duration'].to_i,
274
274
  }
275
275
 
276
276
  # Context
@@ -245,14 +245,14 @@ module Twilio
245
245
  'account_sid' => payload['account_sid'],
246
246
  'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
247
247
  'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
248
- 'duration' => payload['duration'].to_i,
248
+ 'duration' => payload['duration'] == nil ? payload['duration'] : payload['duration'].to_i,
249
249
  'format' => payload['format'],
250
250
  'links' => payload['links'],
251
251
  'processor_sid' => payload['processor_sid'],
252
252
  'resolution' => payload['resolution'],
253
253
  'source_sid' => payload['source_sid'],
254
254
  'sid' => payload['sid'],
255
- 'media_size' => payload['media_size'].to_i,
255
+ 'media_size' => payload['media_size'] == nil ? payload['media_size'] : payload['media_size'].to_i,
256
256
  'status' => payload['status'],
257
257
  'status_callback' => payload['status_callback'],
258
258
  'status_callback_method' => payload['status_callback_method'],
@@ -269,7 +269,7 @@ module Twilio
269
269
  'status_callback' => payload['status_callback'],
270
270
  'status_callback_method' => payload['status_callback_method'],
271
271
  'ended_reason' => payload['ended_reason'],
272
- 'max_duration' => payload['max_duration'].to_i,
272
+ 'max_duration' => payload['max_duration'] == nil ? payload['max_duration'] : payload['max_duration'].to_i,
273
273
  }
274
274
 
275
275
  # Context
@@ -469,7 +469,7 @@ module Twilio
469
469
  'fallback_to_long_code' => payload['fallback_to_long_code'],
470
470
  'area_code_geomatch' => payload['area_code_geomatch'],
471
471
  'synchronous_validation' => payload['synchronous_validation'],
472
- 'validity_period' => payload['validity_period'].to_i,
472
+ 'validity_period' => payload['validity_period'] == nil ? payload['validity_period'] : payload['validity_period'].to_i,
473
473
  'url' => payload['url'],
474
474
  'links' => payload['links'],
475
475
  'usecase' => payload['usecase'],
@@ -215,7 +215,7 @@ module Twilio
215
215
  'tags' => payload['tags'],
216
216
  'segments' => payload['segments'],
217
217
  'priority' => payload['priority'],
218
- 'ttl' => payload['ttl'].to_i,
218
+ 'ttl' => payload['ttl'] == nil ? payload['ttl'] : payload['ttl'].to_i,
219
219
  'title' => payload['title'],
220
220
  'body' => payload['body'],
221
221
  'sound' => payload['sound'],
@@ -0,0 +1,162 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+ #
7
+ # frozen_string_literal: true
8
+
9
+ module Twilio
10
+ module REST
11
+ class Oauth < Domain
12
+ class V1 < Version
13
+ class OauthList < ListResource
14
+ ##
15
+ # Initialize the OauthList
16
+ # @param [Version] version Version that contains the resource
17
+ # @return [OauthList] OauthList
18
+ def initialize(version)
19
+ super(version)
20
+
21
+ # Path Solution
22
+ @solution = {}
23
+ end
24
+
25
+ ##
26
+ # Provide a user friendly representation
27
+ def to_s
28
+ '#<Twilio.Oauth.V1.OauthList>'
29
+ end
30
+ end
31
+
32
+ class OauthPage < Page
33
+ ##
34
+ # Initialize the OauthPage
35
+ # @param [Version] version Version that contains the resource
36
+ # @param [Response] response Response from the API
37
+ # @param [Hash] solution Path solution for the resource
38
+ # @return [OauthPage] OauthPage
39
+ def initialize(version, response, solution)
40
+ super(version, response)
41
+
42
+ # Path Solution
43
+ @solution = solution
44
+ end
45
+
46
+ ##
47
+ # Build an instance of OauthInstance
48
+ # @param [Hash] payload Payload response from the API
49
+ # @return [OauthInstance] OauthInstance
50
+ def get_instance(payload)
51
+ OauthInstance.new(@version, payload, )
52
+ end
53
+
54
+ ##
55
+ # Provide a user friendly representation
56
+ def to_s
57
+ '<Twilio.Oauth.V1.OauthPage>'
58
+ end
59
+ end
60
+
61
+ class OauthContext < InstanceContext
62
+ ##
63
+ # Initialize the OauthContext
64
+ # @param [Version] version Version that contains the resource
65
+ # @return [OauthContext] OauthContext
66
+ def initialize(version)
67
+ super(version)
68
+
69
+ # Path Solution
70
+ @solution = {}
71
+ @uri = "/certs"
72
+ end
73
+
74
+ ##
75
+ # Fetch the OauthInstance
76
+ # @return [OauthInstance] Fetched OauthInstance
77
+ def fetch
78
+ payload = @version.fetch('GET', @uri)
79
+
80
+ OauthInstance.new(@version, payload, )
81
+ end
82
+
83
+ ##
84
+ # Provide a user friendly representation
85
+ def to_s
86
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
87
+ "#<Twilio.Oauth.V1.OauthContext #{context}>"
88
+ end
89
+
90
+ ##
91
+ # Provide a detailed, user friendly representation
92
+ def inspect
93
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
94
+ "#<Twilio.Oauth.V1.OauthContext #{context}>"
95
+ end
96
+ end
97
+
98
+ class OauthInstance < InstanceResource
99
+ ##
100
+ # Initialize the OauthInstance
101
+ # @param [Version] version Version that contains the resource
102
+ # @param [Hash] payload payload that contains response from Twilio
103
+ # @return [OauthInstance] OauthInstance
104
+ def initialize(version, payload)
105
+ super(version)
106
+
107
+ # Marshaled Properties
108
+ @properties = {'keys' => payload['keys'], 'url' => payload['url'], }
109
+
110
+ # Context
111
+ @instance_context = nil
112
+ @params = {}
113
+ end
114
+
115
+ ##
116
+ # Generate an instance context for the instance, the context is capable of
117
+ # performing various actions. All instance actions are proxied to the context
118
+ # @return [OauthContext] OauthContext for this OauthInstance
119
+ def context
120
+ unless @instance_context
121
+ @instance_context = OauthContext.new(@version, )
122
+ end
123
+ @instance_context
124
+ end
125
+
126
+ ##
127
+ # @return [Hash] A collection of certificates
128
+ def keys
129
+ @properties['keys']
130
+ end
131
+
132
+ ##
133
+ # @return [String] The url
134
+ def url
135
+ @properties['url']
136
+ end
137
+
138
+ ##
139
+ # Fetch the OauthInstance
140
+ # @return [OauthInstance] Fetched OauthInstance
141
+ def fetch
142
+ context.fetch
143
+ end
144
+
145
+ ##
146
+ # Provide a user friendly representation
147
+ def to_s
148
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
149
+ "<Twilio.Oauth.V1.OauthInstance #{values}>"
150
+ end
151
+
152
+ ##
153
+ # Provide a detailed, user friendly representation
154
+ def inspect
155
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
156
+ "<Twilio.Oauth.V1.OauthInstance #{values}>"
157
+ end
158
+ end
159
+ end
160
+ end
161
+ end
162
+ end